1.3.0 • Published 1 year ago
@nvogel/typescript-npm-package-template v1.3.0
typescript-npm-package-template
A npm package template using TypeScript
Features
Getting started
Set up your repository
Click the "Use this template" button.
Alternatively, create a new directory and then run:
curl -fsSL https://github.com/nvogel/typescript-npm-package-template/archive/main.tar.gz | tar -xz --strip-components=1
Replace FULL_NAME
, GITHUB_USER
, and REPO_NAME
in the script below with your own details to personalize your new package:
FULL_NAME="John Smith"
GITHUB_USER="johnsmith"
REPO_NAME="my-cool-package"
sed -i.mybak "s/\([\/\"]\)(nvogel)/$GITHUB_USER/g; s/typescript-npm-package-template\|my-package-name/$REPO_NAME/g; s/Nicolas Vogel/$FULL_NAME/g" package.json package-lock.json README.md
rm *.mybak
Add NPM Token
Add your npm token to your GitHub repository secrets as NPM_TOKEN
.
Remove everything from here and above
my-package-name
My awesome module
Install
npm install my-package-name
Usage
import { myPackage } from 'my-package-name'
myPackage('hello')
//=> 'hello from my package'