FullMoon
FullMoon

Reputation: 754

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?

Upvotes: 6

Views: 4597

Answers (1)

TGrif
TGrif

Reputation: 5941

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.

Upvotes: 9

Related Questions