fs-store-async

0.3.3 • Public • Published

node-fs-store-async

Data storage compatible, async, version of node-fs-store.

Use temporarily while migrating to a purely async API.

Example

const { createFileStore } = require('fs-store-async');
 
createFileStore('example_data.json', function (err, my_store) {
  // Get a value, providing a default
  let number_of_runs = my_store.get('number_of_runs', 0);
  ++number_of_runs;
  // Store a value (will be written to disk asynchronously)
  my_store.set('number_of_runs', number_of_runs, () => console.log('async write finished'));
  console.log('This example has run ' + number_of_runs + ' time(s)');
});

Package Sidebar

Install

npm i fs-store-async

Weekly Downloads

21

Version

0.3.3

License

MIT

Unpacked Size

8.38 kB

Total Files

4

Last publish

Collaborators

  • jimbly