Last 12 weeks · 0 commits
4 of 6 standards met
Currently, the function doesn't accept a file instance: Results in the following error: This makes harder to work with within Node.js ESM modules. Users will run into this gotcha more frequently as most Node.js APIs that work with filesystem paths accept file instances, including . In the meantime, we have to do this workaround:
Per https://github.com/nodejs/node/pull/31530 node.js will soon return the first directory created rather than returning the requested directory. So if does not exist the following script: This will print then instead of printing (also the result is never 'd). Knowing the first directory created can be useful when you need to set permissions or ownership of the created directories. The node.js change itself will be masked by which returns but I think it would be useful for to emulate this new functionality. Maybe need to wait until it's known what versions of node.js will get this new functionality so can be updated to ensure native is only used if it provides the result?
Repository: sindresorhus/make-dir. Description: Make a directory and its parents if needed - Think `mkdir -p` Stars: 481, Forks: 24. Primary language: JavaScript. Languages: JavaScript (94.8%), TypeScript (5.2%). License: MIT. Latest release: v5.1.0 (11mo ago). Open PRs: 0, open issues: 0. Last activity: 11mo ago. Community health: 85%. Top contributors: sindresorhus, coreyfarrell, RyanZim, BendingBender, realityking, bndnsmth, cclauss, striezel, papb, gurucomkz and others.