JsonDB

When I was playing with Node-RED, a flow management based on Node.js, I discover that I was needing a simple Node to save and retrieve information from simple file.

I then created JsonDB and published it on Npm registry :

You can find the source code on my Github Repository : 

The module store the data using JavaScript Object directly into a JSON file. You can easily traverse the data to reach directly the interesting property using the DataPath. The principle of DataPath is the same as XMLPath.

Example

{
	test: {
		data1 : {
			array : ['test','array']
		},
		data2 : 5
	}
}

If you want to fet the value of array, the DataPath is /test/data1/array To reach the value of data2 :/test/data2 You can of course get also the full object test : /test Or even the root : /

I’m quite happy with this lib and the Node created for Node-RED

Antoine Aflalo Written by:

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *