I am not understanding how to use an npm module into my phonegap project.
Right now I would like to use this:
I have ran the command:
npm i cordova-sqlite-storage
Now the package shows here:
But my project is here:
How to link the node_modules/cordova-sqlite-storage to my index.html please? What is the correct way of doing this?
That package is a Cordova plugin, so instead of installing it as a npm package you have to install it as a Cordova plugin
cordova plugin add cordova-sqlite-storage
Thank you so much.
What is the difference logic wise between plugins and npm packages please?
Well, cordova plugins are technically npm packages, but if you install them with cordova plugin add, then all the files (native and js) are copied to the right place so the plugin works. If you install them with npm, then all the code will be in node_modules, but not accessible from the app and you should manually copy the files.