Skip to content

chore: update examples to run from examples folder#2463

Merged
bcoe merged 1 commit intoyargs:mainfrom
shadowspawn:update-examples
Apr 21, 2025
Merged

chore: update examples to run from examples folder#2463
bcoe merged 1 commit intoyargs:mainfrom
shadowspawn:update-examples

Conversation

@shadowspawn
Copy link
Member

The examples were not runnable from examples folder since they were CJS with .js extension in a project which is ESM. This was probably broken since v17, not a recent problem.

  • The files were not set to executable although examples.md gave examples of running directly, so fixed that too.
  • Left a few of the examples as CJS but changed file extension to .cjs so runnable.
  • Changed var to const.
  • Deleted the strict example as it didn't run and wasn't clear what it was doing!

Messy diff since files renamed and edited.

@bcoe
Copy link
Member

bcoe commented Apr 21, 2025

Awesome, thanks for helping with the docs @shadowspawn. I'm glad we're cleaning up some of this cruft from past releases.

@bcoe bcoe merged commit f9c72a7 into yargs:main Apr 21, 2025
6 checks passed
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