[NPM] Installing indexedDB promise


#1

I can’t create indexedDB after adding it dependency to package.json. Link to the library i want to use


#2

How are you trying to use it, with Rollup/Webpack or directly in the front-end?


#3

Directly through package.json


#4

What problem are you running into? What did you expect to happen, and what happened instead?


#5

I am trying to use it my project on https://glitch.com/edit/#!/cool-eyebrow?path=js/idb-test/index.js:1:0 then create an indexDB database with
import idb from ‘idb’;

idb.open(‘keyval-store’, 1, upgradeDB => {
upgradeDB.createObjectStore(‘keyval’);
});


#6

It looks like you’re getting there. One thing, since you’re including it in package.json - you can then reference the idb.js file if you make it accessible with Express e.g. https://glitch.com/edit/#!/dark-double?path=server.js:13:6


#7

Thanks a bunch its working now


#8

ah, it was working but I think something must have been cached. Try now.