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.
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...
If you troll page markup like me, you've no doubt seen the use of data URI's within image src attributes. Instead of providing a traditional address to the image, the image file data is base64-encoded and stuffed within the src attribute. Doing so saves...
Many times you'll see a form dynamically change available values based on the value of a form field. For example, a "State" field will change based on which Country a user selects. What annoys me about these forms is that they'll often do an...
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.