Tags

Input / Output

Input / Output

0 lessons
5 community items

input-output

Community

5 items
Code Snippet

ANSI Colored Logger in 50 Lines

chalk is great. chalk plus chalk-template plus log-symbols plus signal-exit is heavy. Here is the dependency-free ANSI logger I drop into every Node script when I want one-line wins without 14 transitive packages.

JavaScript
logging
input-output
code-template

1.1k

34

4.2 (11)

May 12, 2026

by @carlosherrera

Code Snippet

An argv Parser Without yargs or commander

Eighty percent of the time I just need --flag and --opt=value parsing for a one-off script. Adding yargs feels heavy. This is the 30-line zero-dependency parser I copy into every Node script.

JavaScript
input-output
code-template
functional-programming

460

8

4.4 (12)

May 1, 2026

by @nehanasser

Code Snippet

Prompt for y/N Without readline Cruft

Every CLI script needs a confirm() one day. The full Inquirer ceremony is overkill. Here is the small wrapper I copy into deploy scripts when I need 'are you sure? [y/N]' that defaults to no.

JavaScript
input-output
code-template

1k

33

Apr 25, 2026

by @petrawilson

Code Snippet

A stdout Progress Bar Without a Library (Python)

tqdm is wonderful but adds 30k of dependencies for a 30-line job. Here is the pure-stdlib progress bar I drop into ETL scripts when I just want to know how far through the file I am.

Python
input-output
code-template
py-generators

359

8

Mar 31, 2026

by @rajtanaka

Code Snippet

CSV With Quoted Commas: The 30-Line Parser

split(',') gets you fired on the first row that contains a comma inside quotes. Here is a state-machine CSV parser in 30 lines that handles quoted commas, escaped quotes, and CRLF endings.

JavaScript
serialization
code-template
input-output

296

8

4.3 (11)

Dec 14, 2025

by @gracechoi