relevant-urban

2.0.0 • Public • Published

Relevant urban NPM Build Status Greenkeeper badge

Urban Dictionary API wrapper logo

This module was meant to replace shitty urban module as it uses callbacks and does useless stuff.

const urban = require('relevant-urban');
Methods returns description
urban('string') => Promise<Definition> Gets first definition from urban matching provided query
urban.random() => Promise<Definition> Gets random definition from urban
urban.all('string') => Promise<Array<Definition>> Gets all definitions from page 1 matching provided query
urban.random('string') => Promise<Definition> Gets random definition from urban matching provided query
urban.search('string'[, page]) => Promise<api response> Gets raw response from api without any formating

Example output

NOTE: urban.random() method doesn't have tags and sounds

  Definition {
  id: 69266,
  word: 'hello',
  definition: 'what you say when your talking casually with friends and your mom walks in the room',
  example: 'What the hell(mom enters)-o mom.',
  urbanURL: 'http://hello.urbanup.com/69266',
  author: 'mad at the world',
  thumbsUp: 3297,
  thumbsDown: 936,
  tags: [ 'hi', 'hey', 'greeting', 'yo', 'goodbye' ],
  sounds: [ 'http://media.urbandictionary.com/sound/hello-7503.mp3',
  'http://media.urbandictionary.com/sound/hello-9778.mp3',
  'http://media.urbandictionary.com/sound/hello-9897.mp3',
  'http://media.urbandictionary.com/sound/hello-10454.mp3',
  ...]
  }

Package Sidebar

Install

npm i relevant-urban

Weekly Downloads

395

Version

2.0.0

License

MIT

Last publish

Collaborators

  • mr-sakamoto