Gathering detailed insights and metrics for @jkuebart/jslint
Gathering detailed insights and metrics for @jkuebart/jslint
Gathering detailed insights and metrics for @jkuebart/jslint
Gathering detailed insights and metrics for @jkuebart/jslint
npm install @jkuebart/jslint
Typescript
Module System
Node Version
NPM Version
77.5
Supply Chain
99.5
Quality
76.2
Maintenance
100
Vulnerability
99.6
License
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
126,412
Last Day
2
Last Week
9
Last Month
773
Last Year
10,240
Minified
Minified + Gzipped
Latest Version
20201106.0.0
Package Id
@jkuebart/jslint@20201106.0.0
Unpacked Size
1.46 MB
Size
300.64 kB
File Count
22
NPM Version
7.11.2
Node Version
16.1.0
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
50%
9
Compared to previous week
Last Month
-49.2%
773
Compared to previous month
Last Year
12.5%
10,240
Compared to previous year
2
This package provides Douglas Crockford's JSLint library as a Node.js package. The package version indicates the upstream »edition«.
Both a universal CommonJS/AMD module and an ECMAScript 6 module are provided.
Notable features of this package are:
The major version number of this package indicates the JSLint »edition« it contains. Multiple updates to JSLint on a single day are represented by increasing minor version numbers. The patch version indicates updates to this package itself.
This package can be installed using
$ npm install @jkuebart/jslint
The jslint
function expects up to three arguments source
,
option_object
and global_array
as explained in the JSLint
documentation.
1const jslint = require("@jkuebart/jslint"); 2 3const report = jslint(source, option_object, global_array);
The report
module which aids in formatting JSLint reports as HTML is also
included and can be loaded like this:
1const jslintReport = require("@jkuebart/jslint/dist/report.min.js");
For more detailed examples, see the documentation.
This package makes it quite simple to create a basic website similar to JSLint's.
1<!DOCTYPE html> 2<meta charset="utf-8"> 3 4<title>JSLint Node package demo page</title> 5 6<script type="module"> 7 import jslint from "//unpkg.com/@jkuebart/jslint/dist/jslint.min.js"; 8 import report from "//unpkg.com/@jkuebart/jslint/dist/report.min.js"; 9 10 const $ = document.querySelectorAll.bind(document); 11 12 document.addEventListener("DOMContentLoaded", function () { 13 const error = $("#error")[0]; 14 const source = $("#source")[0]; 15 const update = $("#update")[0]; 16 17 update.onclick = function update() { 18 error.innerHTML = report.error(jslint(source.value)); 19 } 20 }); 21</script> 22 23<div><textarea id="source"></textarea></div> 24<button id="update">JSLint</button> 25<pre id="error"></pre>
If you're having to support browsers which can't handle ES6 modules, you can fall back to the universal modules:
1<!DOCTYPE html> 2<meta charset="utf-8"> 3 4<title>JSLint Node package demo page</title> 5 6<script src="//unpkg.com/@jkuebart/jslint/dist/jslint.umd.min.js"></script> 7<script src="//unpkg.com/@jkuebart/jslint/dist/report.umd.min.js"></script> 8<script> 9 var $ = document.querySelectorAll.bind(document); 10 11 document.addEventListener("DOMContentLoaded", function () { 12 var error = $("#error")[0]; 13 var source = $("#source")[0]; 14 var update = $("#update")[0]; 15 16 update.onclick = function update() { 17 error.innerHTML = report.error(jslint(source.value)); 18 } 19 }); 20</script> 21 22<div><textarea id="source"></textarea></div> 23<button id="update">JSLint</button> 24<pre id="error"></pre>
Alternatively, CommonJS and AMD compatible loaders can also load the universal module.
Apart from a list of warnings, JSLint also returns a full abstract syntax tree of the given code. This can be useful for automatic refactorings, static analysis, and much more…
1const jslint = require("@jkuebart/jslint"); 2 3function dumpTree(tree) { 4 // ... 5} 6 7const report = jslint(source, option_object, global_array); 8dumpTree(report.tree);
A shell script is provided for building new packages when this project or the upstream project is updated. It can be run using
npm run editions
This creates branches and tags based on the »edition« of the upstream project. Packages still need to be generated and published manually.
The local branches and tags can be viewed using
npm run show-branches
npm run show-tags
This can be used to automate some tasks, for example:
npm run show-branches --silent |
while read b
do
git push --set-upstream origin "${b#refs/heads/}:${b#refs/heads/}"
done
or
npm run show-tags --silent |
while read t
do
git checkout "${t#refs/tags/}"
npm publish --access public
done
To easily remove automatically created local branches and tags, use
npm run reset
There is also a shell script that determines whether the upstream project has new commits.
npm run show-branches --silent |
npm run uptodate --silent
No vulnerabilities found.
No security vulnerabilities found.