PHPackages                             webignition/node-jslint-output-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. webignition/node-jslint-output-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

webignition/node-jslint-output-parser
=====================================

Parser for the output of reid / node-jslint, get lovely things such as a list of errors, error counts, % of content scanned, bunnies

2.0(8y ago)02.4k1MITPHPPHP &gt;=5.6.0

Since Mar 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/webignition/node-jslint-output-parser)[ Packagist](https://packagist.org/packages/webignition/node-jslint-output-parser)[ Docs](https://github.com/webignition/node-jslint-output-parser)[ RSS](/packages/webignition-node-jslint-output-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (13)Used By (1)

node-jslint-output-parser [![Build Status](https://camo.githubusercontent.com/2bf2a2ee4df8214aab1d25c3255bca9bcb2ef936de2bc77c51dead0acf57bbc4/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f77656269676e6974696f6e2f6e6f64652d6a736c696e742d6f75747075742d7061727365722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/webignition/node-jslint-output-parser)
=====================================================================================================================================================================================================================================================================================================================================================================================

[](#node-jslint-output-parser-)

Overview
--------

[](#overview)

PHP parser for the output of [reid/node-jslint](https://github.com/reid/node-jslint), get lovely things such as:

- a list of errors
- error counts
- % of content scanned
- bunnies

If you're building a PHP-based application that programmatically interfaces with node-jslint, this is for you.

Usage
-----

[](#usage)

### The "Hello World" example

[](#the-hello-world-example)

Running JSLint from the command line through node-jslint can give you a nice collection of error information to process:

```
node jslint.js --json /home/jon/www/gears.simplytestable.com/src/SimplyTestable/WebClientBundle/Resources/public/js/app.js

[
   "/home/jon/www/gears.simplytestable.com/src/SimplyTestable/WebClientBundle/Resources/public/js/app.js",
   [
      {
         "id":"(error)",
         "raw":"Missing 'use strict' statement.",
         "evidence":"    var nextTaskIdCollection = [];",
         "line":6,
         "character":5,
         "a":"var",
         "reason":"Missing 'use strict' statement."
      },
      {
         "id":"(error)",
         "raw":"Unexpected '{a}'.",
         "evidence":"    ",
         "line":7,
         "character":1,
         "a":"(space)",
         "reason":"Unexpected '(space)'."
      },
```

Let's parse that in a unit test and see what we can get:

```
