mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
45 lines
7.5 KiB
JSON
45 lines
7.5 KiB
JSON
![]() |
{
|
||
|
"name": "strong-store-cluster",
|
||
|
"version": "0.1.3",
|
||
|
"description": "In-memory key/value store for the node's native cluster.",
|
||
|
"readmeFilename": "README.md",
|
||
|
"license": "MIT",
|
||
|
"keywords": [
|
||
|
"cluster",
|
||
|
"store"
|
||
|
],
|
||
|
"author": {
|
||
|
"name": "Bert Belder",
|
||
|
"email": "bert@strongloop.com"
|
||
|
},
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "https://github.com/strongloop/strong-store-cluster.git"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/strongloop/strong-store-cluster/issues"
|
||
|
},
|
||
|
"main": "index.js",
|
||
|
"scripts": {
|
||
|
"blanket": {
|
||
|
"pattern": "//^((?!(node_modules|test)).)*$/"
|
||
|
},
|
||
|
"coverage": "mocha -r blanket -R html-cov > coverage_strong-store-cluster.html",
|
||
|
"test": "mocha --reporter spec --timeout 5000 --slow 1000 --ui tdd"
|
||
|
},
|
||
|
"devDependencies": {
|
||
|
"blanket": "latest",
|
||
|
"mocha": "~1.9.0"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">=0.10"
|
||
|
},
|
||
|
"readme": "# Strong Store Cluster\n\nStrong Store for Cluster provides a key/value collection that can be accesses by\nall processes in a node cluster.\n\n## Example\n\n```javascript\n// get the collection and give it a name\nvar collection = require('strong-store-cluster').collection('test');\n\n// don't let keys expire, ever - the number represents seconds\ncollection.configure({ expireKeys: 0 });\n\ncollection.set('ThisIsMyKey', { a: 0, b: 'Hiya', c: { d: 99}}, function(err) {\n if (err) {\n console.error('There was an error');\n return;\n }\n\n collection.get('ThisIsMyKey', function(err, obj) {\n if (err) {\n console.error('There was an error in collection.get.');\n return;\n }\n\n console.log('The object: ',obj);\n });\n});\n```\n\n## API documentation\n\n### store.collection(name)\n\nReturns a Collection object which lets you share data between node processes.\n\n### Class: Collection\n\nA `Collection` instance provides access to a shared key-value store\nshared by multiple node instances.\n\nHow collections are named and stored is determined by the storage backend. The\n`strong-store-cluster` implementation stores collections in the master process\n(if you're using cluster), and accepts any arbitrary string as a collection\nname.\n\nA `Collection` object is also an `EventEmitter`.\n\n\n#### collection.configure([options])\n\n* `options` (`Object`) contains configurations options to be changed\n * `expireKeys` (`Number`) seconds after which keys in this\n collection are to be expired.\n\nSet configuration options for the collection.\n\nCurrently only one configurable option is supported: `expireKeys`. When set\nto a nonzero value, keys will automatically expire after they've not been\nread or updated for some time. The timeout is specified in seconds. There's no\nguarantee that the key will be discared after exactly that number of seconds\nhas passed. However keys will never be automatically deleted _sooner_ than what\nthe `expireKeys` setting allows.\n\nIt is perfectly legal to call the `configure` method from multiple node\nprocesses (e.g. both in a worker and in the master process). However you\nshould be careful to set the _same_ option values every time, otherwise the\neffect is undefined.\n\n\n#### collection.get(key, callback)\n\n* `key` (`String`) key to retrieve\n* `callback` (`Function`) called when the value has been retrieved\n\nRead the value associated with a particular key. The callback is called with\ntwo arguments, `(err, value)`. When the key wasn't found in the collection, it\nis automatically created and it's `value` is set to `undefined`.\n\n\n#### collection.set(key, [value], [callback])\n\n* `key` (`String`) key to set or update\n* `value` (`object`) value to associate with the key\n* `callback` (`Function`) called when the value has been retrieved\n\nSet the value associated with `key`. The `value` must be either undefined or\na value that can be serialized with JSON.stringify.\n\nWhen the `value` parameter is omitted or set to `undefined`, the key is\ndeleted, so effectively it's the same as calling `collection.del(key)`.\n\nThe `callback` function receives only one argument, `err`. When the\ncallback is omitted, the master process does not send a confirmation\nafter updating the key, and any errors are silently ignored.\n\n\n#### collection.del(key, [callback])\n\n* `key` (`String`) key to delete\n* `callback` (`Function`) called when the value has been retrieved\n\nDelete a key from the collection.\n\nThis operation is the equivalent of setting the key to `undefined`.\n\nThe `callback` function receives only one argument, `err`. When the\ncallback is omitted, the master process does not send a confirmation\nafter deleting the key, and any errors are silently ignored.\n\n\n#### collection.acquire(key, callback)\n\n* `key` (`String`) key to delete\n* `callback` (`Function`) called when the key has been locked\n\nLock a key for exclusive read and write access.\n\nThe `acquire` methods waits until it can grab an exclusive lock on the\nspecified key. When th
|
||
|
"_id": "strong-store-cluster@0.1.3",
|
||
|
"dist": {
|
||
|
"shasum": "aaab17a025b6b8809c0c1f7a796e49254cd3386c"
|
||
|
},
|
||
|
"_from": "strong-store-cluster@~0.1.0",
|
||
|
"_resolved": "https://registry.npmjs.org/strong-store-cluster/-/strong-store-cluster-0.1.3.tgz"
|
||
|
}
|