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

steamer-plugin

v1.0.4

Published

steamer plugin base class

Downloads

1,348

Readme

steamer-plugin

NPM Version Travis Deps Coverage

快速开发 steamerjs 插件的类,继承即可。 如何开发 steamerjs 插件,请参考 steamer-plugin-example

接口

属性

  • pluginName
    • String
    • required
    • 默认值: ""
    • 注册 plugin

基础方法

获取路径

  • getGlobalModules

    • Function
    • 获取全局 node_modules 路径
  • getGlobalHome

    • Function
    • 获取全局 home 目录

配置方法

  • createConfig

    • Function
    • 创建 steamer 插件配置
    • 参数
      • config, 配置 object, 默认值为: {}
      • options, 参数对象
        • option.folder, String, .steamer 的父目录,
        • option.filename, String 具体的文件名
        • option.extension, String 默认值:js
        • option.overwrite, Boolean 是否覆盖已经存在的配置文件
        • option.isGlobal, Boolean 是否全局
  • readConfig

    • Function
    • 读取 steamer 插件配置
    • 参数
      • options, 参数对象
        • option.folder, String, .steamer 的父目录,
        • option.filename, String 具体的文件名
        • option.extension, String 默认值:js
        • option.isGlobal, Boolean 是否全局
  • createSteamerConfig

    • Function
    • 创建 steamerjs 配置
    • 参数
      • config, 配置 object, 默认值为: {}
      • options, 参数对象
        • option.folder, String, .steamer 的父目录,
        • option.overwrite, Boolean 是否覆盖已经存在的配置文件
        • option.isGlobal, Boolean 是否全局
  • readSteamerDefaultConfig

    • Function
    • 读取 steamerjs 配置与默认配置的并集
    • 默认值
    NPM: 'npm',
    PLUGIN_PREFIX: 'steamer-plugin-',
    KIT_PREFIX: 'steamer-kit-',
    TEAM_PREFIX: 'steamer-team-'
  • readSteamerConfig

    • Function
    • 读取 steamerjs 配置
    • 参数
      • options, 参数对象
        • option.isGlobal, Boolean 是否全局

命令输出

  • log

    • Function
    • 输出文本
    • 参数
      • str, 文本
      • color, 颜色, 默认 white
  • error

    • Function
    • 输出报错
    • 参数
      • str, 文本
  • info

    • Function
    • 输出信息
    • 参数
      • str, 文本
  • warn

    • Function
    • 输出警告
    • 参数
      • str, 文本
  • success

    • Function
    • 输出成本信息
    • 参数
      • str, 文本
  • printTitle

    • Function
    • 输出标题
    • 参数
      • str, 文本
      • color, 颜色, 默认 white
// 例子
================================ Command Usage ================================
  • printEnd
    • Function
    • 输出末尾
    • 参数
      • str, 文本
      • color, 颜色, 默认 white
// 例子
================================================================================
  • printUsage
    • Function
    • 输出命令使用方法
    • 参数
      • description, 命令描述
      • cmd, 命令名称
// 例子
usage:
steamer doctor    help you check steamer running environment!!!
  • printOption
    • Function
    • 输出命令参数
    • 参数
      • options, 参数数组
        • option.option, 参数名
        • option.alias, 参数别名
        • option.value, 参数值
// 例子
options:
    --help, -h                    123
    --ak, -a                      456
    --plugin, -p <plugin name>    789
    --help                        123

开发及测试

// 用于全局进行代码清理
npm i -g eslint
npm run lint

// 用于测试
npm test