Skip to content

Proposed changes to Deno.spawn() API #14918

@nayeemrmn

Description

@nayeemrmn
  • SpawnOutput should extend ChildStatus instead of composing it, discussed favourably on Discord a while ago.
  • SpawnOutput::stdout, SpawnOutput::stderr, Child::stdin, Child::stdout and Child::stderr shouldn't be optional, instead make them getters that throw at runtime if that stream wasn't set to "piped". Remove the complicated <T extends SpawnOptions = SpawnOptions> which we currently need to give proper type hints for the availability of these fields. Their typings for these would get increasingly complex if it became dependent on more options (e.g. SpawnOptions::pty which if set should make the stdio streams unavailable), so we should make them always present.

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