https://github.com/vikhram-s/indianconstitution-js
A robust JavaScript library designed to provide seamless access to the Constitution of India. This module enables developers to retrieve articles, explore summaries, perform keyword searches, and more, leveraging a comprehensive dataset embedded within the IndianConstitution class.
https://github.com/vikhram-s/indianconstitution-js
india indian-constitution indian-language javascript json law legal natural-language-processing nodejs npm
Last synced: 5 months ago
JSON representation
A robust JavaScript library designed to provide seamless access to the Constitution of India. This module enables developers to retrieve articles, explore summaries, perform keyword searches, and more, leveraging a comprehensive dataset embedded within the IndianConstitution class.
- Host: GitHub
- URL: https://github.com/vikhram-s/indianconstitution-js
- Owner: Vikhram-S
- License: apache-2.0
- Created: 2025-03-19T09:06:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-13T07:00:49.000Z (6 months ago)
- Last Synced: 2026-01-13T10:22:01.750Z (6 months ago)
- Topics: india, indian-constitution, indian-language, javascript, json, law, legal, natural-language-processing, nodejs, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@vikhram-s/indianconstitution-js
- Size: 276 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# @vikhram-s/indianconstitution-js (v0.2.0)
A robust JavaScript library designed to provide seamless access to the Constitution of India. This module enables developers to retrieve articles, explore summaries, perform keyword searches, and more, leveraging a comprehensive dataset embedded within the `IndianConstitution` class.
[](https://www.npmjs.com/package/@vikhram-s/indianconstitution-js) [](https://github.com/Vikhram-S/IndianConstitution-js/blob/main/LICENSE) [](https://github.com/Vikhram-S/IndianConstitution-js) [](https://nodejs.org/) [](https://www.npmjs.com/package/@vikhram-s/indianconstitution-js) [](https://github.com/Vikhram-S/IndianConstitution-js/issues)
## Installation
Install the library via npm to integrate it into your Node.js project:
```bash
npm install @vikhram-s/indianconstitution-js
```
## Features
- **Comprehensive Access**: Retrieve the full text of the Constitution of India, including the Preamble and individual articles.
- **Article Retrieval**: Fetch detailed information or concise summaries for any article by its number.
- **Search Capabilities**: Perform keyword-based searches across article content or filter by titles.
- **Utility Functions**: Count total articles and explore the dataset with ease.
## Usage
Get started with @vikhram-s/indianconstitution-js using these examples:
### Quick Example
```javascript
const { getArticle, IndianConstitution } = require('@vikhram-s/indianconstitution-js');
// Fetch an article directly
console.log(getArticle(14)); // "Article 14: Equality before law..."
// Use the class for advanced access
const india = new IndianConstitution();
console.log(india.preamble()); // "We, the people of India..."
```
### Detailed Node.js Example
```javascript
const { IndianConstitution } = require('@vikhram-s/indianconstitution-js');
// Instantiate the class
const india = new IndianConstitution();
// Access the Preamble
console.log(india.preamble());
// Retrieve article details
console.log(india.getArticle(14)); // "Article 14: Equality before law..."
// List all articles
console.log(india.articlesList());
// Search by keyword
console.log(india.searchKeyword('equality'));
// Get an article summary
console.log(india.articleSummary(21)); // "Article 21 - Protection of life..."
// Count total articles
console.log(india.countArticles());
// Search by title keyword
console.log(india.searchByTitle('Fundamental'));
```
## API Reference
| Function | Description |
|----------|-------------|
| `preamble()` | Returns the Preamble of the Constitution of India. |
| `getArticle(number)` | Retrieves full details of the specified article by number. |
| `articlesList()` | Lists all articles with their titles in a readable format. |
| `searchKeyword(word)` | Searches for a keyword across article titles and descriptions. |
| `articleSummary(num)` | Provides a concise summary of the specified article. |
| `countArticles()` | Returns the total number of articles in the Constitution. |
| `searchByTitle(title)` | Finds articles matching a keyword in their titles. |
## Development
This library is actively maintained. We welcome contributions, bug reports, and feature suggestions via GitHub Issues. For usage terms, refer to the LICENSE file.
## License
This project is licensed under the Apache License 2.0. See the LICENSE file for full details.
## Data Source
The Constitution data is meticulously compiled from publicly available, authoritative sources to ensure accuracy and reliability.
## Developer Information
- **Author**: Vikhram S
- **Email**: [vikhrams@saveetha.ac.in](mailto:vikhrams@saveetha.ac.in)
- **Python Companion**: IndianConstitution
## Copyright
© 2026 Vikhram S. All rights reserved.