bv-touch is a Node.js command-line tool that allows you to create files or directories at the specified path, automatically creating any missing directories along the way.
To install bv-touch globally on your system, use the following command:
npm install -g bv-touchbv-touch <path>Where <path> is the relative or absolute path where you want to create a file or directory.
-v, --verbose: Enable verbose output.-a, --abs: In case of relative path, show the absolute path.-c, --check: Check if the file or directory exists without creating anything.-n, --no-create: Do not create missing directories or files, only check the last part of the path.
bv-touch myfolder/subfolder/If myfolder or subfolder does not exist, they will be created.
bv-touch myfolder/myfile.txtIf myfolder does not exist, it will be created and then myfile.txt will be created inside it.
bv-touch myfolder/subfolder -vbv-touch myfolder/subfolder -abv-touch myfolder/myfile.txt -cbv-touch myfolder/myfile.txt -nWhen you run the command, it will output the following:
- If directories or files are created, it will log their creation.
- If directories or files already exist, it will log a warning.
- If a file exists when a directory is required (or vice versa), an error message will be shown.
- If using
--check, it will only inform you whether the path exists or not.
[bv-touch] destination: /absolute/path/to/myfolder/subfolder
[bv-touch] created dir: ./myfolder/subfolder
[bv-touch] Done!This project is licensed under the ISC License - see the LICENSE file for details.