Skip to main content

Node.js

Features in node.js (v 17.9.1)

Node.js is used to run server side javascript, where what you written would be hidden to end user unlike browser based javascript. along with writing REST apis the node.js will alow many other features. Below is the list of features the Node.js have

  1. Assertion testing -- This module provide set of assertion functions to write test cases

  2. Asynchronous context tracking -- These classes are used to associate state and propagate it throughout callbacks and promise chains. They allow storing data through out the lifetime of a web request or any asynchronous duration

  3. Async hooks -- It will provide module to track asynchronous resources

  4. Buffer -- Buffer objects are used to represent a fixed-length sequence of bytes. Many node.js apis support buffers, it is a subclass of Uint8Array, though buffer class available in global scope it is still recommended to import explicitly

  5. C++ Addons -- Addons are dynamically-lined shared objects written in C++. The require can load C++ addons as ordinary Node.js modules. These addons provide interface to communicate between Javascript and C++ libraries

  6. Node-API (formerly N-API) -- The Node-API is independent from underlying Javascript runtime the V8, it is implemented as part of Node,.js itself. It is intended to insulate addons from changes in the underlying Javascript engine and allow modules for one major version to run on later major version of Node.js

  7. C++ embedder API -- Node.js provides many C++ APIs that can be used to execute Javascript in a Node.js env from other C++ softwares

  8. Child processes -- The child_process module provides the ability to spawn subprocesses in a manner that is similar, but not identical, to popen(3). i.e, it opens a process by creating a separate process

  9. Cluster -- The clusters of Node.js processes can be used to run multiple instances of Node.js

  10. Command-line Api -- Node.js comes with a variety of CLI options. These options expose built-in debugging, multiple ways to execute scripts, and other helpful runtime options.

  11. Console -- The console module provides a simple debugging console that is similar to the browser console

  12. Corepack (Experimental) -- Corepack is an experimental tool to help with managing version of your package managers. This will allow to use package mangers without installing them explicitly

  13. Crypto -- The crypto module provides cryptographic functionalities for the popular algorithms

  14. Debugger -- Node.js includes a command-line debugging utility.

  15. Deprecated APIs -- The list of deprecated apis due to unsafe, or improved alternate available, or breaking changes are expected in future

  16. Diagnostics Channel -- The diagnostics_channel module provides an API to create named channels to report arbitary message data for diagnostics purpose

  17. DNS -- The dns module enables name resolution. For example use it to lookup IP address of host names

  18. Domain (Soon going to deprecate) -- When a node.js app run in cluster, domains provide a way to handle multiple different IO operations as a single group. If an event subscribed to domain, when error thrown the domain object will be notified rather than losing the context of the error in the process.

  19. Errors -- Node.js will generally experience 4 kind of errors 1) Standard Javascript errors 2) System errors 3) User-specified errors (Code errors) 4) AssertionErrors all these kind of error handling can be done with this module

  20. Events -- Most of the Node.js core API is built around an idiomatic asynchronous event-driven archtecture, this module help emit /broadcast events and subscribe to them and do action.

  21. File system -- The Files system module allow to handle files and folders through node.js

  22. Globals -- This module will provide list of variables, methods that are globally available.

  23. HTTP -- This module will handle http server and client and support wide range of protocalls

  24. HTTP/2 -- The http2 module provides an implementation of the HTTP/2 protocol.

  25. HTTPS -- This module is to handle http over TLS/SSL layer.

  26. Inspector -- The inspector module provides an API for interacting with the V8 inspector

  27. Internationalization -- Node.js uses International Components for Unicode (ICU) to implement i18n features in native C/C++ code

  28. Modules: CommonJS modules -- CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the ECMAScript modules standard used by browsers and other JavaScript runtimes.
    In Node.js, each file is treated as a separate module.

  29. Modules: ECMAScript modules -- ECMAScript modules are the official standard format to package JavaScript code for reuse. Modules are defined using a variety of import and export statements.

  30. Modules: module API -- Provides general utility methods when interacting with instances of Module, the module variable often seen in CommonJS modules. Accessed via import 'module' or require('module').

  31. Modules: Packages -- A package is a folder tree described by a package.json file. The package consists of the folder containing the package.json file and all subfolders until the next folder containing another package.json file, or a folder named node_modules.
    This page provides guidance for package authors writing package.json files along with a reference for the package.json fields defined by Node.js.

  32. Net -- The net module provides an asynchronous network API for creating stream-based TCP or IPC servers (net.createServer()) and clients (net.createConnection()).

  33. OS -- The os module provides operating system-related utility methods and properties.

  34. Path -- The path module provides utilities for working with file and directory paths.

  35. Performance hooks -- This module provides an implementation of W3C (Web Performance APIs) and also some additional APIs to measure Node.js specific performance measurements

  36. Policies (Experimental) -- Node.js support this experimental feature where it is possible to control access and execution to certain modules through policies.

  37. Process -- the process object is instance of event emitter which provides information of node.js process

  38. Punycode (Deprecated) -- Punycode is a representation of Unicode with the limited ASCII character subset used for Internet hostnames. this module will allow to encode and decode punycode text

  39. Query strings -- This module provide utilities to parse and format URL query strings

  40. Readline -- The readline module provides an interface for reading data from a Readable stream (such as process.stdin) one line at a time.

  41. REPL -- The Read-Eval-Print-Loop implementation available in both standalone and other applications. The repl module exports the repl.REPLServer class. While running, instances of repl.REPLServer will accept individual lines of user input, evaluate those according to a user-defined evaluation function, then output the result. Input and output may be from stdin and stdout, respectively, or may be connected to any Node.js stream.

  42. Report (Diagnostic report) -- The report is intended for development, test and production use, to capture and preserve information for problem determination. It includes JavaScript and native stack traces, heap statistics, platform information, resource usage etc.

  43. Stream -- A stream is an abstract interface for working with streaming data in Node.js. The stream module provides an API for implementing the stream interface. There are many stream objects provided by Node.js. For instance, a request to an HTTP server and process.stdout are both stream instances. Streams can be readable, writable, or both. All streams are instances of EventEmitter.

  44. String decoder -- The string_decoder module provides an API for decoding Buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters.

  45. Timers -- The timer module exposes a global API for scheduling functions to be called at some future period of time. Because the timer functions are globals, there is no need to call require('timers') to use the API.

  46. TLS/SSL -- The tls module provides an implementation of the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.

  47. Trace events (Experimental) -- The trace_events module provides a mechanism to centralize tracing information generated by V8, Node.js core, and userspace code.

  48. TTY -- The tty module provides the tty.ReadStream and tty.WriteStream classes. In most cases, it will not be necessary or possible to use this module directly or should use require to import module. When Node.js detects that it is being run with a text terminal ("TTY") attached, process.stdin will, by default, be initialized as an instance of tty.ReadStream and both process.stdout and process.stderr will, by default, be instances of tty.WriteStream. The preferred method of determining whether Node.js is being run within a TTY context is to check that the value of the process.stdout.isTTY property is true

  49. UDP/datagram -- The dgram module provides an implementation of UDP datagram sockets. allow you to write websocket layers.

  50. URL -- The url module provides utilities for URL resolution and parsing.

  51. Utilities -- The util module supports the needs of Node.js internal APIs. Many of the utilities are useful for application and module developers as well which are like debuglogs,format strings, callbacks etc.

  52. V8 -- We know that Node.js runs on V8 and V8 is the engine that built on C++ and compails javascirpt to C++ and runs. This module provide little lo level access to V8 module and helps activities like serialize and deserialize data.

  53. VM -- The vm module enables compiling and running code within V8 Virtual Machine contexts. A common use case is to run the code in a different V8 Context. This means invoked code has a different global object than the invoking code.

  54. WASI (Experimental) -- WASI (WebAssembly System Interface) gives sandboxed WebAssembly applications access to the underlying operating system via a collection of POSIX-like functions.

  55. Web Crypto API (Experimental) -- This module provides an implementation of the standard Web Crypto API. The module help to generate keys using different cryptic algorithms, and also helps encode decode text through cryptography.

  56. Web Streams API (Experimental) -- The WHATWG Streams Standard (or "web streams") defines an API for handling streaming data. It is similar to the Node.js Streams API but emerged later and has become the "standard" API for streaming data across many JavaScript environments.

  57. Worker threads -- The worker_threads module enables the use of threads that execute JavaScript in parallel. To access it. Unlike child_process or cluster, worker_threads can share memory. They do so by transferring ArrayBuffer instances or sharing SharedArrayBuffer instances.

  58. Zlib -- The zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli.