Skip to content

打开终端输入命令即可翻译,翻译结果基于nodejs爬虫获取

License

Notifications You must be signed in to change notification settings

satrong/node-dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-dict

Nodejs >= 16.0.0 required.

CLI Usage

Install

npm install node-dict -g

Usage

dict [word]

Example

$ dict hello

Output:

✔ [bing] hello
美[heˈləʊ],英[həˈləʊ],int. 你好;喂;您好;哈喽; 网络释义: 哈罗;哈啰;大家好;

Options

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

API Usage

Install

npm i node-dict

Usage

import { nodeDict } from 'node-dict'

const result = await nodeDict('hello')
console.log(result)

output:

{
  crawler: 'bing',
  source: 'test',
  result: '美[test],英[test],v. 试验;测试;检测;测验; n. 试验;检测;考试;测验; 网络释义: 检验;考验;睾酮(testosterone); '
}

About

打开终端输入命令即可翻译,翻译结果基于nodejs爬虫获取

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published