Skip to content
/ node Public template

repository template for TypeScript/Node.js projects

License

Notifications You must be signed in to change notification settings

neoncitylights/node

Repository files navigation

TypeScript Template

This repository template makes it easier to create a new NPM library, package or application using Node.js and TypeScript. It comes with several developer tools pre-configured and ready to use, so it's easier to get started.

Features

Getting started

Create a new repository

Choose a method:

  • GitHub UI: Press the "Use this template" button in the top-right corner of this page.
  • GitHub CLI: Install GitHub CLI. Then run one of the following:
    gh repo create --template neoncitylights/typescript --public --clone {{repository}} # clone as public
    gh repo create --template neoncitylights/typescript --private --clone {repository}} # clone as private

Replace placeholders

Using your text editor or IDE, find-and-replace the following placeholders:

  • @author/package: Replace this with the author's name (e.g a user or organization) and package's name.
  • {{author}}: Replace this with the author's name (e.g real name, GitHub username, etc).
  • {{username}}: Replace this with your GitHub username.
  • {{repository}}: Replace this with the name of your repository.
  • {{desc}}: Replace this with a short description of the package.

Publishing a package

# Enter the root directory of the package you want to publish
cd packages/pkg1

# if package is scoped, e.g "hello-world"
npm publish

# if package is non-scoped, e.g "@user123/hello-world",
# can also be published privately via `--access private` (requires npm pro plan)
npm publish --access public

Configure

NPM scripts

Command Description
npm run build Build all packages
npm run docs Generate documentation
npm run docs-watch Generate documentation in watch mode
npm run clean Remove all generated files
npm run test Run unit tests
npm run test-ci Run unit tests in CI mode
npm run test-ui Run unit tests in UI/browser mode
npm run test-watch Run unit tests in watch mode
npm run lint Check for ESLint/publint errors
npm run lint-fix Fix ESLint errors (publint errors must be fixed manually)
npm run eslint Check for ESLint errors
npm run eslint-fix Fix ESLint errors
npm run publint Check for NPM packaging errors

Developer tools

Tool File Documentation
NPM package.json, packages/*/package.json docs, website
TypeScript tsconfig.json, packages/*/tsconfig.json docs, website
TypeDoc tsconfig.json (typedocOptions) docs, website
ESLint eslint.config.js docs, website
Vite packages/*/vite.config.ts docs, website
Vitest vitest.config.ts, packages/*/vite.config.ts (test) docs, website
Vitest (workspace) vitest.workspace.ts docs
Dependabot .github/dependabot.yml docs, website

License

This software is licensed under the MIT license (LICENSE-MIT or https://opensource.org/license/mit/).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

About

repository template for TypeScript/Node.js projects

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •