babel-fs
v1.0.5
Published
Implement nodejs fs module with babel on promise style.
Downloads
18
Maintainers
Readme
babel-fs
Implement nodejs fs module with babel on promise style.
Usage
import bfs from './babel-fs';
const SELF = process.argv[1];
// call the readFileSync
var selfContent = bfs.readFileSync(SELF);
// call the readFile mehtod with promsie style
bfs.readFile(SELF).then(data => {
console.log(selfContent + '' === data + ''); // true
// done
console.log(data);
}, error => {
// fail
console.error(error);
});