jssl

JavaScript Spoken Lint

Usage no npm install needed!

<script type="module">
  import jssl from 'https://cdn.skypack.dev/jssl';
</script>

README

JSSL

JSSL is the acronym of JavaScript Spoken Lint

Background

There are a lot of tools that check/lint your code.

  • JSLint
  • JSHint
  • ESLint...

But there was not a tool to do the same speaking to the user what are the issues in his/her code.

Features

  • Easily Pluggable
  • Simple Usage
  • Get a mp3 report of your syntax and lint errors or get a mp3 congratulating for good work.
  • Using preferences you can define if you want:
    • Create the mp3 report in the same folder or in a different path.
    • Use your own lint extensions.
    • Listen the report one it has finished it.

Installation

Node

Dependencies:

npm install jssl --save

Usage

JSSL is very simple and pluggable.

Using your own extensions:

JSSL implements the basic rules to check your code but you can also create and use your own.

Adding one extension:

var myJsslExtension = require('./myJsslExtension');

jssl.registerExtension(myJsslExtension);

The previous code says JSSL to use your extension during the process of the file.

Adding a bunch of extensions:

var customExtensionsPath = './my/path/to/my/extensions'

jssl.setCustomExtensionsPath(customExtensionsPath); 

The previous code says JSSL to require all the extensions inside of the supplied path.

Generating the report:

JSSL only requires one file to analyze and it will go through all your code creating a mp3 file with all the errors in it using natural language.

Default usage.

var jssl = require('jssl');

jssl.process(sourceFilePath, outputFilePath)
    .then(function (output) {
        console.log('The mp3 file has been saved in:' + output);
    });

Only passing the file to analyze.

Using this approach the mp3 file will be stored in the same folder as the source.

var jssl = require('jssl');

jssl.process(sourceFilePath)
    .then(function (output) {
        console.log('The mp3 file has been saved in:' + output);
    });

Start listening the report once the file has been analyzed.

Using this approach the mp3 file will be stored in the same folder as the source.

var jssl = require('jssl');

jssl.process(sourceFilePath, outputFilePath, true)
    .then(function (output) {
        console.log('The mp3 file has been saved in:' + output);
    });

To get more information I recommend to read the use cases in tests.

Tests

To run the tests with NodeUnit:

npm install
npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Check that it still works: npm test
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D

History

0.1.0 - First release.

License

The MIT License (MIT)

Copyright (c) 2016 Tomás Corral

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.