Krakenjs Over Expressjs(如果我使用 Kraken JS,我可以获得 express js 的所有好处)

Krakenjs Over Expressjs (If I use Kraken JS can I get all the benefits of express js)

我的问题很直接,即如果我开始使用 Kraken 进行编码,我能否获得 express 框架的所有好处? 就像如果我使用 Spring 我可以获得 Java 或 Servelet 的所有好处吗?

因为给出了一个声明 "Kraken Give your node.js express apps some extra arms"

我们可以在基于 kraken 的项目中使用 express 支持的所有包(插件)吗(因为有 3828 个包依赖于 expressjs)?

人们建议我使用 express,因为它有大量的社区支持,更多的堆栈溢出问题等等。我对 kraken 和 express 有点困惑

请看这个 Image

是的,你可以。 Kraken 只是一个快速中间件:

var kraken = require('kraken-js'),
app = require('express')();
app.use(kraken(options));

所以,基本上,您可以随意使用 Express 的所有功能,而 Kraken 是最重要的。


Middleware functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.

Middleware functions can perform the following tasks:

  • Execute any code.
    • Make changes to the request and the response objects.
    • End the request-response cycle.
    • Call the next middleware function in the stack.

来自 Using middleware.