cr-ts-node
v1.0.31
Published
A handy CLI tool for setting up projects
Downloads
11
Readme
README for cr-ts-node CLI
Overview
Welcome to cr-ts-node
(Create TypeScript Node), a CLI utility designed to facilitate the rapid setup of Node.js projects using TypeScript. This tool automates various initial setup tasks such as creating the project structure, installing dependencies, initializing version control, and configuring TypeScript. Aimed at backend developers looking to kickstart new projects, cr-ts-node
reduces setup time and lets you focus on development.
Key Features
- Automated Project Structure Setup: Creates a new project directory, initializing a sensible folder structure.
- Comprehensive Dependency Installation: Sets up all the necessary npm packages for development and production.
- Environment and Configuration Setup: Automatically configures
.gitignore
,.env
, and TypeScript settings. - Version Control Ready: Initializes a Git repository with the first commit already in place.
- Quick Start: Use
npx
to run the setup without installing the package globally.
Getting Started
Prerequisites
- Node.js installed on your machine (download from Node.js official website).
Usage with NPX
You can run this setup tool directly using npx
without needing to install it globally:
npx cr-ts-node
Follow the on-screen prompts to provide your project name and description. The tool will handle everything else, and you will end up with a fully configured TypeScript Node.js project.
Local Installation (Optional)
If you prefer, you can also install the package globally using npm:
npm install -g cr-ts-node
Then you can run the tool anytime using:
cr-ts-node
How It Works
When you execute the tool, it performs the following steps:
- Prompts for Project Information: Asks for project name and description.
- Creates Project Directory: Sets up the main and subdirectories.
- Initializes npm and Installs Dependencies: Sets up
package.json
and installs dependencies. - Sets Up TypeScript: Configures TypeScript with
tsconfig.json
andenv.d.ts
. - Version Control Initialization: Sets up a new Git repository.
- Creates Essential Files: Such as
.gitignore
,.env
,README.md
, and more. - Generates a Basic Express Server: In TypeScript, ready for further development.
Packaging as an npm Package
To make this tool available through npx
, follow these steps:
- Ensure your
package.json
has the correctbin
entry which points to the CLI script. - Publish the package to npm using:
npm publish
- Once published, it can be run using
npx [package-name]
as described above.
Contributing
We encourage contributions! If you have improvements or bug fixes, please fork the repository and submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE
file for details.
Further Contact
Feel free to reach out or contribute to the project at its GitHub page: https://github.com/dishant0406.