@crrajaguru/thirukkural
v0.1.4
Published
A thirukkural Package that give set of functions to read thirukkural
Maintainers
Readme
Thirukkural Lookup
Thirukkural Lookup is a TypeScript library designed to facilitate easy access and retrieval of verses from the Thirukkural, a classic Tamil text renowned for its universal teachings on ethics and morality.
About Thirukkural
The Thirukkural, authored by the ancient Tamil poet Thiruvalluvar, comprises 1,330 couplets (kurals) that provide timeless insights into various aspects of life. These couplets are organized into 133 chapters, each containing 10 kurals, and are further grouped into three primary sections:
- Aram (Virtue): Focuses on moral values and ethical living.
- Porul (Wealth): Deals with statecraft and socio-economic matters.
- Inbam (Love): Explores love and interpersonal relationships.
This structure ensures comprehensive coverage of both individual conduct and societal norms.
Installation
To incorporate Thirukkural Lookup into your project, install it via npm:
npm install @crrajaguru/thirukkuralUsage
First, import the necessary functions from the library:
import {
getSections,
getChapterGroups,
getChapters,
getAllChapterGroups,
getAllChapters,
getKuralByChapter,
getSongByNumber
} from '@crrajaguru/thirukkural';Functions
getSections(): Retrieves all section names.const sections = getSections(); console.log(sections); // Output: ['Aram', 'Porul', 'Inbam']getChapterGroups(sectionNumber: number): Fetches chapter groups within a specified section.const chapterGroups = getChapterGroups(1); // For 'Aram' section console.log(chapterGroups);getChapters(chapterGroupNumber: number): Retrieves chapters within a specified chapter group.const chapters = getChapters(1); // Assuming chapter group 1 exists console.log(chapters);getAllChapterGroups(): Returns all chapter groups across sections.const allChapterGroups = getAllChapterGroups(); console.log(allChapterGroups);getAllChapters(): Fetches all chapters across all sections and groups.const allChapters = getAllChapters(); console.log(allChapters);getKuralByChapter(chapterNumber: number): Retrieves all kurals within a specified chapter.const kurals = getKuralByChapter(1); // For chapter 1 console.log(kurals);getSongByNumber(songNumber: number): Fetches a specific kural by its number.const kural = getSongByNumber(1); // For kural number 1 console.log(kural);kuralSearch(query: string): The search query (one or more words)..const kurals = kuralSearch('உலகு'); // For kural number 1 console.log(kurals);
Data Source
The kural data utilized in this library is sourced from the thirukkural repository. We extend our gratitude to the contributors for making this valuable resource available.
Source Code
The source code for this npm package is available at GitHub.
License
This project is licensed under the MIT License.
