Probably a bunch of other cruft i threw away too and a couple other bug fixes found during typing it strongly.
ESM/ESNext
This PR makes a questionable decision: to ship only ESNext (and ES modules).
What this means is that no bundle (i.e. rollup and friends) will be shipped, meaning no support will be provided for browsers which do not support ES modules and async/await.
This shouldn't be many browsers, these features are widely supported now for some time.
It also means in order to be loaded in Node, one must use --experimental-modules (though "type": "module" is set in the package manifest so it should figure out you can import it).
This means you can use the built sources out of the box in a modern browser:
<script type="module">
import * as id3 from './node_modules/id3/id3.js';
id3.fromUrl('/test.mp3').then((tag) => {
console.log(tag);
});
</script>
So here's the rewrite.
fromFile
,fromPath
,fromUrl
)kind
to specify if v2 or v1)tag.frames
(with their original ID, their mapped name, and their value)Closes #21 Closes #27 Closes #31 Closes #38 Closes #40 Fixes #13 Fixes #14 Fixes #15 Fixes #18 Fixes #26 Fixes #28 Fixes #33 Fixes #34 Fixes #36 Fixes #39 Fixes #41 Fixes #6
Probably a bunch of other cruft i threw away too and a couple other bug fixes found during typing it strongly.
ESM/ESNext
This PR makes a questionable decision: to ship only ESNext (and ES modules).
What this means is that no bundle (i.e. rollup and friends) will be shipped, meaning no support will be provided for browsers which do not support ES modules and async/await.
This shouldn't be many browsers, these features are widely supported now for some time.
It also means in order to be loaded in Node, one must use
--experimental-modules
(though"type": "module"
is set in the package manifest so it should figure out you can import it).This means you can use the built sources out of the box in a modern browser: