Thesaurus is a multi-language library for client-side frontends that look up synonyms from different online dictionaries. These are the currently available dictionaries and languages.
Getting started
Installation
npm install thesaurus-js
Usage
Parameters
- word: main word to look up synonyms
- language: language code to search for ('fr', 'pt', etc.) if none is present, the default value is 'en'.
- dictionaries: dictionaries to search for (currently available: 'thesaurus', 'wordreference' and 'reverso'), if none is present it will default to 'multi' and search all dictionaries.
Example
import { thesaurus } from 'thesaurus-js';
await thesaurus('house', 'en', ['reverso', 'wordreference']);
// => [ word: 'house', language: 'en', dictionary: 'reverso', synonyms: [ 'home', 'residence', ... ] ]