It provides ~80 rules (including ~40 bug detection), which represent the "Sonar Way" profile of the SonarJS analyzer.
> npm install -g sonarjs
> cd <directory of project to analyze> > sonarjs
MAJOR - S3923: /Users/path/to/foo/file.js [3, 6]: Remove this conditional structure or edit its code blocks so that they're not all the same. BLOCKER - OctalNumber: /Users/path/to/foo/file.js [3, 10]: Replace the value of the octal number (056) by its decimal equivalent (46).
> npm install sonarjs
analyzefunction to collect logs and to add some behavior before and after analysis
Note that SonarJS requires a JRE, so if it's not available on your machine (Java 1.8 version) it will be downloaded during the first analysis.