Skip to main content

reddit cli node app

✓ Published0🌍 Public
Aalessioalex
Last edited May 8, 2015
Created on May 8, 2015

This example shows a command-line interface that streams recent Reddit posts from a specified subreddit, displaying titles and their age in a terminal. It fetches JSON data from Reddit’s API, filters posts by keywords or time since creation, and prints formatted text with dashed separators. The code uses `request` for HTTP, `JSONStream` for parsing the nested JSON structure, `through` for streaming transforms, `minimist` for command-line arguments, `ms` for time formatting, and `chalk` for colored output. Results are limited by the `--limit` flag, with optional `--filter` and `--since` parameters.

AI-generated description