Skip to content

Node module that creates missing folders in the middle of a path

Notifications You must be signed in to change notification settings

fcostarodrigo/open-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPEN-PATH

Codacy Badge Build Status codecov

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.

License

MIT License

About

Node module that creates missing folders in the middle of a path

Resources

Stars

Watchers

Forks

Packages

No packages published