dicionario-aberto

v0.1.0
Query the [Dicionário Aberto](http://dicionario-aberto.net) project API using a promisified (Bluebird/A+ compatible) interface.
dictionary portuguese

dicionario-aberto Build Status

Query the Dicionário Aberto project API using a promisified (A+ compliant) interface.

Install

$ npm install --save dicionario-aberto

Usage

The search() and define() methods return promises to the objects deserialized from Dicionário Aberto's JSON responses.

var DicionarioAberto = require('dicionario-aberto')();

DicionarioAberto.define('a')
    .then(function(entry) {
        //=> Object
    });

DicionarioAberto.search({'prefix': 'a'})
    .then(function(results) {
        //=> Object
    });

DicionarioAberto.search({'suffix': 'z'})
    .then(function(results) {
        //=> Object
    });

DicionarioAberto.search({'prefix': 'a', 'suffix': 'z'})
    .then(function(results) {
        //=> Object
    });

DicionarioAberto.search({'like': 'a'})
    .then(function(results) {
        //=> Object
    });

API

dicionarioAberto([options])

Factory function that creates a new Dicionário Aberto client object which provides search() and define() methods to query the Dicionário Aberto API.

options

Can be used to compose the created object.

baseUrl

Type: string
Default: http://dicionario-aberto.net/search-json

Base URL for the Dicionário Aberto RESTful API.

License

MIT © Luís Rodrigues

Metadata

  • MIT
  • >=0.10.0
  • Luís Rodrigues
  • released 10/5/2015

Downloads

Maintainers