Skip to content

npm nodemon

c
//为了不必手动刷新我们的开发服务器,我们将为开发安装一个额外的依赖项nodemon
npm i -D nodemon
npm i --save express node-fetch redis

package 中新建一个"start": "nodemon index.js"

js-audio-recorder

录音的库,我试了下感觉还不错 https://blog.csdn.net/museions/article/details/100916920

sqlite3

缺点:无法数据加密 https://blog.csdn.net/w2sft/article/details/104027349

redis

redis 的教程 https://zhuanlan.zhihu.com/p/96762107redis-server.exe redis.windows.confhttps://blog.csdn.net/q282176713/article/details/80580886

神经网络相关

https://blog.csdn.net/aria_miazzy/article/details/103793098

Tensorflow.js

https://tensorflow.google.cn/js?hl=zh-cnhttps://blog.csdn.net/aria_miazzy/article/details/103793098git clone https://github.com/tensorflow/tfjs-examples

TensorSpace.js

https://juejin.cn/post/6844903713203568653

express

最好用的 web 框架

那么,什么时用app.use,什么时用app.get呢?

路由规则是app.use(path,router)定义的,router 代表一个由express.Router()创建的对象,在路由对象中可定义多个路由规则。可是如果我们的路由只有一条规则时,可直接接一个回调作为简写,也可直接使用app.getapp.post方法。即

当一个路径有多个匹配规则时,使用app.use,否则使用相应的app.method(get、post)

javascript
const app = require("express")();

// If you receive a GET request with `url = '/test'`, always
// send back an HTTP response with body 'ok'.
app.get("/test", function routeHandler(req, res) {
  res.send("ok");
});
javascript
const app = require("express")();

// `:userId` is a route parameter. Express will capture whatever
// string comes after `/user/` in the URL and store it in
// `req.params.userId`
app.get("/user/:userId", (req, res) => {
  req.params; // { userId: '42' }
  res.json(req.params);
});

const server = await app.listen(3000);
// Demo of making a request to the server
const axios = require("axios");
const res = await axios.get("http://localhost:3000/user/42");

res.data; // { userId: '42' }

dotenv

用于加载系统 env 变量 npm i -D dotenv

vega vega-embed

用于曲线绘制,等其他可视化方案 npm i -D vega-embed

echart

https://echarts.apache.org/examples/en/index.html

parcel

急速 web 应用打包工具 parcel index.html--no-hmr是否开启代码热更新 --open是否打开默认浏览器

c
parcel -h # 查看帮助信息
parcel serve -h # 本地开发模式,会启动一个默认1234端口的本地服务器,代理到配置的目标文件,前端页面开发为主
parcel watch -h # 监听文件改动模式,不会启动默认本地服务器,服务端开发为主
parcel build -h # 编译源文件并打包到目标�文件夹

esbuild

急速 javascript 打包工具 据说 vite 用的就是它 官网 https://esbuild.docschina.org/

webpack

需要根据提示下载 webpack-cli webpack有个配置,一般出口在 dist

js
import webpack = require("webpack")
module.exports = {
  devtool: 'source-map',
  entry: './app.js',//你的路径
  output: {
    filename: './dist/bundle.js',//输出文件名
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({ sourceMap: true }),
    ]//压缩文件用的
}

"build":"webpack --progress --watch"progress 进度,watch 监听 然后直接运行

servez

这个是轻量级的 http 服务器 servez -p 8080\

chalk

用来给输出上色的

js
const chalk = require("chalk");
console.log(chalk.blue("Hello world!"));

rollup 模块打包工具

https://www.rollupjs.com/

multer

上传文件的中间件 https://blog.csdn.net/naoguaten/article/details/121965199

javascript-obfuscator

这个库是用来做变量混淆的。官方链接 https://obfuscator.io/

c
//安装
npm install javascript-obfuscator -g
//使用
javascript-obfuscator a.js

PhantomJS

无头浏览器

node-serialport

npm install serialport

js
const SerialPort = require("serialport");

(async () => {
  try {
    let ports = await SerialPort.list();
    console.log(ports); // 打印串口列表
  } catch (error) {
    console.log(error);
  }
})();

串口

codemirror

CodeMirror is a code editor component for the web. It can be used in websites to implement a text input field with support for many editing features, and has a rich programming interface to allow further extension. 官网 https://codemirror.net/ 中文网站 https://www.tun6.com/projects/code_mirror/ 针对 Vue npm install vue-codemirror --save

PM2

node 进程管理工具

Released under the MIT License.