New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

youdao-node

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youdao-node

youdaozhiyun sdk for nodejs

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

youdao-node

有道智云非官方Node.js SDK,API官方文档: http://ai.youdao.com/doc.s#docs

功能

  • 文本翻译
  • 图片文字识别翻译(支持base64或图片Url)

安装

$ yarn add youdao-node

引入

import youdao from 'youdao-node';

配置

youdao.config({
    appKey: <your appkey>,
    appSecret: <your appSecret>
});

注意: 需要到官网创建应用获取appKey和appSecret,并为服务添加相应的实例

主要功能

文本翻译
参数
  • content (String): 需要翻译的文本内容
  • from (String): 源语言(可设置为auto,默认为auto)
  • to (String): 目标(可设置为auto,默认为auto)

可翻译语言列表参考:http://ai.youdao.com/docs/doc-trans-api.s#p05

示例代码
const res = await youdao.translate({
    content: '你好',
    from: 'zh-CHS',
    to: 'EN'
});


图片文字识别翻译
参数
  • img (String): 需要翻译的图片base64或图片链接字符串
  • langType (String): 目前支持英文:en,和中英混合:zh-en,默认为zh-en
示例代码
const res = await youdao.ocr({
    img: <base64> || <imageUrl>
});

License

MIT

Keywords

FAQs

Package last updated on 27 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc