jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.29k stars 353 forks source link

Browser load of minimised library file? #184

Closed sheffieldnikki closed 3 years ago

sheffieldnikki commented 4 years ago

Could the Installation section be expanded to add an example of a browser loading the minimised idb library from a CDN as a single HTTP request? Would something like this work?

<script src="https://unpkg.com/idb@5.0.4/build/iife/index-min.js"></script>
<script>
  async function doDatabaseStuff() {
    const db = await idb.openDB(…);
  }
</script>
jakearchibald commented 4 years ago

Yeah, that works fine. Seems reasonable to add it to the readme.

ShawnMcClure commented 4 years ago

Yes, it would be great if this suggestion were added to the README soon. I spent quite a bit of time trying to figure out what the "main" Javascript file was so that I could include it as suggested above. Having this example in the README would've saved me all that time. Thanks.