CanIUse Command Line
Every front-end developer should be well acquainted with CanIUse, the website that lets you view browser support for browser features. When people criticize my blog posts for not detailing browser support for features within the post, I tell them to check CanIUse: always up to date, unlike posts on any blog. While I know to use the CanIUse website, I recently found out that Sam Gentle has an accompanying Node.js CanIUse module for looking up browser support.
To install the utility, use a typical npm install
command:
# Install globally for less hassle
npm install -g caniuse-cmd
With the caniuse
command available, you can look up feature support from the command line:
The display of results is pretty and it provides a listing of different matching features if the lookup is vague. And because we can get this information in an automated way, you can probably write a decent scraper with cURL and other tools.
One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?
You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...
The MooTools Accordion plugin seems to be the plugin that people seem to have the most problems with. It's an awesome plugin, so I can see why so many people want to use it, but I think that may be part of the problem.
Every UI framework has the same set of widgets which have become almost essential to modern sites: modals, tooltips, button varieties, and notifications. One problem I find is each site having their own widget colors, styles, and more -- users don't get a consistent experience. Apparently the...
I need to get this hooked up to be an email responder bot! “Hey Steve does
${browserX}
support${featureY}
?” => auto respond ;-)How about just adding canIuse as a search engine to your browser, like so http://caniuse.com/#search=%s?
Simply typing “c webp” into my browser gives me even nicer formatted results.
Sadly the output is not very useful for automated processing. It would’ve been nice if this could be implemented in a gulp-task, scanning CSS for a defined set of supported browsers, and if a css-declaration wasn’t supported it would throw an error.
But as your example of ‘transform’ shows, it returns things like JPEG2000, so output parsing is required and tedious. Plus it seems that there is no option to print a simple boolean instead of fancy ticks and crosses.
There’s also this package available via npm.
https://www.npmjs.com/package/caniuse-api
Perhaps this would work better for that task.
Definitely an interesting article about this new npm tool, useful for those who like command line better then gui.