Asynchronously writes data to a file, replacing the file if it already exists.
npm install --only=production --save fs-writefile-promise
I recommend using an optimized build matching your Node.js environment version, otherwise, the standard
require would work just fine with any version of Node
>= v4.0 .
/** Node 7*/const write =/** Node 6*/const write =/** Node 4 (Default)* Note: additional ES2015 polyfills may be required*/var write =
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.
The option object will be directly passed to fs.writefile.