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

@lpj.app/npm-package-template

v1.0.0

Published

A npm package template for ESM using TypeScript and TSUP.

Readme

Setup

  1. Clone or fork the repo

  2. Install dependencies

npm i 

Add custom functionality

Add your package functionality in /src/index.ts

Publishing process

1. Customize the package metadata in /package.json

In the package.json file, customize the following fields:

  • name -> this will be the name of your package on npm for scoped packages use @<your-npm-username>/<package-name>
  • version -> Package version, needs to be increases with every release
  • description -> Short package description
  • author -> Your name
  • license -> License type (e.g. MIT) as needed
  • keywords -> Array of keywords that describe your package
  • main -> The main entry point of the package (if changed from templates default) Also when using git it's recommended to update the repository field with the package's git repo url as well as the bugs/url and homepage fields with the package's homepage url..

IMPORTANT: Check files whitelist In package.json, the files field is set to ["dist"]. This means only the contents of the dist folder (plus mandatory files like README, LICENSE, and package.json) will be included in the final npm package. If you add new folders (e.g., an assets folder) that should be part of the package, you must add them to the files array in package.json.

2. Tests

The file is located in /tests/index.test.ts (Write your own tests here, to check if your package works as expected)

To test the package functionality, run:

npm test

3. Local Build

To build the package, run:

npm run build

The build files will be located in /dist

3.1 Local tests

Before publishing the package, do some manual local tests. For this you can add the package to your systems global npm packages with:

npm link

Now you can connect the local package to your test project with:

npm link '@lpj.app/npm-package-template' 

This simulates the behavior of a user installing the package from npm.

Note If you make changes to the source code, you need to run npm run build again in the package directory for the changes to take effect in your test project.

Now you can import it as any other package. Example for this template:

import {helloWorld, goodbyeWorld} from "@lpj.app/npm-package-template";

console.log(helloWorld());
console.log(goodbyeWorld());

and run it with

node .\tests\manual-test.js

If your output is as expected, you can publish the package.

4. Publish

To publish a npm package you need to have an account on npmjs.com and setup the 2FA in your account settings. With this done you can continue in your package directory.

4.1 Verify publish with dry run

It is highly recommended to run a "dry run" first. This simulates the publishing process and shows you exactly which files will be included in your package without actually uploading it:

npm publish --dry-run

Check the output list. If you don't see the dist folder or if important files are missing, check your files array in package.json.

To finally publish the package to the public npm registry login to npm with npm login, follow the login instructions in the terminal then run

npm publish --access public

You will be asked to login to your account in a browser window. After successful login, the package will be published automatically and you can track it in your npm account under Packages.

Usage

After publishing your npm package to the public registry you'll get an install command like npm i @lpj.app/npm-package-template in the npm package site. From here it's the same process as for any other npm package.

IMPORTANT Keep in mind that the package template is optimized for ES Modules structure, so when creating a new project where you want to use your package, make sure to initialize the project with npm init -y && npm pkg set type="module" or change the type field in package.json to "module" later on.

When using the package in your project, you can import it like any other package and use your custom functionality e.g.:

import { helloWorld, goodbyeWorld } from "@lpj.app/npm-package-template";

console.log(helloWorld());
console.log(goodbyeWorld());

Other


License

See LICENSE.


© lpj.app. Licensed under MIT.