Skip to content

Jumace/typescript-skeleton

Repository files navigation

Typescript Skeleton

Content

Introduction

Good day fellow people. This is an opinionated skeleton for Typescript projects. The Typescript code will be compiled into CommonJS to be used in a Node environment.

This skeleton includes building, testing, linting and formatting for Typescript code. Furthermore does it offer a proven structure to document the project over the documentation-skeleton.

Feel free to use it under the MIT license.

Quick Start

  1. install dependencies
    npm i
  2. start development mode
    npm run dev
  3. change the code and have fun with it

Requirements

To run the code the system one uses needs to fulfill the following requirements:

  • Node.js 20.X.X or higher
  • npm 10.X.X or higher

How to start

  1. Install all dependencies
    npm i
  2. Run the build command
    npm run build
  3. Run the compiled script
    npm run start

For the development process one can omit the build and run steps and use the dev command to run the code after every saved change:

npm run dev

How to test

Functionality can be tested with Jest. One sample test is already available in the tests folder.

It is best practice to have one test file for each code file one wants to test. The test file should include the name of the code file, e.g.:

  • code file: ./src/Index.ts
  • test file: ./tests/Index.test.ts

To run the tests a npm script is provided:

npm run test

License

MIT License

How to continue

Once one is familiar with this skeleton feel free to use it as a base to set up a new Typescript project to get head start.

About

Opinionated skeleton for new TypeScript projects

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published