bamboo-tree
v0.0.2
Published
Parse your file directory into a nice index.html home page.
Readme
bamboo-tree
bamboo-tree is a small CLI tool that turns a directory into a polished, browsable HTML index page. It is useful for publishing a directory listing as a simple static site without needing a full web server or CMS.
A live example is available at https://bucket.marutsuki.com.
Quick start
Requirements
- Node.js 18 or newer
- npm
Run it
Install the package globally or use it with npx:
npx bamboo-tree --root ./my-folder --output ./index.htmlUseful options:
npx bamboo-tree --root ./my-folder --name "My Project" --output ./index.html --exclude .git,node_modulesOptions:
--root <root>: directory to scan--name <name>: title shown in the generated page--output <output>: output HTML file path--exclude <exclude>: comma-separated list of files/directories to skip (defaults to.git)
Development setup
If you want to work on the project locally:
git clone https://github.com/marutsuki/bamboo-tree.git
cd bamboo-tree
npm install
npm run build
npm testProject structure
src/cli.ts— command-line entrypointsrc/index.ts— public API for generating the treesrc/tree.ts— directory traversal and exclusion logicsrc/template.ts— HTML rendering via EJStemplates/index.ejs— the page template
Contributing
Contributions are welcome. If you make changes, please run the test suite and build before opening a pull request.
npm run build
npm test