Skip to content

examples use node: api#48

Open
jbolda wants to merge 6 commits into
mainfrom
node-api-compat
Open

examples use node: api#48
jbolda wants to merge 6 commits into
mainfrom
node-api-compat

Conversation

@jbolda
Copy link
Copy Markdown
Collaborator

@jbolda jbolda commented May 28, 2026

Motivation

We want to run these examples on both deno and node.

Approach

If we use node: APIs, we are able to run the examples with either deno or node. The deno compatibility is generally pretty good here (save for one case where I hit an issue, noted in the code comment). Note that this change supersedes the need for #34, as the node: API usage has the writeSync consideration handled internal. Also, I added ensure() blocks to include the rawMode change which showed up on windows as needed when it crashed.

@jbolda jbolda requested a review from cowboyd May 28, 2026 05:36
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/clayterm@48

commit: f65d172

@jbolda jbolda force-pushed the node-api-compat branch from 1fc8bf6 to 97c98e9 Compare May 28, 2026 05:40
Copy link
Copy Markdown
Collaborator

@cowboyd cowboyd left a comment

Choose a reason for hiding this comment

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

For the examples, let's try and keep main() as close to the top of the file and the helper functions underneath. That way, if someone reads it, they see the biggest picture first.

Comment thread examples/inline-regions/index.ts
@jbolda jbolda requested a review from cowboyd May 31, 2026 05:52
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.

2 participants