Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dictcc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dictcc

Unofficial dict.cc translation client

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dictcc

npm version Node CI GitHub issues GitHub license PRs Welcome

dictcc is a client for the dict.cc dictionary service. It returns a list of translations for a given term for a given source and target language.

Installation

npm i dictcc

# or
yarn add dictcc

Usage Example

/**
 * `translate` translates a `term` from a language (`sourceLanguage`) into another
 * language (`targetLanguage`).
 *
 *  `Languages` represents supported languages
 */
import translate, { Languages } from 'dictcc'

const getTranslation = async () => {
  const { data, error, url } = await translate({
    sourceLanguage: Languages.en,
    targetLanguage: Languages.de,
    term: 'home',
  })

  return data
}

A result looks something like this:

[
  {
    "sourceTranslation": {
      "text": "home",
      "meta": {
        "abbreviations": [],
        "comments": ["at home"],
        "optionalData": [],
        "wordClassDefinitions": ["adv"]
      }
    },
    "targetTranslation": {
      "text": "daheim",
      "meta": {
        "abbreviations": [],
        "comments": ["bes. südd., österr. u. schweiz."],
        "optionalData": [],
        "wordClassDefinitions": []
      }
    },
    "targetTranslationAudioUrl": "https://www.example.com/audio/daheim.mp3"
  }
]

License

MIT

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Stefan Natter
Stefan Natter

🤔 💻
Juan Rodriguez
Juan Rodriguez

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 14 Feb 2023

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