Socket
Socket
Sign inDemoInstall

mw-dict

Package Overview
Dependencies
5
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mw-dict

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


Version published
Weekly downloads
7
decreased by-56.25%
Maintainers
1
Install size
1.84 MB
Created
Weekly downloads
 

Readme

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

Last updated on 06 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc