This notebook is just a copy of Mozilla’s srihash.org web app. But I was blown away by realizing how little code was needed in Observable to create it—just compare with the setup at GitHub - mozilla/srihash.org: SRI Hash Generator
I notice you use require.resolve to find target package, but this requires target to be published package; you could modify it to first check if there is an observable notebook with that name and use the API endpoint to get the module content and provide script tag for the import like how the embed options show, so you can get a script tag integrity hash of the notebook. However it’s a module so as a script tag module that doesn’t execute it’s not necessarily useful like that. I was messing around with variants on the obs.run site to provide a wrapped notebook execution module for web so maybe that could work with a hash generator like this.
Yes, but you can also type a full URL: require.resolve will return it unchanged. (And don’t hesitate to fork and send a suggestion if you want to expand it!) By the way, maybe I should turn this into a simple async function.
Oh nice yeah full URL works I didn’t try that before