This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
fs-writefile-promise with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
npm install fs-writefile-promise
When it finishes, it will be fulfilled with the file name that was written to.
When it fails, it will be rejected with an error as its first argument.
write('/tmp/foo', 'bar') .then(filename => console.log(filename)) //=> '/tmp/foo' .catch(err => console.error(err))
The option object will be directly passed to fs.writeFile.