Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.38 KB

README.md

File metadata and controls

60 lines (38 loc) · 2.38 KB

Build Status License: MIT semantic-release Commitizen friendly Coverage Status

Description

Rae provides a tiny library to access the well-known spanish RAE dictionary programatically. It exposes an easy API for fetching words and a commnad line utility for looking up words in the official RAE dictionary. Access the demo site here

Setup

NPM

Rae requires node in order to work. Please, download and install it from node website

Then, open a terminal session and type:

# Local Setup
$ npm install rae
# Global Setup
$ npm install --global rae

Example1

Command line

For using the command line interface utility, just exec the rae process passing in the word as first parameter. A basci example is shown below.

$ rae repositorio

It will display the definition for the "repositorio"(repository in english) word.

Etimologia:  (Del lat. repositorĭum, armario, alacena).
 1. m. Lugar donde se guarda algo.

Using in your own project

In order to use Rae in your personal project, you first need to import it. Rae exports a RaeClient which is a factory you can use to instantiate Rae clients. By default, it uses an HTTP Rae client. All clients have a search function to which you just need to pass in the word looking up for. Check the example below.

import Rae from 'rae';

const raeClient = Rae.create();

raeClient.search("repositorio").then((match) => ...);

Contributing

Feel free to raise a PR either for fixing bugs and implementing new features. You can also help by increasing the test cases or documenting the project. All help is welcome.

Just make sure npm run validate works before submitting your PR!