ilp-store
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ILP Store

An ILP store loader for key/value stores used by ILP components

NPM Package CircleCI Known Vulnerabilities

The script below will create an instance of an ILP store with no setup whatsoever. You can use this anywhere that you need a key value store for use by an ILP component.

IMPORTANT: The default store is an in-memory store that will lose all of its data when the process exits. For persistent storage consider one of the other ilp-store-* modules such as ilp-store-redis or ilp-store-simpledb.

Examples

Javascript:

const store = require('ilp-store')()
async function run () {
  await store.put('key', 'some value')
  const value = await store.get('key')
  process.exit(0)
}
run()

TypeScript:

import createStore from 'ilp-store'
const store = createStore()
async function run () {
  await store.put('key', 'some value')
  const value = await store.get('key')
  process.exit(0)
}
run()

If no parameters are provided it will attempt to find the config in environment variables. If these are not found it will load an in-memory store.

The Environment variables that can be set are:

  • ILP_STORE : The name/path of the store module
  • ILP_STORE_OPTIONS : The options passed to the constructor, serialized as a JSON object.

The options object passed are a subset of the configuration object used in ilp-connector.

Readme

Keywords

none

Package Sidebar

Install

npm i ilp-store

Weekly Downloads

0

Version

1.0.1

License

Apache-2.0

Unpacked Size

22.8 kB

Total Files

11

Last publish

Collaborators

  • interledger