npm.io
2.4.6 • Published 5 years ago

@scrabble-solver/wiktionary

Licence
CC-BY-NC-ND-4.0
Version
2.4.6
Deps
3
Size
158 kB
Vulns
0
Weekly
0
Stars
139

@scrabble-solver/wiktionary

Fetches WordDefinition of a given word in a given language from Wiktionary. It supports all 174 languages.

Usage

import { getWordDefinition } from '@scrabble-solver/wiktionary';

async function main() {
  const { definitions, isAllowed, word } = await getWordDefinition('en', 'feline');

  console.log(`"${word}" - ${isAllowed ? '👍' : '👎'}`); // "feline" - 👍
  console.log(JSON.stringify(definitions, null, 2)); // ["Of or pertaining to cats.","catlike (resembling a cat)"]
}