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

packlet

v0.3.3

Published

A KazVizian toolkit to build packages and prepare deterministic release artifacts.

Readme

📦️ packlet

TypeScript Bun NodeJS license

What is Packlet?

packlet is the primary command-line interface of the Packlet toolkit, designed to provide a unified, predictable, and developer-friendly workflow for building modern JavaScript/TypeScript packages. It bundles your project, emits type declarations, validates your output, and generates deterministic artifacts that are ready for distribution.

At its core, Packlet is built to be simple: one CLI, one configuration model, and one consistent experience. Whether you are publishing libraries, internal modules, CLI tools, or SDKs, packlet offers a streamlined build-and-prepare pipeline you can rely on.

Why Packlet?

The JavaScript ecosystem offers many build tools, but very few aim to simplify the entire lifecycle of producing a clean, distribution-ready package. Packlet fills this gap by delivering a focused set of features designed for reliability, repeatability, and minimal configuration:

  • One command to build, validate, and prepare artifacts—without juggling multiple tools.
  • Modern output by default: ESM-first with optional CJS, fully typed, and ready for node and bundlers.
  • Deterministic release artifacts (via npm pack) tailored for GitHub Packages (GPR) or any npm registry.
  • Clear validation to ensure your dist/ directory contains everything your consumers expect.
  • Universal: works with Bun, Node.js, or any toolchain that interoperates with npm packages.
  • Zero lock-in: Packlet does not manage your release pipeline; it integrates with your workflow.

If you want a minimal, predictable, and automation-friendly path from src/ to publish-ready artifacts, Packlet is designed for you.

Installation

Install Packlet as a development dependency:

# with bun
bun add -D packlet

# with npm
npm install -D packlet

You may also install it globally:

bun add -g packlet
# or
npm install -g packlet

Quick start

Once installed, the packlet command becomes available:

# build your package (ESM by default; add CJS via --cjs)
packlet build

# create a GPR-ready variant and write a JSON manifest
packlet gpr --root . --json

# list generated tarball artifacts
packlet list-artifacts --artifacts .artifacts

# validate dist contents
packlet validate --root . --json

Or through package.json scripts:

{
  "scripts": {
    "build": "packlet build",
    "build:cjs": "packlet build --cjs",
    "gpr": "packlet gpr --root . --json",
    "validate": "packlet validate --root . --json"
  }
}

CLI commands

packlet build

Builds your package using sensible defaults:

  • ESM output (dist/index.mjs)
  • Optional CJS output via --cjs
  • Type declarations emitted to dist/

Common options:

  • --entry <file>: entry point (default: src/index.ts)
  • --outdir <dir>: output directory (default: dist)
  • --formats <list>: esm,cjs, etc.
  • --cjs: shorthand to enable CJS output
  • --sourcemap <mode>: external or none
  • --types / --no-types: enable or disable .d.ts
  • --target <target>: build target (default: node)
  • --exec-js: mark output as an executable script
  • --minify / --no-minify: minification control
  • --external <packages>: treat specific packages as external
  • --external-auto: externalize deps and peerDeps automatically

packlet gpr

Stages a GitHub Packages–compatible variant of your package and generates .tgz artifacts.

Key options:

  • --root <path>: project root
  • --dist <path>: dist directory (default: dist)
  • --gpr-dir <path>: staging directory (default: .gpr)
  • --artifacts <path>: output directory (default: .artifacts)
  • --scope <scope>: npm scope
  • --registry <url>: registry URL
  • --name <name>: override package name
  • --include-readme / --no-include-readme
  • --include-license / --no-include-license
  • --json: print manifest to stdout
  • --manifest <file>: write manifest to file

Packlet copies your build output, adjusts metadata, and uses npm pack to produce deterministic release tarballs.

packlet validate

Ensures your dist/ output contains the expected entry files:

  • index.mjs (ESM)
  • index.d.ts
  • index.js (optional, when CJS is enabled)

Options:

  • --root <path>
  • --dist <path>
  • --json: output as JSON

packlet list-artifacts

Lists .tgz artifacts generated by npm pack.

Options:

  • --artifacts <path>
  • --json

Configuration

Packlet supports a unified configuration model via package.json.packlet. This allows you to define defaults for all commands in one place.

Example:

{
  "packlet": {
    "distDir": "dist",
    "artifactsDir": ".artifacts",
    "gprDir": ".gpr",

    "build": {
      "entry": "src/index.ts",
      "outdir": "dist",
      "formats": ["esm"],
      "sourcemap": "none",
      "types": true,
      "target": "node",
      "execJs": false,
      "minify": true,
      "external": [],
      "externalAuto": true
    },

    "gpr": true,
    "gprName": "your-package-name",
    "scope": "your-scope",
    "registry": "https://npm.pkg.github.com/",
    "includeReadme": true,
    "includeLicense": true,

    "validate": { "dist": "dist" },
    "listArtifacts": { "artifactsDir": ".artifacts" }
  }
}

Configuration precedence:

  1. CLI flags
  2. Environment variables (PACKLET_*, GPR_*)
  3. package.json.packlet
  4. Built-in defaults

For advanced configuration and environment variable behavior, see the @packlet/core.

Programmatic API

Packlet exposes a focused API surface suitable for embedding in your own tools, build scripts, or CI pipelines:

import {
  listArtifacts,
  writeArtifactsManifest,
  validateDist,
  deriveScopedName,
  awakenGpr
} from "packlet"

const result = validateDist({ distDir: "dist" })
const artifacts = listArtifacts(".artifacts")

const manifest = writeArtifactsManifest(".artifacts", {
  packageName: "my-lib",
  scopedName: "@acme/my-lib",
  version: "1.2.3"
})

const gpr = awakenGpr({ rootDir: process.cwd() })
console.log(gpr.scopedName, gpr.version)

Types are also exported:

import type {
  ArtifactEntry,
  ArtifactsManifestV1,
  ValidateDistOptions,
  ValidateDistResult,
  DeriveNameInput
} from "packlet"

License

MIT © KazViz