Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to enable strict mode in node by default?

I've just started (learning while working) a new project in nodejs. I'm gonna use ES5 & ES6 (need to know the features of ES6). Well, IMO, using "use strict" in every file is a tedious task and looking for the ways of enabling strict mode by default so that I don't need to write this line in every file. As i don't have any old code so no worry of backward compatibility. Can any one help me enabling strict mode by default in java script?

like image 538
FullMoon Avatar asked Oct 23 '15 17:10

FullMoon


1 Answers

You can use

$ node --use-strict

to start your app in strict mode.
See Any way to force strict mode in node? for other method.

like image 195
TGrif Avatar answered Oct 10 '22 05:10

TGrif