NodeJS API Quick Tour

Home / NodeJS API Quick Tour

NodeJS API Quick Tour

December 9, 2015 | Article | No Comments

Most programming language has shipped what it call as standard library. In NodeJS, there is a predefined library which we call API. All APIs are exactly a module, which can be included on source code.

Node provides a platform API that covers some aspects:

  1. process
  2. filesystem
  3. networking
  4. utilities

Note that we won’t cover all the object available, nor cover a material in details. For that purpose, you should go to http://nodejs.org/api/ instead.

Our list is also built only for stable modules. There are some unstable modules which may change later, for example crypto. We won’t cover that here.

[ Process ]

Node allows programmer to analyze process (environment variables, etc) and manage external processes. The involved modules are:

process

Inquire the current process to know the PID, environment variables, platform, memory usage, etc.

child_process

Spawn and kill new processes, execute commands and pipe their outputs

[ File System ]

Low-level API is also provided to manipulate files and directory. All the API is influenced by POSIX style.

fs

This is used for file manipulation, including: create, remove, load, write, and read files. This modules also used for create read and write streams.

path

Normalize and join file paths. It can also be used for checking whether a file exists or is a directory.

[ Networking ]

Used for networking purpose such as connecting, sending and receiving information over network.

net

This module is used for creating a TCP server or client.

dgram

This module is used for manipulating UDP packets, including receiving and send UDP packets.

http

Create an HTTP server or client. It is also a more specific version of net module.

tls

Transport Layer Security (TLS) is a successor of Secure Socket Layer (SSL) protocol. Node uses OpenSSL to provide TLS and/or SSL encrypted stream communication.

https

Implementing http over TLS/SSL.

dns

This module implement asynchronous DNS resolution.

[ Utilities ]

Various utilities for NodeJS.

util

A module which bundles various utility functions.

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial