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

@breezr/core

v1.0.0-alpha.1

Published

aliyun build system

Downloads

7

Readme

Breezr core service

插件开发

插件本质上是一个 JS 的模块, 你需要在这个 JS 模块中导出一个方法


export default (api: PluginAPI, opts) => {

};

插件 API

API 是个 PluginAPI 实例, 具体代码参见 src/PluginAPI.ts

系统 API

api.getCwd()

获取当前的工作路径,也就是项目所在的根目录

api.hasPlugin(id: string): boolean

判断当前是不是存在了某个plugin, 主要业务插件用来判断判断他依赖的插件是否存在

id - 插件的名字, 可以忽略 (@breezr/|breezr-|@scope/breezr)-plugin-这些前缀

api.registerCommand(name: string, opts: CommandOption, fn: CommandCallback)

注册一个命令, 这个命令最终会变成 CLI 的命令作为透出

name: 注册 cli 的名字

opts: command 选项

  • description: 命令的描述
  • usage: 命令用法介绍
  • details? : 更详细的信息(可选)
  • options: 配置参数 如 { '--xxx': '描述', '-x': '描述'}

fn: 命令被调用之后的回调方法

api.registerAPI(name: string, fn: PluginAPIMethod)

注册一个插件 API, 注册之后可以被其他的插件调用如:

api.registerAPI('log', (msg) => {
  console.log(msg)
})


api.log('show log');

name: string - 注册方法名字

fn: (...args: any) => void; - 方法被调用时候的回调方法.

api.on(lifecycleName: string, fn: PluginLifeCycelMethod)

注册一个生命周期

name: string - 注册生命周期的名字

fn: (...args: any) => void; - 生命周期被触发后的回调.

emit(lifecycleName: string, ...args: Array)

api.registerPlugin

在插件内部注册其他的 API

插件 API

TODO