🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

datastore-core

Package Overview
Dependencies
Maintainers
2
Versions
62
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

Source
npmnpm
Version
11.0.4
Version published
Weekly downloads
70K
-45.05%
Maintainers
2
Weekly downloads
 
Created
Source

datastore-core

ipfs.tech Discuss codecov CI

Wrapper implementation for interface-datastore

About

Various Datastore implementations are available.

BaseDatastore

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

Example

import { 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

Example

import { Key } from 'interface-datastore'
import {
  MemoryStore,
  MountStore
} from 'datastore-core'

const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})

BlackHoleDatastore

Example

A datastore that does not store any data.

import { BlackHoleDatastore } from 'datastore-core'

const store = new BlackHoleDatastore()

Install

$ npm i datastore-core

Browser <script> tag

Loading this module through a script tag will make its exports available as DatastoreCore in the global namespace.

<script src="https://unpkg.com/datastore-core/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Keywords

datastore

FAQs

Package last updated on 20 Apr 2026

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