sphinxknight / compat-tester Goto Github PK
View Code? Open in Web Editor NEWNPM package to statically analyze the compatibility of a web page across a given browser scope
Home Page: https://www.npmjs.com/package/compat-tester
NPM package to statically analyze the compatibility of a web page across a given browser scope
Home Page: https://www.npmjs.com/package/compat-tester
Provide a more detailed documentation about the type of arguments needed and the output when compat-tester is used as a module.
(i.e. improve this)
E.g. if CSS uses user-select
with a prefix, being able to detect -moz-user-select
and report accordingly.
So far, only element-specific attributes are detected. Since data have been added to the browser-compat-data
repo, the tool should detect such attributes and report accordingly.
Testing on an env w/ a proxy causes a connection error.
compat-tester --init
should provide a set a questions in order to create the scope.json
file
Here's the code:
const ct = require('compat-tester');
let report = ct.htmlFileAnalyzer('new-tab.html', 'scope.json');
console.log(report);
It's in a file called 'Index.js', run with:
node index.js
It gives this output:
Using index.html as the root and scope.json as the scope descriptor
undefined
events.js:165
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open 'index.html'
Emitted 'error' event at:
at fs.js:2068:12
at FSReqWrap.oncomplete (fs.js:153:20)
Currently, specifying --help results in an error:
$ compat-tester --help
fs.js:651
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'scope.json'
at Object.fs.openSync (fs.js:651:18)
at Object.fs.readFileSync (fs.js:553:33)
at Object.<anonymous> (/Users/sheppy/.nvm/versions/node/v8.1.2/lib/node_modules/compat-tester/index.js:69:29)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
Ideally, this should provide usage information instead.
When installing compat-tester as a command-line tool, installing a manpage as well would be helpful.
Trying to use compat.htmlFileAnalyzer()
(the module way) I'm facing an error:
if((options.contrib === "true" || options.contrib === "all" ) && versionAddedElem === true){
^
TypeError: Cannot read property 'contrib' of undefined
But as far as I understand, there's no way to provide options when using compat-tester as a module, is there?
Add a feature so that we can report vs. https://github.com/mdn/browser-compat-data/tree/master/css/selectors
We might need to introduce a graph of the assets.
It maybe useful to restrict this with a -r option to recursively follow links
ee
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.