writeout
v2.3.4
Published
Write out string files with various options.
Downloads
2,619
Readme
writeout
Write out string files with various options.
Installation
npm install writeout --save
Usage
'use strict'
const writeout = require('writeout')
// Generate a file.
writeout('hello-wold', 'This is the contents text', {
mkdirp: true,
skipIfIdentical: true
}).then((result) => {
if (!result.skipped) {
console.log('File generated:', result.filename)
}
}).catch((err) =>
console.error(err)
)
Options
| Name | Default | Description |
| --- | --- | --- |
| mkdirp
| false | Make parent directories. |
| skipIfIdentical
| false | Skip to write if existing content is identical. ||
| mode
| "644" | File permission. |
| force
| false | Force to write even if existing file is readonly. |
License
This software is released under the MIT License.