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

babelmodule

v1.0.0

Published

npm install babel-cli -g

Downloads

14

Readme

###安装babel cli 使用babel编译的方法### npm install babel-cli -g

/*
* 现在只是吧es6.js代码复制过来 没有任何处理 需要配置babel怎么去编译代码
*
* 1)babel是通过安装插件(plugin)或者预设(preset, 就是一组设定好的插件)来编译代码
* 配置.babelrc
  2) npm init 
  3) npm install --save-dev babel-preset-es2015
  4) 修改.babelrc文件 添加
    "presets": ['es2015'],
    
 5) 运行 babel es6.js -o compiledes6.js  //发现已经编译完成
    
* */

###babel单独插件实现对象展开操作符 babel单独插件的配置使用### npm install babel-plugin-transform-object-rest-spread --save-dev

babel核心概念####

用一系列的plugin来管理编译规则 通过不同的plugin, 不仅可以编译ES6代码 还可以编译React JSX

###待解决问题### SyntaxError: Unexpected token import

####模块module与组件component### 模块是语言层面的 往往表现为单独的js文件 对外暴露一些属性方法 组件是业务层面的 一个独立使用的功能实现 往往表现为一个UI组件 组件包含他所需要的所有资源 js, css , html , 甚至图片与字体 组件化以模块化为基础