node-uuid

参考:https://www.jianshu.com/p/0388e3d4bed4
常见用法:

  1. uuid.v1(); —>基于时间戳生成 (time-based)
  2. uuid.v4(); —>随机生成 (random)
  1. const uuid = require('node-uuid');
  2. const uid = uuid.v1()

live-server

live-server 是一个具有实时加载功能的小型服务器.
用法:在所在项目目录下,打开命令行工具,输入 live-server,回车就可以了(注意这里默认打开的是index.html)

  1. cd /home/gmx/test-html/
  2. live-server

zx

超级好用的写脚本神器
地址:https://github.com/google/zx
用法:

  1. #!/usr/bin/env zx
  2. await $`cat package.json | grep name`
  3. let branch = await $`git branch --show-current`
  4. await $`dep deploy --branch=${branch}`
  5. await Promise.all([
  6. $`sleep 1; echo 1`,
  7. $`sleep 2; echo 2`,
  8. $`sleep 3; echo 3`,
  9. ])
  10. let name = 'foo bar'
  11. await $`mkdir /tmp/${name}`