binjs-ref
binjs-ref copied to clipboard
Do not use the length of input in binjs_encode
it retrieves the length of the input, and just prints it in the progress. https://github.com/binast/binjs-ref/pull/168 is going to add filter mode that reads input from stdin. ~~we need to read whole input just in order to get the length.~~ ~~that step can be removed if we remove the progress message.~~
err, that was wrong. we need some data representation which can be passed to node.js, to parse with shift.
we're executing node.js command and passing a generated script via stdin, so, we need either an external something (mostly file), or data embedded in the script. we could avoid the large allocation on Rust side by feeding the data from binjs_encode's stdin to node.js's stdin by chunk, but it's a bit complicated and hard to read.
I'll postpone this for a while.