JSPM

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

Ensures that the file path exists.

Package Exports

  • ensure-file

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 (ensure-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ensure-file

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Ensures that the file path exists. Like fs-extra#ensureFile but out of the box.

Install

$ npm install ensure-file --save

Usage

'use strict'

var ensureFile = require('ensure-file')
var file = '/tmp/this/path/does/not/exist/file.txt'

ensureFile(file, function (err) {
  console.log(err) // => null
  // file has now been created, including the directory it is to be placed in
})

API

ensureFile(file, cb)

ensureFile.sync(file)

file

Required Type: string

License

MIT © Kiko Beats