{"_id":"checkpoint-store","_rev":"4629127","name":"checkpoint-store","description":"In-memory key-value store with history! Keys are strings, values are any type.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"time":{"modified":"2026-04-10T18:46:45.000Z","created":"2015-10-06T19:08:06.508Z","1.1.0":"2015-10-06T19:42:14.076Z","1.0.0":"2015-10-06T19:08:06.508Z"},"users":{},"author":{"name":"kumavis"},"repository":{"type":"git","url":"git+https://github.com/kumavis/checkpoint-store.git"},"versions":{"1.1.0":{"name":"checkpoint-store","version":"1.1.0","description":"In-memory key-value store with history! Keys are strings, values are any type.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"kumavis"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/kumavis/checkpoint-store.git"},"dependencies":{"functional-red-black-tree":"^1.0.1"},"gitHead":"193f1186746d1b02d65dca66f57805f81db54fe3","bugs":{"url":"https://github.com/kumavis/checkpoint-store/issues"},"homepage":"https://github.com/kumavis/checkpoint-store#readme","_id":"checkpoint-store@1.1.0","_shasum":"04e4cb516b91433893581e6d4601a78e9552ea06","_from":".","_npmVersion":"3.3.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"04e4cb516b91433893581e6d4601a78e9552ea06","size":1891,"noattachment":false,"key":"/checkpoint-store/-/checkpoint-store-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/checkpoint-store/download/checkpoint-store-1.1.0.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"directories":{},"publish_time":1444160534076,"_hasShrinkwrap":false,"_cnpm_publish_time":1444160534076,"_cnpmcore_publish_time":"2021-12-16T17:14:30.500Z"},"1.0.0":{"name":"checkpoint-store","version":"1.0.0","description":"In-memory key-value store with history! Keys are strings, values are any type.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"kumavis"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/kumavis/checkpoint-store.git"},"dependencies":{"functional-red-black-tree":"^1.0.1"},"gitHead":"a4341929b2e713ca819bc52dcda927087bdadc30","bugs":{"url":"https://github.com/kumavis/checkpoint-store/issues"},"homepage":"https://github.com/kumavis/checkpoint-store#readme","_id":"checkpoint-store@1.0.0","_shasum":"2ef41e2d00dc7dee47d009d57fd7aae392db24b5","_from":".","_npmVersion":"3.3.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"2ef41e2d00dc7dee47d009d57fd7aae392db24b5","size":1751,"noattachment":false,"key":"/checkpoint-store/-/checkpoint-store-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/checkpoint-store/download/checkpoint-store-1.0.0.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"directories":{},"publish_time":1444158486508,"_hasShrinkwrap":false,"_cnpm_publish_time":1444158486508,"_cnpmcore_publish_time":"2021-12-16T17:14:30.693Z"}},"readme":"# Checkpoint-Store\n\nIn-memory key-value store with history!\nKeys are strings, values are any type.\n\n```js\nvar store = new CheckpointStore()\nstore.put('xyz', 'hello world')\nstore.checkpoint()\nstore.put('xyz', 'haay wuurl')\n\nstore.get('xyz') //=> 'haay wuurl'\nstore.revert()\nstore.get('xyz') //=> 'hello world'\n```\n\nUses [functional-red-black-tree](https://github.com/mikolalysenko/functional-red-black-tree) under the hood.\n\n### api\n\n##### new CheckpointStore(initialState)\n\ncreates a new store. optionally pass in the intial state as a pojo.\n\n##### store.put(key, value)\n\nsets a value. key is a string. value is any type.\n\n##### store.get(key)\n\nreturns a value. key is a string. value is any type.\n\n##### store.del(key)\n\ndeletes a value. key is a string.\n\n##### store.checkpoint()\n\nadds a checkpoint. state of the store can be returned to this point.\n\n##### store.revert()\n\nreturns to the state of the previous checkpoint. throws an error if there are no checkpoints.\n\n##### store.commit()\n\nkeeps the state and removes the previous checkpoint. throws an error if there are no checkpoints.\n\n##### store.isCheckpointed()\n\nreturns true if the store has remaining checkpoints.\n\n##### store.copy()\n\nreturns a new CheckpointStore with matching state and checkpoints.\n\n##### store.toJSON()\n\nreturns an object (not a string!) of the current state.","_attachments":{},"homepage":"https://github.com/kumavis/checkpoint-store#readme","bugs":{"url":"https://github.com/kumavis/checkpoint-store/issues"},"license":"ISC"}