Skip to content

Commit

Permalink
update the comment on stop()
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jan 27, 2024
1 parent 11ec95f commit dd139a7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,17 @@ export interface InitializeOptions {
export let version: string

// Call this function to terminate esbuild's child process. The child process
// is not terminated and re-created for each API call because it's more
// efficient to keep it around when there are multiple API calls.
// is not terminated and re-created after each API call because it's more
// efficient to keep it around when there are multiple API calls. This child
// process normally exits automatically when the parent process exits, so you
// usually don't need to call this function.
//
// In node this happens automatically before the parent node process exits. So
// you only need to call this if you know you will not make any more esbuild
// API calls and you want to clean up resources.
// One reason you might want to call this is if you know you will not make any
// more esbuild API calls and you want to clean up resources (since the esbuild
// child process takes up some memory even when idle).
//
// Unlike node, Deno lacks the necessary APIs to clean up child processes
// automatically. You must manually call stop() in Deno when you're done
// using esbuild or Deno will continue running forever.
// Another reason you might want to call this is if you are using esbuild from
// within a Deno test. Deno fails tests that create a child process without
// killing it before the test ends, so you have to call this function (and
// await the returned promise) in every Deno test that uses esbuild.
export declare function stop(): Promise<void>

0 comments on commit dd139a7

Please sign in to comment.