Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terkelg/mkdirplz
Make directories recursively -plz 🙏
https://github.com/terkelg/mkdirplz
directory io mkdir mkdirp
Last synced: 3 months ago
JSON representation
Make directories recursively -plz 🙏
- Host: GitHub
- URL: https://github.com/terkelg/mkdirplz
- Owner: terkelg
- Created: 2018-02-19T23:12:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-18T13:14:31.000Z (over 4 years ago)
- Last Synced: 2024-07-18T12:15:45.187Z (4 months ago)
- Topics: directory, io, mkdir, mkdirp
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
Awesome Lists containing this project
README
mkdir -plz
Make directories recursively -please - you promised!
## Installation
```
npm install mkdirplz
```> **OBS**: This package uses async/await and requires Node.js 7.6
## Usage
```js
const mkdir = require('mkdirplz');await mkdir('path/to/something');
// => path/to/somethingawait mkdir('path/to/myfile.js', { filepath: true });
// => path/to/
```## API
This package does not create the last part of the path, since it assumes that's a filepath.
### mkdirplz(path, options)
Type: `Promise`
Creates path recursively.
#### path
Type: `String`
A string file path to create.
#### options.filepath
Type: `Boolean`
Default: `false`Set to `true` to skip making the last segment.
Useful if the input path is a filename.## Related
- [mk-dirs](https://github.com/lukeed/mk-dirs) - The fast way
- [mkdirp](https://github.com/substack/node-mkdirp) - The old school way## License
MIT © [Terkel Gjervig](https://terkel.com)