1.8.1 • Published 2 years ago

urbn v1.8.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Get Urban Dictionary definitions displayed on your app the easy way


This package uses promises to allow for easy and asynchronous urban dictionary requests.


Install

npm install urbn

Usage

Two different ways you can use this, as shown below.

const u = require('urbn').Urbn();
u.getFirst('term')

//------------//

const u = require('urbn');
u.Urbn().getFirst('term')

//------------//

// available methods
.getFirst(term) // gets the first definition from the list
.getAll(term) // gets all from the "page"
.getRandom() // retrieves an array of random definitions

Types

Added type definition to use with typescript.

import {Urbn} from 'urbn';
const u = new Urbn();

u.getFirst(term: string): Promise<object>;
u.getAll(term: string): Promise<object>;
u.getRandom(): Promise<object>;
u.getRandom(term: string): Promise<object>;
// using getRandom('term') will return a single definition
// as opposed to getFirst() it will return one random from an array of 10
1.8.1

2 years ago

1.8.0

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago