2.0.3 • Published 6 years ago

tomas v2.0.3

Weekly downloads
3,001
License
MIT
Repository
github
Last release
6 years ago

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

2.0.3

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago