path-ensure
Ensure path exists
A simple module to generate the directory before writing the files. See fs-extra
for advance.
Install
$ npm install path-ensure
API
pathEnsure([...paths])
- Params:
- paths:
<string[]>
- A sequence of path segments.
- paths:
- Return:
<Promise<string>>
- Example:const fs = ;const pathEnsure = ;async {const filepath = await ;console;const writeStream = fs;writeStream;};
.sync([...paths])
- Params:
- paths:
<string[]>
- A sequence of path segments.
- paths:
- Return:
<string>
- Example:const fs = ;const pathEnsure = ;const writeStream = fs;writeStream;
Related
- make-dir - Make a directory and its parents if needed - Think
mkdir -p
- fs-extra - Contains methods that aren't included in the vanilla Node.js fs package.
License
MIT © Guntur Poetra