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

envirs-cli

v1.8.0

Published

51 web toolkit

Downloads

5

Readme

Envirs-cli

u51.inc 内部前端流程辅助工具。功能点:

  • 任务流程 envirs task
  • 项目创建 envirs project
  • 服务启动 envirs server

简化前端开发复杂的流程,让工作更easy!

Installation

$ sudo npm install -g envirs-cli

Functions

功能点介绍:

envirs project [project-type] -c [project-name] [-b [-f]]

创建一个内置项目

$ envirs project -c project-name

  • -c, --create 创建项目
  • -b, --bootstrap 采用bootstrap项目创建
  • -f, --force 强制覆盖

envirs project tool -c [project-name] [-f]

创建一个工具项目

$ envirs project tool -c newproject -f

其他项目创建敬请期待。

envirs task [task-name]

任务流程控制。集合了 browserify uglify cssmin 等等功能。

如何使用

$ cd [your project]

$ envirs task [project-name]

每个项目中都存在一个 Envfile.jspackage.json

  • Envfile.js 用于任务流控制
  • package.json 项目包管理文件

Envfile.js配置

module.exports = function(task){
	// task.js 包含了 browserify uglify 功能
	// 采用 CMD 方式加载模块
	// task.js( 任务名 , 预编译文件地址 , 文件存放地址 );
	task.js("compress-js", "./js/index.js", "./js/minify.js");

	// 压缩CSS
	// 可批量
	// task.css( 任务名, 配置数据 )
	// 配置数据键值对 键名为存放地址 值为数组或者字符串,数组表示多个css合并后压缩
	task.css("compress-css", { "./css/minify.css": ["./css/style.css"] });

	// 合并文件
	// 可批量
	// task.concats( 任务名, 配置数据 )
	// 配置数据键值对 键名为存放地址 值为数组或者字符串,数组表示多个文件合并
	task.concats = ("compress-concat", { "./module/concat.js": ["./lib/A.js", "./lib/B.js"] });

	// browserify 合并模块
	task.browser('compress-browser', {
		'./a.js': './c.js'
	});
	task.browser('compress-browser', './a.js', './c.js');

	// jsmin 压缩模块
  task.jsmin('compress-browser', {
    './a.js': './c.js'
  });
  task.jsmin('compress-browser', './a.js', './c.js');

	// 在任务流中注册任务
	// task.registTask(任务名, 任务流数组)
	task.registTask("default", ["compress-css", "compress-js"]);

	/**
	 * 自定义任务
	 * task.createTask(taskname, fn);
	 * 注意 fn 有2个默认参数 resolve reject 分别是promise的2种状态回调函数
	 * task.createTask('test', function(resolve, reject){
	 *    setTimeout(function(){
	 *      resolve();
	 *    }, 3000);
	 * });
	 * task.registTask('task1', ['test']);
	 */
};

envirs server [port]

在某个项目下启动WEB服务。

$ cd your-project

$ envirs server

port默认8000端口。

$ envirs server 9000

启动端口为9000的WEB服务。

License

MIT