Template to kickstart creating a Node.js module using TypeScript and VSCode
Fork from typescript-npm-package-template and make some changes to make to easy use for me.
keep most features in source repo.
- Newer dependencies version
- ESLint version and rules
- remove prepare-commit-msg hooks, use commitlint instead
- Configuration File Location
- Windows and mac compatible
- Private customization
Click the "Use this template" button.
Alternatively, use giget downloading repo to your local computer.
npx giget@latest gh:kainstar/typescript-npm-package-template my-new-project --install
Replace REPO_NAME
in the script below with your own details to personalize your new package:
Linux or MacOS:
Since incompatible sed
command in BSD and GNU, I use sd
to replace string in files, install it with brew install sd
or cargo install sd
.
NPM_PKG_NAME="pkg-name"
sd "(@kainstar/typescript-npm-package-template|my-package-name)" "$NPM_PKG_NAME" package.json README.md
REPO_NAME="repo-name"
sd "(typescript-npm-package-template)" "$REPO_NAME" package.json README.md
Windows:
$NPM_PKG_NAME="pkg-name"
$REPO_NAME="repo-name"
foreach ($File in @("package.json", "README.md")) {
(Get-Content $File) | %{$_ -replace "@kainstar/typescript-npm-package-template|my-package-name", $NPM_PKG_NAME} | %{$_ -replace "typescript-npm-package-template", $REPO_NAME} | Set-Content $File
}
-
Add your npm token to your GitHub repository secrets as
NPM_TOKEN
. -
Add your github token to your GitHub repository secrets as
GH_TOKEN
.
Enable the Codecov GitHub App here.