Socket
Socket
Sign inDemoInstall

node-dict

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 3.0.0

bin/dict.mjs

45

package.json
{
"name": "node-dict",
"version": "2.0.1",
"description": "terminal dict",
"version": "3.0.0",
"description": "Easy to translate in the terminal",
"type": "module",
"bin": {
"dict": "./bin/dict"
"dict": "./bin/dict.mjs"
},
"main": "index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"main": "dist/index.js",
"packageManager": "pnpm@8.10.5",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "tsx test/index.test.ts",
"build": "tsup",
"dev": "NODE_ENV=development tsx src/cli.ts"
},
"keywords": [
"dict",
"node dict"
"terminal dict",
"translate"
],
"dependencies": {
"cheerio": "~1.0.0-rc.2",
"ora": "^3.0.0",
"request": "~2.87.0"
"axios": "^1.6.8",
"ora": "^8.0.1"
},

@@ -30,5 +41,15 @@ "author": "satrong",

"engines": {
"node": ">= 8.0.0"
"node": ">= 16.0.0"
},
"license": "ISC"
}
"license": "ISC",
"devDependencies": {
"@types/node": "^20.12.7",
"tsup": "^8.0.2",
"tsx": "^4.7.2",
"typescript": "^5.4.5"
},
"files": [
"dist",
"bin"
]
}

@@ -1,2 +0,9 @@

# 安装 / Install
# node-dict
> Nodejs >= 16.0.0 required.
### CLI Usage
#### Install
```bash

@@ -6,4 +13,58 @@ npm install node-dict -g

# 使用 / Usage
1. 打开终端;
2. 输入命令`dict hello`
#### Usage
```bash
dict [word]
```
#### Example
```bash
$ 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
```js
import { nodeDict } from 'node-dict'
const result = await nodeDict('hello')
console.log(result)
```
output:
```js
{
crawler: 'bing',
source: 'test',
result: '美[test],英[test],v. 试验;测试;检测;测验; n. 试验;检测;考试;测验; 网络释义: 检验;考验;睾酮(testosterone); '
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc