aknorw / discojs

Easiest way to use the Discogs API in Javascript/Typescript :musical_note:
https://aknorw.github.io/discojs
MIT License
62 stars 9 forks source link

Can't use import #44

Closed Cryopt closed 1 year ago

Cryopt commented 2 years ago

Hey, When I use import in my file an error shows up cannot use import statement outside a module. I made some researches and I still don't really understand why I have this error. Can I use this without using import ? Thanks

neurowelt commented 1 year ago

Hi, I just started getting familiar with this library and this thread helped me out. Specifically, add "type":"module" to your package.json file and then you should be able to get going like this:

import Discojs from 'Discojs';

const client = new Discojs.Discojs({
   //options
})

Hope this helps 🙂