2.3.4 • Published 4 years ago

writeout v2.3.4

Weekly downloads
1,374
License
MIT
Repository
github
Last release
4 years ago

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

NameDefaultDescription
mkdirpfalseMake parent directories.
skipIfIdenticalfalseSkip to write if existing content is identical.
mode"644"File permission.
forcefalseForce to write even if existing file is readonly.

License

This software is released under the MIT License.