file-mkdir
v0.1.3
Published
It is used to generate the project directory tree, and supports markdown and txt file formats.
Downloads
13
Maintainers
Readme
It is used to generate the project directory tree, and supports markdown and txt file formats.
Usage
First you need to install it:
npm i -D file-mkdir
Tree files can be generated by directly calling the interface, and the md type file is exported by default.
# generateDirectory has default parameters
# generateDirectory(
# projectPath = __dirname,
# outputPath = path.join(projectPath, "MD.md"),
# ignore = ["node_modules", ".git", "dist", ".vscode", ".github"]
# )
# So u can just call it
const generateDirectory = require("file-mkdir");
generateDirectory();
Of course, you can customize the configuration parameters.
const path = require("path");
const generateDirectory = require("file-mkdir");
# Where do you want to start traversing the file
const projectPath = "E://picture";
# markdown
const fileName = "MD.md";
# OR txt
const fileName = "MD.txt";
# Where do you generate.md files
const outputPath = path.join(projectPath, fileName);
const ignore = ["node_modules", ".git"];
generateDirectory(projectPath, outputPath, ignore);