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

zjlu

v1.0.2

Published

build the --es6 --react dev-tool with npm-scripts

Downloads

2

Readme

zjlu(自己卤) 自动化构建工具 --es6, --react

自己卤npm script


installation

$ npm i zjlu --save-dev

use

  • es5 project with 'mocha' git
$ ./node_modules/.bin/zjlu  
  • es6 project with mocha git babel
$ ./node_modules/.bin/zjlu --es6
  • react&es6
$ ./node_modules/.bin/zjlu --react

git

  1. git init
  2. .gitignore << node_modules

test (mocha chai)

  1. cnpm i mocha --save-dev
  2. cnpm i chai --save-dev
  3. exaple.text.js --es5 or example.test.js --es6
  4. mocha.opt --es5 or es6

test

  1. cnpm i mocha --save-dev
  2. cnpm i chai --save-dev

react

  1. webpack.config.js
  2. cnpm i react --save
  3. cnpm i react-dom --save
  4. cnpm i redux --save
  5. cnpm i immutable --save
  6. cnpm i redux --save
  7. cnpm i

es6

  1. babel-init babelrc(presets: es2015 react)

  2. babel-cli

命令行转码,包含 babel-node(支持 repl, debug es6)

  • npm script 转码 命令
  • npm script debug 命令
  1. babel-register

给require加钩子, 每当加载 js, jsx, es, es6 后缀文件, 就babel转码
使用时,必须首先加载babel-register babel-register只会对require命令加载的文件转码, 而不会对当前文件转码。
另外,由于它是实时转码,所以 只适合在开发环境 使用。

require("babel-register");
require("./index.js"); //==> 对 index.js 实时转码
  1. babel-polyfill

Babel默认只转换新的JavaScript句法(syntax), 而不转换新的API,比如Iterator、Generator、Set、Maps、Proxy、Reflect、Symbol、Promise等全局对象, 以及一些定义在全局对象上的方法(比如Object.assign)都不会转码。

Babel默认不转码的API非常多,详细清单可以查看babel-plugin-transform-runtime模块的definitions.js文件。

使用时 请加上

import 'babel-polyfill';
// 或者
require('babel-polyfill');
  1. bable-core

如果某些代码需要调用Babel的API进行转码,就要使用babel-core模块。
这么高深的模块,我暂时不会用,但尼玛react 御用构建工具 webpack 要用唉.