saschanaz / libflif.js

Another trial to get FLIF to the web platform
ISC License
41 stars 2 forks source link

Node.js module #12

Open saschanaz opened 7 years ago

saschanaz commented 7 years ago

Support Node.js which does not support Web Worker.

TheJaredWilcurt commented 7 years ago

I was thinking about doing a separate repo to contain the built flif executable for different versions of flif. Then create a node module that will detect your OS and download the correct executable during npm install from the first repo. That node module would have a JS wrapper for all the possible arguments that can be thrown at the executable.

I don't really have time to work on this right now though. But I feel like it's a good idea.

It would give one central location for all common builds of the flif encoder (Lin32, Lin64, Win32, Win64, OSX 64).

Then Node could just detect the OS/Arch and download the correct build and act as a layer of abstraction so it just passes along the commands and spawns a child process to run it. This would be a much more efficient way of encoding/decoding using Node, since you'd just be running a local binary.

saschanaz commented 7 years ago

That will be great for performance, but for simplicity I will do asm.js here, and later wasm. Module support may also help web browser context when ES2015 module implementation arrives (or just existing module loaders).