Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paladini/8a7587c0608d0b6cf51f184418d70c16 to your computer and use it in GitHub Desktop.
Save paladini/8a7587c0608d0b6cf51f184418d70c16 to your computer and use it in GitHub Desktop.
A simple guide to using the aa-daily-reflections NPM package. Fetch AA Daily Reflections in your Node.js/TypeScript project or directly from your terminal with the CLI. Supports EN, ES, FR.

πŸš€ The Easiest Way to Use AA Daily Reflections in Node.js & Terminal

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).


1. Quick Install

First, add the package to your project:

npm install aa-daily-reflections

2. Two Ways to Use It

A) As a Command-Line Tool (CLI)

Instantly 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 es

B) In Your JavaScript/TypeScript Code

Easily 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();

⭐ Key Features

  • 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.

πŸ“š Explore the Full Documentation

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 (⭐)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment