today-idiom
v1.0.2
Published
A Node.js package that picks an English idiom for today
Downloads
18
Maintainers
Readme
today-idiom
:pushpin: A Node.js package that picks an English idiom for today
Table of Contents
Installation
Using npm:
$ npm install today-idiom
Using yarn:
$ yarn add today-idiom
Methods
getIdiom()
Examples
Import the package
NodeJS
const todayIdiom = require('today-idiom');
ES6/ TypeScript
import todayIdiom from 'today-idiom';
How to use
(async () => {
try {
const idiom = await todayIdiom.getIdiom();
console.log(idiom);
/* {
idiom: 'a war of words',
meaning: "If you're in a war of words with someone, you're having a long argument or dispute with them.",
examples: [
'The leaders of the two main political parties are in a war of words over the issue of gun ownership. They debate the topic whenever they see each other.',
'The war of words between community leaders and church leaders has been dominating the newspaper headlines lately.'
]
} */
} catch (error) {
console.log(error);
}
})();