Using Node.js CLI’s Nifty Option Arguments

Node.js’s CLI comes with a bunch of option arguments to suppress deprecation warnings, preserve symbolic links when resolving and caching modules, and many, many more, which is quite convenient in many cases.

Robin Schulz
Robin Schulz

--

I am using Node.js in its current version 7.9.0 and get tons of depreciation warnings and more I can easily suppress by using the - -no-deprecation argument when I run scripts like node - -no-deprecation old-stuff.js. There are plenty of other useful arguments you can use to debug your scripts or change the behavior of how Node.js will treat your scripts.

To see all the available option arguments, have a look at the official docs you can find here: https://nodejs.org/dist/latest-v7.x/docs/api/cli.html

Not using Node.js in version 7.x? No problem! Go to https://nodejs.org/dist/ where you get a directory listing of all available Node.js versions grouped by version numbers. Those folders contains all version - related binary/installation files as well as a snapshot of the version - related documentation page. In the case of version v0.10.26, you would land on https://nodejs.org/dist/v0.10.26/docs/api/.

Here are some arguments I use the most:

--interactive
--trace-events-enabled
--no-deprecation
--no-warnings

Cheers \w

--

--

Self-taught Full Stack Web Developer | Audio Engineer | Technology Evangelist | Blogger | Gamer | Streamer | Musician