Node series - Summary of Node third-party module usage

Summary of mainstream modules in Node

1. Summarized by others

2. Database related

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

4. Full text search

5. Logs

6. Send an email

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

7. Texting

yunpian-sdk

8. Operate excel

npoi

9. Test

9.1. Unit Testing

9.2. e2e testing

9.3. Stress testing

9.4. Data Simulation

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. Event queue

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

node-schedule

12. WeChat related

  • wechaty

13. Forms

body-parse formable

14. Deployment

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. Artificial Intelligence

  • superscript

16. Tools

glob uuid xml2json async (flow control) axios fs-extra

17. Advanced gadgets

amqp bearcat(IoC,AOP)

18. Others

  • gm
    • image processing
    • http://github.com/aheckmann/gm
    • Introduction
      • ImageMagick and GraphicsMagick are mainly used to create, edit, and synthesize images. They can read, convert, and write pictures in many formats. Picture cutting, color replacement, application of various effects, picture rotation, combination, text, straight line, polygon, ellipse, curve, attached to picture stretching and rotation.
      • The gm module implements the related functions of ImageMagick and GraphicsMagick, allowing us to easily perform image-related operations in Node
  • sharp
    • Mainly used for image processing, compared to ImageMagick and GraphicsMagick, the processing speed will be four or five times faster. Mainly supports JPEG, PNG, WebP, TIFF, GIF and SVG images
    • http://github.com/lovell/sharp

18.1. spritesmith

  • Category: Image Processing
  • Official website: http://github.com/ensighten/spritesmith
  • Introduction:
    • SSSprites are called css sprites by many people in China, which is a kind of web page image application processing method. It allows you to include all the sporadic pictures involved in a page into a large picture, so that when visiting the page, the loaded pictures will not be displayed slowly one by one as before .
    • The spritesmith module is to generate CSSSprites from multiple images and combine them into one image
  • Code:
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

  • Category: Color Manipulation
  • Official website: https://github.com/bgrins/TinyColor
  • Introduction:
    • In daily development, we often deal with the conversion of some color values, and TinyColor comes in handy, which can easily convert color values.
  • Code:
var color = tinycolor("red");

color.getFormat(); // "name"

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

color.getFormat(); // "rgb"

18.3. pdfkit

  • Category: Document Processing
  • Official website: http://github.com/devongovett/pdfkit
  • Introduction:
    • At first, generating PDF files may seem like a tedious task, but with PDFKit, this task is much easier. But for the PDFKit module of Node.js, not many people know it, which is surprising. Working with PDF files is very easy thanks to the PDFKit module, which saves you from all the complicated work and provides a simple API written in CoffeeScript (also available as plain Javascript)
  • Code:
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

  • Category: Document Handling
  • Official website: http://github.com/chjj/marked
  • Introduction:
    • Markdown is a lightweight "markup language". It has many advantages and is widely used by more and more writing enthusiasts and writers. Therefore, the need to display Markdown format comes along, and marked can handle this requirement very well.
  • Code:
var marked = require('marked');

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

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482545&siteId=291194637