Intro
Installable via npm install --save datastore-core
, it can also be used directly in the browser.
Download
The source is available for download from GitHub. Alternatively, you can install using npm:
$ npm install --save datastore-core
You can then require()
datastore-core as normal:
const datastoreCore = require('datastore-core')
In the Browser
Datastore-core should work in any ES2015 environment out of the box.
Usage:
<script type="text/javascript" src="index.js"></script>
The portable versions of datastore-core, including index.js
and index.min.js
, are included in the /dist
folder. Datastore-core can also be found on unpkg.com under
KeyTransformDatastore
An object with a pair of functions for (invertibly) transforming keys
Parameters
child: any
:transform: any
:
KeyTransformDatastore
A datastore shim, that wraps around a given datastore, changing the way keys look to the user, for example namespacing keys, reversing them, etc.
Parameters
child: any
:transform: any
:
MountDatastore
A datastore that can combine multiple stores inside various key prefixs.
Parameters
mounts: any
:
NamespaceDatastore
Wraps a given datastore into a keytransform which makes a given prefix transparent.
For example, if the prefix is new Key(/hello)
a call
to store.put(new Key('/world'), mydata)
would store the data under
/hello/world
.
Parameters
child: any
:prefix: any
:
parseShardFun
Convert a given string to the matching sharding function.
Parameters
str: string
:
Returns
ShardV1