{"id":24464,"date":"2019-08-14T18:10:48","date_gmt":"2019-08-14T10:10:48","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=24464"},"modified":"2019-08-13T21:31:03","modified_gmt":"2019-08-13T13:31:03","slug":"browser-compatibility-command-line-caniuse","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/","title":{"rendered":"How to Check Browser Compatibility via Command Lines"},"content":{"rendered":"<p>Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all.  Web developers these days would always refer to <a target=\"_blank\" href=\"https:\/\/caniuse.com\/\">CanIUse<\/a> to check if a certain feature is supported on a browser or one of its many versions.<\/p>\n<p>CanIUse keeps track of the browser adoption of standard HTML, CSS, and SVG along with their references, the specifications status from W3C, and links to the issues and bugs that present in each browser (when available).<\/p>\n<p>For instance, we can see below that  Edge, Firefox, and Opera Mini do not support <a target=\"_blank\" href=\"https:\/\/www.webkit.org\/blog\/182\/css-reflections\/\">CSS Reflection<\/a>, and in browsers that it is supported in, the vendor prefix is required.<\/p>\n<p>CanIUse is the <em>de facto<\/em> tool that records how far the standard web specifications compatibility in desktop and mobile browsers.<\/p>\n<p>Aside from the browser version through caniuse.com,  CanIUse is now also available as a CLI (Command Line Interface). We are also be able to pull out the CanIUse resultant via Terminal or Command Prompt.<\/p>\n<p>If you found yourself stumbling while on Terminal often, the CLI would effectively streamline your workflow.<\/p>\n<h2>Requirements<\/h2>\n<p>To deploy the CanIUse command line, you will first need <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/node-js-server-side-javascript\/\">NodeJS<\/a> and NPM installed.<\/p>\n<p>If running <code>npm -v<\/code> or <code>node -v<\/code> returns the version number (as shown below) you are ready to deploy the CLI. Otherwise, if it returns the \u201ccommand not found\u201d error, download <a target=\"_blank\" href=\"https:\/\/nodejs.org\/download\/\">the NodeJS installer here<\/a>.<\/p>\n<p>The installer is available for Windows, OS X, and Linux; select the OS you are using.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg\" height=\"450\" width=\"700\" alt><\/figure>\n<h2>The CLI<\/h2>\n<p>Installing the CanIUse CLI is just a line away. Open Terminal or Command Prompt and run the following command.<\/p>\n<pre>npm install -g caniuse-cmd<\/pre>\n<p>This command installs CLI globally which will allow it to be accessible throughout the location in the OS. Once installed, the command line <code>caniuse<\/code> should now be available at your disposal. There is no rule on how to \u201csearch\u201d via  CLI. Simply search naturally as you would  in the web version, e.g. running \u201ccaniuse box shadow\u201d will return the CSS3 Box-shadow specification.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/css-box-shadow-support.jpg\" height=\"450\" width=\"700\" alt><\/figure>\n<p>Notice that we do not need to escape the space for the keyword query, which we traditionally  would have to do.<\/p>\n<p>Basically, the CLI  results match the web version. Even if a search is done with an incomplete keyword, for example, <code>soc<\/code> or <code>sock<\/code> , the search will result with <strong>Web Socket<\/strong> at the top, followed by relevant entries.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/caniuse-soc.jpg\" height=\"450\" width=\"700\" alt><\/figure>\n<p>CanIUse is a perfect complement for other command line based tools like Gulp, Grunt, and is an all-round handy tool that could boost your workflow eventually. Now you don\u2019t have to leave your Terminal ever to check for browser compatibility for HTML, CSS, and SVG.<\/p>","protected":false},"excerpt":{"rendered":"<p>Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web developers these days would always refer to CanIUse to check if a certain feature is supported on a browser or one of its many versions. CanIUse keeps track of the&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[3053,316],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Check Browser Compatibility via Command Lines - Hongkiat<\/title>\n<meta name=\"description\" content=\"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Check Browser Compatibility via Command Lines\" \/>\n<meta property=\"og:description\" content=\"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-14T10:10:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Check Browser Compatibility via Command Lines\",\"datePublished\":\"2019-08-14T10:10:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/\"},\"wordCount\":442,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/browser-compatibility-command-line-caniuse\\\/node-npm-version.jpg\",\"keywords\":[\"Command Line\",\"Web Browsers\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/\",\"name\":\"How to Check Browser Compatibility via Command Lines - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/browser-compatibility-command-line-caniuse\\\/node-npm-version.jpg\",\"datePublished\":\"2019-08-14T10:10:48+00:00\",\"description\":\"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/browser-compatibility-command-line-caniuse\\\/node-npm-version.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/browser-compatibility-command-line-caniuse\\\/node-npm-version.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/browser-compatibility-command-line-caniuse\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Check Browser Compatibility via Command Lines\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Check Browser Compatibility via Command Lines - Hongkiat","description":"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/","og_locale":"en_US","og_type":"article","og_title":"How to Check Browser Compatibility via Command Lines","og_description":"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web","og_url":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2019-08-14T10:10:48+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Check Browser Compatibility via Command Lines","datePublished":"2019-08-14T10:10:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/"},"wordCount":442,"commentCount":8,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg","keywords":["Command Line","Web Browsers"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/","url":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/","name":"How to Check Browser Compatibility via Command Lines - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg","datePublished":"2019-08-14T10:10:48+00:00","description":"Building a website traditionally involves a variety of technologies which may work across all major browsers, some of them partially, or none at all. Web","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/browser-compatibility-command-line-caniuse\/node-npm-version.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/browser-compatibility-command-line-caniuse\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Check Browser Compatibility via Command Lines"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-6mA","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=24464"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24464\/revisions"}],"predecessor-version":[{"id":48416,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24464\/revisions\/48416"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=24464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=24464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=24464"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=24464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}