Skip to content

[Doc] Switch npmjs README examples to ESM#1542

Merged
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1541
Jun 17, 2026
Merged

[Doc] Switch npmjs README examples to ESM#1542
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1541

Conversation

@minggangw

Copy link
Copy Markdown
Member

Align the npm-published README (scripts/npmjs-readme.md) with the package's ESM-first API.

  • Quick-start snippet: replace the CommonJS require() + init().then() form with native ESM import rclnodejs from 'rclnodejs' and top-level await rclnodejs.init().
  • TypeScript guidance: update the sample tsconfig from commonjs / node / es2020 to NodeNext / NodeNext / es2022 to match ESM module resolution.

Fix: #1541

Copilot AI review requested due to automatic review settings June 17, 2026 02:27
@minggangw minggangw merged commit 610dada into RobotWebTools:develop Jun 17, 2026
19 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the npm-published README (scripts/npmjs-readme.md) to reflect rclnodejs’s ESM-first usage patterns, aligning documentation with the package’s modern Node/TypeScript configuration expectations (issue #1541).

Changes:

  • Replaces the CommonJS require() + init().then() quick-start with native ESM import and top-level await rclnodejs.init().
  • Updates the recommended TypeScript tsconfig.json snippet to module/moduleResolution: NodeNext and target: es2022.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/npmjs-readme.md
node.spin();
```

This example assumes your ROS 2 environment is already sourced.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 91.22% (+0.001%) from 91.219% — minggangw:fix-1541 into RobotWebTools:develop

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.

Switch npmjs README examples to ESM

3 participants