UNPKG

fsep

Version:

Fsep is a library that promisifies the native node FS operation and brings extras into the mix.

13 lines (10 loc) 304 B
const Fsep = require('../index'); const Path = require('path'); const path = Path.join(__dirname, 'rw/blue/white/t.txt'); Promise.resolve().then(function () { return Fsep.ensureFile(path, 'foo bar'); }).then(function () { console.log('file is written'); }).catch(function (error) { throw error; });