Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fega/wordreference-api
An api to use the worldreference.com information
https://github.com/fega/wordreference-api
javascript json nodejs nodejs-modules wordreference
Last synced: 3 months ago
JSON representation
An api to use the worldreference.com information
- Host: GitHub
- URL: https://github.com/fega/wordreference-api
- Owner: fega
- License: mit
- Created: 2017-03-08T06:38:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-22T22:26:50.000Z (about 1 year ago)
- Last Synced: 2024-10-28T16:18:21.045Z (3 months ago)
- Topics: javascript, json, nodejs, nodejs-modules, wordreference
- Language: JavaScript
- Size: 11.7 KB
- Stars: 55
- Watchers: 4
- Forks: 19
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wordreference-api [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url][![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)
> An api to use the worldreference.com information
## Installation
```sh
$ npm install --save wordreference-api
```## Usage
```js
var wr = require('wordreference-api');
/**
* wr
* Gets the result for the given word, available languages: 'es', 'en', 'it', 'fr'
* @param {String} word Word to be searched
* @param {String} from from language, default 'en'
* @param {String} to to language, default 'es'
* @return {Object} Object with the word data
*/
wr('Rainbow');
wr('Rainbow','en','fr').then((result)=> console.log);
```
Return:
``` javascript
{
"word": "Rainbow",
"pronWR": "/ˈreɪnˌbəʊ/",
"audio": [
"/audio/en/us/us/en069238.mp3",
"/audio/en/uk/general/en069238.mp3",
"/audio/en/uk/Yorkshire/en069238-55.mp3",
"/audio/en/Irish/en069238.mp3",
"/audio/en/scot/en069238.mp3",
"/audio/en/us/south/en069238.mp3",
"/audio/en/Jamaica/en069238.mp3"
],
"translations": [
{
"title": "Principal Translations",
"translations": [
{
"from": "rainbow",
"fromType": "n",
"toType": "grupo nom",
"to": "arco iris "
}
]
},
{
"title": "Compound Forms:",
"translations": [
{
"from": "rainbow trout",
"fromType": "n",
"toType": "nf",
"to": "trucha arcoiris "
}
]
}
]
}
```
## LicenseMIT © [Fabian Gutierrez](fabiangutierrez.co)
[npm-image]: https://badge.fury.io/js/wordreference-api.svg
[npm-url]: https://npmjs.org/package/wordreference-api
[travis-image]: https://travis-ci.org/fega/wordreference-api.svg?branch=master
[travis-url]: https://travis-ci.org/fega/wordreference-api
[daviddm-image]: https://david-dm.org/fega/wordreference-api.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/fega/wordreference-api
[coveralls-image]: https://coveralls.io/repos/fega/wordreference-api/badge.svg
[coveralls-url]: https://coveralls.io/r/fega/wordreference-api