You might love these packages
In this article, I’m going to talk about essential libraries.
The first library I want to talk about is date-fns. Date-fns is also known as date functions. This library is a collection of hundreds of functions.
With these functions, you can add days to a date, compare dates, format dates, etc. You can get anything related to the
Date function in this library.
Here is some sample code:https://www.npmjs.com/package/date-fns
Date object directly.
According to WebFX, “The library is a wrapper for the
Some believe Moment.js is better because it allows you to import only the part of the
Date function that you need.
It has zero dependencies, which means this library will be incredibly small since you’re only going to be using it in development.
It’s nice because you don’t have to download a bunch of different node modules to work with your application. Its zero-dependency module loads environment variables from a
.env file into
Socket.IO makes doing WebSocket real-time communication between servers and all of the different clients a breeze.
But what exactly does this library do?
If we go to the documentation, we can see that we need to set up a fundamental server. Socket.IO is built on top of the WebSockets API and Node.js.
It consists of:
- A Node.js server.
Some implementations in other languages are also available
Here is some sample code:https://www.npmjs.com/package/socket.io
UUID is called “shortid,” and it’s incredibly popular. It’s mainly used to create short non-sequential URL-friendly unique IDs.
It is very secure because cryptographically strong random values create unique IDs. UUIDs are generally used for identifying information that needs to be unique within a system or network.
You do not want a database to control the identity of records centrally.
Here is some sample code to generate a UUID:https://www.npmjs.com/package/uuid
Axios is everybody’s favorite
fetch replacement. It is used to create web requests very similarly to
fetch, but it’s so easy to use.
If you go to npm publisher, they say Axios is a “promise-based HTTP client for the browser and Node.js.” That means Axios makes it easy to send asynchronous HTTP requests to REST endpoints and perform CRUD operations.
So if you want to support old browsers, Axios is a great way to do that.
Here is some sample code:https://www.npmjs.com/package/axios
This is a simple and tiny library. It allows you to easily combine different class names based on specified conditions.
Here is some sample React code:https://www.npmjs.com/package/classnames
I hope you found this article useful. Thank you for reading.