# require() → import converter

**URL:** <https://talk.observablehq.com/t/require-import-converter/10836>\
**Category:** Show and tell\
**Created:** [September 9, 2026, 7:14pm UTC](https://talk.observablehq.com/t/require-import-converter/10836 "2026-09-09T19:14:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarioDelgadoSr](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mariodelgadosr/32/1828_2.png) [@MarioDelgadoSr](https://talk.observablehq.com/u/MarioDelgadoSr)\
**Post date:** [September 9, 2026, 7:14pm UTC](https://talk.observablehq.com/t/require-import-converter/10836/1 "2026-09-09T19:14:19Z")

</div>

[https://observablehq.com/@ambassadors/require-import-converter](https://observablehq.com/@ambassadors/require-import-converter)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/9/9ba90b7601bbe7d6d85776e1c16ec75c39ec863d.png)

If you’re migrating old notebooks to Observable 2.0, you’ve probably hit this: `require("some-package@1.2.3")` just doesn’t work anymore, and figuring out the right `import` URL by hand is more annoying than it should be — especially for older packages that never published real ESM, or `require()` calls that point at a specific file inside a package (`require("three@0.104.0/build/three.min.js")`).

This notebook is a small tool (built with Observable AI) that does the migration for you: paste in your old `require(...)` line(s), and it resolves an exact version, _actually tries_ real dynamic imports against jsDelivr/esm.sh/Skypack (falling back to a legacy global-script pattern if nothing else works), and hands back verified, paste-ready `import` statements — with a one-click copy button. It also handles a few real-world edge cases that came up while I built it: multi-package `require("a", "b")` merges, subpaths, and malformed/unparseable calls (reported clearly instead of silently vanishing).
