lcq.utils
一个工具集合
安装
$ npm install lcqutils --save // yarn add lcq.utils
使用
常用工具
; // isutilsis; // is.isElectron()utilsis; // is.isWin()utilsis; // is.isMac()utilsis; // is.isLinux() // requestconst res = await request; // filefile; // 浏览器打开file; // 删除文件file // stringstring; // 75cb6b99-c257-41e6-b9f2-ae7ad1d31ce9string // networknetwork; // => 'http://baidu.com'await networkpingpromise; // => {alive: true, ...}await network // => 22.33.44.55await network // => 192.168.1.2await network // =>await network // => true、false // cliclishell; // => show current dir filesconsole; // npmawait npm; // => https://registry.npm.taobao.org/lcq.utils/download/lcq.utils-${version}.tgzawait npm; // => {name: 'lcq.utils', versions: [],....}await npm; // => 3.0.1...
terminal 工具
lcq-del
删除本地文件
$ lcq-del ./somefile
lcq-serve
在当前目录起一个静态服务
$ cd someDir $ lcq-serve -> http://localhost:5000
lcq-open
本地浏览器打开链接
$ lcq-open https://baidu.com
lcq-uuid
生成一个 uuid
$ lcq-uuid -> 75cb6b99-c257-41e6-b9f2-ae7ad1d31ce9
lcq-start
在一个命令行同时运行多个命令
"scripts": { // ... "watch-js": "...", "watch-less": "...", "start": "lcq-start \"npm:watch-js\" \"npm:watch-less\"" // ...} ->
lcq-shell
跨平台的 unix 脚本执行
$ lcq-shell echo hello world -> hello world