Skip to content

ts-node doesn't handle graceful shutdown properly #457

Closed
@endel

Description

@endel

Hey there,

I've created a repository that reproduces this issue here: https://github.com/endel/ts-node-graceful-shutdown-issue

All versions of ts-node doesn't have the expected behaviour when gracefully shutting down a Node.js application.

ts-node behaviour:

Process is dettached from terminal as soon as SIGINT is received.

./node_modules/.bin/ts-node index.ts
^CGraceful shutdown started...

[21:22:41] endel:~/Projects/ts-node-graceful-shutdown-issue [master #]
$ Done, let's finish!

node behaviour:

Process is dettached from terminal only after process.exit() is called.

$ node index.js
^CGraceful shutdown started...
Done, let's finish!
[21:23:34] endel:~/Projects/ts-node-graceful-shutdown-issue [master #]

I believe ts-node ideally should behave exactly how node does, shouldn't it?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions