JSPM

create-if-not-exist

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 97
  • Score
    100M100P100Q63532F
  • License MIT

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

Package Exports

  • create-if-not-exist

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-if-not-exist) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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