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

@d3p1/lib-ts-react-template

v1.1.2

Published

A template to build a library using TypeScript with a Vanilla and React entry points

Downloads

774

Readme

[LIBRARY TYPESCRIPT-REACT TEMPLATE]

code style: prettier Release semantic-release: angular

Introduction

A template to build TypeScript libraries with both Vanilla JavaScript and React entry points.

The goal of this template is to simplify the process of creating, maintaining, and publishing libraries. It provides a ready-to-use setup with sensible defaults, including an automated release workflow triggered on every push to the repository.

Usage

Using this library is straightforward:


1. Create a repository

Click the Use this template button to create a new repository based on this template.


2. Configure npm authentication

Create an NPM_TOKEN repository secret in your new repository. The token must be a valid npm access token with read and write permissions. On top of that, it must bypass 2FA, as it is used in a CD workflow.

[!NOTE] Follow GitHub’s guide to create repository secrets.

[!NOTE] This token is required by the automated release workflow.


3. Update package.json

Edit the package.json file to reflect your library’s metadata:

  • name – Your library name
  • version – Start at 0.0.0
  • description – Short and meaningful description
  • repository – Repository URL
  • author – Author information
  • bugs – Issue tracker URL
  • homepage – Project homepage (e.g. the README.md link)
  • keywords – Relevant keywords for discoverability

4. Install dependencies and start development

Execute the following commands:

npm install
npm run dev

5. Develop your library

This template comes with sample code inside the src folder.

The only important thing to notice is that every feature your library wants to export should be defined inside src/core/index.ts and src/react/index.ts.

[!NOTE] src/core/index.ts and src/react/index.ts are defined as the entry points of your library.

On top of that, every commit must follow this Conventional Commits format:

<type>(<scope>): <description> [<issue-number>]

[!NOTE] This is required by the release workflow, which analyzes every commit to automatically generate the releases.


6. Validate locally using the dev site

This template includes a local development site under the dev folder.

Remove the dependencies from the package.json, and execute npm install ../. This will install the local library.

Update the sample code and visit http://localhost:5173/dev/ to check the implementation.


7. Build a demo site

A sample Next.js demo site is included in the www folder.

[!NOTE] There is a GitHub Action that deploys it on every push.

To begin with, update the basePath setting inside the next.config.ts. It should match your repository slug (e.g. /my-repo-name/).

Then, you can update the sample code and visit http://localhost:3000/my-repo-name to check the implementation.

Finally, remember to enable GitHub Pages with GitHub Actions for your repository.


8. Finalize documentation

Update the README.md to describe your library’s purpose and usage.

[!IMPORTANT] Don’t forget to update the release badge URL at the top of this file if you keep it — it currently points to this repository.


[!NOTE] To gain a deeper understanding of how to use this library and how it works under the hood, visit the wiki page.

[!NOTE] At the time of writing, it seems npm does not support fine-grained tokens for CD workflows. A recommended workaround is to publish the package once. For instance, using the CLI: npm login and npm publish. Then, create a token restricted to that specific package.

[!NOTE] There is a ticket to add testing tools to improve the library's validation workflow.

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

This work is published under MIT License.

Author

Always happy to receive a greeting on: