grimmdude / MidiWriterJS

♬ A JavaScript library which provides an API for programmatically generating and creating expressive multi-track MIDI files and JSON.
MIT License
557 stars 60 forks source link

How to "import" ? #86

Closed humbleCoder1990 closed 1 year ago

humbleCoder1990 commented 2 years ago

I see the example is using require. Can't I use "import"?

VictorKolb commented 2 years ago

You can. Maybe you need to add "type": "module" to your package.json.

grimmdude commented 1 year ago

Hi @humbleCoder1990, yes you should be able to import the package assuming your environment is configured for it.


import MidiWriter from 'midi-writer-js';