Socket
Book a DemoInstallSign in
Socket

super-dictionary

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

super-dictionary

Zero-Dependency All-Language Dictionary Wrapper for Dictionary API

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
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

dictionary

FAQs

Package last updated on 10 Sep 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.