gen-file-structure
generate your file structure
Getting Started
- add your project
pnpm install gen-file-structure
- generate your file structure
const gen=require('gen-file-structure')
gen({
rootPath: path.resolve(__dirname,'../'),
out: "./example.md",
})
- specify ignored files or folders
By default,node_ modules
and.git
folders will be ignored.
const gen=require('gen-file-structure')
gen({
rootPath: path.resolve(__dirname,'../'),
out: "./example.md",
excludes:['package.lock.json',"node_modules",'.git']
})
- Whether to append it to the Markdown document
const gen=require('gen-file-structure')
gen({
rootPath: path.resolve(__dirname,'../'),
out: "./example.md",
excludes:['package.lock.json',"node_modules",'.git'],
append: true
})
command line
- Generate file structure in the current directory, the default file name is
structure.md
npx gen-file
- Specify the generated root directory and output directory
npx gen-file -r=./src -o=./myFile.md
examples
excute npx gen-file -r=./node_modules/jest
├──bin
│ ├──jest.js
├──build
│ ├──index.d.ts
│ └──index.js
├──LICENSE
├──README.md
└──package.json