datastore-core
    TypeScript icon, indicating that this package has built-in type declarations

    7.0.1 • Public • Published

    js-datastore-core

    codecov GitHub Workflow Status

    Implementations for interface-datastore.

    Lead Maintainer

    Alex Potsides

    Table of Contents

    Implementations

    Install

    $ npm install datastore-core
    

    Usage

    BaseDatastore

    An base store is made available to make implementing your own datastore easier:

    const { BaseDatastore } from 'datastore-core')
    
    class MyDatastore extends BaseDatastore {
      constructor () {
        super()
      }
    
      async put (key, val) {
        // your implementation here
      }
    
      async get (key) {
        // your implementation here
      }
    
      // etc...
    }

    See the MemoryDatastore for an example of how it is used.

    Wrapping Stores

    import { Key } from 'interface-datastore'
    import {
      MemoryStore,
      MountStore
    } from 'datastore-core'
    
    const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})

    Contribute

    Feel free to join in. All welcome. Open an issue!

    This repository falls under the IPFS Code of Conduct.

    License

    MIT

    Install

    npm i datastore-core

    DownloadsWeekly Downloads

    18,018

    Version

    7.0.1

    License

    Apache-2.0 OR MIT

    Unpacked Size

    221 kB

    Total Files

    125

    Last publish

    Collaborators

    • daviddias
    • dignifiedquire
    • achingbrain