jscc
jscc copied to clipboard
Node Module
Very cool! What about creating a version of these checks as a standalone node module? That way it could be easily integrated into code sniffs or other static analysis tools.
:+1:
:+1:
:+1:
:+1: would love to integrate into build tasks
:+1:
I agree, this would useful to have as a standalone module which can be integrated into something else. I have no experience in making Node modules but I think I should be able to create a Grunt plug-in. Would be something you're interested in?
No doubt a grunt plugin would be conducive to a port to a node module. Plus - grunt plugin! All for it.
Grunt plugin would be fantastic. If you're able create a grunt plugin, if you create a separate file that you can require
into that grunt plugin, you should be easily able to turn that dependency into a standalone module
I believe the recommended way to create grunt plugins, is to make them wrappers around node modules. If no one else has time to look at this in the next couple of days, I can look into it later this week.
Yep yep ^^, should just be an interface/wrapper to your node module, so node module first, grunt plugin second. Really should be :cake:
Okay, so Node it is. Any suggestions as to what would make a good repository name? Perhaps node-jscc?
I think it would be preferable to have a library that works in the browser as well. Using something similar to this pattern perhaps
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = jscc;
} else {
window.jscc = jscc;
}
:+1:
Also module for Gulp would be nice :)
@d-simon Everything is already wrapped in a UMD pattern, so that is covered. I've refactored the way the compatibility data is loaded so it will be easier to have the data come from either an URL or the file system. I think a Node module should be possible without a huge effort.
I have a basic Node.js version available of the JSCC. It can consume a glob, loads the compatibility data and analyses the files matching the glob. I have no previous experience in building Node modules so I am sure there is room for improvement.
I also haven't build anything that reports the findings as I am not sure what would be the best way to go about it (write it to the console, put something in a file, etc). All ideas are more than welcome.
I am going to publish the code that I have to a new repository, I would appreciate if you can give feedback and suggestions for the Node.js version on the new repository.
@tbusser, cool, thanks for putting this together! Logging to the console with stdout would probably be the most helpful for the output (since it can be piped into anything), though a separate option for writing to a file might be a feature to add after (JSON format maybe?).
@andrewrota Thanks! Logging to the console it will be for now. Expect an update soon. The repository for the Node.js version is up and can be found here.
:+1:
Gulp would be nice!
here is a version made for gulp: https://github.com/mozesmagyar/gulp-browser-compat