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

unitool

v1.1.3

Published

The Extension library build package based on Rollup's uniLib can also be used to build other libraries

Readme

unitool

简介

基于rollup的uniLib的扩展库构建打包工具,也可以用于构建其他库

The Extension library build package based on Rollup's uniLib can also be used to build other libraries

特性

  1. 支持typescript开发
  2. 可以导出iife,commonjs,systemjs等格式
  3. 将声明打包成单个dts声明文件

安装

npm install -D unitool

使用

  1. 对于不需要全局变量名的
    unitool build -f cjs 
  2. 需要全局变量名的,冒号: 后跟变量名(如果不写,自动从package.json中解析)
    unitool build -f iife:xxx 

更多使用可以参考 模板项目 package-template

构建配置项

在tsconfig.json中可以增加配置

  1. dtsGenExclude 生成.d.ts文件时所要忽略的

    比如 core包中的

     "dtsGenExclude": [
         "__tests__/**/*"
     ]

    忽略测试目录下的文件,不生成声明文件

  2. externalTag 用来判断引用的模块是否做为外部引用(不编译进来) 因为packages内的A包,引用了B包,会把A和B的代码编译成一个js 参考:

    "externalTag":"@helojo"
    或
    "externalTag":["@helojo"]

构建命令行参数

  1. '-w, --watch [watch]', '是否监视 默认false'
  2. '-e, --entry [entry]', '入口文件 默认src/index.ts'
  3. '-o, --output [output]', '输出文件 默认dist/index.js'
  4. '-f, --format [format]', '输出格式 默认cjs,可选iife,umd,es 如果是iife和umd 需要加: 冒号+全局变量名'
  5. '-d, --types-dir [typesDir]', '声明文件输出目录 默认 dist/types'
  6. '-s, --source-dirs [sourceDirs]', '源码目录数组,默认[src],写 src,src2'
  7. '-u, --unRemoveComments [unRemoveComments]', '是否移除注释'
  8. '-t, --target [target]', '编译目标es标准,默认es5'
  9. '-m, --minify [minify]', '是否压缩,如果是将会输出.min.js'

CHANGELOG