js-template-generator
v1.3.0
Published
CLI tool for generating Node.js and TypeScript project templates.
Maintainers
Readme
JS Template Generator
js-template-generator is a CLI tool designed to facilitate the creation of various Node.js and TypeScript project templates. This tool simplifies the setup process for common project structures, allowing for rapid development and prototyping.
Features
- Generate Templates: Quickly create pre-defined project structures for Node.js and TypeScript applications.
- Customizable: Easily add more templates as your project evolves.
- Comprehensive Templates: Includes configurations, tests, and documentation for each template.
Installation
To install js-template-generator, run the following command:
npm install -g js-template-generatorUsage
To generate a new project template, use the generate-js-template command followed by the name of the template. For example:
generate-js-template typescript-sfaReplace typescript-sfa with the desired template name. The tool will create a project directory with the specified template at your current working directory.
Available Templates
express-sfa: (Express.js single file app) This is a single-file TypeScript template app for faster idea testing and prototyping. It includes:- Tests
- Swagger documentation
- A demo root API call
- Basic async error handling
- A demo Axios call
.envsupport
nest-sta: (Nest.js startup template app) 'Quick generic template for spinning up Nest.js apps. Designed to help you bootstrap your next Nest.js project efficiently:- Cookie Auth
- Swagger documentation
- validation
- logging
- Mongoose ORM
- File Handling
- Emails
- Caching
.envsupport
Adding New Templates
To add new templates, follow these steps:
- Create a Template Directory: Place your template files inside a new directory within the
templatesfolder. - Update Template List: Add an entry for the new template in the
templatesobject inindex.js.
Development
For development and contributing to the js-template-generator, follow these instructions:
Clone the Repository:
git clone https://github.com/your-username/js-template-generator.gitNavigate to the Project Directory:
cd js-template-generatorInstall Dependencies:
npm installRun the CLI Tool:
npm startLint and Format Code:
npm run lint npm run format
Contributing
Contributions are welcome! Please open an issue or submit a pull request to contribute to this project. Ensure your contributions adhere to the project's coding standards and include tests where applicable.
License
This project is licensed under the ISC License.
