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

snorkel-cli

v2.0.0-alpha.19

Published

snorkel v2.0.0

Downloads

8

Readme

如何使用

环境准备(可选)

建议使用npm2.x版本,这个版本虽然安装时间略长,但目录没有被打平,如果想了解snorkel-cli内部实现,2.x的安装结果会比较清爽。

写这个文档时,2.x的最新版为2.14.12

sudo tnpm i [email protected] -g -d

全局安装snorkel-cli(必选)(更新时在群里提示)

snorkel-cli是创建脚手架的终端命令工具,用于生成新的项目,新的页面。前期会经常更新,但对已生成的页面不产生影响。

sudo tnpm i snorkel-cli@latest -g -d

全局安装snorkel-scripts(必选)(必要时才更新)

snorkel-scripts是项目开发阶段的依赖,包括webpackbabel*-loader等很多工具。

sudo tnpm i snorkel-scripts@latest -g -d

初始化项目

后续加入更多的模板后,在终端开启交互式创建,目前还不支持。

创建名为foo的项目

sc foo

启动开发环境

进入项目根目录

cd foo
npm install 
npm start

上面命令执行后,在浏览器打开localhost:3000/hello.html即可调试hello页面。

可用的命令

创建页面:sc page {{page-name}}

页面名称命名规范:如果是多个单词,请使用连字符。

例:创建名为foo-bar的页面,在项目new目录执行:

sc page foo-bar

创建新页面后,重新执行npm start,访问localhost:3000/foo-bar.html查看效果。

日常打包:npm run build:daily

打包后的文件在项目根目录的build目录下。

生产打包:npm run build

打包后的文件位置同上。

工具库

已集成的工具库文档如下:

TODO

  • 单页面模板
  • 移动端模板
  • 版本锁定,将项目使用的cli的版本固定
  • 添加局部构建,提升构建速度,项目开发前期,允许只构建自己的页面。

共建snorkel-cli

全局安装snorkel-scrips

snorkel-scripts是项目开发阶段的依赖,包括webpack,babel,*-loader等很多工具。

sudo tnpm i [email protected] -g -d

拷贝snorkel-cligit库到本地

git clone [email protected]:crm/snorkel-cli.git

进入项目根目录执行

npm install
npm link

这时候,再次运行sc project-name创建新项目的时候,脚手架调用的就是刚刚拷贝到本地的snorkel-cli库里的代码了。改动即生效。