šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

mw-dict

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mw-dict

**Node.js Wrapper for Merriam Webster Dictionary Developer API**

3.0.0
latest
npm
Version published
Weekly downloads
15
200%
Maintainers
1
Weekly downloads
Ā 
Created
Source

mw-dict

Node.js Wrapper for Merriam Webster Dictionary Developer API

  • Supports CollegiateĀ® Dictionary & Learner's Dictionary
  • Supports CollegiateĀ® Thesaurus
  • Exports word senses with hierarchy (sense, subsense...)
  • Outputs pronunciation audio url
  • Cares about functional label, synonyms, verbal illustrations ...
  • Outputs popularity

Preview:

'screen shot'

Note: Please get your API Key from Merriam-Webster's Developer Center

install

npm install mw-dict

usage

import { CollegiateDictionary, LearnersDictionary } from 'mw-dict'

const dict = new CollegiateDictionary(API_KEY)
// const dict = new LearnersDictionary(API_KEY)

dict
  .lookup(QUERY_WORD)
  .then(result => {})
  .catch(error => {})

result interface

// result: Definition[]
// Definition
{
  word: String,
  functional_label: String,
  pronunciation: String[],
  definition: Sense[],
  popularity: String
}
// Sense
{
  number: String,
  meanings: String[],
  synonyms: String[],
  antonyms: String[],
  illustrations: String[],
  senses: Sense[]
}

Error handler

import { WordNotFoundError } from 'mw-dict'

dict
  .lookup(QUERY_WORD)
  .catch(error => {
    if (error instanceof WordNotFoundError) {
      // error.suggestion
    }
  })

FAQs

Package last updated on 06 Apr 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