Code Whisperer Code Whisperer - 7 months ago 33
Node.js Question

How to Skip Using "use strict" In Node.js 4.0+?


"use strict"
allows support for ES6 features, which Node 4.0 supports, in JavaScript code.

However, it is cumbersome to have this at the beginning of every single back-end code file.

Is there a way to configure Node to just assume
"use strict"
is always in use within an application?


You can pass the --use_strict command line option to the node command. This will treat all of your code as being in strict mode.

Alternately, you can use the package That way you don't have to give the command line argument each time.