Welcome to the Node TS Scripts Template! This repository provides a robust boilerplate for developing Node.js CLI scripts using TypeScript (version 5.0 and above) and ts-node. It is designed to streamline your development process by offering a preconfigured setup with essential tools.
- Features
- Getting Started
- Usage
- Scripts
- Linting and Formatting
- Project Structure
- Contributing
- License
- Releases
- TypeScript Support: Leverage the power of TypeScript for type safety and better code quality.
- Preconfigured ESLint and Prettier: Maintain code quality and consistency with minimal effort.
- Yarn Scripts: Easily run, build, lint, and format your project using simple commands.
- Batteries Included: Start coding immediately without the hassle of setup.
To get started with this template, clone the repository and install the dependencies.
Make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/topanaprilaint2202/node-ts-scripts-TEMPLATE.git
-
Navigate to the project directory:
cd node-ts-scripts-TEMPLATE -
Install dependencies:
yarn install
You can start using this template right away. Hereβs how to run your first script:
-
Create a new TypeScript file in the
srcdirectory. For example, createhello.ts:console.log("Hello, World!");
-
Run your script using ts-node:
yarn run start hello.ts
The template comes with several useful scripts. Here are the most important ones:
-
Run: Executes your TypeScript scripts.
yarn run start <script>
-
Build: Compiles TypeScript files to JavaScript.
yarn run build
-
Lint: Checks your code for issues using ESLint.
yarn run lint
-
Format: Formats your code using Prettier.
yarn run format
This template uses ESLint and Prettier for linting and formatting your code. To ensure your code meets the standards, run the lint and format scripts regularly.
ESLint helps identify and fix problems in your JavaScript code. You can customize the rules in the .eslintrc.js file.
Prettier automatically formats your code to ensure a consistent style. You can configure it in the .prettierrc file.
Hereβs a brief overview of the project structure:
node-ts-scripts-TEMPLATE/
βββ src/ # Source files
β βββ index.ts # Entry point
βββ .eslintrc.js # ESLint configuration
βββ .prettierrc # Prettier configuration
βββ package.json # Project metadata and scripts
βββ tsconfig.json # TypeScript configuration
We welcome contributions! If you have suggestions for improvements or want to add features, please open an issue or submit a pull request. Make sure to follow the coding standards and guidelines in this repository.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest releases, check the Releases section. You can download and execute the files as needed.
Thank you for checking out the Node TS Scripts Template! We hope this boilerplate helps you kickstart your Node.js CLI projects with TypeScript. If you have any questions or need support, feel free to reach out or check the Releases section for updates. Happy coding!