tomas

2018-10-23 admin

tomas是什么

什么是tomas,save data to storage and read from it to speed up computing

tomas使用教程帮助文档

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-43452.html

文章标题:tomas

回到顶部