folder-structures
v1.0.0
Published
Automatically generate and monitor your project folder structure. The output is a .txt file that shows the folder and file hierarchy in a tree view.
Downloads
7
Maintainers
Readme
Folder Structure
Automatically generate and monitor your project folder structure. The output is a .txt file that shows the folder and file hierarchy in a tree view.
Installation
npm install folder-structuresUse
It must be used at the application entry point, such as index.js, server.js, ,app.js, main.mjs or others according to your project entry point.
CommonJS
const path = require('path');
require('folder-structures').init(__dirname, {
ignoredFolders: ['node_modules', '.git', 'dist', 'build'],
ignoredFiles: ['.gitignore'],
outputFilename: 'my-folder-structure.txt',
});ESM
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
import { init } from 'folder-structures';
const __dirname = dirname(fileURLToPath(import.meta.url));
init(resolve(__dirname), {
ignoredFolders: ['node_modules', '.git', 'dist', 'build'],
ignoredFiles: ['.gitignore'],
outputFilename: 'my-folder-structure.txt',
});Configuration Options
| Options | Type | Default | Information |
| ---------------- | ---------- | -------------------------- | --------------------------- |
| ignoredFolders | string[] | ['node_modules', '.git'] | Ignored folder |
| ignoredFiles | string[] | [] | Ignored files |
| outputFilename | string | 'folder-structure.txt' | Structure output file name |
Example Output
my-project/
├── public
│ └── index.html
├── src
│ ├── components
│ │ └── Header.js
│ └── App.js
└── package.json