Skip to content

RFC process.on("shutdown") proposal #20804

@pravdomil

Description

@pravdomil

See this popular question on so https://stackoverflow.com/q/14031763/3748498

By now there is no clean API to do cleanup when node.js exits, in order to catch all situation you need to do following:

for (const event of ["exit", "SIGINT", "SIGUSR1", "SIGUSR2", "uncaughtException", "SIGTERM"]) {
  process.on(event, cleanUp)
}

This issue is a place for discussion how to fix it.

My proposal is process.on("shutdown", cleanUp).

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.processIssues and PRs related to the process subsystem.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions