Skip to content

docs: make JavaScript README examples safe to copy - #34

Closed
MatheoPaiva wants to merge 1 commit into
priompt:mainfrom
MatheoPaiva:docs/copyable-async-examples
Closed

MatheoPaiva wants to merge 1 commit into
priompt:mainfrom
MatheoPaiva:docs/copyable-async-examples

Conversation

@MatheoPaiva

Copy link
Copy Markdown

Fixes #23
Fixes #24

Make the CommonJS quick-start valid in a .js file by moving await into an async function and handling errors. Update the subscription examples to await the returned NATS connection, handle startup errors, and close both connections when the app stops.

Validation: extracted quick-start and live-update snippets pass node --check on Node v24.18.0. Mock-client smoke checks passed for quick-start cleanup, rejected subscription handling, and SIGINT cleanup of both connections. The project test suite was not run because this changes README examples only.

AI assistance: prepared with OpenAI Codex.

@sujal-maheshwari2004

Copy link
Copy Markdown
Member

Hi @MatheoPaiva, thank you for taking the time to send this. We're closing it, and it's not about the quality of the change.

The issue it fixes is labelled good first issue. In this organisation those are reserved for people making their first open-source contributions: we're onboarding a group of students who will learn the workflow on exactly these issues. We've now written this down in our contribution guide.

If you'd like to keep contributing, we'd welcome help on our help wanted issues. That's where experienced and AI-assisted effort makes a real difference. Please claim one by commenting, wait to be assigned before opening a pull request, and keep to at most two open pull requests at a time.

Thanks again!

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.

README subscribe() examples should await and handle connection errors README quick-start example fails: require() mixed with top-level await

2 participants