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

y-workflow

v0.0.10

Published

> 让前端工程更简单

Downloads

6

Readme

y-workflow

让前端工程更简单

安装

全局安装

npm install -g y-workflow

局部安装

npm install --save-dev y-workflow

使用

命令行用法

y-workflow run [task] [--config other-dir/y-workflow.config.js]

JS用法

const yWorkflow = require('y-workflow');

// 注册 tasks
yWorkflow({
  tasks: [],
});

// 注册 tasks 并运行 task
yWorkflow.run('dev', {
  config: 'y-workflow.config.js',
});

配置

命令行参数 / run方法第二个参数

  • config 配置文件路径,默认当前目录下的 y-workflow.config.js 文件

y-workflow.config.js 配置

  • tasks 任务集合,每一个任务必须有 $lib 对应到 lib 目录下的一个文件,其它部分就是传给对用 lib 的配置

lib 通用配置

  • taskName 任务名称,默认为 lib 名字
  • src 待处理文件
  • dest 处理后存放目录
  • watch 是否监听,启用监听之后会额外增加 {taskName}:watch 任务,会先执行一次 {taskName} 任务,然后监听 {src} 再执行 {taskName} 任务
  • taskHandler 任务执行方法,原有的逻辑不满足要求的时候覆盖用的

clean lib 配置

  • delOptions 传给 del 的配置

cmdify lib 配置

  • urify 传给 gulp-urify 的配置
  • cmdify 传给 gulp-cmdify 的配置
  • manifest gulp-cmdifymanifest 文件路径,默认值为 dest 加上 cmdify-manifest.json

cmdifyReplace lib 配置

combo lib 配置

copy lib 配置

cssUrlAbsify lib 配置

ejs lib 配置

  • changedDeps 传给 gulp-changed-deps 的配置,默认值为 { syntax: 'ejs' }
  • ejs 传给 gulp-ejs 的配置
  • urify 传给 gulp-urify 的配置,可以通过数组形式传多个

eslint lib 配置

  • eslint 传给 gulp-eslint 的配置
  • eslintFormatter 传给 eslint.format 的配置,默认值为 require.resolve('eslint-friendly-formatter')

fontMin lib 配置

imgMin lib 配置

  • imagemin 传给 gulp-imagemin 的配置,默认值为 [imagemin.gifsicle({ interlaced: true }), imagemin.jpegtran({ progressive: true }), imagemin.optipng({ optimizationLevel: 2 }), imagemin.svgo()]

imgSprite lib 配置

  • responsive 传给 gulp-responsive 的配置,默认值为 {'**/*': [{min: true, width: '50%'}, {min: true, rename: { suffix: '@2x' }}]}
  • spritesmith 传给 gulp.spritesmith 的配置,默认值为 { imgName: 'img-sprite.png', cssName: 'img-sprite.css', padding: 4, retinaSrcFilter: '**/*@2x.png', retinaImgName: '[email protected]' }
  • cssUrlAbsify gulp-css-url-absify 的配置

multiple lib 配置

  • srcDirs 多个任务的 src 的目录,每一个 srcDir 生成一个任务,srcDir 相对 glob base 得到每一个 task 的 name
  • srcFiles src 目录下需要处理的文件
  • destDir 处理后存放目录,每一个子任务补上 name 得到最终的 处理后存放目录
  • lib 实际任务 lib
  • libOptions lib 的配置,如果为方法,则会传入 name

nunjucks lib 配置

  • changedDeps 传给 gulp-changed-deps 的配置,默认值为 { syntax: 'nunjucks', base: true }
  • nunjucks 传给 gulp-nunjucks 的配置
  • urify 传给 gulp-urify 的配置,可以通过数组形式传多个

rev lib 配置

  • manifest gulp-revmanifest 文件路径,默认值为 dest 加上 rev-manifest.json
  • revReplace gulp-rev-replace 配置,如果传则表示 rev 之前会先进行一次 revReplace
  • revAll gulp-rev-all 配置,如果传值就表示要分析依赖

revReplace lib 配置

sass lib 配置

sequence lib 配置

svgSprite lib 配置

  • svgmin 传给 gulp-svgmin 配置,默认值为 { plugins: [{ removeAttrs: { attrs: '(fill|fill-rule)' } }, { removeTitle: true }] }
  • svgstore 传给 gulp-svgstore 配置,默认值为 { inlineSvg: true }
  • spritedFilename 合并之后的文件名,如果后缀名为.js则需要调用 gulp-svg-jsify 进行转换,默认值为 svg-sprite.js

urify lib 配置

测试

测试 lib
# urify 可以换成其它任何 lib
npm test lib urify
测试 example
# basic 可以换成其它 example, dev 可以换成其它 task
npm test example basic:dev