Node体系——Node第2方模块使用总计

Node中主流模块汇总

壹. 别的人总括的

2. 数据库相关

Drivers
    PostgreSQL - 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 / ORM
    Sequelize - 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 builder
    Knex - Query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.
Other
    NeDB - Embedded persistent database written in JavaScript.
    Lowdb - Small JavaScript database powered by Lodash.

3. 爬虫

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

9. 测试

九.一. 单元测试

9.2. e2e测试

玖.三. 压力测试

⑨.四. 数目模拟

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.

十. 事件队列

  • 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.

1一. 定时任务

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.

一五. 人造智能

  • superscript

16. 工具类

glob uuid xml二json async(流程序调控制) axios fs-extra

一柒. 高级玩意

amqp bearcat(IoC,AOP)

18. 其他

  • gm
    • 图表处理
    • http://github.com/aheckmann/gm
    • 简介
      • ImageMagick和GraphicsMagick首要用来图片的始建、编辑、合成图片。它们得以读取、调换、写入二种格式的图片。图片切割、颜色替换、种种功能的接纳,图片的转动、组合,文本,直线,多边形,椭圆,曲线,附加到图片张开旋转。
      • gm模块完毕了ImageMagick和GraphicsMagick的相关职能,让我们很便宜的在Node中开始展览图片的相干操作
  • sharp
    • 重大用于图片的拍卖,比较ImageMagick 和 GraphicsMagick
      ,处理速度会快四5倍。主要帮衬JPEG,PNG,WebP,TIFF,GIF 和 SVG
      images
    • http://github.com/lovell/sharp

18.1. spritesmith

  • 项目:图片处理
  • 官网:http://github.com/ensighten/spritesmith
  • 简介:
    • SSPepsi-Colas在境内不少人叫cssSmart,是1种网页图片应用处理情势。它同意你将2个页面涉及到的富有零星图片都富含到一张大图中去,这样壹来,当访问该页面时,载入的图纸就不会像从前那样1幅壹幅地逐步展现出来了。
    • spritesmith 模块就是将两个图片生成 CSS七喜s 和 拼成一张图
  • 代码:

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

  • 类别:颜色处理
  • 官网:https://github.com/bgrins/TinyColor
  • 简介:
    • 在日常支出中,我们平时会处理部分颜色值的转移,正好TinyColor就派上用场了,能很有益于的开始展览颜色值的更改
  • 代码:

var color = tinycolor("red");

color.getFormat(); // "name"

color = tinycolor({r:255, g:255, b:255});

color.getFormat(); // "rgb"

18.3. pdfkit

  • 项目:文书档案处理
  • 官网:http://github.com/devongovett/pdfkit
  • 简介:
    • 发端,生成PDF文件就像是件很麻烦的任务,但有了PDFKit,那个任务就轻松多了。但对于Node.js的PDF基特模块,知道的人并不多,那倒是很想得到。有了PDFKit模块,处理PDF文件变得异常轻易,它让您制止了具有的繁杂工作,并提供用CoffeeScript(也足以视作普通版的Javascript使用)写成的总结的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

  • 品类:文件处理
  • 官网:http://github.com/chjj/marked
  • 简介:
    • 马克down
      是一种轻量级的「标识语言」,它的长处多数,最近也被越多的文章爱好者,撰稿者广泛应用。因而显得马克down格式的要求则随之而来,marked就能很好处理那一个供给
  • 代码:

var marked = require('marked');

console.log(marked('I am using __markdown__.'));

// Outputs: <p>I am using <strong>markdown</strong>.</p>