-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Browserify #99
base: master
Are you sure you want to change the base?
No Browserify #99
Conversation
Hi @leetreveil, I would love to have a browser-based library that reads (music) metadata from an This particular branch seems to be the best fit I could find. What is the current status regarding the non-browserify arraybuffer-accepting build? May I somehow help with the development? |
6c37983
to
8f2f26b
Compare
Hi @ondras, I would love some help with this! Getting this codebase to a state where it can accept an 1) Fix the last failing test on this branch (running node v4.2.3)This requires us to update strtok2 (https://github.com/andrewrk/node-strtok) to use Fix all diffs like this: - var value = this.data.toString('utf8', this.offset, this.offset + len)
+ var value = String.fromCharCode.apply(null, this.data.slice(this.offset, this.offset + len)) To properly decode utf8 encoded array buffers. Would need to implement our own ala: https://github.com/leetreveil/musicmetadata/blob/master/lib/windows1252decoder.js Or find one on the net. 2) Wrap
|
strtok.parse(stream, function (v, cb) { |
Might just be able to push the bytes to a stream:
Line 12 in e064112
function wrapFileWithStream (file) { |
This doesn't get us off browserify but it should allow us to pass an ArrayBuffer
as input. Let me know if you have anymore questions.
Hi @leetreveil, thanks for your prompt response! As far as the decoding goes, what about this (standard) interface: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder ? I assume that |
I've looked at This could work: https://github.com/nfroidure/UTF8.js |
Also, if you want |
My point is that But if the strtok2 is to use TextDecoder internally, we must make sure this API exists in node as well. |
Yeah I think that's reasonable. I would be happy to take a PR that uses We don't have to worry about strtok either, we can just use https://github.com/leetreveil/musicmetadata/search?utf8=%E2%9C%93&q=StringType |
Node 4, cross platform buffers without browserify!