EventEmitter
EventEmitter is a Node native class containing a set of methods to operate on the events.
copy
EventEmitter is a Node native class containing a set of methods to operate on the events.
copy
Node comes with a full support for setting up a HTTP server. With a few lines of code you can build a simple web server.
copy
Each file in your Node application represents a module and it has its own scope. Therefore to access data or functionality from another file/module you need to make them public within your application. To do that use Export method on the Module object.
copy
Global object is an equivalent of the Window object available in the browser environment. The main difference between the two is that new variables and functions created in the top scope of the application are added to the Window object in the browser environment but not in Node. In Node, they are scoped to the file (module) they have been declared in.
copy
Dirname argument belongs to module wrapper function and it stores the absolute path to the module.
copy
Filename argument belongs to module wrapper function and it stores the module name including the absolute path to the file.
copy
Run this command to check Node version. You can also use the shorthand "-v".
copy
OS module is a native Node module giving you access to operating system information like memory, architecture, uptime and many more.
copy
Parse a method belonging to the Path native Node module. A parsed path returns an object containing directory, module base name, extension and the file name.
copy
Read directory (readdir) is a method belonging to the Node native file system module (fs). reddir is an asynchronous method and it used a javascript promise to return an error or an array with a list of filenames located in the given directory.
copy
Require is a Node specific function letting you add exported functionality and/or data from other modules. The function takes an argument for the module location. The ".js" file extension is optional. It's also a good practice to use constants when assigning required modules.
copy
To start a script in node simply point to the file.
copy