Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use import for code examples in the readme #471

Merged
merged 2 commits into from Jan 18, 2022

Conversation

rauno56
Copy link
Contributor

@rauno56 rauno56 commented Jan 17, 2022

Readme very conveniently includes code snippets most of which have both:

  1. top-level await(TLA) which is not supported outside of ESM,
  2. require calls which is not supported in ESM.

So essentially the examples work nowhere in JS land(TS has TLA from v3.8).
Why not use import statements which are supported in TS and Node.js 12.20, 14.14, or 16.0 and up?

Copy link
Member

@aricart aricart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aricart aricart merged commit 4b1aa0e into nats-io:master Jan 18, 2022
@aricart
Copy link
Member

aricart commented Jan 18, 2022

@rauno56 thanks for your contribution.

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.

None yet

2 participants