springbokjs-utils

2.0.1 • Public • Published

springbokjs-utils NPM version Build Status Coverage

See the full API here.

fs with Promises

var fs = require('springbokjs-utils/fs');
 
fs.readFile('./myfile')
    .then(function(contentBuffer) {
        console.log('success ', contentBuffer.toString());
    })
    .catch(function(error) {
        console.error('error', error);
    });
 
Promise.all([
    fs.readFile('./myFirstFile'),
    fs.readFile('./mySecondFile')
]).then(function(contents) {
    console.log('myFirstFile content', contents[0].toString());
    console.log('mySecondFile content', contents[1].toString());
});
 

Package Sidebar

Install

npm i springbokjs-utils

Weekly Downloads

7

Version

2.0.1

License

MIT

Last publish

Collaborators

  • churpeau