我可以使用命令行

    技术2022-07-11  133

    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.

    每个前端开发人员都应该熟悉CanIUse ,该网站可让您查看浏览器对浏览器功能的支持。 当人们批评我的博客文章未详细说明浏览器对文章功能的支持时,我告诉他们检查CanIUse:始终保持最新,这与任何博客上的文章不同。 当我知道要使用CanIUse网站时,我最近发现Sam Gentle有一个随附的Node.js CanIUse模块来查找浏览器支持。

    To install the utility, use a typical npm install command:

    要安装该实用程序,请使用典型的npm install命令:

    # 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:

    使用caniuse命令,您可以从命令行查找功能支持:

    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.

    结果的显示很漂亮,如果查找不明确,它会列出不同的匹配功能。 而且由于我们可以自动获取此信息,因此您可能可以使用cURL和其他工具编写不错的刮板。

    翻译自: https://davidwalsh.name/caniuse-command-line

    Processed: 0.020, SQL: 9