npm install datastore-core

Wrapper implementation for interface-datastore

About datastore-core

Datastore-core is a critical npm package designed to serve as a wrapper implementation for the interface-datastore, primarily used in projects like IPFS (InterPlanetary File System). This node module provides a standardized way of handling data across different storage backends, ensuring that applications can manage and store data efficiently regardless of the underlying technology. The core functionality of datastore-core includes the ability to create, read, update, and delete data in a uniform manner, making it an indispensable tool for developers working with data-intensive applications. Its integration with the IPFS ecosystem also means that it supports decentralized storage solutions, enhancing data availability and resilience.

To begin using datastore-core in your project, you can easily integrate it by running the command `npm install datastore-core` in your project's directory. This installation process is straightforward, allowing developers to quickly set up and start utilizing the module in their applications. Once installed, datastore was the core facilitates various advanced data operations, such as batching and querying, which are crucial for optimizing the performance and scalability of applications. The package is also highly customizable, providing developers with the flexibility to tailor the datastore to meet specific requirements of their projects.

Developers looking to implement datastore-core will find its compatibility with multiple backend technologies particularly beneficial. The package supports a range of storage options from in-memory and filesystem storage to more complex implementations like database storage. This versatility ensures that datastore-core can be adapted to various environments and use cases, from small-scale projects to large, distributed applications. Moreover, its robust architecture not only simplifies data management tasks but also significantly reduces the development time, allowing teams to focus more on core application features rather than on backend data handling intricacies.

More from ipfs

ipfs npm packages

Find the best node modules for your project.

Search npm

interface-datastore

datastore...

Read more
,

ipfs-unixfs

JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a...

Read more
,

hamt-sharding

JavaScript implementation of sharding using hash array mapped...

Read more
,

ipfs-unixfs-importer

JavaScript implementation of the UnixFs importer used by...

Read more
,

is-ipfs

A set of utilities to help identify IPFS resources on the...

Read more
,

ipfs-unixfs-exporter

JavaScript implementation of the UnixFs exporter used by...

Read more
,

blockstore-core

Contains various implementations of the API contract described in...

Read more
,

ipfs-car

Convert files to content-addressed archives (...

Read more
,

datastore-core

Wrapper implementation for...

Read more
,

ipns

IPNS record...

Read more
,

datastore-level

Datastore implementation with level(up|down)...

Read more
,

ipfs-bitswap

JavaScript implementation of the Bitswap data exchange protocol used by...

Read more

Dependencies

Core dependencies of this npm package and its dev dependencies.

aegir, npm-run-all

Documentation

A README file for the datastore-core code repository. View Code

datastore-core

ipfs.tech Discuss codecov CI

Wrapper implementation for interface-datastore

About

Various Datastore implementations are available.

Implementations

Example - BaseDatastore

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

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.

Example - Wrapping Stores

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

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

Example - BlackHoleDatastore

A datastore that does not store any data.

import { BlackHoleDatastore } from 'datastore-core/black-hole'

const store = new BlackHoleDatastore()

Install

$ npm i datastore-core

Browser <script> tag

Loading this module through a script tag will make it's 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.