Most used NPM Packages in Node Js
Here are some most used NPM packages in Node Js :
Lodash is particularly useful if you’re working with lots of numbers, digits, arrays, etc.
The best thing about Lodash is that it is available for usage in different formats and packages. That way, web developers can use this NPM package with greater flexibility.
Socket.IO is a library that enables real-time, bidirectional and event-based communication between the browser and the server.
A real-time application (RTA) is an application that functions within a period that the user senses as immediate or current.
Some examples of real-time applications are –
- Instant messengers − Chat apps like Whatsapp, Facebook Messenger, etc. You need not refresh your app/website to receive new messages.
- Push Notifications − When someone tags you in a picture on Facebook, you receive a notification instantly.
- Collaboration Applications − Apps like google docs, which allow multiple people to update same documents simultaneously and apply changes to all people's instances.
- Online Gaming − Games like Counter Strike, Call of Duty, etc., are also some examples of real-time applications.
Nodemailer is a Node. js module that allows you to send emails from your server with ease. Whether you want to communicate with your users or just notify yourself when something has gone wrong, one of the options for doing so is through mail.
It is useful for below resons:
Zero dependencies on other modules
- Secure emails delivery
- HTML content or embedded attachments
- Unicode support
- Various transport options besides
Pug is a template engine for Node and for the browserIt compiles to HTML and has a simplified syntax, which can make you more productive and your code more readable. Pug makes it easy both to write reusable HTML, as well as to render data pulled from a database or API.
Pug is a templating language. Pug has powerful features like conditions, loops, includes, mixins using which we can render HTML code based on user input or reference data.
It is used to generate HTML. Why not write the HTML directly? For one, Pug requires a lot less typing. More importantly, as a templating language, Pug has many features that HTML does not, such as simple coding constructions like conditional and case statements. It also has the ability to import other files, allowing reuse of sections of code, which is not possible in HTML directly.
Mocha is a testing library for Node.js, created to be a simple, extensible, and fast.
It's one of the simplest test suites for Node.Js available and allows for fairly accurate reporting, asynchronous tests, test coverage reports and, most importantly, can use any assertion library.
It also cleans the state of the software being tested to ensure that test cases run independently of each other.
While it can be used with most assertion libraries, Mocha.js is commonly used with Chai, a popular assertion library for Node.js and the browser.
Mocha.js makes provision for creating test hooks. Hooks are basically logic that have been configured to run before or after tests. They are useful for setting up preconditions for tests or cleaning up resources after tests.
Passport is middleware for Node.js that makes it easy to implement authentication and authorization. Whether you are building your first login page or are an expert in all things identity, the documentation will help you understand Passport and use it in your applications.
Passport uses the concept of strategies to authenticate requests. Strategies can range from verifying username and password credentials, delegated authentication using Oauth (for example, via Facebook or Twitter ), or federated authentication using OpenID .
Before authenticating requests, the strategy (or strategies) used by an application must be configured.
- A nice API for working with datetimes
- Interval support (from time x to time y)
- Duration support (14 days, 5 minutes, 33 seconds)
- Parsing and Formatting datetimes, intervals, and durations
- Internationalization of strings using the Intl API
- Detailed and unambiguous math operations
- Built-in handling of time zones
- Partial support for multiple calendar systems
Yup separates the parsing and validating functions into separate steps. Cast() transforms data while validate checks that the input is the correct shape. Each can be performed together (such as HTML form validation) or seperately (such as deserializing trusted data from APIs).
1. Go to JSHint.com and paste your code in there on line text editor.
2. Install JSHint in your IDE.
- Atom: linter-jshint (must have Linter plugin installed)
- Sublime Text: JSHint Gutter and/or Sublime Linter
- Vim: jshint.vim or jshint2.vim
- Visual Studio: VSCode JSHint
Managing utilities can rapidly become overwhelming, Bower makes sure you stay in control by managing components. It categorizes every packages you are using, runs constant checks for any potential risks and helps in updating as well.
Bower is optimized for the front-end. If multiple packages depend on a package - jQuery for example - Bower will download jQuery just once. This is known as a flat dependency graph and it helps reduce page load.