Wrapper implementation for interface-datastore
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.
Core dependencies of this npm package and its dev dependencies.
aegir, npm-run-all
A README file for the datastore-core code repository. View Code
Wrapper implementation for interface-datastore
Various Datastore implementations are available.
src/mount
src/keytransform
src/sharding
src/tiered
src/namespace
src/black-hole
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.
import { Key } from 'interface-datastore'
import {
MemoryStore,
MountStore
} from 'datastore-core'
const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})
A datastore that does not store any data.
import { BlackHoleDatastore } from 'datastore-core/black-hole'
const store = new BlackHoleDatastore()
$ npm i datastore-core
<script>
tagLoading 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>
Licensed under either of
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.