Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 1.74 KB

README.md

File metadata and controls

69 lines (50 loc) · 1.74 KB

typescript-template

Supported node versions

typescript logo

A minimal TypeScript project template for both frontend and backend development.

Features

  • Start a TypeScript project with best practices
  • Better developer experience with formatting, linting and fast testing
  • A good starting point for both frontend and backend development

Usage

Use Github template

Use this template to create your own repo on Github.

Create locally

Also, you can create a local project with this template.

npx degit lem0nle/typescript-template my-ts-project
cd my-ts-project
# you need to first install pnpm: npm i -g pnpm
pnpm i

Develop a library

If you want to further publish your project as a npm library, you may need some manual modifications to this template.

Modify your package.json:

{
  // replace `"private": true` line with these:
  "name": "LIBRARY-NAME",
  "version": "1.0.0",
  "author": "YOUR-NAME-AND-EMAIL",
  "type": "module",
  "source": "src/index.ts",
  "main": "dist/index.js",
  "types": "dist/index.d.ts"
  // other fields...
}

Then you can build and publish your library. We recommend using Parcel to build your project for simplicity:

npm install -D parcel
npx parcel build

You can add this to your scripts field in package.json:

{
  "scripts": {
    // ...
    "build": "parcel build",
    "prepublishOnly": "npm run test && npm run build"
  }
}