Comments (6)
Side note: this can be done with dir
in fs-jetpack
from make-dir.
Can also be done with fs-extra
emptyDir
https://github.com/jprichardson/node-fs-extra/blob/master/docs/emptyDir.md
from make-dir.
but it starts with readdir
In my case, it is an edge case that the target directory exists. So I'd prefer if it starts with the mkdir command and only removes the directory if an EEXIST exception is thrown.
from make-dir.
Honestly, if you need to be that hyper-optimized, you're probably best off embedding the function in your own code; because there are many other use-cases where it would be more efficient to do the exact opposite. A library can't cover all cases with highest efficiency.
from make-dir.
I might do that. But make-dir almost does what I need. It runs mkdir without checking the existence of the directory first. So adding an empty
option would not be a breaking change.
from make-dir.
I guess I will create a new package for this. This one is not that useful anymore, as NodeJS supports recursive mkdir natively
from make-dir.
Related Issues (20)
- Why pify instead of util.promisify? HOT 2
- import * as makeDir doesn't work in 2.1.0 HOT 8
- can't make dir on parent's parent folder HOT 2
- Stale process.umask() value HOT 1
- Changing return value of Node.js recursive mkdir HOT 1
- Inconsistency between async and sync implementations HOT 1
- make-dir should preserve EACCES error HOT 3
- Stop using process.umask()
- umask warnings HOT 1
- Add option to disable absolute path resolution (useful for alternate fs) HOT 1
- create CLI HOT 1
- Try Catch problems HOT 2
- Accept file `URL` instances HOT 2
- [Feature Request] Add the posibility to create files HOT 1
- Semver dependency in published package does not match what's in the repo HOT 2
- Failing tests ERR_INVALID_ARG_TYPE (Windows?) HOT 2
- NPM package.json not updated HOT 1
- 3.x release supporting recent semver? HOT 2
- `process.umask()` is not available inside worker thread HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from make-dir.