Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');

Params

  • filename - The file name to create if it doesn't exist.
  • body - The contents of the file that's being created.

API

createIfNotExist(filename, data)

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

About

Synchronous Node.JS function to simply create a file if it does not exist.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.