This is a quick guide to the aa-daily-reflections NPM package, a lightweight and efficient library for fetching Alcoholics Anonymous Daily Reflections.
It works out-of-the-box with zero configuration, providing both a programmatic API and a powerful Command-Line Interface (CLI).
First, add the package to your project:
npm install aa-daily-reflectionsInstantly get reflections directly in your terminal. This is perfect for quick reads or scripting.
# Get today's reflection in English
aa-daily
# Get the reflection for June 25th
aa-daily 06/25
# Get today's reflection in Spanish
aa-daily -l esEasily integrate the reflections into any Node.js application.
const { DailyReflections } = require('aa-daily-reflections');
async function getReflection() {
// Create an instance (supports 'en', 'es', 'fr')
const reflections = new DailyReflections('en');
// Fetch today's reflection
const today = await reflections.getToday();
console.log(today.title);
console.log(today.quote);
}
getReflection();- Simple & Modern API: Clean, async/await-based methods.
- Powerful CLI: Get reflections without writing any code.
- Multi-Language: Supports English (
en), Spanish (es), and French (fr). - TypeScript Ready: Comes with built-in type definitions for a great developer experience.
- Zero-Config Data: Fetches live data directly from the source; no local database needed.
For the complete API reference, advanced examples, and contribution guidelines, check out the main repository on GitHub. If you find it useful, please give it a star (β)!