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
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