是否可以在node.js的帮助下在Windows中以命令行运行JSLint? [英] is it possible to run JSLint as commandline in windows with help of node.js?
问题描述
我的意思是这样运行:
node.exe lint.js my_js_file.js
然后将其输出到控制台。
And then get output to a console.
我需要什么去下载 ?我是否只需要将 http://www.jslint.com/
保存到磁盘,然后获取一些附加的js文件,或者我需要为node.js寻找特殊版本?
What do I need to download ? Do I need just to save http://www.jslint.com/
to disk and then grab some attached js file or I need to look for special version for node.js ?
推荐答案
全局安装 jshint
,然后可以从命令中使用它
Install jshint
globally then you can use it from the command line.
npm install -g jshint
jshint testfile.js
所有这些都是假设您已经有个节点
和 npm
在Windows计算机上运行。
All this is assuming that you already have node
and npm
running on you windows machine.
编辑
我刚刚注意到我回答了 jshint
而不是 jslint
,正如其他答案指出的那样,它们是相似的但不相同。我的答案对两个都适用。
对于 jslint
:
Edit
I just noticed that I responded with an answer for jshint
instead of jslint
, the as the other answer points out, they are similar but not the same. My answer holds true for both though.
For jslint
:
npm install -g jslint
jslint testfile.js
这篇关于是否可以在node.js的帮助下在Windows中以命令行运行JSLint?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!