0.7.0 • Published 8 years ago
snapnode v0.7.0
snapnode
run your node in snapshot mode!

Usage
- first, install:
npm install -g snapnode- also
npm install -g electronif you don't have it already
- also
- now instead of running
node yourscript.jsrunsnapnode yourscript.js - you'll see the output of
yourscript.jsin a window - try changing something in
yourscript.jsto produce a different output. - now you can see the diff!
- if the new output looks wrong, fix it. If it looks right, press the "Update" button to update the base snapshot.
Power user
jandkmove to the next and previous snapshot in the list.when there is a diff you can press the
\(or|) key to toggle between a unified diff and a split left/right view.
Multiple snapshots
You can create a config file with multiple snapshots. Whenever you edit a js file in your project, all snapshots will be recalculated so you can see which diffs changed.
For example, create a file called snaps.js in your project root:
module.exports = {
entries: [
{
file: 'place-order.js',
args: [ ]
},
{
file: 'place-order.js',
args: [ 'pizza', '--cheese' ]
},
{
file: 'hello.js',
args: [ 'Mr. Realperson' ]
}
]
}Then run snapnode snaps.js
License
MIT