@jiltq/urban.js

1.0.12 • Public • Published

urban.js

urban.js is a lightweight Node.js module that allows you to easily interact with the Urban Dictionary API.

features

  • term definitions

example usage

to define "javascript":

const urban = require('urban.js');

(async () => {
	const [answer] = await urban.define('javascript');
	console.log(answer);
})();

to get a random definition:

const { randomArray } = require('urban.js');

(async () => {
	const randomAnswer = randomArray(await urban.define('javascript'));
	console.log(randomAnswer);
})();

example output

{
	definition: 'A computer [programming language], provides a [source] of [endless suffering] for many poor middle-schoolers throughout the world (including myself).',
	permalink: 'http://javascript.urbanup.com/13778263',
	thumbs_up: 50,
	sound_urls: [],
	author: "stanley yelnats :')",
	word: 'javascript',
	defid: 13778263,
	current_vote: '',
	written_on: '2019-04-05T02:52:22.489Z',
	example: '"You have an [assignment] on javascript for [summer break]"',
	thumbs_down: 13
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jiltq/urban.js

Weekly Downloads

7

Version

1.0.12

License

ISC

Unpacked Size

1.89 kB

Total Files

3

Last publish

Collaborators

  • jiltq