animetosho / node-yencode

SIMD accelerated yEnc encoder/decoder and CRC32 calculator for node.js
37 stars 5 forks source link

CLI options? #10

Closed symgryph closed 2 years ago

symgryph commented 3 years ago

I was wondering if this has a cli invocation?

animetosho commented 3 years ago

This is just a library and has no CLI interface.

(I'm also not sure what a CLI would do as this is only really useful for uploaders/downloaders)

sntran commented 3 years ago

I think the CLI will be useful when the uploaders/downloaders are written in a language that does not interop with Node.js or C++.

With a CLI, I can at least npm install yencode into my project, then spawn a system process for the CLI to encode/decode a file.

I suppose I could do the same thing by writing a JS file calling this API, but it's essentially writing the CLI :) It would be nicer that your library directly supports it.

animetosho commented 3 years ago

spawn a system process for the CLI to encode/decode a file.

That sounds rather inefficient for an application to do though.

Unfortunately, if you need it for your language, it needs to be ported across. I did consider making this more of a C library, which could ease porting a bit, but never got around to it. Realistically, there's already a C++ -> Node interface, so shouldn't be hard to adopt to another language; the main difficulty would probably be getting the build system to handle the compiler flags.