sindresorhus/terminal-image

Remove conversion to buffer

piranna opened this issue · 3 comments

exports.file = async filePath => exports.buffer(await readFile(filePath));

Both term-img and jimp accept as first parameter both a buffer of a filepath, so usage of readFIle() is superfluous and also add some limits...

It was an intentional choice as I plan to switch out Jimp with something custom.

so usage of readFIle() is superfluous and also add some limits...

What limitations?

It was an intentional choice as I plan to switch out Jimp with something custom.

Oh, well... I was using it more extensively in the changes I'm doing to #6... :-/

What limitations?

File vs Buffer and access to libraries internal features.

Oh, well... I was using it more extensively in the changes I'm doing to #6... :-/

Feel free to take advantage of Jimp right now. I don't plan on switching right now. Just a long-term goal, as Jimp is needlessly heavy for what this module needs. I just prefer to keep the file reading separate.

File vs Buffer and access to libraries internal features.

This doesn't clarify what limitations reading the file ourselves causes. It should make no difference, other than 10 characters of needless code.