Node系列——Node第三方模块使用总结
2019獨角獸企業重金招聘Python工程師標準>>>
Node中主流模塊匯總
1. 其他人總結的
- https://github.com/sindresorhus/awesome-nodejs#videos
2. 數據庫相關
- express-session
- 狀態保持庫
- https://github.com/expressjs/session
- connect-mongo
- 將session存入mongodb
- https://github.com/jdesboeufs/connect-mongo
- connect-redis
- 將session存入redis
- https://github.com/tj/connect-redis orm mongoose
3. 爬蟲
- cheerio
- 網頁爬蟲處理,cheerio可以在服務端使用JQuery的類庫,比如操作DOM元素
- http://github.com/cheeriojs/cheerio
4. 全文檢索
5. 日志
6. 發郵件
Nodemailer - The fastest way to handle email. emailjs - Send text/HTML emails with attachments to any SMTP server.
7. 發短信
yunpian-sdk
8. 操作excel
npoi
- xlsx-populate
- 操作excel
- https://github.com/dtjohnson/xlsx-populate
9. 測試
9.1. 單元測試
9.2. e2e測試
9.3. 壓力測試
9.4. 數據模擬
AVA - Futuristic test runner. Mocha - Feature-rich test framework making asynchronous testing simple and fun. nyc - Code coverage tool built on istanbul that works with subprocesses. tap - TAP test framework. tape - TAP-producing test harness. power-assert - Provides descriptive assertion messages through the standard assert interface. Mochify - TDD with Browserify, Mocha, PhantomJS and WebDriver. trevor - Run tests against multiple versions of Node.js without switching versions manually or pushing to Travis CI. loadtest - Run load tests for your web application, with an API for automation. Sinon.JS - Test spies, stubs and mocks. navit - PhantomJS / SlimerJS wrapper to simplify browser test scripting. nock - HTTP mocking and expectations. intern - Code testing stack. toxy - Hackable HTTP proxy to simulate failure scenarios and network conditions. hook-std - Hook and modify stdout/stderr. testen - Run tests for multiple versions of Node.js locally with NVM. Nightwatch - Automated UI testing framework based on Selenium WebDriver. WebdriverIO - Automated testing based on the WebDriver protocol. Jest - Painless JavaScript testing. TestCafe - Automated browser testing.
10. 事件隊列
- bee-queue
- 封裝了redis的事件隊列 kue - Priority job queue backed by Redis. bull - Persistent job and message queue. agenda - Lightweight job scheduling on MongoDB. idoit - Redis-backed job queue engine with advanced job control.
11. 定時任務
node-schedule
12. 微信相關
- wechaty
13. 表單
body-parse formable
14. 部署
PM2 - Advanced Process Manager. nodemon - Monitor for changes in your app and automatically restart the server. node-mac - Run scripts as a native Mac daemon and log to the console app. node-linux - Run scripts as native system service and log to syslog. node-windows - Run scripts as a native Windows service and log to the Event viewer. forever - Ensures that a given script runs continuously. supervisor - Restart scripts when they crash or restart when a *.js file changes. Phusion Passenger - Friendly process manager that integrates directly into Nginx. naught - Process manager with zero downtime deployment.
15. 人工智能
- superscript
16. 工具類
glob uuid xml2json async(流程控制) axios fs-extra
- moment
- 時間處理
- http://github.com/moment/moment
- validator
- 在服務端和客戶端都可以進行驗證的模塊,常用的郵箱,網址,電話,信用卡等都支持
- https://github.com/chriso/validator.js
- ccap
- 生成圖片驗證碼
- https://cnodejs.org/topic/50f90d8edf9e9fcc58a5ee0b
- https://cnodejs.org/topic/50fd3b74df9e9fcc58e776a0
17. 高級玩意
amqp bearcat(IoC,AOP)
18. 其他
- gm
- 圖片處理
- http://github.com/aheckmann/gm
- 簡介
- ImageMagick和GraphicsMagick主要用于圖片的創建、編輯、合成圖片。它們可以讀取、轉換、寫入多種格式的圖片。圖片切割、顏色替換、各種效果的應用,圖片的旋轉、組合,文本,直線,多邊形,橢圓,曲線,附加到圖片伸展旋轉。
- gm模塊實現了ImageMagick和GraphicsMagick的相關功能,讓我們很方便的在Node中進行圖片的相關操作
- sharp
- 主要用于圖片的處理,相比ImageMagick 和 GraphicsMagick ,處理速度會快四五倍。主要支持JPEG,PNG,WebP,TIFF,GIF 和 SVG images
- http://github.com/lovell/sharp
18.1. spritesmith
- 類別:圖片處理
- 官網:http://github.com/ensighten/spritesmith
- 簡介:
- SSSprites在國內很多人叫css精靈,是一種網頁圖片應用處理方式。它允許你將一個頁面涉及到的所有零星圖片都包含到一張大圖中去,這樣一來,當訪問該頁面時,載入的圖片就不會像以前那樣一幅一幅地慢慢顯示出來了。
- spritesmith 模塊就是將多個圖片生成 CSSSprites 和 拼成一張圖
- 代碼:
18.2. TinyColor
- 類別:顏色處理
- 官網:https://github.com/bgrins/TinyColor
- 簡介:
- 在日常開發中,我們經常會處理一些顏色值的轉換,正好TinyColor就派上用場了,能很方便的進行顏色值的轉換
- 代碼:
18.3. pdfkit
- 類別:文檔處理
- 官網:http://github.com/devongovett/pdfkit
- 簡介:
- 起初,生成PDF文件似乎是件很繁瑣的任務,但有了PDFKit,這個任務就容易多了。但對于Node.js的PDFKit模塊,知道的人并不多,這倒是很意外。有了PDFKit模塊,處理PDF文件變得非常容易,它讓你避免了所有的復雜工作,并提供用CoffeeScript(也可以作為普通版的Javascript使用)寫成的簡易的API
- 代碼:
18.4. marked
- 類別:文件處理
- 官網:http://github.com/chjj/marked
- 簡介:
- Markdown 是一種輕量級的「標記語言」,它的優點很多,目前也被越來越多的寫作愛好者,撰稿者廣泛使用。因此顯示Markdown格式的需求則隨之而來,marked就能很好處理這個需求
- 代碼:
轉載于:https://my.oschina.net/u/1416844/blog/915816
總結
以上是生活随笔為你收集整理的Node系列——Node第三方模块使用总结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [转载]织梦后台添加新变量-内容模型
- 下一篇: CentOS 7 防火墙开启了哪些服务和