0.0.1 • Published 11 years ago

nor-json-file v0.0.1

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

nor-json-file

Prototype of JSON file editing with JSON diff based transactions.

var file = 'samples/test.json';
var JSONFile = require('nor-json-file');
JSONFile.open(file).then(function(data) {
	data.messages.push( {'subject':'Hello', 'body':'This is a test message.'} );
	return data.commit();
}).then(function() {
	util.debug('Successfully edited '+file);
}).fail(function(err) {
	/* ... */
}).done();

/* EOF */