npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@robertbagge/template-typescript-library

v0.1.17

Published

Template typescript library

Readme

Template Typescript Repository

NPM Package

Description

This is a repository I use as a base for my typescript libraries. It includes a basic setup for typescript, eslint, prettier, jest and GitHub Actions.

Feel free to use this template, clone it and use it as a base for your own projects.

Always open for feedback if you think this repo can be improved further.

Features:

  • Typescript
  • GitHub Actions worklows for code linting, formatting, testing and publishing to NPM

Table of Contents

Pre-requisites

  • Node 16.5.0 or newer

Setup

  • No setup required

Development

  • npm run lint - Lint the code and checks types
  • npm run format - Formats the code using prettier
  • npm test - Compiles code and runs tests

CI/CD

This repo is setup with GitHub Actions to automatically run tests and publish the package to NPM when a new tag is pushed to the repo.

The two configured workflows are:

  • CI/CD main - Runs on every commit to main
  • CI/CD PR - Runs on every commit to PR

CI/CD main

Actions run:

  • Code actions
    • Format Code
    • Test Code
  • Bump Minor version
  • Publish to NPM

Publishing to NPM

This happens automatically on every commit, which might not be ideal. Will probably change to publish when new tags are pushed to the repo in the future.

If you fork this repo you will need to create a NPM account and generate a NPM token to use for publishing. You can then add the token as a secret to your repo and update the workflow to use the secret.

CI/CD PR

Actions run:

  • Code actions
    • Format Code
    • Test Code

Appendices

Appendix A: Publishing to private NPM Registry

Once you have setup your private NPM registry, you can publish your package to it by running the following command:

npm publish --registry <Your registry URL here>

To safeguard for accidentally publishing to the public NPM registry, you can add the following to your package.json, I usually do the following. Add a file pre-publish.js to the root of the project with the following content:

const RELEASE_MODE = !!process.env.RELEASE_MODE;

if (!RELEASE_MODE) {
  console.log('Run `npm run release` to publish the package');
  process.exit(1); //which terminates the publish process
}

This will enforce the RELEASE_MODE environment variable to be set to true before publishing the package.

Then add a new release to the scripts section of your package.json:

scripts: {
...,
'release': 'RELEASE_MODE=True npm run build && npm publish --registry <Your registry URL here> && git push --follow-tags',
...,
}

Then change any Github actions etc. to use npm run release instead of npm publish.