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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pkb/cli

v1.5.4

Published

全局脚手架,用于全局操作项目,项目配置检查、生成项目、添加插件等等

Downloads

71

Readme

@pkb/cli

@pkb/cli 可用来生成项目、添加插件、检查项目配置、升级更新等等,主要的功能就是对整体项目的管理。

# 全局安装
npm i -g @pkb/cli # 全局安装使用

pk create <project-name> # 创建项目 webpack|rollup|vite|lerna|node
pk add <plugin> # 安装插件
pk info # 查看项目及系统配置
pk upgrade [filter] # 检查升级 npm 版本 并安装
pk cm # commit 提交
pk eslint # eslint 检查,需要安装 @pkb/plugin-eslint
pk stylelint # stylelint 检查,需要安装 @pkb/plugin-stylelint
pk gotty # 在 web 中使用终端
pk jsdoc2md # 把 js 注释生成 md
pk lerna # 多包管理 发布
pk changelog # 生成 changelog
pk mock # 开启 mock,支持 mockjs

mock

模拟接口,支持 mockjs

module.exports = {
  // 支持值为 Object 和 Array
  'GET /api/users': { users: [1, 2] },
  // GET 可省略
  '/api/users/1': { id: 2 },
  '/api/users/2': (req, res) => {
    res.json({
      success: true
    })
  },
  '/api/users/3' (req, res) {
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.end('ok');
  },
  '/api/users/4': {
    // 属性 list 的值是一个数组,其中含有 1 到 10 个元素
    'list|1-30': [{
      // 属性 id 是一个自增数,起始值为 1,每次增 1
      'id|+1': 1
    }]
  }
}

// GET http://localhost:3000/api/users
// GET http://localhost:3000/api/users/1
// GET http://localhost:3000/api/users/2
// GET http://localhost:3000/api/users/3
// GET http://localhost:3000/api/users/4