🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

datastore-core

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datastore-core

Wrapper implementation for interface-datastore

7.0.1
Source
npm
Version published
Weekly downloads
57K
-24.39%
Maintainers
3
Weekly downloads
 
Created
Source

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

Keywords

datastore

FAQs

Package last updated on 28 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts