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

@jnanda/a_library

v1.1.0

Published

my sample library

Readme

🚀 Captain.js — Complete npm Publishing Guide

This document contains everything needed to build, structure, and publish captain.js to npm professionally.


1️⃣ Prerequisites

Make sure you have:

  • Node.js installed
  • npm installed
  • Git installed
  • GitHub account
  • npm account

Check versions:

node -v
npm -v
git --version

2️⃣ Create Project Folder

mkdir captain-js
cd captain-js

3️⃣ Create Library File

Create:

captain.js

Add:

(function (global) {

  const Captain = {

    sum: function(a, b) {
      return a + b;
    },

    multiply: function(a, b) {
      return a * b;
    },

    capitalize: function(str) {
      return str.charAt(0).toUpperCase() + str.slice(1);
    }

  };

  global.Captain = Captain;

})(typeof window !== "undefined" ? window : global);

4️⃣ Initialize npm

npm init -y

Edit package.json:

{
  "name": "captain-js",
  "version": "1.0.0",
  "description": "A tiny OG JavaScript utility library",
  "main": "captain.js",
  "keywords": ["javascript", "utility", "library"],
  "author": "Your Name",
  "license": "MIT"
}

⚠️ Note: Package name must be unique on npm.


5️⃣ Create README.md

Create:

README.md

Example content:

# Captain.js

A tiny OG JavaScript utility library.

## Installation

```bash
npm install captain-js

CDN Usage

<script src="https://cdn.jsdelivr.net/npm/[email protected]/captain.js"></script>

Example

Captain.sum(2, 3); // 5

---

# 6️⃣ Create .gitignore

Create:

.gitignore


Add:

Dependencies

node_modules/

Logs

npm-debug.log* yarn-debug.log* yarn-error.log*

Environment files

.env .env.local

OS files

.DS_Store Thumbs.db

Optional future build folders

dist/ build/ coverage/


### Why `.gitignore`?

It prevents unnecessary files (like `node_modules`) from being committed to GitHub.

---

# 7️⃣ Create LICENSE (MIT)

Create:

LICENSE


Add:

MIT License

Copyright (c) 2026 Your Name

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software...


(Use full MIT template from https://opensource.org/licenses/MIT)

### Why License?

Without a license, legally no one can use your code.

MIT allows:
- Commercial use
- Modification
- Distribution
- Private use

Requires:
- Keeping copyright notice

---

# 8️⃣ Initialize Git

```bash
git init
git add .
git commit -m "Initial commit"

9️⃣ Push to GitHub

Create a repository on GitHub named captain-js.

Then:

git remote add origin https://github.com/yourusername/captain-js.git
git branch -M main
git push -u origin main

🔟 Login to npm

npm login

Enter username, password, email, and OTP if required.

Check login:

npm whoami

1️⃣1️⃣ Publish to npm

npm publish

If successful:

+ [email protected]

1️⃣2️⃣ CDN Usage (Automatic)

After publishing, your package is automatically available on CDN:

https://cdn.jsdelivr.net/npm/[email protected]/captain.js

Use in HTML:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/captain.js"></script>

1️⃣3️⃣ Updating Version

You cannot overwrite a published version.

Update version in package.json:

"version": "1.0.1"

Then:

npm publish

1️⃣4️⃣ Semantic Versioning

Format:

MAJOR.MINOR.PATCH

Examples:

  • 1.0.1 → Bug fix
  • 1.1.0 → New feature
  • 2.0.0 → Breaking change

📁 Final Folder Structure

captain-js/
│
├── captain.js
├── package.json
├── README.md
├── LICENSE
└── .gitignore

🏁 You Are Now

✔ A published npm package author
✔ CDN-distributed globally
✔ Properly licensed
✔ Professionally structured


🚀 Optional Next Steps

  • Add minified build
  • Add TypeScript definitions
  • Add CI/CD auto publish
  • Add automated version bumping
  • Convert to ES Module + UMD

Captain.js is now officially live-ready.