A basic project scaffolder made using Bun and boune.
- Initialize projects from customizable templates
- Interactive template selection with configurable defaults
- Built-in local http server using the serve npm package
- Optional git initialization
- Template management through a simple JSON configuration
- Lightning-fast execution powered by Bun
The instructions below are for unix based systems (Linux, macOS, BSD) but can be adapted for other operating systems.
Navigate to the home directory
cd ~Clone the git repository
git clone https://github.com/h-3d/xenx.gitNavigate to the cloned directory
cd xenxInstall dependencies
bun installAdd the xenx alias to your shell configuration file (~/.bashrc, ~/.zshrc, etc)
echo "alias xenx='bun run ~/xenx/index.js'" >> ~/.bashrc # For Bashecho "alias xenx='bun run ~/xenx/index.js'" >> ~/.zshrc # For ZshSource your shell configuration file to apply the changes
source ~/.bashrc # For Bashsource ~/.zshrc # For ZshInitialize a new project
xenx init my-projectNavigate to the project directory
cd my-projectStart the http server
xenx serveBy default, templates are stored in ~/xenx/templates/. Each template has its own subdirectory, for example:
templates
├── picocss
├── tailwind
├── threejs
├── vanilla
└── templates.json
You can customize the location of the templates folder by modifying the templatesDirectory variable in index.js:
const templatesDirectory = path.join(os.homedir(), "xenx", "templates");The templates.json file controls which templates appear in the interactive prompt and which one is selected by default. This file is located in the templates directory and has two main fields:
templates: An array of template objects that define what appears in the prompt.default: The directory name of the template that is selected by default.
Each template object has two main fields:
label: The text that appears in the interactive prompt.value: The directory name of the template.
{
"templates": [
{
"label": "Vanilla",
"value": "vanilla"
},
{
"label": "Tailwind CSS",
"value": "tailwind"
},
{
"label": "Pico CSS",
"value": "picocss"
},
{
"label": "Three.js",
"value": "threejs"
}
],
"default": "vanilla"
}