{"_id":"history-tree","_rev":"4629067","name":"history-tree","description":"Tree for tracking reverts and commits on checkpoints. Checkpoints can nest arbitrarily deep.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"time":{"modified":"2026-04-10T18:46:29.000Z","created":"2015-09-14T21:19:45.060Z","2.0.0":"2015-09-15T05:43:19.374Z","1.0.1":"2015-09-14T21:31:50.938Z","1.0.0":"2015-09-14T21:19:45.060Z"},"users":{},"author":"","versions":{"2.0.0":{"name":"history-tree","version":"2.0.0","description":"Tree for tracking reverts and commits on checkpoints. Checkpoints can nest arbitrarily deep.","main":"index.js","scripts":{"test":"node test.js"},"author":"","license":"ISC","dependencies":{"async":"^1.4.2","async-eventemitter":"^0.2.2"},"devDependencies":{"tape":"^4.2.0"},"gitHead":"0f1329c79839f144f327a04fa10aed4a7ed1124c","_id":"history-tree@2.0.0","_shasum":"ebc714dcf11515e6bef13488c28346231cd76f42","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"ebc714dcf11515e6bef13488c28346231cd76f42","size":2648,"noattachment":false,"key":"/history-tree/-/history-tree-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/history-tree/download/history-tree-2.0.0.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"directories":{},"publish_time":1442295799374,"_hasShrinkwrap":false,"_cnpm_publish_time":1442295799374,"_cnpmcore_publish_time":"2021-12-16T17:18:41.248Z"},"1.0.1":{"name":"history-tree","version":"1.0.1","description":"Tree for tracking reverts and commits on checkpoints. Checkpoints can nest arbitrarily deep.","main":"index.js","scripts":{"test":"node test.js"},"author":"","license":"ISC","dependencies":{"async":"^1.4.2","async-eventemitter":"^0.2.2"},"devDependencies":{"tape":"^4.2.0"},"gitHead":"4d32bc4e6208d42b6d3d204a072e09784462d818","_id":"history-tree@1.0.1","_shasum":"afe20a4c24d9715a59f318e77819b7931acfaa1f","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"afe20a4c24d9715a59f318e77819b7931acfaa1f","size":2661,"noattachment":false,"key":"/history-tree/-/history-tree-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/history-tree/download/history-tree-1.0.1.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"directories":{},"publish_time":1442266310938,"_hasShrinkwrap":false,"_cnpm_publish_time":1442266310938,"_cnpmcore_publish_time":"2021-12-16T17:18:41.427Z"},"1.0.0":{"name":"history-tree","version":"1.0.0","description":"Tree for tracking reverts and commits on checkpoints. Checkpoints can nest arbitrarily deep.","main":"index.js","scripts":{"test":"node test.js"},"author":"","license":"ISC","dependencies":{"async":"^1.4.2","async-eventemitter":"^0.2.2"},"devDependencies":{"tape":"^4.2.0"},"gitHead":"013c8265c5a841e87aa967ed9b61c9a5d093b0e0","_id":"history-tree@1.0.0","_shasum":"7027dcdf2547835230a159d5fd3978e298c7cf59","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kumavis","email":"aaron@kumavis.me"},"dist":{"shasum":"7027dcdf2547835230a159d5fd3978e298c7cf59","size":2444,"noattachment":false,"key":"/history-tree/-/history-tree-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/history-tree/download/history-tree-1.0.0.tgz"},"maintainers":[{"name":"kumavis","email":"aaron@kumavis.me"}],"directories":{},"publish_time":1442265585060,"_hasShrinkwrap":false,"_cnpm_publish_time":1442265585060,"_cnpmcore_publish_time":"2021-12-16T17:18:41.644Z"}},"readme":"# history-tree\n\nTree for tracking reverts and commits on checkpoints.\nCheckpoints can nest arbitrarily deep.\n\n## api\n\n### methods\n\n##### new HistoryTree() -> history tree\n\nConstructor. Creates a history tree.\n\n##### historyTree.checkpoint() -> history sub-tree\n\nSynchronous.\nCreates a new history sub-tree and adds it to the checkpoint stack.\n\n##### historyTree.commit(cb)\n\nAsynchronous.\nRemoves the top sub-tree from the checkpoint stack,\ncalls `accept` on the sub-tree,\nthen emits `commit` on this tree.\nCalls the callback with an Error if the stack is empty.\n\n##### historyTree.revert(cb)\n\nAsynchronous.\nRemoves the top sub-tree from the checkpoint stack,\ncalls `reject` on the sub-tree,\nthen emits `revert` on this tree.\nCalls the callback with an Error if the stack is empty.\n\n##### historyTree.accept(cb)\n\nAsynchronous.\nCalls `commit` on this tree for all checkpoints on the stack, in series.\nDoes NOT call the callback with an Error if the stack is empty.\nEmits event `accepted` on this tree.\n\n##### historyTree.reject(cb)\n\nAsynchronous.\nCalls `revert` on this tree for all checkpoints on the stack, in series.\nDoes NOT call the callback with an Error if the stack is empty.\nEmits event `rejected` on this tree.\n\n### events\n\nHistoryTree is an [AsynchronousEventEmitter](https://github.com/ahultgren/async-eventemitter).\nThis means that HistoryTree's async api calls won't complete until all event listeners call their callback, unless the listener is synchronous.\nSee the AsynchronousEventEmitter api for usage.\n\n##### 'accepted' -> function(subTree, [next])\n\nCalled AFTER the `accept(cb)` on this HistoryTree node.\n\n##### 'rejected' -> function(subTree, [next])\n\nCalled AFTER the `reject(cb)` on this HistoryTree node.\n\n##### 'commit' -> function(subTree, [next])\n\nCalled AFTER every `commit(cb)` on this HistoryTree node.\n\n##### 'revert' -> function(subTree, [next])\n\nCalled AFTER every `revert(cb)` on this HistoryTree node.\n\n\n","_attachments":{},"license":"ISC"}