tomas
save data to storage and read from it to speed up computing
Last updated 8 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tomas 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.3                                ...           latest (8 years ago)

7 Versions

  • 2.0.3                                ...           8 years ago
  • 2.0.2                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 1
Dependencies (4)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |