Essential packages for Node.js newbies

uf4no

Antonio

Posted on December 12, 2018

Essential packages for Node.js newbies

Finding packages in NPM that solve certain problem or that just can make your life easier as a developer can be difficult, and even more if you're new to Node.js.

When I started learning Node I asked some of my friends (which were already working in JS projects) to tell me the packages they used the most so I could level up my skills. The list I got was very basic and I've been adding more packages to it whenever I've found the need to use them.

Searching here I found this post by @ben from last year and, although people suggested a lot of very useful packages, I think they are mostly for advance users.

I know this list is very short so maybe we can improve it together!

Backend:
- express: web application server framework
- body-parser: middleware for express
- hapi: another web framework with built in plugins for auth, caching, cookies... (@Jeremy Shore)
- axios: to send http requests.
- dotenv: load variables from a .env file as environment variables. Super useful to load different database details depending on local, staging and production.

Database:
- mongoose - Interact with MongoDB
- json-server - Creates a fake REST API from a JSON file. Super useful when working in front-end projects or to mock an external API.

Security, encrypt:
- jsonwebtoken: to generate ,validate and decode JWT
- bcrypt: encryption functions

Testing
- mocha: Testing framework
- chai: Assertion library
- jest: another test framework with coverage reports built in (@joelnet )
- chai-http: send http requests from your tests
- sinon: To create stubs
- nock: To create mocks
- nyc: To generate test coverage reports

Others:
- amqplib: For Rabbit MQ
- debug: prints debug messages in console
- watson: another debug library, has different levels of debug
- url: to parse URLs
- moment: to format dates
- lodash: helper functions to work with arrays, objects, numbers...

Plugins/code formatters:
- nodemon: restart app when changing files
- prettier
- eslint

What do you guys think? Which are the essential packages you think a newbie should know about? I'll try to keep this list updated as much as I can so it can be helpful to others :)

💖 💪 🙅 🚩
uf4no
Antonio

Posted on December 12, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related