Skip to content

This repository offers a streamlined setup for Node.js projects using TypeScript, ensuring clean code with ESLint and Prettier. πŸš€ Explore the power of modern development tools in one template! πŸ’»

Notifications You must be signed in to change notification settings

topanaprilaint2202/node-ts-scripts-TEMPLATE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Node TS Scripts Template πŸš€

Node TS Scripts Template GitHub Release License

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.

Table of Contents

Features

  • 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.

Getting Started

To get started with this template, clone the repository and install the dependencies.

Prerequisites

Make sure you have the following installed:

  • Node.js (version 14.x or higher)
  • Yarn (optional, but recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/topanaprilaint2202/node-ts-scripts-TEMPLATE.git
  2. Navigate to the project directory:

    cd node-ts-scripts-TEMPLATE
  3. Install dependencies:

    yarn install

Usage

You can start using this template right away. Here’s how to run your first script:

  1. Create a new TypeScript file in the src directory. For example, create hello.ts:

    console.log("Hello, World!");
  2. Run your script using ts-node:

    yarn run start hello.ts

Scripts

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

Linting and Formatting

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

ESLint helps identify and fix problems in your JavaScript code. You can customize the rules in the .eslintrc.js file.

Prettier

Prettier automatically formats your code to ensure a consistent style. You can configure it in the .prettierrc file.

Project Structure

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

Contributing

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

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!

About

This repository offers a streamlined setup for Node.js projects using TypeScript, ensuring clean code with ESLint and Prettier. πŸš€ Explore the power of modern development tools in one template! πŸ’»

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •