Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prdpx7/webdict
Fetch definition/meaning of words from dictionary.com and urbandictionary
https://github.com/prdpx7/webdict
dictionary nodejs npm-package web-scraping
Last synced: about 1 month ago
JSON representation
Fetch definition/meaning of words from dictionary.com and urbandictionary
- Host: GitHub
- URL: https://github.com/prdpx7/webdict
- Owner: prdpx7
- License: mit
- Created: 2017-04-16T11:13:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-22T01:21:13.000Z (about 6 years ago)
- Last Synced: 2024-11-14T11:42:06.235Z (about 2 months ago)
- Topics: dictionary, nodejs, npm-package, web-scraping
- Language: JavaScript
- Size: 42 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# webdict
> Fetch definition/meaning of words from `dictionary.com` and `urbandictionary.com`
[![Build Status](https://travis-ci.org/prdpx7/webdict.svg?branch=master)](https://travis-ci.org/prdpx7/webdict)
[![MITlicensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/prdpx7/webdict/master/LICENSE)## Install
```bash
npm install --save webdict
```## Usage
```js
const webdict = require('webdict');
webdict('dictionary', 'broken')
.then(response => {
console.log(response);
/*
{
statusCode: '200',
message: 'success',
type: 'verb',
definition: [
'past participle of break.',
'reduced to fragments; fragmented.',
'ruptured; torn; fractured.'
],
source: 'http://dictionary.com'
}
*/
});
webdict('urbandictionary', 'hello')
.then(response => {
console.log(response);
/*
{
statusCode: '200',
message: 'success',
type: 'Unknown',
definition: [
'what you say when your talking casually with friends and your mom walks in the room',
'The only word on this site that has nothing to do with [sex] or [drugs]!',
'1. A greeting\r\n2. A for of incredulity'
],
source: 'http://urbandictionary.com'
}
*/
});webdict('urbandictionary', 'thisworddoesnotexistinanydictionary')
.then(response => {
console.log(response);
/*
{
statusCode: 403,
message: 'check the spelling again'
}
*/
});
```## Related
* [webdict-cli](https://github.com/prdpx7/webdict-cli) - Command line tool using this package.