# NodeJS
# Flag
- https://github.com/topics/nodejs (opens new window)
- https://github.com/topics/node-js (opens new window)
- https://github.com/nodejs (opens new window)
- https://github.com/nodeschool (opens new window)
- https://github.com/workshopper (opens new window)
- http://www.npmdoc.org (opens new window)
- https://github.com/goldbergyoni/nodebestpractices (opens new window)
- NodeJs小册 (opens new window)
- https://developer.ibm.com/zh/technologies/node-js (opens new window)
- https://github.com/alsotang/node-lessons (opens new window)
- https://github.com/cnodejs (opens new window)
- https://github.com/amplication (opens new window)
- https://github.com/i5ting/asynchronous-flow-control (opens new window)
- 基准测试 https://github.com/RafaelGSS/nodejs-bench-operations (opens new window)
- 实时协作 https://github.com/partykit/partykit (opens new window)
node
执行脚本时获取参数process.argv
数组,下标0
为执行程序的绝对路径,下标1
为脚本的绝对路径, 所以真正的参数从下标2
开始process.argv.splice(2)
- Web标准实现 https://github.com/jsdom/jsdom (opens new window)
- https://github.com/stylus (opens new window)
- 自动重启Node https://github.com/remy/nodemon (opens new window)
- 2023年最受欢迎的node.js框架 (opens new window)
# 构建打包
- https://github.com/webpack/webpack (opens new window)
- https://github.com/parcel-bundler/parcel (opens new window)
- https://github.com/snowpackjs/snowpack (opens new window)
- https://github.com/rollup/rollup (opens new window)
- https://github.com/TurboPack (opens new window)
- https://github.com/vitejs/vite (opens new window)
- https://github.com/evanw/esbuild (opens new window)
- https://github.com/web-infra-dev (opens new window)
- https://github.com/bower/bower (opens new window)
- https://github.com/gulpjs/gulp (opens new window)
- 2009年,npm
- 2012年,grunt
- 2012年,bower
- 2013年,yeoman https://github.com/yeoman (opens new window)
- 2014年,gulp
- 2015年,fis3
- 2017年,webpack3
- https://github.com/wuhao000/aegis-tools (opens new window)
- https://github.com/fuchengwei/deploy-cli-service (opens new window)
- https://github.com/Tencent/hel (opens new window)
# 第三方库
- https://github.com/parro-it/awesome-micro-npm-packages (opens new window)
- https://github.com/TanninOne (opens new window)
- https://github.com/dylang (opens new window)
- https://github.com/isaacs (opens new window)
- https://github.com/nodeca (opens new window)
- https://github.com/dominictarr (opens new window)
- https://github.com/kentcdodds (opens new window)
- https://github.com/unjs (opens new window)
- https://github.com/eggjs/egg (opens new window)
- glob https://github.com/micromatch/extglob (opens new window)
- https://github.com/mrmlnc/fast-glob (opens new window)
- https://github.com/reworkcss (opens new window)
- https://github.com/visionmedia (opens new window)
- CMS https://github.com/strapi/strapi (opens new window)
- ORM https://github.com/prisma/prisma (opens new window)
- https://github.com/jugglingdb (opens new window)
- https://github.com/dresende/node-orm2 (opens new window)
- https://github.com/sequelize/sequelize (opens new window)
- https://github.com/vincit/objection.js (opens new window)
- https://github.com/bookshelf/bookshelf (opens new window)
- https://github.com/balderdashy/waterline (opens new window)
- https://github.com/sutandojs/sutando (opens new window)
- https://github.com/jaynath-d/node-jdbc-driver (opens new window)
- SQL查询 https://github.com/knex/knex (opens new window)
- https://github.com/TryGhost/node-sqlite3 (opens new window)
- https://github.com/sql-js/sql.js (opens new window)
- SQLite REST API https://github.com/thevahidal/soul (opens new window)
- 解析器、压缩器、压缩器和美化 https://github.com/mishoo/UglifyJS (opens new window)
- https://github.com/solzimer/nsyslog-parser (opens new window)
- 日志 https://github.com/trentm/node-bunyan (opens new window)
- https://github.com/pillarjs/send (opens new window)
- https://github.com/pinojs/pino (opens new window)
- https://github.com/debug-js/debug (opens new window)
- 断言 https://github.com/chaijs (opens new window)
- Expect交互 https://github.com/facebook/jest (opens new window)
- https://github.com/sinonjs (opens new window)
- 命令行 https://github.com/tj/commander.js (opens new window)
- https://github.com/SBoudrias/Inquirer.js (opens new window)
- https://github.com/oclif/oclif (opens new window)
- https://github.com/yargs/yargs (opens new window)
- https://github.com/shelljs/shelljs (opens new window)
- USB https://github.com/schakko/node-usb (opens new window)
- https://github.com/node-usb (opens new window)
- 字体管理 https://github.com/foliojs/font-manager (opens new window)
- 访问头文件 https://github.com/charto/nbind (opens new window)
- 正则表达式 https://github.com/CJex/regulex (opens new window)
- 特性开关 https://github.com/Unleash/unleash (opens new window)
- 分布式ID https://github.com/cloudyan/snowflake (opens new window)
- REST https://github.com/restify (opens new window)
- https://github.com/senchalabs/connect (opens new window)
- 压缩解压文件 https://github.com/quentinrossetti/node-7z (opens new window)
- WEB框架 https://github.com/marblejs/marble (opens new window)
- https://github.com/nestjs/nest (opens new window)
- https://github.com/fastify/fastify (opens new window)
- https://github.com/koajs/koa (opens new window)
- https://github.com/expressjs/express (opens new window)
- 键值存储 https://github.com/jaredwray/keyv (opens new window)
- https://github.com/microlinkhq/keyvhq (opens new window)
- https://github.com/sindresorhus/quick-lru (opens new window)
- 图片压缩 https://gitlab.com/ramiel/caravaggio (opens new window)
- https://github.com/lovell/sharp (opens new window)
- C交互接口 https://github.com/Koromix/koffi (opens new window)
- 游戏框架 https://github.com/greenheartgames/greenworks (opens new window)
- https://github.com/ceifa/steamworks.js (opens new window)
- 检测文字语言 https://github.com/komodojp/tinyld (opens new window)
- 表单验证 https://github.com/vinejs/vine (opens new window)
- 代理HLS视频流 https://github.com/warren-bank/HLS-Proxy (opens new window)
- 文件操作 https://github.com/jprichardson/node-fs-extra (opens new window)
- 文件监视 https://github.com/paulmillr/chokidar (opens new window)
- 环境变量加载 https://github.com/motdotla/dotenv (opens new window)
# 管理NodeJS
- https://github.com/topics/versioning (opens new window)
- https://github.com/topics/version-manager (opens new window)
- https://github.com/topics/dependency-manager (opens new window)
- https://github.com/topics/environment (opens new window)
- https://github.com/tj/n (opens new window)
- https://github.com/Jrohy/nodejs-install (opens new window)
- https://github.com/jasongin/nvs (opens new window)
- https://github.com/nodenv/nodenv (opens new window)
- https://github.com/nodesource/distributions (opens new window)
- https://github.com/Schniz/fnm (opens new window)
- https://github.com/jdxcode/rtx (opens new window)
# 检查Node.js和NPM版本
node -v && npm -v
NVM
nodeJs版本管理工具,管理nodejs版本和npm版本
- https://github.com/nvm-sh/nvm (opens new window)
- https://github.com/coreybutler/nvm-windows (opens new window)
- https://github.com/lukechilds/zsh-nvm (opens new window)
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
# 刷新
source ~/.bashrc
# 查询最新版本号
nvm ls-remote --lts
# 安装稳定版 Nodejs
nvm install <最新的版本号>
# 依赖管理
- https://github.com/Unitech/pm2 (opens new window)
- https://github.com/npm (opens new window)
- https://github.com/yarnpkg (opens new window)
- https://github.com/pnpm/pnpm (opens new window)
- https://github.com/xthezealot/npmprune (opens new window)
- https://github.com/antfu/ni (opens new window)
# 管理yarn
# 安装
npm install -g yarn
卸载
# 查找目录并删除
yarn global bin
# 卸载
npm uninstall -g yarn
# 依赖镜像
npm i -g nrm
安装nrm
,nrm ls
查看下载镜像源,nrm use taobao
切换镜像源
手动配置
如果使用
yarn
,就把命令开头的npm
替换为yarn
# 查看仓库地址
npm config get registry
# 设置官方仓库地址
npm config set registry https://registry.npmjs.org
# 设置淘宝镜像仓库地址
npm config set registry https://registry.npmmirror.com
# 查看代理地址
npm config get proxy
npm config get https-proxy
# 设置代理地址
npm config set proxy http://127.0.0.1:1080
# 设置https代理地址
npm config set https-proxy http://server:port
# 设置代理用户名和密码
npm config set proxy http://username:password@server:port
npm confit set https-proxy http://username:password@server:port
# 删除代理地址
npm config delete proxy
npm config delete https-proxy
# 更新依赖包
yarn
yarn.lock
和package.json
都会更新,但是会进行版本锁定
- 更新所有到最新版本
需要手动选择升级的依赖包,a键选择所有,i键反向选择
yarn upgrade-interactive --latest
- 更新单个到指定版本
yarn upgrade package@latest
npm
更新
dependencies
到最新版本
# 先检查更新
npm outdated
# 安装
npm install -g npm-check-updates
# 检查可更新依赖,ncu
npm-check-updates
# 更新,ncu -u
ncu --upgrade
# 安装最新版本依赖
npm install
# yarn和npm命令
npm | yarn | 说明 |
---|---|---|
npm install(i) | yarn/yarn install | 根据package.json安装依赖 |
npm uninstall(un) 包名 –-global(-g) | yarn global remove 包名 | 卸载全局依赖包 |
npm uninstall(un) 包名 -–save(-S) | yarn remove 包名 | 卸载依赖,并删除package.json中的 |
npm uninstall(un) 包名 -–save-dev(-D) | yarn remove 包名 –dev(-D) | 卸载开发环境依赖 |
npm install 包名 –-global(-g) | yarn global add 包名 | 安装全局依赖包 |
npm install 包名 -–save(-S) | yarn add 包名 | 安装依赖,并保存到package.json |
npm install 包名 -–save-dev(-D) | yarn add 包名 –dev(-D) | 安装开发环境依赖 |
npm update 包名 –-global(-g) | yarn global upgrade 包名 | 更新全局依赖 |
npm update 包名 -–save(-S) | yarn upgrade 包名 | 更新依赖 |
npm update 包名 -–save-dev(-D) | yarn upgrade 包名 –dev(-D) | 更新开发环境依赖 |
npm cache clean | yarn cache clean | 清除缓存 |
rm -rf node_modules && npm install | yarn upgrade | 重装 |
npm init | yarn init | 初始化某个项目 |
npm publish/login/logout | yarn publish/login/logout | 发布/登录/登出,NPM Registry操作 |
npm run/test 命令 | yarn run/test 命令 | 运行某个命令 |
# 正式发布包
不要使用其他npm源,如:taobao
# 先去https://www.npmjs.com注册个账号,然后在命令行使用
# 根据提示输入用户名密码即可
npm adduser
# 发布
npm publish
# 升级补丁版本号
npm version patch
# 升级小版本号
npm version minor
# 升级大版本号
npm version major
# 解析
/**
* https://www.npmjs.com/search?q=keywords:xml2js
*/
const fs = require("fs");
//模拟发送http请求
const request = require("request");
// npm install xpath
// https://github.com/yaronn/xpath.js
const xpath = require('xpath');
//get请求
request('https://jolx-1256021553.cos.ap-chengdu.myqcloud.com', function (error, response, body) {
if (!error && response.statusCode == 200) {
// npm install xmlreader
// const xmlreader = require("xmlreader");
// xmlreader.read(body, function (errors, res) {
// if (null !== errors) {
// console.log(errors)
// return;
// }
// console.log(res);
// });
// npm install xml2js
// const Xml2js = require('xml2js');
// const Parser = new Xml2js.Parser({ explicitArray: false, ignoreAttrs: false });
// Parser.parseString(body, function (err, result) {
// console.log(result);
// });
// npm install xmldom
// https://github.com/goto100/xpath
// const dom = require('xmldom').DOMParser;
// let doc = new dom().parseFromString(body);
// console.log(doc);
// npm install fast-xml-parser
// const parser = require('fast-xml-parser');
// const doc = parser.parse(body);
// console.log(doc);
// npm install xml-js
const convert = require('xml-js');
const doc = convert.xml2js(body);
console.log(doc);
}
});
//post请求
request({
url: "https://jolx-1256021553.cos.ap-chengdu.myqcloud.com",
method: "post",//如果是post就涉及到跨域的问题了
json: true,
headers: {
"content-type": "application/json",
},
body: {
account: 'admin',
pwd: 'admin'
}
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
});
# 爬虫
- https://github.com/webdriverio (opens new window)
- https://github.com/puppeteer (opens new window)
- https://github.com/adieuadieu/serverless-chrome (opens new window)
- https://github.com/N0taN3rd/chrome-remote-interface-extra (opens new window)
- https://github.com/cowchimp/headless-devtools (opens new window)
- Puppeteer配置小记 (opens new window)
- https://github.com/zhaoqize/puppeteer-api-zh_CN (opens new window)
- https://github.com/ebidel/try-puppeteer (opens new window)
- https://github.com/berstend/puppeteer-extra (opens new window)
- 自动化 https://github.com/microsoft/playwright (opens new window)
- https://github.com/cypress-io/cypress (opens new window)
- https://github.com/aerokube (opens new window)
- https://github.com/getgauge/taiko (opens new window)
- https://github.com/milankinen/cuic (opens new window)
- https://github.com/CheshireCaat/bas-remote-node (opens new window)
- 基于webkit https://github.com/ariya/phantomjs (opens new window)
- https://github.com/krisselden/chrome-debugging-client (opens new window)
- https://github.com/cyrus-and/chrome-remote-interface (opens new window)
- https://github.com/TracerBench/chrome-debugging-client (opens new window)
- 基于Gecko https://github.com/laurentj/slimerjs (opens new window)
- https://github.com/vitest-dev/vitest (opens new window)
- https://github.com/NaiboWang/EasySpider (opens new window)
- https://github.com/inu1255/soulsign-chrome (opens new window)
脚本
- https://github.com/Peng-YM/QuanX (opens new window)
- https://github.com/dompling/Script (opens new window)
# 小程序
- https://github.com/search?q=weapp (opens new window)
- https://github.com/topics/wxapp (opens new window)
- https://github.com/topics/weapp (opens new window)
- https://github.com/topics/wechat (opens new window)
- https://github.com/topics/minapp (opens new window)
- https://github.com/topics/wechat-app (opens new window)
- https://github.com/topics/wechat-mini-program (opens new window)
- https://github.com/topics/weixin (opens new window)
- https://github.com/justjavac/awesome-wechat-weapp (opens new window)
- https://github.com/qiushi123/xiaochengxu_demos (opens new window)
- https://github.com/YanxinNet/uView (opens new window)
- 使用Golang开发的微信SDK: https://github.com/silenceper/wechat (opens new window)
框架
- https://github.com/dcloudio/uni-app (opens new window)
- https://github.com/NervJS/taro (opens new window)
- https://github.com/tinajs/tina (opens new window)
- https://github.com/didi/chameleon (opens new window)
- https://github.com/didi/mpx (opens new window)
- https://github.com/kaola-fed/megalo (opens new window)
- https://github.com/Tencent/wepy (opens new window)
- https://github.com/Meituan-Dianping/mpvue (opens new window)
Other
- https://gitee.com/laeser/demo-weapp (opens new window)
- 小程序海报组件-生成朋友圈分享海报并生成图片 (opens new window)
- 微信小程序Markdown渲染库 (opens new window)
- 手持弹幕微信小程序版 (opens new window)
- https://github.com/super456/weapp_expressTime (opens new window)
- https://github.com/ecomfe/echarts-for-weixin (opens new window)
- 照片修复 https://github.com/shifu-group/inpaint_wechat (opens new window)
# 自定义组件
组件库
- https://github.com/youzan/vant-weapp (opens new window)
- https://github.com/jisida/VtuWeapp (opens new window)
- https://github.com/wux-weapp/wux-weapp (opens new window)
- https://github.com/Tencent/weui (opens new window)
- https://github.com/weilanwl/ColorUI (opens new window)
日历
授权
- https://github.com/misterxu1567/wxMiniProgram-components (opens new window)
- https://github.com/GRW999/auth-component (opens new window)
- https://github.com/yeyi361936738/mini-login-component (opens new window)
- https://github.com/Skura23/authModal (opens new window)
搜索