【文件属性】:
文件名称:is-unicode-supported:检测终端是否支持Unicode
文件大小:5KB
文件格式:ZIP
更新时间:2021-03-25 15:40:29
JavaScript
是unicode支持的
检测终端是否支持Unicode
这对于决定在命令行输出中使用Unicode字符还是回退ASCII字符很有用。
请注意,检查是非常幼稚的。 仅假设所有非Windows终端都支持Unicode和硬代码,而Windows终端确实支持Unicode。 但是,多年来我一直在一些流行的软件包中使用此逻辑,而没有出现问题。
安装
$ npm install is-unicode-supported
用法
const isUnicodeSupported = require ( 'is-unicode-supported' ) ;
isUnicodeSupported ( ) ;
//=> true
原料药
isUnicodeSupported()
返回有关终端是否支持Unicode的boolean 。
有关的
检查stdout或stderr是否是交互式的
color-检测
【文件预览】:
is-unicode-supported-main
----.gitignore(23B)
----package.json(734B)
----.npmrc(19B)
----index.js(313B)
----test.js(559B)
----.github()
--------workflows()
----license(1KB)
----readme.md(1KB)
----index.test-d.ts(118B)
----.gitattributes(19B)
----.editorconfig(175B)
----index.d.ts(243B)