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

@koa_web/boot

v2.0.9

Published

ne front end basic module

Downloads

24

Readme

@koa_web/boot

简介

ne 前端基础工程

安装&配置

全局安装该模块 $ npm install @koa_web/boot -g$ npm install @koa_web/boot -g --production

使用

1 获取使用帮助

通过ne -hne --help查看使用帮助

$ ne -h
Usage: ne run [command] [option]

Options:

  -v, --version    output the version number
  -e --env [env]   what env do you want set
  --senv [senv]    what egg environment do you want
  -h, --help       output usage information

Commands:

  dev [options]    run project in dev mode
  build [options]  Only effective in dashboard or h5.
  lint             lint project code follow your eslint file
  packageName      echo project name
  packageVersion   echo project version
  startup:docker   startup. Only effective in docker container
  test             Only effective in service(egg.js)
  cov              Only effective in service(egg.js)
  ci               Only effective in service(egg.js)

2 获取版本号

通过ne -vne --version查看版本号

$ ne-create-project -v

 v1.4.1

3 指令说明

3.1 dev

开发模式启动当前工程

$ ne run dev

3.2 build

编译当前工程

$ ne run build

3.3 lint

对当前工程进行语法检测

$ ne run lint

3.4 packageName

输出当前工程的名称

$ ne run packageName

3.5 packageVersion

输出当前工程的版本号

$ ne run packageVersion

3.6 startup:docker

容器中启动该工程的命令

$ ne run startup:docker

3.7 test

对当前工程进行单元测试,只在eggjs为基础的后端工程中有效

$ ne run test

3.8 cov

生成当前工程的测试覆盖率报告,只在eggjs为基础的后端工程中有效

$ ne run cov

3.9 ci

对当前工程进行语法检测并生成当前工程的测试覆盖率报告,只在eggjs为基础的后端工程中有效

$ ne run ci

4 设置环境变量

优先读取第一种方式设定的环境变量

4.1 运行时注入

4.1.1 -e --env

注入环境变量,可以用 process.env.k1 获取到

$ ne run dev -e k1=v1,k2=v2
$ ne run dev --env k1=v1,k2=v2
4.1.2 senv

注入eggjs启动参数,只在eggjs为基础的后端工程中有效

$ ne run dev --senv port=7002

4.2 在当前工程的package.json中写入

在当前工程的package.json中写入,格式为 默认在dev指令中注入了NODE_ENV=development

  "ne-env-[command]": {
    "k1": "v1",
    "k2": "v2"
  },
  "ne-senv-[command]": {
    "k1": "v1",
    "k2": "v2"
  }

其中 ne-senv-[command] 只在以eggjs为基础的后端工程中有效
例如

  "ne-env-dev": {
    "NODE_SYS": "dealer"
  },
  "ne-senv-dev": {
    "port": "7002"
  }

本地安装

工程目类下安装该模块 $ npm install @koa_web/boot --save-dev
提供基于githook的相关语法检查与commit信息检查

相关功能基于yorkielint-staged进行修改

测试相关

请参照yorkielint-staged