1.0.1 • Published 9 years ago

create-file v1.0.1

Weekly downloads
2,766
License
MIT
Repository
github
Last release
9 years ago

create-file

NPM version js-xo-style

Write to a file only if it does not exist

Installation

Install create-file using npm:

npm install --save create-file

Usage

Module usage

var createFile = require('create-file');

createFile('/path/to/file/to-create', 'my content\n', function (err) {
  // file either already exists or is now created (including non existing directories)
});

API

createFile(filename, contents, cb)

NameTypeDescription
filenameStringThe filename to create
contentsStringThe content to write
cbFunctionCallback

License

MIT