Nodejs >= 16.0.0 required.
npm install node-dict -g
dict [word]
$ dict hello
Output:
✔ [bing] hello
美[heˈləʊ],英[həˈləʊ],int. 你好;喂;您好;哈喽; 网络释义: 哈罗;哈啰;大家好;
Usage: dict <word>
-h, --help Show help message
--bing Set Bing dictionary as default. (default)
--youdao Set Youdao dictionary as default
-d, --default Show default dictionary.
-v, --version Show version number
npm i node-dict
import { nodeDict } from 'node-dict'
const result = await nodeDict('hello')
console.log(result)
output:
{
crawler: 'bing',
source: 'test',
result: '美[test],英[test],v. 试验;测试;检测;测验; n. 试验;检测;考试;测验; 网络释义: 检验;考验;睾酮(testosterone); '
}