#Node.js
2 posts

What is Deno and will it Replace NodeJS?

For the past 2 years, Ryan Dahl has been speaking about the shortcomings of NodeJS. He is now attempting to resolve those problems with NodeJS.
Read more

What is Deno and will it Replace NodeJS?

JS Programming Language
Courtesy: Toggl

For the past 2 years, Ryan Dahl has been speaking about the shortcomings of NodeJS. He is now attempting to resolve those problems with NodeJS. Let's take a look at some of the promises made by Deno:

  • Security is integrated into the language. Via CLI arguments you can enable/disable access to a filesystem or network resources to a Deno script. This is a huge boon for operations folks.
  • Unlike NodeJS, the standard library for Deno is more featureful and works well independently. You only require dependencies for complex tasks.
  • Typescript is a first-class citizen and requires no extra tooling for it to work in Deno. No more tranpilation!
  • Bid farwell to node_modules/. To me, this is the biggest advantage of Deno. All dependencies are part of the binary itself and don't require an external folder as a cache.
  • Better tooling all around. An improved debugger (which is essential), test runner and file watcher are just a few of the things.

This is an exciting new development in the programming world. We are all looking forward to see how Deno performs against real-world production use-cases.

Full Post here, 6 mins read

5 ways to make HTTP requests in Node.js

Request is a simplified HTTP client which is more user-friendly that you can install as a dependency from npm. It is easy to use and you can support Promises with the request-promise library.
Read more

5 ways to make HTTP requests in Node.js

  • You can use the default HTTP module in the standard library. It saves you the trouble of installing external dependencies but is not as user-friendly as other solutions.
  • Request is a simplified HTTP client which is more user-friendly that you can install as a dependency from npm. It is easy to use and you can support Promises with the request-promise library.
  • Axios is a Promise-based client for both the browser and Node.js, good for asynchronous code and more complex uses. It parses JSON responses by default and can handle multiple concurrent requests with axios.all.
  • SuperAgent, that is primarily used for Ajax requests in the browser, also works in Node.js. It offers functions like query() that you can chain on to requests to add parameters, and as with Axios, you don’t need to parse JSON responses yourself.
  • Got is a more lightweight library compared to Request, etc. Got work with Promises as well.

Full post here, 4 mins read