Skip to content

CLI: support reading HTML from stdin#192

Open
Jkker wants to merge 1 commit intokepano:mainfrom
Jkker:cli-stdin-support
Open

CLI: support reading HTML from stdin#192
Jkker wants to merge 1 commit intokepano:mainfrom
Jkker:cli-stdin-support

Conversation

@Jkker
Copy link

@Jkker Jkker commented Mar 20, 2026

Summary

  • allow defuddle parse to read HTML from stdin when no source is provided or when - is passed explicitly
  • refactor CLI parsing into testable helpers while preserving existing file and URL behavior
  • document stdin usage and add focused CLI coverage for stdin, file input, and interactive-stdin errors

Testing

  • npm test
  • npm test -- tests/cli.test.ts
  • npm run build:node
  • node dist/cli.js parse tests/fixtures/general--appendix-heading.html --property title
  • cat tests/fixtures/general--appendix-heading.html | node dist/cli.js parse --property title
  • node dist/cli.js parse https://stephango.com/saw --property title
  • curl -sSL https://stephango.com/saw | node dist/cli.js parse - --property title

@Jkker Jkker mentioned this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant