Comments (5)
Hello! This library is meant to be consumed by node.js, so, no it isn't possible to use it in the browser. In particular, the node fs module would not be available for accessing a file.
I suppose the file abstraction concept could be expanded to operate on files that are purely in memory, similarly to how the test file object is used for unit tests. However, this doesn't exist today and the file abstraction is really only used to wrap around a file in the filesystem.
from node-taglib-sharp.
get it. thanks for your reply!
from node-taglib-sharp.
After a few attempts, I finally create a wrapper to read and write in the browser. but the main drawback currently is that the polyfill for node:crypto
is a little big:
with crypto polyfill: 972.38 kB │ gzip: 391.16 kB
without crypto polyfill: 683.34 kB │ gzip: 297.25 kB
I find it is only used in matroskaAttachment.ts
and generate random array by crypto.randomFillSyn
. Is it equal to window.crypto.getRandomValue
?
from node-taglib-sharp.
It looks like it's pretty much the same as window.crypto.getRandomValues
. Though looking at the docs for that, it appears to only be supported in Node v15 and up. At the moment node-taglib-sharp maintains compatibility with Node v12 and up. Upgrading would be possible but would require a major version bump. I'm also not entirely sure if that's the only place crypto
is used. The uuid
package used in various places around the library is hopefully relying on cryptographically secure values.
I'm also curious:
- Is 300k really that big of a difference? Modern web apps are colossal, and I'd suspect 300k is nothing to most browsers
- What are you trying to build? This library really isn't intended to be used in a browser setting, especially with the filesystem functionality it uses. Has it been working with all the polyfills?
from node-taglib-sharp.
Thanks for your explain. The polyfill process is running at build time, so there is no need to modify the original code.
I am building a web app that manage audio files tags directly inside the browser using file system api. I used to choose music-metadata-browser, but its data is read-only and still have a long road to support write feature, so I write a wrapper for this. I will open source the package later.
300KB (100KB in gzip) data may not impact on most browsers. I personally consider it as an learning research and optimization. Build once and run everywhere without installation is wonderful
from node-taglib-sharp.
Related Issues (20)
- Version 5.2.3 breaks reading of mp3 picture.data for some files HOT 4
- bitrate will be 0 on some files HOT 2
- Error setting tags for m4a files HOT 26
- Remove Ogg granule position safe integer check and make granule position a number HOT 1
- Support for M4A HOT 7
- Matroska tag docs didn't get generated HOT 1
- Question - error setting title HOT 2
- Question - Setting the text information frames in a id3v2TextInformationFrame HOT 2
- Id3v2FrameIdentifier doc and possible bug ? HOT 4
- Named export not found HOT 4
- Pictures cannot display in windows file browser. HOT 4
- ID3v2 tags at end of file not showing up in players
- Throwing error: `Argument null: ${name} was not provided` HOT 10
- 'Cannot set property ByteVector' error on load of module HOT 3
- id3v2 frameId RGAD causes failure to read tags HOT 4
- Add Legacy ReplayGain Frame Support
- Why Tag class has no accessor for 'artist' ? HOT 1
- poor performance when saving picture HOT 3
- wrong duration of `.mp3` and `.wav` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-taglib-sharp.