aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
738 stars 128 forks source link

Hotfix: add release-file to package.json so it is usable in svelte/typescript #167

Closed uvulpos closed 1 year ago

uvulpos commented 1 year ago

Linked to https://github.com/aadsm/jsmediatags/issues/75

uvulpos commented 1 year ago

I wanted to use this library in svelte + typescript and these tips (from the issue) did not work out for me but this small change in the package.json of my local node module did. I don't even have to import it anymore since it is globally available anyway

Screenshot 2022-09-14 at 14 07 30
$: fileUploadInput, updateMusicMetaData()

function updateMusicMetaData() {
        if (fileUploadInput && fileUploadInput[0]) {
            jsmediatags.read(fileUploadInput.item(0), {
                onSuccess: function (tag) {
                    console.log(tag);
                },
                onError: function (error) {
                    console.log(error);
                }
            });
        }
    }