bible-search

1.0.5 • Public • Published

bible-search NPM version Build Status Dependency Status

A client Bible Search Api wrapper for NodeJs https://pt-br.bibles.org/pages/api

Install

$ npm install --save bible-search

Usage

var BibleSearch = require('bible-search');
var bibleSearch = new BibleSearch('<<API KEY HERE>>');
 
//
//ES6 Style
//
import BibleSearch from 'blble-search';
var bibleSearch = new BibleSearch('<<API KEY HERE>>');
 
//
// Get books
//
bibleApi.book.getBooks().then((data) => {
  //JSON Structure see: https://pt-br.bibles.org/pages/api/documentation/books 
}).catch(function (err) {
  console.log('Ops! Sorry :|');
});
 
//
// Get passage
//
bibleApi.passage.getPassage({
  book: 'rev',
  chapter: 21,
  start: 4
}).then(function (data) {
  //JSON Structure see: https://pt-br.bibles.org/pages/api/documentation/passages
}).catch(function (err) {
  console.log('Ops! Sorry :|');
});
 
//
// Get book chapters
//
bibleApi.book.getChapters({
  book: 'rev'
}).then(function (data) {
  //JSON Structure see: https://pt-br.bibles.org/pages/api/documentation/chapters
}).catch(function (err) {
  console.log('Ops! Sorry :|');
});
 
//
// Get book verses
//
bibleApi.book.getVerses({
  book: 'rev',
  chapter: 21
}).then(function (data) {
  //JSON Structure see: https://pt-br.bibles.org/pages/api/documentation/verses
}).catch(function (err) {
  console.log('Ops! Sorry :|');
});
 
//
// Search in the bible
//
bibleApi.search.find({
  query: 'Pai nosso'
}).then(function (data) {
  //JSON Structure see: https://pt-br.bibles.org/pages/api/documentation/search
}).catch(function (err) {
  console.log('Ops! Sorry :|');
});

Test

Before you run tests, you must create a file named: config-auth.json, example:

{
  "bibleApiKey": ""
}
npm test
gulp test

Build

gulp

Lib output: ./dist/

Generate ESDoc

gulp doc

Documentation output: ./dist/docs

License

Apache-2.0 © William Sena

TODO

  • Correct grammar mistakes! :)
  • Improve the documentation (ESDocs)
  • Support browserify
  • Refactoring ;)

Thanks :)

https://github.com/yeoman/generator-node

Readme

Keywords

Package Sidebar

Install

npm i bible-search

Weekly Downloads

6

Version

1.0.5

License

Apache-2.0

Last publish

Collaborators

  • williampsena