Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easyurban

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easyurban

Urban dictionary definitions. Fast and simple.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM version NPM downloads Dependencies Paypal

Easyurban

Urban dictionary definitions. Fast and simple.

Get urban dictionary definitions, immediately.

One Step Installation:

npm install easyurban

Why easyurban

• Actually works (😱), without any unnecessary bloat or confusion from using other packages.

• Modern (es6), and lightweight (~4.5 kB packed)

I'm hooked, how do I begin?

const UrbanDictionary = require('easyurban');
const dictionary = new UrbanDictionary;

The new keyword is optional, a dictionary can be created simply with UrbanDictionary() as well.

Lookup terms with dictionary.lookup (await, promise .then()):

const result = await dictionary.lookup('Urban dictionary');
dictionary.lookup('Urban dictionary')
  .then(result => console.log(result.list))
  .catch(console.error)

The result will have a list property, and result.list will be an array of (hopefully) a maximum of 10 elements.

Random:

const random = await dictionary.random();

Error handling:

Request handling errors (hopefully) contain three properties: error, code, and message

• error contains an Error object with a stack trace error.stack

• code contains the status code of the request

• message contains the body returned by the server. If possible, it will be a parsed JSON.

Pagination: If more than 10 definitions exist, fetch a specific page by specifying the second parameter as the page number.

const secondpage = await dictionary.lookup('Urban dictionary', 2);

Enjoy this package? Consider starring on github and checking out some of my other work:

Youtube Search API

Fluent Filepaths

Keywords

FAQs

Package last updated on 19 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc