Store data in a file synchronously
$ npm install file-store-sync
Simply the module return a constructor that receive as a unique parameter the path to the file to use and just execute the operations that you need. Remember, no callbacks, all the operations are synchronously.
var FileStoreSync = require'file-store-sync';var store = './store-test';
'use strict';var FileStoreSync = require'file-store-sync';var store = './store-test';storepush'array-key' 'array-value';storepushIfNotExists'array-key' 'array-value';console.log'The value of array-key is: ' + storeget'array-key';storeset'key' some: 'value' ;console.log'The value of key is: ' + storeget'key';storeremove'array-key' 'array-value';console.log'Now array-key is: ' + storeget'array-key';storedelete'key';console.log'Now the value of key is: ' + storeget'key';
I would like to appreciate to Raynos to develop the file-store project and release that under MIT license.
License (The MIT License)
Copyright (c) 2013 Ivan Fraixedes Cugat firstname.lastname@example.org
This project is a fork from the project file-store developed Raynos (https://github.com/Raynos/file-store)
Copyright (c) 2012 Raynos.