What's the difference between Express Generator and KrakenJS?

424 views Asked by At

I'm new to Node development and have started using express recently. I begin my projects using express generator which lays out the file structures and organizes routes, views, etc for me. I went to KrakenJS' website recently and saw that it does the same thing, saying it organizes routes and stuff into separate folders. So I was wondering what the difference or advantage of using one or the other? From my understanding, they do the same thing. Please inform me if I'm wrong.

2

There are 2 answers

0
Lenny Markus On BEST ANSWER

To further expand on @theoutlander's answer, KrakenJS acts more like a configuration layer on top of express.

It bundles together several modules that have been created (and open sourced) by PayPal to enhance the functionality of a plain vanilla express server.

Kraken was initially built to satisfy enterprise concerns, so it may be overkill for small projects, but it does offer some very nice convenience features out-of-the-box:

A couple of examples: (Note: If you see a feature you're interested in, but don't want the whole bunch, it can be cherry picked and added to a plain express app; as they're all separate modules)

  • Security: Provided by the lusca module. Gives you protection for XSS, CSRF, X-Frame headers, an many more OWASP best security practices.

  • Environment-specific configuration: Provided by the confit module. One of the more useful features, in my opinion. You can separate configuration "profiles" for your application. (eg: One configuration specific to the machine you develop on, vs one that's completely different from your final deploy environment)

  • Middleware management: Provided by the meddleware module. Let's you control the order in which middleware loads, and it's configuration as an external configuration to the app. Keeps your code clean, and it's very powerful when combined with confit

These are just a few of the ones I find most useful, but there's a ton more that Kraken provides to make your life easier as an express dev.

0
Nick On

Express Generator will scaffold an Express app instance. KrakenJS is built on top of Express and they define certain conventions. Part of of those conventions when generating a kraken app is the app structure. I would recommend getting familiar with Express first and then jump on to using Kraken.