Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/appgeist/ensure-dir
Utility function to ensure a directory path exists and return a Promise
https://github.com/appgeist/ensure-dir
check create directory filesystem mkdirp nodejs promise server-side shell utilities
Last synced: about 2 months ago
JSON representation
Utility function to ensure a directory path exists and return a Promise
- Host: GitHub
- URL: https://github.com/appgeist/ensure-dir
- Owner: appgeist
- License: isc
- Created: 2019-07-09T07:41:01.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T09:18:12.000Z (almost 3 years ago)
- Last Synced: 2024-11-02T06:48:05.614Z (about 2 months ago)
- Topics: check, create, directory, filesystem, mkdirp, nodejs, promise, server-side, shell, utilities
- Language: JavaScript
- Size: 190 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @appgeist/ensure-dir
[![NPM version][npm-image]][npm-url]
[![License][license-image]][license-url]Utility function to ensure a directory path exists and return a Promise.
Uses [mkdirp](https://www.npmjs.com/package/mkdirp) under the hood.## Usage
```js
const ensureDir = require("@appgeist/ensure-dir");await ensureDir("/folder/to/store/lotsa/files");
```### Why not [mkdirp-promise](https://www.npmjs.com/package/mkdirp-promise)?
@appgeist/ensure-dir should be slightly more efficient than [mkdirp-promise](https://www.npmjs.com/package/mkdirp-promise) because it checks whether the specified path exists before trying to create it.
## License
The [ISC License](LICENSE).
[npm-image]: https://img.shields.io/npm/v/@appgeist/ensure-dir.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@appgeist/ensure-dir
[license-image]: https://img.shields.io/npm/l/@appgeist/ensure-dir.svg?style=flat-square
[license-url]: LICENSE