npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bhagwad-geeta

v1.0.1

Published

A Library based on the song of God

Downloads

1

Readme

A Library for Bhagwad Geeta

A wrapper of the Bhagwad Geeta API. This library is designed to make it easier for you to use the API.

Features

  • easy to understand and use
  • suits best for making discord bots
  • uses async/await for methods

Setup

  • Importing the library
const BhagwadGeeta = require('bhagwad-geeta');
const bg = new BhagwadGeeta('api url');

Here, the api url is required. You can get one by signing up here. In the docs your api key will be visible afer signing up.

Getting a Shloka (verse)

The verse param we took is not just a verse. It is an object containing more properties. In the code below you're gonna know about the verse object.

bg.fetchVerse('2:64').then(verse => {
  const translations = verse.translate({ lamguage: 'english', limit: 2 });
  
  translations.forEach(translation => {
    const text = translation.text; // The translation
    const author = translation.author; // The one who translated it
    console.log(`${text} \n Translated by ${author}`);
  });

  // The Sanskrit Shaloka
  const verseText = verse.text;  
  // रागद्वेषवियुक्तैस्तु विषयानिन्द्रियैश्चरन्।
  // आत्मवश्यैर्विधेयात्मा प्रसादमधिगच्छति।।2.64।

  // The word meanings of the shloka :
  const wordMeanings = verse.wordMeaning;  
})
  • the reference you would provide should be like chapter:verse where both chapter & verse are in numbers
  • for example, in 1:2, 1 is the chapter number and 2 is the shloka number.
  • the verse.translate it translates the fetched verse. Currently only two languages are supported, which are Hindi and English.
  • the limit option is given so that you can fetch multiple translations by multiple scholars. Each shloka has around 10 - 15 different translations max.
    • due to the limit option, the translation(s) are provided in array format. Means even if you've set limit to 1, you need to treat it as array. Like arr[0]

Fetching Chapter

The code below fetches chapter and some information about it.

bg.fetchChapter('2').then(chapter => {
  /* Name */
  const english_name = chapter.name.english; // Sankhya Yoga
  const sanskrit_name = chapter.name.sanskrit; // सांख्ययोग'

  /* Summary */
  const english_summary = chapter.summary.english;
  const hindi_summary = chapter.summary.hindi;

  /* General Info */
  const verses = chapter.verseCount; // 72
  const number = chapter.numer; // 2
});
  • the chapter name is availibe in two lamguages - Hindi and Sanskrit
  • you can get summary of a chapter in two languages - Hindi and English
  • i hope the general info part is self-explanatory

Need help?

You can contact me if you need help regarding this library. Suggestions, pull requests and friend requests are welcomed.

  • Discord: Sxlitude#8885
  • Github: Sxlitude
  • NPM: sxlitudee