Skip to content

Trimming the trailing newline (and more tips on migrating from execa/other packages) #36

@pralkarz

Description

@pralkarz

When migrating execa to tinyexec in some projects, I've ran into a difference in the default behavior where execa would trim the trailing newline by default (https://github.com/sindresorhus/execa/blob/3fc804916d60b0b2e774a3642bd9815388caf7af/docs/lines.md?plain=1#L56-L63), whereas tinyexec wouldn't. I see two possible solutions for this issue:

  1. Trim by default in tinyexec. This could potentially introduce some unwanted complexity as disabling the behavior (stripFinalNewline option in execa) should also be supported then.
  2. Mention the difference in the documentation so that the consumers' can catch issues related to not stripping the trailing newline early and call .trim() on the returned output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions