Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nano 12 - make the library ESM-only. Exchange all "require"s for "import"s.#355

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
glynnbird wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromesm

Conversation

glynnbird
Copy link
Contributor

@glynnbirdglynnbird commentedSep 10, 2025
edited
Loading

Overview

Preparation work for Nano 12.

  • Making the library ESM-only - remove any "require" use and replace with equivalent "import".
  • version 12.
  • Update README code to eliminate "require".
  • Remove a bunch of legacy Nano code that dates back to the request/axios days. It's a bit simpler to read now with the "relax" method making the request and handling the response.
  • The..AsStream variants of the functions are now "async" - i.e. they return a Promise which resolves to a stream, rather than synchronously returning a dummy stream as before. This makes the code easier to maintain, but is abreaking change.

Testing recommendations

All the tests have changed in the require-->import sense, but are functionally identical.

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

digitalextremist reacted with hooray emoji
@glynnbird
Copy link
ContributorAuthor

glynnbird commentedSep 11, 2025
edited
Loading

Note to future self: It is possible to turn the ESM into CJS with:

rolldown --input lib/nano.js --file lib/dist.js --format cjs

I think ESM is the future though

Glynn Bird added3 commitsOctober 6, 2025 09:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@glynnbird

[8]ページ先頭

©2009-2025 Movatter.jp