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

@vviital/wooordhunter-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vviital/wooordhunter-api

## Motivation

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

Wooordhunter API

Motivation

This package provide asyncronize API for WooordHunt service for word translation.

Installation

To add this package to the project just run command:

  yarn add @vviital/wooordhunter-api

API

This package provide API for word translation and getting word tips. You can translate in both directions:

  • Russian -> English
  • English -> Russian

fetchWordTranslation

Usage
  const WooordhuntAPI = require('@vviital/wooordhunter-api');

  const options = { apiUri: 'https://wooordhunt.ru' };

  const API = new WooordhuntAPI(options);

  API
    .fetchWordTranslation('test')
    .then(translation => {
      console.log(translation);
    });
Options

Right now options has only one mandatory parameter apiUri which should have value https://wooordhunt.ru

Response format

Data in response depends on languge of requested word. Generally response have such format:

{
  commonMeanings: string[],
  language: 'english|russian',
  mainMeaning: string,
  nouns: string[],
  phrases: string[],
  transcription: {
    uk: string,
    us: string,
  },
  verbs: string[],
  word: string
}

fetchTips

  const WooordhuntAPI = require('@vviital/wooordhunter-api');

  const options = { apiUri: 'https://wooordhunt.ru' };

  const API = new WooordhuntAPI(options);

  API
    .fetchTips('test')
    .then(tips => {
      console.log(tips);
    });
Response format

Generally response have such format:

[
  {
      word: string,
      translation: string
  },
  ...
  {
      word: string,
      translation: string
  }
]

reconfigure

Generally you don't need this method

Actually WooordhunterAPI is a singelton and because of this we sometimes need to have possibility to reconfigure it. To do it - just invoke reconfigure method.

  const WooordhuntAPI = require('@vviital/wooordhunter-api');

  const wrongOptions = { apiUri: 'http://example.com' };

  const API = new WooordhuntAPI(options);

  const correctOptions = { apiUri: 'https://wooordhunt.ru' };

  API.reconfigure(correctOptions); // Now API has correct configuration

FAQs

Package last updated on 14 Jul 2018

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