Borewit

Results 226 comments of Borewit

It is not only `node:buffer` `file-type` depends on, also `safe-buffer` ```mermaid graph TD; FT-->S FT(file-type)-->RWNS(readable-web-to-node-stream) S(strtok3)-->P(peek-readable) S(strtok3)-->TO("@tokenizer/token") TY(token-types)-->TO TY-->IE("ieee754") FT-->TY TY-->NB(node:buffer) RWNS-->RS(readable-stream) RS-->SD(string_decoder) SD-->SB(safe-buffer) RS-->UD(util-deprecate) RS-->I(inherits) style NB fill:#F88,stroke:#A44 style...

I still don't see a good alternative for the string encoding node:buffer supports: `ascii`, `utf8`, `utf-8`, `utf16le`, `ucs2`, `ucs-2`, `base64`, `base64url`, `latin1`, `binary`, `hex`; e.g.: ```js Buffer.from(uint8Array).toString(encoding); ```

With the introduction of ESM you cannot just import from some sub-path. Basically you propose to re-enable that, but I think there are good reasons to keep the implementation private....

It is already close to do something like that: https://github.com/Borewit/music-metadata/blob/7cdebd1ca61411f3bb8bf7ae1d69a916ff317222/lib/ParserFactory.ts#L100 & https://github.com/Borewit/music-metadata/blob/7cdebd1ca61411f3bb8bf7ae1d69a916ff317222/lib/ParserFactory.ts#L105 If we would throw an error with a good described error code, would that provide you the feedback...

Sorry for this very late reply, custom error class sounds good to me.

Can someone provide some small copyright free sample files?

> not sure this is required, afaict neither jpeg-ls nor spiff have a different file extension (or even mimetype) It seems to me that they do have a dedicated registered...

Looking to some jls fixtures found [here](https://github.com/team-charls/charls/tree/master/test/jlsimage), some of them have a string `J1U6G` at offset `0xF7` (247), some others not, none of them have the `SOF55` or `JPG7` marker....

I found this information: [JPEG Lossless Compression (ISO/IEC 14495), File type signifiers and format identifiers](https://www.loc.gov/preservation/digital/formats/fdd/fdd000151.shtml#sign). Which describes the _SOF55_ maker, which is actually encoded as `JPG7` at `0xF7`. But the...

> ```js > await Promise.allSettled(files.map(async (file) => { > return Metadata.parseBlob(file) > })) > ``` Better to limit the number of parallel calls. You may use something like [p-limit](https://www.npmjs.com/package/p-limit). >...