@fcostarodrigo/open-path
v5.0.4
Published
Node module that creates missing folders in the middle of a path
Downloads
21
Maintainers
Readme
OPEN-PATH
Node module that creates missing folders in the middle of a path, like mkdir -p
.
Setup
npm install @fcostarodrigo/open-path
Usage
CLI
npm install -g @fcostarodrigo/open-path
openPath --help
openPath <pathToOpen>
Positionals:
pathToOpen String with the path [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--fileInPath, -f Indicates if the last item of the path is a file [boolean]
Lib
const openPath = require("@fcostarodrigo/open-path");
async function main() {
await openPath("docs/UI");
fs.writeFileSync("docs/UI/button.txt", "test");
}
main();
Documentation
openPath(pathToOpen, fileInPath);
pathToOpen
: String with the path.
fileInPath
: Indicates if the last item of the path is a file.
Returns a promise.