日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Node系列——Node第三方模块使用总结

發(fā)布時(shí)間:2024/4/17 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Node系列——Node第三方模块使用总结 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

Node中主流模塊匯總

1. 其他人總結(jié)的

  • https://github.com/sindresorhus/awesome-nodejs#videos

2. 數(shù)據(jù)庫相關(guān)

  • express-session
    • 狀態(tài)保持庫
    • 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
DriversPostgreSQL - PostgreSQL client. Pure JavaScript and native libpq bindings.Redis - Redis client.LevelUP - LevelDB.MySQL - MySQL client.nano - CouchDB client.Aerospike - Aerospike client.Couchbase - Couchbase client.MongoDB - MongoDB driver. ODM / ORMSequelize - Multi-dialect ORM. Supports PostgreSQL, SQLite, MySQL.Bookshelf - ORM for PostgreSQL, MySQL and SQLite3 in the style of Backbone.js.Massive - PostgreSQL data access tool.Mongoose - Elegant MongoDB object modeling.Waterline - Datastore-agnostic tool that dramatically simplifies interaction with one or more databases.Iridium - MongoDB ORM with support for promises, distributed caching, preprocessing, validation and plugins.OpenRecord - ORM for PostgreSQL, MySQL, SQLite3 and RESTful datastores. Similar to ActiveRecord.orm2 - ORM for PostgreSQL, MariaDB, MySQL, Amazon Redshift, SQLite, MongoDB.firenze - Adapter-based ORM for MySQL, Memory, Redis, localStorage and more.pg-promise - PostgreSQL framework for native SQL using promises.Objection.js - Lightweight ORM built on the SQL query builder Knex. Query builderKnex - Query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use. OtherNeDB - Embedded persistent database written in JavaScript.Lowdb - Small JavaScript database powered by Lodash.

3. 爬蟲

  • cheerio
    • 網(wǎng)頁爬蟲處理,cheerio可以在服務(wù)端使用JQuery的類庫,比如操作DOM元素
    • http://github.com/cheeriojs/cheerio

4. 全文檢索

5. 日志

6. 發(fā)郵件

Nodemailer - The fastest way to handle email. emailjs - Send text/HTML emails with attachments to any SMTP server.

7. 發(fā)短信

yunpian-sdk

8. 操作excel

npoi

  • xlsx-populate
    • 操作excel
    • https://github.com/dtjohnson/xlsx-populate

9. 測(cè)試

9.1. 單元測(cè)試

9.2. e2e測(cè)試

9.3. 壓力測(cè)試

9.4. 數(shù)據(jù)模擬

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. 事件隊(duì)列

  • bee-queue
    • 封裝了redis的事件隊(duì)列 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. 定時(shí)任務(wù)

node-schedule

12. 微信相關(guān)

  • 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
    • 時(shí)間處理
    • http://github.com/moment/moment
  • validator
    • 在服務(wù)端和客戶端都可以進(jìn)行驗(yàn)證的模塊,常用的郵箱,網(wǎng)址,電話,信用卡等都支持
    • https://github.com/chriso/validator.js
  • ccap
    • 生成圖片驗(yàn)證碼
    • https://cnodejs.org/topic/50f90d8edf9e9fcc58a5ee0b
    • https://cnodejs.org/topic/50fd3b74df9e9fcc58e776a0

17. 高級(jí)玩意

amqp bearcat(IoC,AOP)

18. 其他

  • gm
    • 圖片處理
    • http://github.com/aheckmann/gm
    • 簡(jiǎn)介
      • ImageMagick和GraphicsMagick主要用于圖片的創(chuàng)建、編輯、合成圖片。它們可以讀取、轉(zhuǎn)換、寫入多種格式的圖片。圖片切割、顏色替換、各種效果的應(yīng)用,圖片的旋轉(zhuǎn)、組合,文本,直線,多邊形,橢圓,曲線,附加到圖片伸展旋轉(zhuǎn)。
      • gm模塊實(shí)現(xiàn)了ImageMagick和GraphicsMagick的相關(guān)功能,讓我們很方便的在Node中進(jìn)行圖片的相關(guān)操作
  • sharp
    • 主要用于圖片的處理,相比ImageMagick 和 GraphicsMagick ,處理速度會(huì)快四五倍。主要支持JPEG,PNG,WebP,TIFF,GIF 和 SVG images
    • http://github.com/lovell/sharp

18.1. spritesmith

  • 類別:圖片處理
  • 官網(wǎng):http://github.com/ensighten/spritesmith
  • 簡(jiǎn)介:
    • SSSprites在國內(nèi)很多人叫css精靈,是一種網(wǎng)頁圖片應(yīng)用處理方式。它允許你將一個(gè)頁面涉及到的所有零星圖片都包含到一張大圖中去,這樣一來,當(dāng)訪問該頁面時(shí),載入的圖片就不會(huì)像以前那樣一幅一幅地慢慢顯示出來了。
    • spritesmith 模塊就是將多個(gè)圖片生成 CSSSprites 和 拼成一張圖
  • 代碼:
var fs = require('fs');var Spritesmith = require('spritesmith');Spritesmith.run({src: [ __dirname + '/fork.png', __dirname + '/github.png', __dirname + '/twitter.png'],engine: require('canvassmith') }, function handleResult (err, result) { if (err) { throw err;} fs.writeFileSync(__dirname + '/canvassmith.png', result.image); result.coordinates, result.properties; });

18.2. TinyColor

  • 類別:顏色處理
  • 官網(wǎng):https://github.com/bgrins/TinyColor
  • 簡(jiǎn)介:
    • 在日常開發(fā)中,我們經(jīng)常會(huì)處理一些顏色值的轉(zhuǎn)換,正好TinyColor就派上用場(chǎng)了,能很方便的進(jìn)行顏色值的轉(zhuǎn)換
  • 代碼:
var color = tinycolor("red");color.getFormat(); // "name"color = tinycolor({r:255, g:255, b:255});color.getFormat(); // "rgb"

18.3. pdfkit

  • 類別:文檔處理
  • 官網(wǎng):http://github.com/devongovett/pdfkit
  • 簡(jiǎn)介:
    • 起初,生成PDF文件似乎是件很繁瑣的任務(wù),但有了PDFKit,這個(gè)任務(wù)就容易多了。但對(duì)于Node.js的PDFKit模塊,知道的人并不多,這倒是很意外。有了PDFKit模塊,處理PDF文件變得非常容易,它讓你避免了所有的復(fù)雜工作,并提供用CoffeeScript(也可以作為普通版的Javascript使用)寫成的簡(jiǎn)易的API
  • 代碼:
var PDF = require('pdfkit'); var fs = require('fs'); var text = 'ANY_TEXT_YOU_WANT_TO_WRITE_IN_PDF_DOC'; doc = new PDF(); doc.pipe(fs.createWriteStream('PATH_TO_PDF_FILE')); doc.text(text, 100, 100); doc.end();

18.4. marked

  • 類別:文件處理
  • 官網(wǎng):http://github.com/chjj/marked
  • 簡(jiǎn)介:
    • Markdown 是一種輕量級(jí)的「標(biāo)記語言」,它的優(yōu)點(diǎn)很多,目前也被越來越多的寫作愛好者,撰稿者廣泛使用。因此顯示Markdown格式的需求則隨之而來,marked就能很好處理這個(gè)需求
  • 代碼:
var marked = require('marked');console.log(marked('I am using __markdown__.'));// Outputs: <p>I am using <strong>markdown</strong>.</p>

轉(zhuǎn)載于:https://my.oschina.net/u/1416844/blog/915816

總結(jié)

以上是生活随笔為你收集整理的Node系列——Node第三方模块使用总结的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。