Search code examples
node.jsexpresskraken.js

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


My question is very straight forward, i.e If I start coding using Kraken can I get all the benefits of express framework? Its like If I use Spring can I get all the benefits of Java Or Servelet?

Because there is a Statement given "Kraken Give your node.js express apps some extra arms"

Can we use All the Packages(Plugins) which is supported for express in kraken based projects(Because there are 3828 packges which are dependent on expressjs)?

People are suggesting me to use express because it have large community support, more stack overflow questions etc. I am bit confused about kraken and express

Please see this Image


Solution

  • Yes you can. Kraken is just an express middleware:

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

    So, basically, you have all the power of Express at your disposal, with Kraken on top.


    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.

    From Using middleware.