Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Latest commit

 

History

History
91 lines (66 loc) · 3.55 KB

README.md

File metadata and controls

91 lines (66 loc) · 3.55 KB

api-js

A JavaScript Wrapper for the GurbaniNow API

npm Travis (.org) GitHub license GitHub issues GitHub pull requests jsdelivr

Contents

Usage

Install the library via NPM:

npm install gurbaninow

The library can be imported into Node as below:

const gn = require('gurbaninow')

gn.getShabad('DMP', true)

Additionally, the package is available for web use via unpkg CDN.

<script src="https://unpkg.com/gurbaninow"></script>

Or via jsDelivr

<script src="https://cdn.jsdelivr.net/npm/gurbaninow/dist/index.min.js"></script>

Want a demo?
Try on RunKit

API

getShabad(shabadId, [devApi]) ⇒ Object

Fetches and returns Shabad via ShabadID from GurbaniNow API

Returns: Object - GurbaniNow API Response

Param Type Default Description
shabadId string | number ShabadID of Shabad to request
[devApi] boolean false Use Development API instead of Production

Example

getShabad( 'DMP', true )

Contributing

We're happy to accept suggestions and pull requests!

To get started, clone this repo and run npm install inside this directory.

This repository follows the Airbnb's Javascript Style Guide, with a few minor modifications. Notably, spaces should be included inside parentheses and brackets (weird, right!). An ESLint file is provided, and your code will automatically be checked on-commit for style. It is recommended to install an ESLint plugin for your editor (VS Code's ESLint plugin works out of the box), so you can receive linter suggestions as you type.

When writing commit messages, please follow the seven rules. Markdown and HTML JSDoc documentation is generated automatically, on commit, however if you'd like to preview any changes to documentation, npm run build-docs will update README.md. README.md should not be edited, instead apply modifications to README.hbs.

The general workflow for contributing:

  • Fork/create a new branch.
  • Write or update existing tests with expected results
  • Implement functions/changes
  • Add JSDoc function documentation and examples.
  • Run tests with npm test and ensure they all pass. Testing is done with the mocha testing framework.
  • Create a pull request with the changes.