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

@1-/rolldown

v0.1.7

Published

Fast JavaScript bundler with iterative minification

Readme

English | 中文


@1-/rolldown : High-performance JavaScript bundler with iterative DCE optimization

Functionality

This package provides a wrapper around the rolldown bundler that implements automatic iterative Dead Code Elimination (DCE). It repeatedly runs the bundling process until output code size stabilizes, achieving optimal dead code removal without manual configuration. Leveraging rolldown's native dce-only minification mode, it delivers maximum dead code elimination efficiency out of the box while preserving ESM output format.

Usage demonstration

Install the package:

npm install @1-/rolldown

Use in JavaScript:

import rolldown from "@1-/rolldown";

// Basic usage (no DCE optimization)
const [code, map] = await rolldown("./src/index.js");

// With iterative DCE optimization
const [minifiedCode, minifiedMap] = await rolldown("./src/index.js", {}, true);

// Write to file
import { minifyTo } from "@1-/rolldown";
await minifyTo("./src/index.js", "./dist/bundle.js");

// Support for multiple files (array form)
await minifyTo(["./src/a.js", "./src/b.js"], ["./dist/a.js", "./dist/b.js"]);

// Support for multiple files (object mapping form)
await minifyTo({
  "main": "./src/main.js",
  "utils": "./src/utils.js"
}, {
  "main": "./dist/main.js",
  "utils": "./dist/utils.js"
});

Design rationale

The core design implements iterative DCE using a memory plugin that loads previous bundle outputs as virtual modules. The memory plugin supports both direct module ID resolution and relative path imports (.js, ./, ../), ensuring virtual modules resolve correctly in different contexts. The bundler runs repeatedly until code size no longer decreases.

Technology stack

  • rolldown: Fast Rust-based JavaScript/TypeScript bundler
  • @3-/merge: Configuration merging utility
  • @3-/write: File writing utility
  • Node.js: Runtime environment

Code structure

src/
├── _.js          # Main entry point with iterative DCE logic, memory plugin implementation, and bundling coordinator

Historical context

JavaScript bundlers evolved from Browserify's simple concatenation to Webpack and Rollup's modular systems. Rolldown represents the next generation, leveraging Rust's performance for sub-second builds while maintaining Rollup's API compatibility. This wrapper enhances rolldown with compiler-inspired iterative DCE optimization techniques.

About

This library is developed by WebC.site.

WebC.site: A new paradigm of web development for AI


@1-/rolldown : 高性能 JavaScript 打包器与迭代 DCE 优化工具

功能介绍

此包提供 rolldown 打包器的封装,实现自动迭代 Dead Code Elimination(DCE)优化。通过重复运行打包过程直至输出代码体积稳定,达到最优未使用代码消除效果。基于 rolldown 的原生 dce-only minification 模式,无需手动配置即可移除未使用代码,同时保持 ESM 输出格式。

使用演示

安装包:

npm install @1-/rolldown

在 JavaScript 中使用:

import rolldown from "@1-/rolldown";

// 基础用法(无 DCE 优化)
const [code, map] = await rolldown("./src/index.js");

// 启用迭代 DCE 优化
const [minifiedCode, minifiedMap] = await rolldown("./src/index.js", {}, true);

// 写入文件
import { minifyTo } from "@1-/rolldown";
await minifyTo("./src/index.js", "./dist/bundle.js");

// 支持多文件打包(数组形式)
await minifyTo(["./src/a.js", "./src/b.js"], ["./dist/a.js", "./dist/b.js"]);

// 支持多文件打包(对象映射形式)
await minifyTo({
  "main": "./src/main.js",
  "utils": "./src/utils.js"
}, {
  "main": "./dist/main.js",
  "utils": "./dist/utils.js"
});

设计思路

核心设计采用迭代 DCE 机制,通过内存插件将前一次打包输出作为虚拟模块,重复运行打包过程直至代码体积不再减小。内存插件支持直接模块 ID 解析和相对路径导入(.js, ./, ../),确保虚拟模块在不同上下文中正确解析。

技术栈

  • rolldown:基于 Rust 的高性能 JavaScript/TypeScript 打包器
  • @3-/merge:配置合并工具
  • @3-/write:文件写入工具
  • Node.js:运行时环境

代码结构

src/
├── _.js          # 主入口文件,包含迭代 DCE 逻辑、内存插件实现和打包协调器

历史故事

JavaScript 打包工具从 Browserify 的简单连接演变为 Webpack 和 Rollup 的模块化系统。Rolldown 代表新一代打包器,利用 Rust 性能实现亚秒级构建,同时保持 Rollup 的 API 兼容性。此封装通过受编译器优化启发的迭代 DCE 技术,将 Dead Code Elimination 效果提升到新水平。

关于

本库由 WebC.site 开发。

WebC.site : 面向人工智能的网站开发新范式