A comprehensive collection of traditional Roman Catholic prayers in multiple languages, organized as structured JSON files with flexible label-based classification.
This NPM package provides 57 traditional Catholic prayers in 8 languages (Latin, English, Spanish, French, German, Italian, Portuguese, Polish) with rich metadata and a flexible multi-label classification system.
Key Features:
- ๐ Multilingual Support - 8 languages per prayer
- ๐ท๏ธ Flexible Classification - Multi-label system with categories and tags
- ๐ Universal Compatibility - Works in Node.js and browsers (React, Vue, etc.)
- ๐ฆ Zero Runtime Dependencies - Pure static data imports
- ๐ Type-Safe - Full TypeScript definitions included
- โก Optimized - Tree-shakeable, bundler-friendly
npm install @codexcommunion/prayer-collectionconst { getPrayerById, getPrayersByLabel, getPrayerText } = require('@codexcommunion/prayer-collection');
// Get a specific prayer
const ourFather = getPrayerById('our-father');
console.log(ourFather.metadata.title); // "Our Father"
// Get all core prayers
const corePrayers = getPrayersByLabel('core');
console.log(corePrayers.length); // 4
// Get prayer text in a specific language
const prayerText = getPrayerText('hail-mary', 'la');
console.log(prayerText); // "Ave Maria..."import { Prayer, getPrayerById, getPrayerText, LanguageCode } from '@codexcommunion/prayer-collection';
const prayer: Prayer | null = getPrayerById('hail-mary');
const text: string | null = getPrayerText('hail-mary', 'la' as LanguageCode);57 prayers available across 11 theological categories with rich metadata and multilingual translations.
๐ Complete Prayer List: lib/prayer-index.json (generated by npm run build)
๐ฎ Planned Additions: pending_prayers.md
- API Reference โ Points to index.d.ts for complete API
- Usage Examples โ Quick-start code for Node.js, React, Vue
- Prayer Organization โ Classification system overview
- Contributing Guide โ GitHub issue or PR workflow
- Data Structure โ JSON prayer format
- Architecture โ Build system and validation
- index.d.ts โ TypeScript types and JSDoc for all functions
- prayer-schema.json โ JSON Schema for validation and IDE autocomplete
- lib/prayer-index.json โ Auto-generated list of all prayers
- scripts/ โ Build and validation implementation
Prayers use a multi-label system:
- Primary Category: Main theological focus (e.g.,
marian,christological,saints) - Labels: Multiple classification tags (e.g.,
["core", "rosary", "daily"]) - Importance: Liturgical significance (
essential,common,devotional)
See Prayer Organization for complete details.
8 languages supported using ISO 639-1 codes:
la(Latin),en(English),es(Spanish),fr(French)de(German),it(Italian),pt(Portuguese),pl(Polish)
โ
Works everywhere - Node.js, React, Vue, Angular, Svelte, vanilla JavaScript
โ
No configuration needed - Works with all modern bundlers (Webpack, Vite, Rollup, etc.)
โ
Static data imports - No filesystem operations at runtime
// Core functions
getAllPrayers() // Get all prayers
getPrayerById(id) // Get specific prayer
getPrayerText(id, language) // Get prayer text
// Filtering
getPrimaryCategories() // List all categories
getPrayersByPrimaryCategory(category) // Filter by category
getPrayersByLabel(label) // Filter by label
getPrayersByImportance(importance) // Filter by importance
// Utilities
searchPrayers(term, language) // Search prayers
getSupportedLanguages() // List supported languages
getLabels() // List all labelsSee API Reference for complete documentation.
npm run build # Generate static data and validate
npm run validate # Run comprehensive validation
npm run validate:schema # Run JSON Schema validation (requires: npm install -D ajv)
npm test # Run API function tests
npm run test:browser # Test browser compatibilityVS Code users get automatic validation and auto-completion! The workspace is configured to use prayer-schema.json for all prayer files.
- Create JSON file in
prayers/directory (filename must match prayer ID) - Follow the data structure or use IDE auto-completion
- Run
npm run buildandnpm run validate - Commit changes
See Architecture for detailed development workflow.
The prepublishOnly hook automatically runs validation before publishing:
npm version patch # or minor, major
npm publishSee Architecture for the complete publishing workflow.
import { useState, useEffect } from 'react';
import { getPrayersByLabel, getPrayerText } from '@codexcommunion/prayer-collection';
function DailyPrayers() {
const [prayers, setPrayers] = useState([]);
useEffect(() => {
setPrayers(getPrayersByLabel('daily'));
}, []);
return (
<div>
{prayers.map(p => (
<div key={p.metadata.id}>
<h3>{p.metadata.title}</h3>
<p>{getPrayerText(p.metadata.id, 'en')}</p>
</div>
))}
</div>
);
}More examples in Usage Examples.
CodexCommunion Digital Code License (CCCL) v1.0 - see LICENSE file for details.
This license permits free use, modification, and distribution for any lawful purpose, with restrictions against use that promotes blasphemy, heresy, or content hostile to the Catholic Church.
Contributions welcome! See CONTRIBUTING.md for guidelines.