sindresorhus / execa

Process execution for humans
MIT License
6.82k stars 217 forks source link

`encoding` option accepted values #925

Closed ehmicky closed 7 months ago

ehmicky commented 7 months ago

The encoding option accepts the same values as Node.js child_process:

It also allows the following:

  1. null as an alias to buffer
  2. utf-8 as an alias to utf8
  3. utf-16le, ucs2 and ucs-2 as aliases to utf16le
  4. binary as an alias to latin1
  5. Any case, e.g. UTF8 instead of utf8

@sindresorhus Do you think we should support the same options as core Node.js, or we should be stricter? If stricter, which of the above should be kept or not?

sindresorhus commented 7 months ago

Stricter. I would drop 1, 2, 3, 4, 5. Needs a human-friendly error when any of those are passed.

ehmicky commented 7 months ago

Alright, let's do this. I'll make sure the validation error message includes the value to use instead.