js-template-generator
v1.2.5
Published
CLI tool for generating Node.js and TypeScript project templates.
Downloads
13
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-generator
Usage
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-sfa
Replace 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
.env
supportnest-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
.env
support
Adding New Templates
To add new templates, follow these steps:
- Create a Template Directory: Place your template files inside a new directory within the
templates
folder. - Update Template List: Add an entry for the new template in the
templates
object 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.git
Navigate to the Project Directory:
cd js-template-generator
Install Dependencies:
npm install
Run the CLI Tool:
npm start
Lint 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.