FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
modern-errors-process/src/main.d.ts at main · ehmicky/modern-errors-process · GitHub
ehmicky
/
modern-errors-process
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
7
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
modern-errors-process
/
src
/
main.d.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (38 loc) · 1.17 KB
Breadcrumbs
modern-errors-process
/
src
/
main.d.ts
Copy path
File metadata and controls
41 lines (38 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import
type
logProcessErrors
from
'log-process-errors'
import
type
{
Event
as
ProcessEvent
,
Options
}
from
'log-process-errors'
import
type
{
Info
}
from
'modern-errors'
export
type
{
ProcessEvent
as
Event
}
/**
* Options of `modern-errors-process`
*/
export
type
{
Options
}
/**
* `modern-errors-process` plugin (Node.js only)
*/
declare
const
plugin
:
{
name
:
'process'
getOptions
:
(
input
:
Options
)
=>
Options
staticMethods
:
{
/**
* Improves process errors:
* [uncaught](https://nodejs.org/api/process.html#process_event_uncaughtexception)
* exceptions,
* [unhandled](https://nodejs.org/api/process.html#process_event_unhandledrejection)
* promises, promises
* [handled too late](https://nodejs.org/api/process.html#process_event_rejectionhandled)
* and [warnings](https://nodejs.org/api/process.html#process_event_warning).
*
* It returns a function to restore Node.js default behavior.
*
*
@example
* ```js
* const restore = UnknownError.logProcess()
* restore()
* ```
*/
logProcess
:
(
info
:
Info
[
'staticMethods'
]
,
)
=>
ReturnType
<
typeof
logProcessErrors
>
}
}
export
default
plugin
Back
|
FazBrowse Home
|
New Git URL