tomas

2.0.3 • Public • Published

Tomas License Dependency Status Build Status NPM version

Save data to storage and read from it to speed up computing.

Install

npm i tomas --save

How to use?

const fs = require('fs'),
const tomas = require('tomas'),
const path = './package.json',
const log = (error, data, str) => {
     if (error)
            console.error(error.message);
        else
            console.log(str, data);

    return error;
};

tomas.check(path, (is) => {
    if (is)
        return tomas.read(name, (error, data) => {
           log(error, data, 'tomas read:\n');
        });
    
    fs.readFile(name, 'utf8', (error, data) => {
        if (!log(error))
            tomas.write(name, data, (error) => {
                log(error, data, 'tomas written:\n');
            });
    });
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i tomas

Weekly Downloads

613

Version

2.0.3

License

MIT

Unpacked Size

6.9 kB

Total Files

7

Last publish

Collaborators

  • coderaiser