node frame

nodejs framework

Recent node to the fiery, led a large number of frameworks, such as

  • express
  • also
  • sails
  • loopback
  • thinkjs
  • egg

I am more than these is the framework, in order to be a simple introduction below

express

This is the most used framework, but also the entry of each recommended novice framework.

Node.js Express does not have the characteristics of secondary abstract, but on top of it extends the basic functionality required for Web applications (personal feeling is equivalent node in jquery)

  • Package routing
  • Static Resources Managed
  • The concept of middleware
  • Built jade, ejs template engine

Personal evaluation, express for small projects, not suitable for large enterprise-level projects, you can also use for personal use, as QuickStart is a good choice, then you can consider the road used to enter koa frame

koa2

koa is more advanced than express ideas framework, is express the same people to build

Koa biggest problem solving, the use async await new syntax features, to solve the problem of callback hell

koa and express the biggest difference, personally feel that there are three points:

1. that the processing method handler, express ordinary callback function, koa ES7 is the use of Async / Await features, no callbacks, no callback, greatly accelerate the speed of development in this regard has been enough to make us kneel lick

2.koa onion intermediate mode, the next execution time, calls will go to the next intermediate, and then executing the next intermediate is then performed on the next following code mezzanine

3.koa the request, response to the same package a context object content

Most express evolution does bring better development efficiency, cost only need to learn a new syntax features about async await the West. It can be said as an advanced framework express framework is very good for him

Behind these are enterprise-class framework

express = "after koa, the biggest problem is the lack of development time constraints, the development of a single person better, than when various directory structure, a variety of package options, flourishing coding style. All team developed a headache.

Because I did before php development framework using laravel very comfortable (elegant!), As well as supporting laravel-admin. I have been looking to improve the efficiency of development as a framework for this node laravel

Back to the topic, sails, loopback, thinkjs, egg are enterprise-class framework, how should we choose

Sails is based on the framework of a large and exrpess, MVC framework, designed to simulate familiar with the Rails framework Ruby on MVC pattern, but support the needs of modern applications. Bundled with a powerful ORM, namely Waterline. Automatically generated REST API

LoopBack Express is built on the basis of enterprise-class framework Node.js, simply write a small amount of code to create a dynamic end-REST API, consistent model of relationship and permission for API access control

ThinkJS 360 team is the launch of a Node.js framework for future development, the integration of a large number of project best practices, so that enterprise development has become so simple and efficient. Koa 2.x framework based on the underlying implementation is compatible with all the features Koa

Egg.js is "Ali's products" based on a Nodejs Node.js and Koa of enterprise-class application development framework that helps development teams and developers reduce development and maintenance costs. Egg.js is developed in accordance with the agreement, pursue the "convention over configuration", with the ability to provide customized based Egg upper frame,
highly scalable plug-in mechanism, built-in multi-process management, based on Koa development, excellent performance, stable framework, high test coverage, progressive development, development and maintenance costs and low.

 

Guess you like

Origin www.cnblogs.com/Yyf506918048/p/11803395.html