npm.io
0.0.2 • Published 10 years ago

create-if-not-exist

Licence
MIT
Version
0.0.2
Deps
1
Vulns
0
Weekly
0

createIfNotExist

Synchronous Node.JS function to simply create a file if it does not exist. If the file does exist, it will not be modified.

npm install create-if-not-exist --save
var createIfNotExist = require("create-if-not-exist");

// File will be created if it does not exist.
// If the file does exist, it will not be modified.
createIfNotExist('file.txt','blablablabla');

API

createIfNotExist(filename, data)

  • filename - The name of the file
  • data - The data to be written to the file

Keywords