Socket
Socket
Sign inDemoInstall

super-dictionary

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    super-dictionary

Zero-Dependency All-Language Dictionary Wrapper for Dictionary API


Version published
Maintainers
1
Install size
20.6 kB
Created

Readme

Source

super-dictionary

Documentation

npm version npm downloads license npm bundle size

Zero-Dependency All-Language API Wrapper for Dictionary API

Installation

npm i super-dictionary

Methods

const dictionary = require('super-dictionary');

// as an async promise
async function run() {
	let data = await dictionary.getDefinition('hello');
	console.log(data);
}

// as a callback
dictionary.getSynonyms('nice').then(synonyms => {
	console.log(synonyms)
})

Example Output

getDefinition(word, language?)
Can return an array of definitions with their part of speech or a simple definition
[
  { pos: 'exclamation', definition: [ [Object] ] },
  { pos: 'noun', definition: [ [Object] ] },
  { pos: 'verb', definition: [ [Object] ] }
]
getSynonyms(word, language?)
Can return an array of synonyms with their definition counterparts or an object of one synonym with its definition
[
  {
    num: 0,
    type: 'giving pleasure or satisfaction; pleasant or attractive.',
    synonyms: [
      'enjoyable',       'pleasant',
      'pleasurable',     'agreeable',
      'delightful',      'satisfying',
      'gratifying',      'acceptable',
      "to one's liking", 'entertaining',
      'amusing',         'diverting',
      'marvellous',      'good',
      'bonny',           'couthy',
      'irie',            'lovely',
      'great',           'neat',
      'lekker',          'mooi'
    ]
  },
  {
    num: 1,
    type: '(especially of a difference) slight or subtle.',
    synonyms: [
      'subtle',     'fine',
      'delicate',   'minute',
      'precise',    'exact',
      'accurate',   'strict',
      'close',      'careful',
      'meticulous', 'rigorous',
      'scrupulous', 'ultra-fine'
    ]
  },
  { num: 2, type: 'fastidious; scrupulous.', synonyms: [] }
]

etc...

Keywords

FAQs

Last updated on 10 Sep 2021

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