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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@packlet/build

v0.2.2

Published

Packlet build wrapper: build ESM, d.ts, and CJS (opt-in) for packages and expose programmatic API.

Readme

📦️ @packlet/build

TypeScript Bun NodeJS license

@packlet/build is a focused, minimal build layer for TypeScript and JavaScript packages. It wraps Bun’s high-performance bundler with a clean, consistent interface tailored for libraries and CLIs—no heavy configuration, no multi-tool orchestration.

If you want a predictable, modern build pipeline with ESM-first output, optional CJS, and automatic type generation, @packlet/build gives you exactly that with a single command or function call.

Use it standalone or as the build engine behind the higher-level packlet CLI.

Features

  • ESM by default (dist/index.mjs), with optional CJS output (dist/index.cjs)
  • TypeScript declarations generated automatically into dist/
  • Fast Bun-based bundling with a single consistent interface
  • Simple control over sourcemaps, minification, externalization, and CLI executables
  • Programmatic API for embedding in your own tooling

Installation

# with bun
bun add -D @packlet/build

# with npm
npm install -D @packlet/build

Note: @packlet/build uses bun build internally. Bun must be installed on the machine running the build (recommended: Bun ≥ 1.2.0). For environments without Bun, you may still use the programmatic API with custom bundlers.

Usage via npm scripts

Add build scripts to your package.json:

{
  "scripts": {
    "build": "packlet-build build --sourcemap none --external-auto",
    "build:cli": "packlet-build build --cjs --exec-js --sourcemap none --external-auto"
  }
}

Run them normally:

npm run build
# or
bun run build

Or run the CLI directly using npx / bunx:

npx @packlet/build build --sourcemap none --external-auto

Programmatic API

You can also invoke the builder directly from JavaScript or TypeScript for full control:

import { build } from "@packlet/build"

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

This API is ideal for custom workflows, monorepos, or script-driven build pipelines.

CLI flags

packlet-build supports the following build flags:

  • --entry <file>: entry file (default: src/index.ts)
  • --outdir <dir>: output directory (default: dist)
  • --formats <list>: comma-separated formats (default: esm)
  • --cjs: shorthand to also emit CommonJS (index.cjs)
  • --sourcemap <kind>: external or none (default: none)
  • --no-types: skip type declaration generation
  • --target <target>: build target (default: node)
  • --exec-js: mark generated output as executable (helpful for CLIs)
  • --no-minify: disable minification (enabled by default)
  • --external <packages>: specify external packages
  • --external-auto: automatically externalize dependencies and peerDependencies

Notes

  • Type declarations come from tsc --emitDeclarationOnly, always using your local tsconfig.json.
  • For debugging, prefer --sourcemap external to keep maps separate from published artifacts.
  • Disable minification (--no-minify) when inspecting bundles locally.

License

MIT © KazViz