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

@xiui/lib-cli

v0.2.2

Published

一个基于webpack5 快速搭建js库的cli

Readme

一个基于webpack5 快速搭建js库的cli

在做一个js库 使用webpack开发 需要做很多繁琐配置,比如Babel、TypeScript、Css 预编译等等,或对于新人来讲上手吃力,不好配置,本CLI 解决这些问题,通过简单配置就可以快速开发。

功能

  • 基于最新的webpack5,更快的速度优化
  • 支持Babel 可配置 polyfill
  • 集成TypeScript配置
  • 可选 Less、Sass、Stylus 预编译语言
  • 支持 Service Workers
  • 支持 ESlint,TypeScript也集成
  • 支持 i8n,可生成其他语言包
  • 支持模板变量,可在项目内使用

兼容性

ie9+    nodejs 12.5+

快速使用

安装  npm i @xiui/lib-cli -g

使用  lib init app

经过一系列配置 cd app npm run dev 就可以开发了

进阶

创建项目

lib init <project> [--current]

init 可简写 i ,project 为创建的目录名称,--current或-c 代表本目录下创建项目

运行&打包

lib run <sheet> [--development] [--production]

--development --production 代表webpack环境,简写 -d -p 设置命令的环境

转换语言包

通过一个写好的语言作为模板生成不同语言json lib lang <template> <type...> [--output] [--entry]

在项目根目录下创建 template.json 文件,配置中文,或英文 模板 执行命令

这时 src 目录下多出lang文件夹,下面有中文,英文,日文语言包

template 语言模板包名称 type 转换的语言 可配多个
--output或-o 可配置输出地址默认lang lib lang template zh-CN en -o langs
--entry或-e 可配置入口地址默认根目录 lib lang template zh-CN en -e src/template

环境变量

在项目 webpack 目录下有两个 dev json文件,在运行不同环境下,会将当前的变量注入到全局中,可在项目中使用
默认有两个 “process.env.NODE_ENV” -- 当前环境 “process.env.BASEURL” -- webpack配置的publicPath

webpack配置

webpack下还有个lib.config.js 用来快捷配置一些功能,例如代码压缩,打包地址目录等等,如果不满足修改同级的webpack.config.js文件