最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to enable strict mode in node by default? - Stack Overflow

programmeradmin0浏览0评论

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 patibility. Can any one help me enabling strict mode by default in java script?

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 patibility. Can any one help me enabling strict mode by default in java script?

Share Improve this question asked Oct 23, 2015 at 17:22 FullMoonFullMoon 7546 silver badges21 bronze badges 1
  • 2 Possible duplicate of Any way to force strict mode in node? – baao Commented Oct 23, 2015 at 17:45
Add a ment  | 

1 Answer 1

Reset to default 9

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.

发布评论

评论列表(0)

  1. 暂无评论