Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ravikisha/gitaverse
A TypeScript library to access Bhagavad Gita shlokas, translations, and metadata. This library allows developers to fetch chapters, verses, and complete shloka details from the Bhagavad Gita, including the translations and synonyms.
https://github.com/ravikisha/gitaverse
gita javascript npm npm-package typescript
Last synced: 12 days ago
JSON representation
A TypeScript library to access Bhagavad Gita shlokas, translations, and metadata. This library allows developers to fetch chapters, verses, and complete shloka details from the Bhagavad Gita, including the translations and synonyms.
- Host: GitHub
- URL: https://github.com/ravikisha/gitaverse
- Owner: Ravikisha
- License: mit
- Created: 2024-12-17T15:19:48.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2024-12-17T15:36:59.000Z (17 days ago)
- Last Synced: 2024-12-17T16:35:18.866Z (17 days ago)
- Topics: gita, javascript, npm, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/gitaverse
- Size: 1.51 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![logo](https://ravikisha.github.io/assets/gitaverselogo.png)
# GitaVerse
A TypeScript library to access Bhagavad Gita shlokas, translations, and metadata. This library allows developers to fetch chapters, verses, and complete shloka details from the Bhagavad Gita, including the translations and synonyms.
---
## đ Description
The **Gita Library** provides a structured and programmatic way to access the verses (shlokas) of the Bhagavad Gita. Whether you're building a spiritual application, research tool, or educational platform, this library makes accessing Gita's wisdom easy and developer-friendly.
---
## đ Features
- Fetch **all verses** in a chapter.
- Get **specific shlokas** by chapter and verse number.
- Retrieve detailed **translations**, **synonyms**, and **Devanagari text**.
- Group shlokas by chapters.
- Includes metadata about the Bhagavad Gita.---
## đĻ Installation
Install the library using **npm**:
```bash
npm install gitaverse
```or using **yarn**:
```bash
yarn add gitaverse
```---
## đ§ Usage
Here is an example of how to use the **Gita Verse**.
### Import and Initialize the Library
```typescript
import { GitaLibrary } from "gita-library";const gita = new GitaLibrary();
```---
### 1. Get Metadata About the Gita
```typescript
const metadata = gita.getDescription();
console.log(metadata);
/*
Output:
{
title: "Bhagavad Gita",
description: "The Bhagavad Gita, often referred to as the Gita, is a 700-verse Hindu scripture that is part of the Indian epic Mahabharata.",
totalChapters: 18,
totalVerses: 700
}
*/
```---
### 2. Fetch All Shlokas in a Chapter
```typescript
const chapter1Shlokas = gita.getChapter(1);
console.log(chapter1Shlokas.map((shloka) => shloka.getSummary()));
```---
### 3. Fetch a Specific Shloka by Chapter and Verse Number
```typescript
const shloka = gita.getShloka(1, 1);
console.log(shloka.getSummary());
/*
Output:
{
chapter: "1",
verse: "1",
devanagari: "ā¤§āĨā¤¤ā¤°ā¤žā¤ˇāĨā¤āĨā¤° ā¤ā¤ĩā¤žā¤...",
verseText: "Dhritarashtra said...",
synonyms: "Dhritarashtra - King Dhritarashtra...",
translation: "King Dhritarashtra inquired...",
meaning: ["Literal meaning of the verse...", "Deeper spiritual significance..."]
}
*/
```---
### 4. Fetch All Verses Grouped by Chapter
```typescript
const allVerses = gita.getAllVerses();
allVerses.forEach((chapter) => {
console.log(`Chapter ${chapter.getShlokas().length} Shlokas`);
});
```---
## đ API Reference
### `GitaLibrary` Methods:
- **`getDescription()`**: Returns Gita metadata.
- **`getChapter(chapterNumber: number)`**: Returns all shlokas for the specified chapter.
- **`getShloka(chapterNumber: number, verseNumber: number)`**: Returns a specific shloka.
- **`getAllVerses()`**: Fetches all verses grouped by chapters.### `GitaShloka` Methods:
- **`getSummary()`**: Returns a structured summary of the shloka.
- **`getChapter()`**: Returns the chapter number.
- **`getVerse()`**: Returns the verse number.
- **`getDevanagari()`**: Returns the verse in Devanagari script.
- **`getVerseText()`**: Returns the verse text.
- **`getTranslation()`**: Returns the translation.
- **`getMeaning()`**: Returns the meaning of the shloka.---
## đ Contributing
Contributions are welcome! To contribute:
1. Fork the repository.
2. Create a feature branch.
3. Submit a Pull Request.---
## đ Issues
If you encounter any bugs or have feature requests, please create an issue on the [GitHub repository](https://github.com/ravikisha/GitaVerse/issues).
---
## đ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## đ Show Your Support
If you like this library, please â the repository and share it with others who might find it useful!
---
## ⨠Stay Inspired
_"You have the right to work, but never to the fruit of work."_ â **Bhagavad Gita** (Chapter 2, Verse 47)
---