tomas

save data to storage and read from it to speed up computing

MIT 7 个版本
安装
npm install tomas
yarn add tomas
pnpm add tomas
bun add tomas
README

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 2018-06-14
2.0.2 2017-10-09
2.0.1 2017-10-09
2.0.0 2017-10-09
1.0.2 2015-06-09
1.0.1 2015-01-15
1.0.0 2014-12-02