Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 0a8f0bc

Browse files
committed
feat: add exit function
1 parent 84b8fcf commit 0a8f0bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export {config} from './config'
99

1010
import {config} from './config'
1111
import {CLIError} from './errors/cli'
12+
import {ExitError} from './errors/exit'
13+
14+
export function exit(code = 0) {
15+
throw new ExitError(code)
16+
}
1217

1318
export function error(err: string | Error, options: {code?: string, exit?: number} = {}) {
1419
throw new CLIError(err, options)

0 commit comments

Comments
 (0)