writeout

2.3.4 • Public • Published

writeout

Build Status Code Climate Code Coverage npm Version

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.

Readme

Keywords

Package Sidebar

Install

npm i writeout

Weekly Downloads

274

Version

2.3.4

License

MIT

Unpacked Size

13.7 kB

Total Files

21

Last publish

Collaborators

  • okunishinishi