신승민

Delete node_modules

Showing 1000 changed files with 0 additions and 4816 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

1 -../ejs/bin/cli.js
...\ No newline at end of file ...\ No newline at end of file
1 -../extract-zip/cli.js
...\ No newline at end of file ...\ No newline at end of file
1 -../jake/bin/cli.js
...\ No newline at end of file ...\ No newline at end of file
1 -../mime/cli.js
...\ No newline at end of file ...\ No newline at end of file
1 -../nanoid/bin/nanoid.cjs
...\ No newline at end of file ...\ No newline at end of file
1 -../rimraf/bin.js
...\ No newline at end of file ...\ No newline at end of file
1 -../sshpk/bin/sshpk-conv
...\ No newline at end of file ...\ No newline at end of file
1 -../sshpk/bin/sshpk-sign
...\ No newline at end of file ...\ No newline at end of file
1 -../sshpk/bin/sshpk-verify
...\ No newline at end of file ...\ No newline at end of file
1 -../uuid/bin/uuid
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 - MIT License
2 -
3 - Copyright (c) Microsoft Corporation.
4 -
5 - Permission is hereby granted, free of charge, to any person obtaining a copy
6 - of this software and associated documentation files (the "Software"), to deal
7 - in the Software without restriction, including without limitation the rights
8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 - copies of the Software, and to permit persons to whom the Software is
10 - furnished to do so, subject to the following conditions:
11 -
12 - The above copyright notice and this permission notice shall be included in all
13 - copies or substantial portions of the Software.
14 -
15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 - SOFTWARE
1 -# Installation
2 -> `npm install --save @types/node`
3 -
4 -# Summary
5 -This package contains type definitions for Node.js (https://nodejs.org/).
6 -
7 -# Details
8 -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9 -
10 -### Additional Details
11 - * Last updated: Mon, 16 May 2022 21:31:43 GMT
12 - * Dependencies: none
13 - * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14 -
15 -# Credits
16 -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
This diff is collapsed. Click to expand it.
1 -declare module 'assert/strict' {
2 - import { strict } from 'node:assert';
3 - export = strict;
4 -}
5 -declare module 'node:assert/strict' {
6 - import { strict } from 'node:assert';
7 - export = strict;
8 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
2 -declare module 'constants' {
3 - import { constants as osConstants, SignalConstants } from 'node:os';
4 - import { constants as cryptoConstants } from 'node:crypto';
5 - import { constants as fsConstants } from 'node:fs';
6 -
7 - const exp: typeof osConstants.errno &
8 - typeof osConstants.priority &
9 - SignalConstants &
10 - typeof cryptoConstants &
11 - typeof fsConstants;
12 - export = exp;
13 -}
14 -
15 -declare module 'node:constants' {
16 - import constants = require('constants');
17 - export = constants;
18 -}
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 -/**
2 - * The `diagnostics_channel` module provides an API to create named channels
3 - * to report arbitrary message data for diagnostics purposes.
4 - *
5 - * It can be accessed using:
6 - *
7 - * ```js
8 - * import diagnostics_channel from 'diagnostics_channel';
9 - * ```
10 - *
11 - * It is intended that a module writer wanting to report diagnostics messages
12 - * will create one or many top-level channels to report messages through.
13 - * Channels may also be acquired at runtime but it is not encouraged
14 - * due to the additional overhead of doing so. Channels may be exported for
15 - * convenience, but as long as the name is known it can be acquired anywhere.
16 - *
17 - * If you intend for your module to produce diagnostics data for others to
18 - * consume it is recommended that you include documentation of what named
19 - * channels are used along with the shape of the message data. Channel names
20 - * should generally include the module name to avoid collisions with data from
21 - * other modules.
22 - * @experimental
23 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/diagnostics_channel.js)
24 - */
25 -declare module 'diagnostics_channel' {
26 - /**
27 - * Check if there are active subscribers to the named channel. This is helpful if
28 - * the message you want to send might be expensive to prepare.
29 - *
30 - * This API is optional but helpful when trying to publish messages from very
31 - * performance-sensitive code.
32 - *
33 - * ```js
34 - * import diagnostics_channel from 'diagnostics_channel';
35 - *
36 - * if (diagnostics_channel.hasSubscribers('my-channel')) {
37 - * // There are subscribers, prepare and publish message
38 - * }
39 - * ```
40 - * @since v15.1.0, v14.17.0
41 - * @param name The channel name
42 - * @return If there are active subscribers
43 - */
44 - function hasSubscribers(name: string): boolean;
45 - /**
46 - * This is the primary entry-point for anyone wanting to interact with a named
47 - * channel. It produces a channel object which is optimized to reduce overhead at
48 - * publish time as much as possible.
49 - *
50 - * ```js
51 - * import diagnostics_channel from 'diagnostics_channel';
52 - *
53 - * const channel = diagnostics_channel.channel('my-channel');
54 - * ```
55 - * @since v15.1.0, v14.17.0
56 - * @param name The channel name
57 - * @return The named channel object
58 - */
59 - function channel(name: string): Channel;
60 - type ChannelListener = (message: unknown, name: string) => void;
61 - /**
62 - * The class `Channel` represents an individual named channel within the data
63 - * pipeline. It is use to track subscribers and to publish messages when there
64 - * are subscribers present. It exists as a separate object to avoid channel
65 - * lookups at publish time, enabling very fast publish speeds and allowing
66 - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
67 - * with `new Channel(name)` is not supported.
68 - * @since v15.1.0, v14.17.0
69 - */
70 - class Channel {
71 - readonly name: string;
72 - /**
73 - * Check if there are active subscribers to this channel. This is helpful if
74 - * the message you want to send might be expensive to prepare.
75 - *
76 - * This API is optional but helpful when trying to publish messages from very
77 - * performance-sensitive code.
78 - *
79 - * ```js
80 - * import diagnostics_channel from 'diagnostics_channel';
81 - *
82 - * const channel = diagnostics_channel.channel('my-channel');
83 - *
84 - * if (channel.hasSubscribers) {
85 - * // There are subscribers, prepare and publish message
86 - * }
87 - * ```
88 - * @since v15.1.0, v14.17.0
89 - */
90 - readonly hasSubscribers: boolean;
91 - private constructor(name: string);
92 - /**
93 - * Publish a message to any subscribers to the channel. This will
94 - * trigger message handlers synchronously so they will execute within
95 - * the same context.
96 - *
97 - * ```js
98 - * import diagnostics_channel from 'diagnostics_channel';
99 - *
100 - * const channel = diagnostics_channel.channel('my-channel');
101 - *
102 - * channel.publish({
103 - * some: 'message'
104 - * });
105 - * ```
106 - * @since v15.1.0, v14.17.0
107 - * @param message The message to send to the channel subscribers
108 - */
109 - publish(message: unknown): void;
110 - /**
111 - * Register a message handler to subscribe to this channel. This message handler
112 - * will be run synchronously whenever a message is published to the channel. Any
113 - * errors thrown in the message handler will trigger an `'uncaughtException'`.
114 - *
115 - * ```js
116 - * import diagnostics_channel from 'diagnostics_channel';
117 - *
118 - * const channel = diagnostics_channel.channel('my-channel');
119 - *
120 - * channel.subscribe((message, name) => {
121 - * // Received data
122 - * });
123 - * ```
124 - * @since v15.1.0, v14.17.0
125 - * @param onMessage The handler to receive channel messages
126 - */
127 - subscribe(onMessage: ChannelListener): void;
128 - /**
129 - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
130 - *
131 - * ```js
132 - * import diagnostics_channel from 'diagnostics_channel';
133 - *
134 - * const channel = diagnostics_channel.channel('my-channel');
135 - *
136 - * function onMessage(message, name) {
137 - * // Received data
138 - * }
139 - *
140 - * channel.subscribe(onMessage);
141 - *
142 - * channel.unsubscribe(onMessage);
143 - * ```
144 - * @since v15.1.0, v14.17.0
145 - * @param onMessage The previous subscribed handler to remove
146 - */
147 - unsubscribe(onMessage: ChannelListener): void;
148 - }
149 -}
150 -declare module 'node:diagnostics_channel' {
151 - export * from 'diagnostics_channel';
152 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -/**
2 - * **This module is pending deprecation.** Once a replacement API has been
3 - * finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have
4 - * the functionality that domains provide may rely on it for the time being
5 - * but should expect to have to migrate to a different solution
6 - * in the future.
7 - *
8 - * Domains provide a way to handle multiple different IO operations as a
9 - * single group. If any of the event emitters or callbacks registered to a
10 - * domain emit an `'error'` event, or throw an error, then the domain object
11 - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
12 - * exit immediately with an error code.
13 - * @deprecated Since v1.4.2 - Deprecated
14 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/domain.js)
15 - */
16 -declare module 'domain' {
17 - import EventEmitter = require('node:events');
18 - /**
19 - * The `Domain` class encapsulates the functionality of routing errors and
20 - * uncaught exceptions to the active `Domain` object.
21 - *
22 - * To handle the errors that it catches, listen to its `'error'` event.
23 - */
24 - class Domain extends EventEmitter {
25 - /**
26 - * An array of timers and event emitters that have been explicitly added
27 - * to the domain.
28 - */
29 - members: Array<EventEmitter | NodeJS.Timer>;
30 - /**
31 - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly
32 - * pushes the domain onto the domain
33 - * stack managed by the domain module (see {@link exit} for details on the
34 - * domain stack). The call to `enter()` delimits the beginning of a chain of
35 - * asynchronous calls and I/O operations bound to a domain.
36 - *
37 - * Calling `enter()` changes only the active domain, and does not alter the domain
38 - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
39 - * single domain.
40 - */
41 - enter(): void;
42 - /**
43 - * The `exit()` method exits the current domain, popping it off the domain stack.
44 - * Any time execution is going to switch to the context of a different chain of
45 - * asynchronous calls, it's important to ensure that the current domain is exited.
46 - * The call to `exit()` delimits either the end of or an interruption to the chain
47 - * of asynchronous calls and I/O operations bound to a domain.
48 - *
49 - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain.
50 - *
51 - * Calling `exit()` changes only the active domain, and does not alter the domain
52 - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a
53 - * single domain.
54 - */
55 - exit(): void;
56 - /**
57 - * Run the supplied function in the context of the domain, implicitly
58 - * binding all event emitters, timers, and lowlevel requests that are
59 - * created in that context. Optionally, arguments can be passed to
60 - * the function.
61 - *
62 - * This is the most basic way to use a domain.
63 - *
64 - * ```js
65 - * const domain = require('domain');
66 - * const fs = require('fs');
67 - * const d = domain.create();
68 - * d.on('error', (er) => {
69 - * console.error('Caught error!', er);
70 - * });
71 - * d.run(() => {
72 - * process.nextTick(() => {
73 - * setTimeout(() => { // Simulating some various async stuff
74 - * fs.open('non-existent file', 'r', (er, fd) => {
75 - * if (er) throw er;
76 - * // proceed...
77 - * });
78 - * }, 100);
79 - * });
80 - * });
81 - * ```
82 - *
83 - * In this example, the `d.on('error')` handler will be triggered, rather
84 - * than crashing the program.
85 - */
86 - run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
87 - /**
88 - * Explicitly adds an emitter to the domain. If any event handlers called by
89 - * the emitter throw an error, or if the emitter emits an `'error'` event, it
90 - * will be routed to the domain's `'error'` event, just like with implicit
91 - * binding.
92 - *
93 - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by
94 - * the domain `'error'` handler.
95 - *
96 - * If the Timer or `EventEmitter` was already bound to a domain, it is removed
97 - * from that one, and bound to this one instead.
98 - * @param emitter emitter or timer to be added to the domain
99 - */
100 - add(emitter: EventEmitter | NodeJS.Timer): void;
101 - /**
102 - * The opposite of {@link add}. Removes domain handling from the
103 - * specified emitter.
104 - * @param emitter emitter or timer to be removed from the domain
105 - */
106 - remove(emitter: EventEmitter | NodeJS.Timer): void;
107 - /**
108 - * The returned function will be a wrapper around the supplied callback
109 - * function. When the returned function is called, any errors that are
110 - * thrown will be routed to the domain's `'error'` event.
111 - *
112 - * ```js
113 - * const d = domain.create();
114 - *
115 - * function readSomeFile(filename, cb) {
116 - * fs.readFile(filename, 'utf8', d.bind((er, data) => {
117 - * // If this throws, it will also be passed to the domain.
118 - * return cb(er, data ? JSON.parse(data) : null);
119 - * }));
120 - * }
121 - *
122 - * d.on('error', (er) => {
123 - * // An error occurred somewhere. If we throw it now, it will crash the program
124 - * // with the normal line number and stack message.
125 - * });
126 - * ```
127 - * @param callback The callback function
128 - * @return The bound function
129 - */
130 - bind<T extends Function>(callback: T): T;
131 - /**
132 - * This method is almost identical to {@link bind}. However, in
133 - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function.
134 - *
135 - * In this way, the common `if (err) return callback(err);` pattern can be replaced
136 - * with a single error handler in a single place.
137 - *
138 - * ```js
139 - * const d = domain.create();
140 - *
141 - * function readSomeFile(filename, cb) {
142 - * fs.readFile(filename, 'utf8', d.intercept((data) => {
143 - * // Note, the first argument is never passed to the
144 - * // callback since it is assumed to be the 'Error' argument
145 - * // and thus intercepted by the domain.
146 - *
147 - * // If this throws, it will also be passed to the domain
148 - * // so the error-handling logic can be moved to the 'error'
149 - * // event on the domain instead of being repeated throughout
150 - * // the program.
151 - * return cb(null, JSON.parse(data));
152 - * }));
153 - * }
154 - *
155 - * d.on('error', (er) => {
156 - * // An error occurred somewhere. If we throw it now, it will crash the program
157 - * // with the normal line number and stack message.
158 - * });
159 - * ```
160 - * @param callback The callback function
161 - * @return The intercepted function
162 - */
163 - intercept<T extends Function>(callback: T): T;
164 - }
165 - function create(): Domain;
166 -}
167 -declare module 'node:domain' {
168 - export * from 'domain';
169 -}
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 -// Declare "static" methods in Error
2 -interface ErrorConstructor {
3 - /** Create .stack property on a target object */
4 - captureStackTrace(targetObject: object, constructorOpt?: Function): void;
5 -
6 - /**
7 - * Optional override for formatting stack traces
8 - *
9 - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
10 - */
11 - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
12 -
13 - stackTraceLimit: number;
14 -}
15 -
16 -/*-----------------------------------------------*
17 - * *
18 - * GLOBAL *
19 - * *
20 - ------------------------------------------------*/
21 -
22 -// For backwards compability
23 -interface NodeRequire extends NodeJS.Require { }
24 -interface RequireResolve extends NodeJS.RequireResolve { }
25 -interface NodeModule extends NodeJS.Module { }
26 -
27 -declare var process: NodeJS.Process;
28 -declare var console: Console;
29 -
30 -declare var __filename: string;
31 -declare var __dirname: string;
32 -
33 -declare var require: NodeRequire;
34 -declare var module: NodeModule;
35 -
36 -// Same as module.exports
37 -declare var exports: any;
38 -
39 -/**
40 - * Only available if `--expose-gc` is passed to the process.
41 - */
42 -declare var gc: undefined | (() => void);
43 -
44 -//#region borrowed
45 -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
46 -/** A controller object that allows you to abort one or more DOM requests as and when desired. */
47 -interface AbortController {
48 - /**
49 - * Returns the AbortSignal object associated with this object.
50 - */
51 -
52 - readonly signal: AbortSignal;
53 - /**
54 - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
55 - */
56 - abort(): void;
57 -}
58 -
59 -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
60 -interface AbortSignal {
61 - /**
62 - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
63 - */
64 - readonly aborted: boolean;
65 -}
66 -
67 -declare var AbortController: {
68 - prototype: AbortController;
69 - new(): AbortController;
70 -};
71 -
72 -declare var AbortSignal: {
73 - prototype: AbortSignal;
74 - new(): AbortSignal;
75 - // TODO: Add abort() static
76 -};
77 -//#endregion borrowed
78 -
79 -//#region ArrayLike.at()
80 -interface RelativeIndexable<T> {
81 - /**
82 - * Takes an integer value and returns the item at that index,
83 - * allowing for positive and negative integers.
84 - * Negative integers count back from the last item in the array.
85 - */
86 - at(index: number): T | undefined;
87 -}
88 -interface String extends RelativeIndexable<string> {}
89 -interface Array<T> extends RelativeIndexable<T> {}
90 -interface Int8Array extends RelativeIndexable<number> {}
91 -interface Uint8Array extends RelativeIndexable<number> {}
92 -interface Uint8ClampedArray extends RelativeIndexable<number> {}
93 -interface Int16Array extends RelativeIndexable<number> {}
94 -interface Uint16Array extends RelativeIndexable<number> {}
95 -interface Int32Array extends RelativeIndexable<number> {}
96 -interface Uint32Array extends RelativeIndexable<number> {}
97 -interface Float32Array extends RelativeIndexable<number> {}
98 -interface Float64Array extends RelativeIndexable<number> {}
99 -interface BigInt64Array extends RelativeIndexable<bigint> {}
100 -interface BigUint64Array extends RelativeIndexable<bigint> {}
101 -//#endregion ArrayLike.at() end
102 -
103 -/**
104 - * @since v17.0.0
105 - *
106 - * Creates a deep clone of an object.
107 - */
108 -declare function structuredClone<T>(
109 - value: T,
110 - transfer?: { transfer: ReadonlyArray<import('worker_threads').TransferListItem> },
111 -): T;
112 -
113 -/*----------------------------------------------*
114 -* *
115 -* GLOBAL INTERFACES *
116 -* *
117 -*-----------------------------------------------*/
118 -declare namespace NodeJS {
119 - interface CallSite {
120 - /**
121 - * Value of "this"
122 - */
123 - getThis(): unknown;
124 -
125 - /**
126 - * Type of "this" as a string.
127 - * This is the name of the function stored in the constructor field of
128 - * "this", if available. Otherwise the object's [[Class]] internal
129 - * property.
130 - */
131 - getTypeName(): string | null;
132 -
133 - /**
134 - * Current function
135 - */
136 - getFunction(): Function | undefined;
137 -
138 - /**
139 - * Name of the current function, typically its name property.
140 - * If a name property is not available an attempt will be made to try
141 - * to infer a name from the function's context.
142 - */
143 - getFunctionName(): string | null;
144 -
145 - /**
146 - * Name of the property [of "this" or one of its prototypes] that holds
147 - * the current function
148 - */
149 - getMethodName(): string | null;
150 -
151 - /**
152 - * Name of the script [if this function was defined in a script]
153 - */
154 - getFileName(): string | null;
155 -
156 - /**
157 - * Current line number [if this function was defined in a script]
158 - */
159 - getLineNumber(): number | null;
160 -
161 - /**
162 - * Current column number [if this function was defined in a script]
163 - */
164 - getColumnNumber(): number | null;
165 -
166 - /**
167 - * A call site object representing the location where eval was called
168 - * [if this function was created using a call to eval]
169 - */
170 - getEvalOrigin(): string | undefined;
171 -
172 - /**
173 - * Is this a toplevel invocation, that is, is "this" the global object?
174 - */
175 - isToplevel(): boolean;
176 -
177 - /**
178 - * Does this call take place in code defined by a call to eval?
179 - */
180 - isEval(): boolean;
181 -
182 - /**
183 - * Is this call in native V8 code?
184 - */
185 - isNative(): boolean;
186 -
187 - /**
188 - * Is this a constructor call?
189 - */
190 - isConstructor(): boolean;
191 - }
192 -
193 - interface ErrnoException extends Error {
194 - errno?: number | undefined;
195 - code?: string | undefined;
196 - path?: string | undefined;
197 - syscall?: string | undefined;
198 - }
199 -
200 - interface ReadableStream extends EventEmitter {
201 - readable: boolean;
202 - read(size?: number): string | Buffer;
203 - setEncoding(encoding: BufferEncoding): this;
204 - pause(): this;
205 - resume(): this;
206 - isPaused(): boolean;
207 - pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
208 - unpipe(destination?: WritableStream): this;
209 - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
210 - wrap(oldStream: ReadableStream): this;
211 - [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
212 - }
213 -
214 - interface WritableStream extends EventEmitter {
215 - writable: boolean;
216 - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
217 - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
218 - end(cb?: () => void): this;
219 - end(data: string | Uint8Array, cb?: () => void): this;
220 - end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
221 - }
222 -
223 - interface ReadWriteStream extends ReadableStream, WritableStream { }
224 -
225 - interface RefCounted {
226 - ref(): this;
227 - unref(): this;
228 - }
229 -
230 - type TypedArray =
231 - | Uint8Array
232 - | Uint8ClampedArray
233 - | Uint16Array
234 - | Uint32Array
235 - | Int8Array
236 - | Int16Array
237 - | Int32Array
238 - | BigUint64Array
239 - | BigInt64Array
240 - | Float32Array
241 - | Float64Array;
242 - type ArrayBufferView = TypedArray | DataView;
243 -
244 - interface Require {
245 - (id: string): any;
246 - resolve: RequireResolve;
247 - cache: Dict<NodeModule>;
248 - /**
249 - * @deprecated
250 - */
251 - extensions: RequireExtensions;
252 - main: Module | undefined;
253 - }
254 -
255 - interface RequireResolve {
256 - (id: string, options?: { paths?: string[] | undefined; }): string;
257 - paths(request: string): string[] | null;
258 - }
259 -
260 - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
261 - '.js': (m: Module, filename: string) => any;
262 - '.json': (m: Module, filename: string) => any;
263 - '.node': (m: Module, filename: string) => any;
264 - }
265 - interface Module {
266 - /**
267 - * `true` if the module is running during the Node.js preload
268 - */
269 - isPreloading: boolean;
270 - exports: any;
271 - require: Require;
272 - id: string;
273 - filename: string;
274 - loaded: boolean;
275 - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
276 - parent: Module | null | undefined;
277 - children: Module[];
278 - /**
279 - * @since v11.14.0
280 - *
281 - * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
282 - */
283 - path: string;
284 - paths: string[];
285 - }
286 -
287 - interface Dict<T> {
288 - [key: string]: T | undefined;
289 - }
290 -
291 - interface ReadOnlyDict<T> {
292 - readonly [key: string]: T | undefined;
293 - }
294 -}
1 -declare var global: typeof globalThis;
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 -// Type definitions for non-npm package Node.js 17.0
2 -// Project: https://nodejs.org/
3 -// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4 -// DefinitelyTyped <https://github.com/DefinitelyTyped>
5 -// Alberto Schiabel <https://github.com/jkomyno>
6 -// Alvis HT Tang <https://github.com/alvis>
7 -// Andrew Makarov <https://github.com/r3nya>
8 -// Benjamin Toueg <https://github.com/btoueg>
9 -// Chigozirim C. <https://github.com/smac89>
10 -// David Junger <https://github.com/touffy>
11 -// Deividas Bakanas <https://github.com/DeividasBakanas>
12 -// Eugene Y. Q. Shen <https://github.com/eyqs>
13 -// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
14 -// Huw <https://github.com/hoo29>
15 -// Kelvin Jin <https://github.com/kjin>
16 -// Klaus Meinhardt <https://github.com/ajafff>
17 -// Lishude <https://github.com/islishude>
18 -// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
19 -// Mohsen Azimi <https://github.com/mohsen1>
20 -// Nicolas Even <https://github.com/n-e>
21 -// Nikita Galkin <https://github.com/galkin>
22 -// Parambir Singh <https://github.com/parambirs>
23 -// Sebastian Silbermann <https://github.com/eps1lon>
24 -// Simon Schick <https://github.com/SimonSchick>
25 -// Thomas den Hollander <https://github.com/ThomasdenH>
26 -// Wilco Bakker <https://github.com/WilcoBakker>
27 -// wwwy3y3 <https://github.com/wwwy3y3>
28 -// Samuel Ainsworth <https://github.com/samuela>
29 -// Kyle Uehlein <https://github.com/kuehlein>
30 -// Thanik Bhongbhibhat <https://github.com/bhongy>
31 -// Marcin Kopacz <https://github.com/chyzwar>
32 -// Trivikram Kamat <https://github.com/trivikr>
33 -// Junxiao Shi <https://github.com/yoursunny>
34 -// Ilia Baryshnikov <https://github.com/qwelias>
35 -// ExE Boss <https://github.com/ExE-Boss>
36 -// Piotr Błażejewicz <https://github.com/peterblazejewicz>
37 -// Anna Henningsen <https://github.com/addaleax>
38 -// Victor Perin <https://github.com/victorperin>
39 -// Yongsheng Zhang <https://github.com/ZYSzys>
40 -// NodeJS Contributors <https://github.com/NodeJS>
41 -// Linus Unnebäck <https://github.com/LinusU>
42 -// wafuwafu13 <https://github.com/wafuwafu13>
43 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
44 -
45 -/**
46 - * License for programmatically and manually incorporated
47 - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
48 - *
49 - * Copyright Node.js contributors. All rights reserved.
50 - * Permission is hereby granted, free of charge, to any person obtaining a copy
51 - * of this software and associated documentation files (the "Software"), to
52 - * deal in the Software without restriction, including without limitation the
53 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
54 - * sell copies of the Software, and to permit persons to whom the Software is
55 - * furnished to do so, subject to the following conditions:
56 - *
57 - * The above copyright notice and this permission notice shall be included in
58 - * all copies or substantial portions of the Software.
59 - *
60 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
65 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
66 - * IN THE SOFTWARE.
67 - */
68 -
69 -// NOTE: These definitions support NodeJS and TypeScript 3.7+.
70 -
71 -// Reference required types from the default lib:
72 -/// <reference lib="es2020" />
73 -/// <reference lib="esnext.asynciterable" />
74 -/// <reference lib="esnext.intl" />
75 -/// <reference lib="esnext.bigint" />
76 -
77 -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
78 -/// <reference path="assert.d.ts" />
79 -/// <reference path="assert/strict.d.ts" />
80 -/// <reference path="globals.d.ts" />
81 -/// <reference path="async_hooks.d.ts" />
82 -/// <reference path="buffer.d.ts" />
83 -/// <reference path="child_process.d.ts" />
84 -/// <reference path="cluster.d.ts" />
85 -/// <reference path="console.d.ts" />
86 -/// <reference path="constants.d.ts" />
87 -/// <reference path="crypto.d.ts" />
88 -/// <reference path="dgram.d.ts" />
89 -/// <reference path="diagnostics_channel.d.ts" />
90 -/// <reference path="dns.d.ts" />
91 -/// <reference path="dns/promises.d.ts" />
92 -/// <reference path="dns/promises.d.ts" />
93 -/// <reference path="domain.d.ts" />
94 -/// <reference path="events.d.ts" />
95 -/// <reference path="fs.d.ts" />
96 -/// <reference path="fs/promises.d.ts" />
97 -/// <reference path="http.d.ts" />
98 -/// <reference path="http2.d.ts" />
99 -/// <reference path="https.d.ts" />
100 -/// <reference path="inspector.d.ts" />
101 -/// <reference path="module.d.ts" />
102 -/// <reference path="net.d.ts" />
103 -/// <reference path="os.d.ts" />
104 -/// <reference path="path.d.ts" />
105 -/// <reference path="perf_hooks.d.ts" />
106 -/// <reference path="process.d.ts" />
107 -/// <reference path="punycode.d.ts" />
108 -/// <reference path="querystring.d.ts" />
109 -/// <reference path="readline.d.ts" />
110 -/// <reference path="repl.d.ts" />
111 -/// <reference path="stream.d.ts" />
112 -/// <reference path="stream/promises.d.ts" />
113 -/// <reference path="stream/consumers.d.ts" />
114 -/// <reference path="stream/web.d.ts" />
115 -/// <reference path="string_decoder.d.ts" />
116 -/// <reference path="timers.d.ts" />
117 -/// <reference path="timers/promises.d.ts" />
118 -/// <reference path="tls.d.ts" />
119 -/// <reference path="trace_events.d.ts" />
120 -/// <reference path="tty.d.ts" />
121 -/// <reference path="url.d.ts" />
122 -/// <reference path="util.d.ts" />
123 -/// <reference path="v8.d.ts" />
124 -/// <reference path="vm.d.ts" />
125 -/// <reference path="wasi.d.ts" />
126 -/// <reference path="worker_threads.d.ts" />
127 -/// <reference path="zlib.d.ts" />
128 -
129 -/// <reference path="globals.global.d.ts" />
This diff could not be displayed because it is too large.
1 -/**
2 - * @since v0.3.7
3 - */
4 -declare module 'module' {
5 - import { URL } from 'node:url';
6 - namespace Module {
7 - /**
8 - * The `module.syncBuiltinESMExports()` method updates all the live bindings for
9 - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It
10 - * does not add or remove exported names from the `ES Modules`.
11 - *
12 - * ```js
13 - * const fs = require('fs');
14 - * const assert = require('assert');
15 - * const { syncBuiltinESMExports } = require('module');
16 - *
17 - * fs.readFile = newAPI;
18 - *
19 - * delete fs.readFileSync;
20 - *
21 - * function newAPI() {
22 - * // ...
23 - * }
24 - *
25 - * fs.newAPI = newAPI;
26 - *
27 - * syncBuiltinESMExports();
28 - *
29 - * import('fs').then((esmFS) => {
30 - * // It syncs the existing readFile property with the new value
31 - * assert.strictEqual(esmFS.readFile, newAPI);
32 - * // readFileSync has been deleted from the required fs
33 - * assert.strictEqual('readFileSync' in fs, false);
34 - * // syncBuiltinESMExports() does not remove readFileSync from esmFS
35 - * assert.strictEqual('readFileSync' in esmFS, true);
36 - * // syncBuiltinESMExports() does not add names
37 - * assert.strictEqual(esmFS.newAPI, undefined);
38 - * });
39 - * ```
40 - * @since v12.12.0
41 - */
42 - function syncBuiltinESMExports(): void;
43 - /**
44 - * `path` is the resolved path for the file for which a corresponding source map
45 - * should be fetched.
46 - * @since v13.7.0, v12.17.0
47 - */
48 - function findSourceMap(path: string, error?: Error): SourceMap;
49 - interface SourceMapPayload {
50 - file: string;
51 - version: number;
52 - sources: string[];
53 - sourcesContent: string[];
54 - names: string[];
55 - mappings: string;
56 - sourceRoot: string;
57 - }
58 - interface SourceMapping {
59 - generatedLine: number;
60 - generatedColumn: number;
61 - originalSource: string;
62 - originalLine: number;
63 - originalColumn: number;
64 - }
65 - /**
66 - * @since v13.7.0, v12.17.0
67 - */
68 - class SourceMap {
69 - /**
70 - * Getter for the payload used to construct the `SourceMap` instance.
71 - */
72 - readonly payload: SourceMapPayload;
73 - constructor(payload: SourceMapPayload);
74 - /**
75 - * Given a line number and column number in the generated source file, returns
76 - * an object representing the position in the original file. The object returned
77 - * consists of the following keys:
78 - */
79 - findEntry(line: number, column: number): SourceMapping;
80 - }
81 - }
82 - interface Module extends NodeModule {}
83 - class Module {
84 - static runMain(): void;
85 - static wrap(code: string): string;
86 - static createRequire(path: string | URL): NodeRequire;
87 - static builtinModules: string[];
88 - static Module: typeof Module;
89 - constructor(id: string, parent?: Module);
90 - }
91 - global {
92 - interface ImportMeta {
93 - url: string;
94 - /**
95 - * @experimental
96 - * This feature is only available with the `--experimental-import-meta-resolve`
97 - * command flag enabled.
98 - *
99 - * Provides a module-relative resolution function scoped to each module, returning
100 - * the URL string.
101 - *
102 - * @param specified The module specifier to resolve relative to `parent`.
103 - * @param parent The absolute parent module URL to resolve from. If none
104 - * is specified, the value of `import.meta.url` is used as the default.
105 - */
106 - resolve?(specified: string, parent?: string | URL): Promise<string>;
107 - }
108 - }
109 - export = Module;
110 -}
111 -declare module 'node:module' {
112 - import module = require('module');
113 - export = module;
114 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -{
2 - "name": "@types/node",
3 - "version": "17.0.34",
4 - "description": "TypeScript definitions for Node.js",
5 - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6 - "license": "MIT",
7 - "contributors": [
8 - {
9 - "name": "Microsoft TypeScript",
10 - "url": "https://github.com/Microsoft",
11 - "githubUsername": "Microsoft"
12 - },
13 - {
14 - "name": "DefinitelyTyped",
15 - "url": "https://github.com/DefinitelyTyped",
16 - "githubUsername": "DefinitelyTyped"
17 - },
18 - {
19 - "name": "Alberto Schiabel",
20 - "url": "https://github.com/jkomyno",
21 - "githubUsername": "jkomyno"
22 - },
23 - {
24 - "name": "Alvis HT Tang",
25 - "url": "https://github.com/alvis",
26 - "githubUsername": "alvis"
27 - },
28 - {
29 - "name": "Andrew Makarov",
30 - "url": "https://github.com/r3nya",
31 - "githubUsername": "r3nya"
32 - },
33 - {
34 - "name": "Benjamin Toueg",
35 - "url": "https://github.com/btoueg",
36 - "githubUsername": "btoueg"
37 - },
38 - {
39 - "name": "Chigozirim C.",
40 - "url": "https://github.com/smac89",
41 - "githubUsername": "smac89"
42 - },
43 - {
44 - "name": "David Junger",
45 - "url": "https://github.com/touffy",
46 - "githubUsername": "touffy"
47 - },
48 - {
49 - "name": "Deividas Bakanas",
50 - "url": "https://github.com/DeividasBakanas",
51 - "githubUsername": "DeividasBakanas"
52 - },
53 - {
54 - "name": "Eugene Y. Q. Shen",
55 - "url": "https://github.com/eyqs",
56 - "githubUsername": "eyqs"
57 - },
58 - {
59 - "name": "Hannes Magnusson",
60 - "url": "https://github.com/Hannes-Magnusson-CK",
61 - "githubUsername": "Hannes-Magnusson-CK"
62 - },
63 - {
64 - "name": "Huw",
65 - "url": "https://github.com/hoo29",
66 - "githubUsername": "hoo29"
67 - },
68 - {
69 - "name": "Kelvin Jin",
70 - "url": "https://github.com/kjin",
71 - "githubUsername": "kjin"
72 - },
73 - {
74 - "name": "Klaus Meinhardt",
75 - "url": "https://github.com/ajafff",
76 - "githubUsername": "ajafff"
77 - },
78 - {
79 - "name": "Lishude",
80 - "url": "https://github.com/islishude",
81 - "githubUsername": "islishude"
82 - },
83 - {
84 - "name": "Mariusz Wiktorczyk",
85 - "url": "https://github.com/mwiktorczyk",
86 - "githubUsername": "mwiktorczyk"
87 - },
88 - {
89 - "name": "Mohsen Azimi",
90 - "url": "https://github.com/mohsen1",
91 - "githubUsername": "mohsen1"
92 - },
93 - {
94 - "name": "Nicolas Even",
95 - "url": "https://github.com/n-e",
96 - "githubUsername": "n-e"
97 - },
98 - {
99 - "name": "Nikita Galkin",
100 - "url": "https://github.com/galkin",
101 - "githubUsername": "galkin"
102 - },
103 - {
104 - "name": "Parambir Singh",
105 - "url": "https://github.com/parambirs",
106 - "githubUsername": "parambirs"
107 - },
108 - {
109 - "name": "Sebastian Silbermann",
110 - "url": "https://github.com/eps1lon",
111 - "githubUsername": "eps1lon"
112 - },
113 - {
114 - "name": "Simon Schick",
115 - "url": "https://github.com/SimonSchick",
116 - "githubUsername": "SimonSchick"
117 - },
118 - {
119 - "name": "Thomas den Hollander",
120 - "url": "https://github.com/ThomasdenH",
121 - "githubUsername": "ThomasdenH"
122 - },
123 - {
124 - "name": "Wilco Bakker",
125 - "url": "https://github.com/WilcoBakker",
126 - "githubUsername": "WilcoBakker"
127 - },
128 - {
129 - "name": "wwwy3y3",
130 - "url": "https://github.com/wwwy3y3",
131 - "githubUsername": "wwwy3y3"
132 - },
133 - {
134 - "name": "Samuel Ainsworth",
135 - "url": "https://github.com/samuela",
136 - "githubUsername": "samuela"
137 - },
138 - {
139 - "name": "Kyle Uehlein",
140 - "url": "https://github.com/kuehlein",
141 - "githubUsername": "kuehlein"
142 - },
143 - {
144 - "name": "Thanik Bhongbhibhat",
145 - "url": "https://github.com/bhongy",
146 - "githubUsername": "bhongy"
147 - },
148 - {
149 - "name": "Marcin Kopacz",
150 - "url": "https://github.com/chyzwar",
151 - "githubUsername": "chyzwar"
152 - },
153 - {
154 - "name": "Trivikram Kamat",
155 - "url": "https://github.com/trivikr",
156 - "githubUsername": "trivikr"
157 - },
158 - {
159 - "name": "Junxiao Shi",
160 - "url": "https://github.com/yoursunny",
161 - "githubUsername": "yoursunny"
162 - },
163 - {
164 - "name": "Ilia Baryshnikov",
165 - "url": "https://github.com/qwelias",
166 - "githubUsername": "qwelias"
167 - },
168 - {
169 - "name": "ExE Boss",
170 - "url": "https://github.com/ExE-Boss",
171 - "githubUsername": "ExE-Boss"
172 - },
173 - {
174 - "name": "Piotr Błażejewicz",
175 - "url": "https://github.com/peterblazejewicz",
176 - "githubUsername": "peterblazejewicz"
177 - },
178 - {
179 - "name": "Anna Henningsen",
180 - "url": "https://github.com/addaleax",
181 - "githubUsername": "addaleax"
182 - },
183 - {
184 - "name": "Victor Perin",
185 - "url": "https://github.com/victorperin",
186 - "githubUsername": "victorperin"
187 - },
188 - {
189 - "name": "Yongsheng Zhang",
190 - "url": "https://github.com/ZYSzys",
191 - "githubUsername": "ZYSzys"
192 - },
193 - {
194 - "name": "NodeJS Contributors",
195 - "url": "https://github.com/NodeJS",
196 - "githubUsername": "NodeJS"
197 - },
198 - {
199 - "name": "Linus Unnebäck",
200 - "url": "https://github.com/LinusU",
201 - "githubUsername": "LinusU"
202 - },
203 - {
204 - "name": "wafuwafu13",
205 - "url": "https://github.com/wafuwafu13",
206 - "githubUsername": "wafuwafu13"
207 - }
208 - ],
209 - "main": "",
210 - "types": "index.d.ts",
211 - "repository": {
212 - "type": "git",
213 - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
214 - "directory": "types/node"
215 - },
216 - "scripts": {},
217 - "dependencies": {},
218 - "typesPublisherContentHash": "b51a58e3b35cbc4ff47bc9fce4296c0f581049d66596b52af715b63c47f24a8b",
219 - "typeScriptVersion": "3.9"
220 -}
...\ No newline at end of file ...\ No newline at end of file
1 -declare module 'path/posix' {
2 - import path = require('path');
3 - export = path;
4 -}
5 -declare module 'path/win32' {
6 - import path = require('path');
7 - export = path;
8 -}
9 -/**
10 - * The `path` module provides utilities for working with file and directory paths.
11 - * It can be accessed using:
12 - *
13 - * ```js
14 - * const path = require('path');
15 - * ```
16 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/path.js)
17 - */
18 -declare module 'path' {
19 - namespace path {
20 - /**
21 - * A parsed path object generated by path.parse() or consumed by path.format().
22 - */
23 - interface ParsedPath {
24 - /**
25 - * The root of the path such as '/' or 'c:\'
26 - */
27 - root: string;
28 - /**
29 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
30 - */
31 - dir: string;
32 - /**
33 - * The file name including extension (if any) such as 'index.html'
34 - */
35 - base: string;
36 - /**
37 - * The file extension (if any) such as '.html'
38 - */
39 - ext: string;
40 - /**
41 - * The file name without extension (if any) such as 'index'
42 - */
43 - name: string;
44 - }
45 - interface FormatInputPathObject {
46 - /**
47 - * The root of the path such as '/' or 'c:\'
48 - */
49 - root?: string | undefined;
50 - /**
51 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
52 - */
53 - dir?: string | undefined;
54 - /**
55 - * The file name including extension (if any) such as 'index.html'
56 - */
57 - base?: string | undefined;
58 - /**
59 - * The file extension (if any) such as '.html'
60 - */
61 - ext?: string | undefined;
62 - /**
63 - * The file name without extension (if any) such as 'index'
64 - */
65 - name?: string | undefined;
66 - }
67 - interface PlatformPath {
68 - /**
69 - * Normalize a string path, reducing '..' and '.' parts.
70 - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
71 - *
72 - * @param p string path to normalize.
73 - */
74 - normalize(p: string): string;
75 - /**
76 - * Join all arguments together and normalize the resulting path.
77 - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
78 - *
79 - * @param paths paths to join.
80 - */
81 - join(...paths: string[]): string;
82 - /**
83 - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84 - *
85 - * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
86 - *
87 - * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
88 - * until an absolute path is found. If after using all {from} paths still no absolute path is found,
89 - * the current working directory is used as well. The resulting path is normalized,
90 - * and trailing slashes are removed unless the path gets resolved to the root directory.
91 - *
92 - * @param pathSegments string paths to join. Non-string arguments are ignored.
93 - */
94 - resolve(...pathSegments: string[]): string;
95 - /**
96 - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
97 - *
98 - * @param path path to test.
99 - */
100 - isAbsolute(p: string): boolean;
101 - /**
102 - * Solve the relative path from {from} to {to}.
103 - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
104 - */
105 - relative(from: string, to: string): string;
106 - /**
107 - * Return the directory name of a path. Similar to the Unix dirname command.
108 - *
109 - * @param p the path to evaluate.
110 - */
111 - dirname(p: string): string;
112 - /**
113 - * Return the last portion of a path. Similar to the Unix basename command.
114 - * Often used to extract the file name from a fully qualified path.
115 - *
116 - * @param p the path to evaluate.
117 - * @param ext optionally, an extension to remove from the result.
118 - */
119 - basename(p: string, ext?: string): string;
120 - /**
121 - * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
122 - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
123 - *
124 - * @param p the path to evaluate.
125 - */
126 - extname(p: string): string;
127 - /**
128 - * The platform-specific file separator. '\\' or '/'.
129 - */
130 - readonly sep: string;
131 - /**
132 - * The platform-specific file delimiter. ';' or ':'.
133 - */
134 - readonly delimiter: string;
135 - /**
136 - * Returns an object from a path string - the opposite of format().
137 - *
138 - * @param pathString path to evaluate.
139 - */
140 - parse(p: string): ParsedPath;
141 - /**
142 - * Returns a path string from an object - the opposite of parse().
143 - *
144 - * @param pathString path to evaluate.
145 - */
146 - format(pP: FormatInputPathObject): string;
147 - /**
148 - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
149 - * If path is not a string, path will be returned without modifications.
150 - * This method is meaningful only on Windows system.
151 - * On POSIX systems, the method is non-operational and always returns path without modifications.
152 - */
153 - toNamespacedPath(path: string): string;
154 - /**
155 - * Posix specific pathing.
156 - * Same as parent object on posix.
157 - */
158 - readonly posix: PlatformPath;
159 - /**
160 - * Windows specific pathing.
161 - * Same as parent object on windows
162 - */
163 - readonly win32: PlatformPath;
164 - }
165 - }
166 - const path: path.PlatformPath;
167 - export = path;
168 -}
169 -declare module 'node:path' {
170 - import path = require('path');
171 - export = path;
172 -}
173 -declare module 'node:path/posix' {
174 - import path = require('path/posix');
175 - export = path;
176 -}
177 -declare module 'node:path/win32' {
178 - import path = require('path/win32');
179 - export = path;
180 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -/**
2 - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users
3 - * currently depending on the `punycode` module should switch to using the
4 - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL
5 - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`.
6 - *
7 - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It
8 - * can be accessed using:
9 - *
10 - * ```js
11 - * const punycode = require('punycode');
12 - * ```
13 - *
14 - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
15 - * primarily intended for use in Internationalized Domain Names. Because host
16 - * names in URLs are limited to ASCII characters only, Domain Names that contain
17 - * non-ASCII characters must be converted into ASCII using the Punycode scheme.
18 - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent
19 - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`.
20 - *
21 - * The `punycode` module provides a simple implementation of the Punycode standard.
22 - *
23 - * The `punycode` module is a third-party dependency used by Node.js and
24 - * made available to developers as a convenience. Fixes or other modifications to
25 - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
26 - * @deprecated Since v7.0.0 - Deprecated
27 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/punycode.js)
28 - */
29 -declare module 'punycode' {
30 - /**
31 - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only
32 - * characters to the equivalent string of Unicode codepoints.
33 - *
34 - * ```js
35 - * punycode.decode('maana-pta'); // 'mañana'
36 - * punycode.decode('--dqo34k'); // '☃-⌘'
37 - * ```
38 - * @since v0.5.1
39 - */
40 - function decode(string: string): string;
41 - /**
42 - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
43 - *
44 - * ```js
45 - * punycode.encode('mañana'); // 'maana-pta'
46 - * punycode.encode('☃-⌘'); // '--dqo34k'
47 - * ```
48 - * @since v0.5.1
49 - */
50 - function encode(string: string): string;
51 - /**
52 - * The `punycode.toUnicode()` method converts a string representing a domain name
53 - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
54 - * converted.
55 - *
56 - * ```js
57 - * // decode domain names
58 - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
59 - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
60 - * punycode.toUnicode('example.com'); // 'example.com'
61 - * ```
62 - * @since v0.6.1
63 - */
64 - function toUnicode(domain: string): string;
65 - /**
66 - * The `punycode.toASCII()` method converts a Unicode string representing an
67 - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the
68 - * domain name will be converted. Calling `punycode.toASCII()` on a string that
69 - * already only contains ASCII characters will have no effect.
70 - *
71 - * ```js
72 - * // encode domain names
73 - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
74 - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
75 - * punycode.toASCII('example.com'); // 'example.com'
76 - * ```
77 - * @since v0.6.1
78 - */
79 - function toASCII(domain: string): string;
80 - /**
81 - * @deprecated since v7.0.0
82 - * The version of the punycode module bundled in Node.js is being deprecated.
83 - * In a future major version of Node.js this module will be removed.
84 - * Users currently depending on the punycode module should switch to using
85 - * the userland-provided Punycode.js module instead.
86 - */
87 - const ucs2: ucs2;
88 - interface ucs2 {
89 - /**
90 - * @deprecated since v7.0.0
91 - * The version of the punycode module bundled in Node.js is being deprecated.
92 - * In a future major version of Node.js this module will be removed.
93 - * Users currently depending on the punycode module should switch to using
94 - * the userland-provided Punycode.js module instead.
95 - */
96 - decode(string: string): number[];
97 - /**
98 - * @deprecated since v7.0.0
99 - * The version of the punycode module bundled in Node.js is being deprecated.
100 - * In a future major version of Node.js this module will be removed.
101 - * Users currently depending on the punycode module should switch to using
102 - * the userland-provided Punycode.js module instead.
103 - */
104 - encode(codePoints: ReadonlyArray<number>): string;
105 - }
106 - /**
107 - * @deprecated since v7.0.0
108 - * The version of the punycode module bundled in Node.js is being deprecated.
109 - * In a future major version of Node.js this module will be removed.
110 - * Users currently depending on the punycode module should switch to using
111 - * the userland-provided Punycode.js module instead.
112 - */
113 - const version: string;
114 -}
115 -declare module 'node:punycode' {
116 - export * from 'punycode';
117 -}
1 -/**
2 - * The `querystring` module provides utilities for parsing and formatting URL
3 - * query strings. It can be accessed using:
4 - *
5 - * ```js
6 - * const querystring = require('querystring');
7 - * ```
8 - *
9 - * The `querystring` API is considered Legacy. While it is still maintained,
10 - * new code should use the `URLSearchParams` API instead.
11 - * @deprecated Legacy
12 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/querystring.js)
13 - */
14 -declare module 'querystring' {
15 - interface StringifyOptions {
16 - encodeURIComponent?: ((str: string) => string) | undefined;
17 - }
18 - interface ParseOptions {
19 - maxKeys?: number | undefined;
20 - decodeURIComponent?: ((str: string) => string) | undefined;
21 - }
22 - interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
23 - interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {}
24 - /**
25 - * The `querystring.stringify()` method produces a URL query string from a
26 - * given `obj` by iterating through the object's "own properties".
27 - *
28 - * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
29 - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
30 - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
31 - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
32 - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
33 - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
34 - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
35 - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
36 - * empty strings.
37 - *
38 - * ```js
39 - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });
40 - * // Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='
41 - *
42 - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');
43 - * // Returns 'foo:bar;baz:qux'
44 - * ```
45 - *
46 - * By default, characters requiring percent-encoding within the query string will
47 - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified:
48 - *
49 - * ```js
50 - * // Assuming gbkEncodeURIComponent function already exists,
51 - *
52 - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null,
53 - * { encodeURIComponent: gbkEncodeURIComponent });
54 - * ```
55 - * @since v0.1.25
56 - * @param obj The object to serialize into a URL query string
57 - * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
58 - * @param [eq='='] . The substring used to delimit keys and values in the query string.
59 - */
60 - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
61 - /**
62 - * The `querystring.parse()` method parses a URL query string (`str`) into a
63 - * collection of key and value pairs.
64 - *
65 - * For example, the query string `'foo=bar&#x26;abc=xyz&#x26;abc=123'` is parsed into:
66 - *
67 - * ```js
68 - * {
69 - * foo: 'bar',
70 - * abc: ['xyz', '123']
71 - * }
72 - * ```
73 - *
74 - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
75 - * `obj.hasOwnProperty()`, and others
76 - * are not defined and _will not work_.
77 - *
78 - * By default, percent-encoded characters within the query string will be assumed
79 - * to use UTF-8 encoding. If an alternative character encoding is used, then an
80 - * alternative `decodeURIComponent` option will need to be specified:
81 - *
82 - * ```js
83 - * // Assuming gbkDecodeURIComponent function already exists...
84 - *
85 - * querystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,
86 - * { decodeURIComponent: gbkDecodeURIComponent });
87 - * ```
88 - * @since v0.1.25
89 - * @param str The URL query string to parse
90 - * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
91 - * @param [eq='='] . The substring used to delimit keys and values in the query string.
92 - */
93 - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
94 - /**
95 - * The querystring.encode() function is an alias for querystring.stringify().
96 - */
97 - const encode: typeof stringify;
98 - /**
99 - * The querystring.decode() function is an alias for querystring.parse().
100 - */
101 - const decode: typeof parse;
102 - /**
103 - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL
104 - * query strings.
105 - *
106 - * The `querystring.escape()` method is used by `querystring.stringify()` and is
107 - * generally not expected to be used directly. It is exported primarily to allow
108 - * application code to provide a replacement percent-encoding implementation if
109 - * necessary by assigning `querystring.escape` to an alternative function.
110 - * @since v0.1.25
111 - */
112 - function escape(str: string): string;
113 - /**
114 - * The `querystring.unescape()` method performs decoding of URL percent-encoded
115 - * characters on the given `str`.
116 - *
117 - * The `querystring.unescape()` method is used by `querystring.parse()` and is
118 - * generally not expected to be used directly. It is exported primarily to allow
119 - * application code to provide a replacement decoding implementation if
120 - * necessary by assigning `querystring.unescape` to an alternative function.
121 - *
122 - * By default, the `querystring.unescape()` method will attempt to use the
123 - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails,
124 - * a safer equivalent that does not throw on malformed URLs will be used.
125 - * @since v0.1.25
126 - */
127 - function unescape(str: string): string;
128 -}
129 -declare module 'node:querystring' {
130 - export * from 'querystring';
131 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -// Duplicates of interface in lib.dom.ts.
2 -// Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all"
3 -// Which in turn causes tests to pass that shouldn't pass.
4 -//
5 -// This interface is not, and should not be, exported.
6 -interface Blob {
7 - readonly size: number;
8 - readonly type: string;
9 - arrayBuffer(): Promise<ArrayBuffer>;
10 - slice(start?: number, end?: number, contentType?: string): Blob;
11 - stream(): NodeJS.ReadableStream;
12 - text(): Promise<string>;
13 -}
14 -declare module 'stream/consumers' {
15 - import { Readable } from 'node:stream';
16 - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
17 - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
18 - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
19 - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Blob>;
20 - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
21 -}
22 -declare module 'node:stream/consumers' {
23 - export * from 'stream/consumers';
24 -}
1 -declare module 'stream/promises' {
2 - import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
3 - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
4 - function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
5 - function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
6 - source: A,
7 - transform1: T1,
8 - destination: B,
9 - options?: PipelineOptions
10 - ): PipelinePromise<B>;
11 - function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
12 - source: A,
13 - transform1: T1,
14 - transform2: T2,
15 - destination: B,
16 - options?: PipelineOptions
17 - ): PipelinePromise<B>;
18 - function pipeline<
19 - A extends PipelineSource<any>,
20 - T1 extends PipelineTransform<A, any>,
21 - T2 extends PipelineTransform<T1, any>,
22 - T3 extends PipelineTransform<T2, any>,
23 - B extends PipelineDestination<T3, any>
24 - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
25 - function pipeline<
26 - A extends PipelineSource<any>,
27 - T1 extends PipelineTransform<A, any>,
28 - T2 extends PipelineTransform<T1, any>,
29 - T3 extends PipelineTransform<T2, any>,
30 - T4 extends PipelineTransform<T3, any>,
31 - B extends PipelineDestination<T4, any>
32 - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
33 - function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
34 - function pipeline(
35 - stream1: NodeJS.ReadableStream,
36 - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
37 - ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
38 - ): Promise<void>;
39 -}
40 -declare module 'node:stream/promises' {
41 - export * from 'stream/promises';
42 -}
This diff is collapsed. Click to expand it.
1 -/**
2 - * The `string_decoder` module provides an API for decoding `Buffer` objects into
3 - * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
4 - * characters. It can be accessed using:
5 - *
6 - * ```js
7 - * const { StringDecoder } = require('string_decoder');
8 - * ```
9 - *
10 - * The following example shows the basic use of the `StringDecoder` class.
11 - *
12 - * ```js
13 - * const { StringDecoder } = require('string_decoder');
14 - * const decoder = new StringDecoder('utf8');
15 - *
16 - * const cent = Buffer.from([0xC2, 0xA2]);
17 - * console.log(decoder.write(cent));
18 - *
19 - * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
20 - * console.log(decoder.write(euro));
21 - * ```
22 - *
23 - * When a `Buffer` instance is written to the `StringDecoder` instance, an
24 - * internal buffer is used to ensure that the decoded string does not contain
25 - * any incomplete multibyte characters. These are held in the buffer until the
26 - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
27 - *
28 - * In the following example, the three UTF-8 encoded bytes of the European Euro
29 - * symbol (`€`) are written over three separate operations:
30 - *
31 - * ```js
32 - * const { StringDecoder } = require('string_decoder');
33 - * const decoder = new StringDecoder('utf8');
34 - *
35 - * decoder.write(Buffer.from([0xE2]));
36 - * decoder.write(Buffer.from([0x82]));
37 - * console.log(decoder.end(Buffer.from([0xAC])));
38 - * ```
39 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/string_decoder.js)
40 - */
41 -declare module 'string_decoder' {
42 - class StringDecoder {
43 - constructor(encoding?: BufferEncoding);
44 - /**
45 - * Returns a decoded string, ensuring that any incomplete multibyte characters at
46 - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
47 - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
48 - * @since v0.1.99
49 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
50 - */
51 - write(buffer: Buffer): string;
52 - /**
53 - * Returns any remaining input stored in the internal buffer as a string. Bytes
54 - * representing incomplete UTF-8 and UTF-16 characters will be replaced with
55 - * substitution characters appropriate for the character encoding.
56 - *
57 - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
58 - * After `end()` is called, the `stringDecoder` object can be reused for new input.
59 - * @since v0.9.3
60 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
61 - */
62 - end(buffer?: Buffer): string;
63 - }
64 -}
65 -declare module 'node:string_decoder' {
66 - export * from 'string_decoder';
67 -}
1 -/**
2 - * The `timer` module exposes a global API for scheduling functions to
3 - * be called at some future period of time. Because the timer functions are
4 - * globals, there is no need to call `require('timers')` to use the API.
5 - *
6 - * The timer functions within Node.js implement a similar API as the timers API
7 - * provided by Web Browsers but use a different internal implementation that is
8 - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/timers.js)
10 - */
11 -declare module 'timers' {
12 - import { Abortable } from 'node:events';
13 - import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises';
14 - interface TimerOptions extends Abortable {
15 - /**
16 - * Set to `false` to indicate that the scheduled `Timeout`
17 - * should not require the Node.js event loop to remain active.
18 - * @default true
19 - */
20 - ref?: boolean | undefined;
21 - }
22 - let setTimeout: typeof global.setTimeout;
23 - let clearTimeout: typeof global.clearTimeout;
24 - let setInterval: typeof global.setInterval;
25 - let clearInterval: typeof global.clearInterval;
26 - let setImmediate: typeof global.setImmediate;
27 - let clearImmediate: typeof global.clearImmediate;
28 - global {
29 - namespace NodeJS {
30 - // compatibility with older typings
31 - interface Timer extends RefCounted {
32 - hasRef(): boolean;
33 - refresh(): this;
34 - [Symbol.toPrimitive](): number;
35 - }
36 - interface Immediate extends RefCounted {
37 - /**
38 - * If true, the `Immediate` object will keep the Node.js event loop active.
39 - * @since v11.0.0
40 - */
41 - hasRef(): boolean;
42 - _onImmediate: Function; // to distinguish it from the Timeout class
43 - }
44 - interface Timeout extends Timer {
45 - /**
46 - * If true, the `Timeout` object will keep the Node.js event loop active.
47 - * @since v11.0.0
48 - */
49 - hasRef(): boolean;
50 - /**
51 - * Sets the timer's start time to the current time, and reschedules the timer to
52 - * call its callback at the previously specified duration adjusted to the current
53 - * time. This is useful for refreshing a timer without allocating a new
54 - * JavaScript object.
55 - *
56 - * Using this on a timer that has already called its callback will reactivate the
57 - * timer.
58 - * @since v10.2.0
59 - * @return a reference to `timeout`
60 - */
61 - refresh(): this;
62 - [Symbol.toPrimitive](): number;
63 - }
64 - }
65 - function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
66 - // util.promisify no rest args compability
67 - // tslint:disable-next-line void-return
68 - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
69 - namespace setTimeout {
70 - const __promisify__: typeof setTimeoutPromise;
71 - }
72 - function clearTimeout(timeoutId: NodeJS.Timeout | undefined): void;
73 - function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
74 - // util.promisify no rest args compability
75 - // tslint:disable-next-line void-return
76 - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer;
77 - namespace setInterval {
78 - const __promisify__: typeof setIntervalPromise;
79 - }
80 - function clearInterval(intervalId: NodeJS.Timeout | undefined): void;
81 - function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
82 - // util.promisify no rest args compability
83 - // tslint:disable-next-line void-return
84 - function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
85 - namespace setImmediate {
86 - const __promisify__: typeof setImmediatePromise;
87 - }
88 - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
89 - function queueMicrotask(callback: () => void): void;
90 - }
91 -}
92 -declare module 'node:timers' {
93 - export * from 'timers';
94 -}
1 -/**
2 - * The `timers/promises` API provides an alternative set of timer functions
3 - * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
4 - *
5 - * ```js
6 - * import {
7 - * setTimeout,
8 - * setImmediate,
9 - * setInterval,
10 - * } from 'timers/promises';
11 - * ```
12 - * @since v15.0.0
13 - */
14 -declare module 'timers/promises' {
15 - import { TimerOptions } from 'node:timers';
16 - /**
17 - * ```js
18 - * import {
19 - * setTimeout,
20 - * } from 'timers/promises';
21 - *
22 - * const res = await setTimeout(100, 'result');
23 - *
24 - * console.log(res); // Prints 'result'
25 - * ```
26 - * @since v15.0.0
27 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
28 - * @param value A value with which the promise is fulfilled.
29 - */
30 - function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
31 - /**
32 - * ```js
33 - * import {
34 - * setImmediate,
35 - * } from 'timers/promises';
36 - *
37 - * const res = await setImmediate('result');
38 - *
39 - * console.log(res); // Prints 'result'
40 - * ```
41 - * @since v15.0.0
42 - * @param value A value with which the promise is fulfilled.
43 - */
44 - function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
45 - /**
46 - * Returns an async iterator that generates values in an interval of `delay` ms.
47 - *
48 - * ```js
49 - * import {
50 - * setInterval,
51 - * } from 'timers/promises';
52 - *
53 - * const interval = 100;
54 - * for await (const startTime of setInterval(interval, Date.now())) {
55 - * const now = Date.now();
56 - * console.log(now);
57 - * if ((now - startTime) > 1000)
58 - * break;
59 - * }
60 - * console.log(Date.now());
61 - * ```
62 - * @since v15.9.0
63 - */
64 - function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
65 -}
66 -declare module 'node:timers/promises' {
67 - export * from 'timers/promises';
68 -}
This diff is collapsed. Click to expand it.
1 -/**
2 - * The `trace_events` module provides a mechanism to centralize tracing information
3 - * generated by V8, Node.js core, and userspace code.
4 - *
5 - * Tracing can be enabled with the `--trace-event-categories` command-line flag
6 - * or by using the `trace_events` module. The `--trace-event-categories` flag
7 - * accepts a list of comma-separated category names.
8 - *
9 - * The available categories are:
10 - *
11 - * * `node`: An empty placeholder.
12 - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data.
13 - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
14 - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
15 - * * `node.console`: Enables capture of `console.time()` and `console.count()`output.
16 - * * `node.dns.native`: Enables capture of trace data for DNS queries.
17 - * * `node.environment`: Enables capture of Node.js Environment milestones.
18 - * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
19 - * * `node.perf`: Enables capture of `Performance API` measurements.
20 - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
21 - * measures and marks.
22 - * * `node.perf.timerify`: Enables capture of only Performance API timerify
23 - * measurements.
24 - * * `node.promises.rejections`: Enables capture of trace data tracking the number
25 - * of unhandled Promise rejections and handled-after-rejections.
26 - * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
27 - * * `v8`: The `V8` events are GC, compiling, and execution related.
28 - *
29 - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
30 - *
31 - * ```bash
32 - * node --trace-event-categories v8,node,node.async_hooks server.js
33 - * ```
34 - *
35 - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be
36 - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default.
37 - *
38 - * ```bash
39 - * node --trace-events-enabled
40 - *
41 - * # is equivalent to
42 - *
43 - * node --trace-event-categories v8,node,node.async_hooks
44 - * ```
45 - *
46 - * Alternatively, trace events may be enabled using the `trace_events` module:
47 - *
48 - * ```js
49 - * const trace_events = require('trace_events');
50 - * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
51 - * tracing.enable(); // Enable trace event capture for the 'node.perf' category
52 - *
53 - * // do work
54 - *
55 - * tracing.disable(); // Disable trace event capture for the 'node.perf' category
56 - * ```
57 - *
58 - * Running Node.js with tracing enabled will produce log files that can be opened
59 - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
60 - *
61 - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
62 - * be specified with `--trace-event-file-pattern` that accepts a template
63 - * string that supports `${rotation}` and `${pid}`:
64 - *
65 - * ```bash
66 - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
67 - * ```
68 - *
69 - * The tracing system uses the same time source
70 - * as the one used by `process.hrtime()`.
71 - * However the trace-event timestamps are expressed in microseconds,
72 - * unlike `process.hrtime()` which returns nanoseconds.
73 - *
74 - * The features from this module are not available in `Worker` threads.
75 - * @experimental
76 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/trace_events.js)
77 - */
78 -declare module 'trace_events' {
79 - /**
80 - * The `Tracing` object is used to enable or disable tracing for sets of
81 - * categories. Instances are created using the
82 - * `trace_events.createTracing()` method.
83 - *
84 - * When created, the `Tracing` object is disabled. Calling the
85 - * `tracing.enable()` method adds the categories to the set of enabled trace
86 - * event categories. Calling `tracing.disable()` will remove the categories
87 - * from the set of enabled trace event categories.
88 - */
89 - interface Tracing {
90 - /**
91 - * A comma-separated list of the trace event categories covered by this
92 - * `Tracing` object.
93 - */
94 - readonly categories: string;
95 - /**
96 - * Disables this `Tracing` object.
97 - *
98 - * Only trace event categories _not_ covered by other enabled `Tracing`
99 - * objects and _not_ specified by the `--trace-event-categories` flag
100 - * will be disabled.
101 - */
102 - disable(): void;
103 - /**
104 - * Enables this `Tracing` object for the set of categories covered by
105 - * the `Tracing` object.
106 - */
107 - enable(): void;
108 - /**
109 - * `true` only if the `Tracing` object has been enabled.
110 - */
111 - readonly enabled: boolean;
112 - }
113 - interface CreateTracingOptions {
114 - /**
115 - * An array of trace category names. Values included in the array are
116 - * coerced to a string when possible. An error will be thrown if the
117 - * value cannot be coerced.
118 - */
119 - categories: string[];
120 - }
121 - /**
122 - * Creates and returns a `Tracing` object for the given set of `categories`.
123 - *
124 - * ```js
125 - * const trace_events = require('trace_events');
126 - * const categories = ['node.perf', 'node.async_hooks'];
127 - * const tracing = trace_events.createTracing({ categories });
128 - * tracing.enable();
129 - * // do stuff
130 - * tracing.disable();
131 - * ```
132 - * @since v10.0.0
133 - * @return .
134 - */
135 - function createTracing(options: CreateTracingOptions): Tracing;
136 - /**
137 - * Returns a comma-separated list of all currently-enabled trace event
138 - * categories. The current set of enabled trace event categories is determined
139 - * by the _union_ of all currently-enabled `Tracing` objects and any categories
140 - * enabled using the `--trace-event-categories` flag.
141 - *
142 - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
143 - *
144 - * ```js
145 - * const trace_events = require('trace_events');
146 - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
147 - * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
148 - * const t3 = trace_events.createTracing({ categories: ['v8'] });
149 - *
150 - * t1.enable();
151 - * t2.enable();
152 - *
153 - * console.log(trace_events.getEnabledCategories());
154 - * ```
155 - * @since v10.0.0
156 - */
157 - function getEnabledCategories(): string | undefined;
158 -}
159 -declare module 'node:trace_events' {
160 - export * from 'trace_events';
161 -}
1 -/**
2 - * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
3 - * In most cases, it will not be necessary or possible to use this module directly.
4 - * However, it can be accessed using:
5 - *
6 - * ```js
7 - * const tty = require('tty');
8 - * ```
9 - *
10 - * When Node.js detects that it is being run with a text terminal ("TTY")
11 - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
12 - * default, be instances of `tty.WriteStream`. The preferred method of determining
13 - * whether Node.js is being run within a TTY context is to check that the value of
14 - * the `process.stdout.isTTY` property is `true`:
15 - *
16 - * ```console
17 - * $ node -p -e "Boolean(process.stdout.isTTY)"
18 - * true
19 - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat
20 - * false
21 - * ```
22 - *
23 - * In most cases, there should be little to no reason for an application to
24 - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
25 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/tty.js)
26 - */
27 -declare module 'tty' {
28 - import * as net from 'node:net';
29 - /**
30 - * The `tty.isatty()` method returns `true` if the given `fd` is associated with
31 - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative
32 - * integer.
33 - * @since v0.5.8
34 - * @param fd A numeric file descriptor
35 - */
36 - function isatty(fd: number): boolean;
37 - /**
38 - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
39 - * process and there should be no reason to create additional instances.
40 - * @since v0.5.8
41 - */
42 - class ReadStream extends net.Socket {
43 - constructor(fd: number, options?: net.SocketConstructorOpts);
44 - /**
45 - * A `boolean` that is `true` if the TTY is currently configured to operate as a
46 - * raw device. Defaults to `false`.
47 - * @since v0.7.7
48 - */
49 - isRaw: boolean;
50 - /**
51 - * Allows configuration of `tty.ReadStream` so that it operates as a raw device.
52 - *
53 - * When in raw mode, input is always available character-by-character, not
54 - * including modifiers. Additionally, all special processing of characters by the
55 - * terminal is disabled, including echoing input characters.Ctrl+C will no longer cause a `SIGINT` when in this mode.
56 - * @since v0.7.7
57 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
58 - * property will be set to the resulting mode.
59 - * @return The read stream instance.
60 - */
61 - setRawMode(mode: boolean): this;
62 - /**
63 - * A `boolean` that is always `true` for `tty.ReadStream` instances.
64 - * @since v0.5.8
65 - */
66 - isTTY: boolean;
67 - }
68 - /**
69 - * -1 - to the left from cursor
70 - * 0 - the entire line
71 - * 1 - to the right from cursor
72 - */
73 - type Direction = -1 | 0 | 1;
74 - /**
75 - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
76 - * should be no reason to create additional instances.
77 - * @since v0.5.8
78 - */
79 - class WriteStream extends net.Socket {
80 - constructor(fd: number);
81 - addListener(event: string, listener: (...args: any[]) => void): this;
82 - addListener(event: 'resize', listener: () => void): this;
83 - emit(event: string | symbol, ...args: any[]): boolean;
84 - emit(event: 'resize'): boolean;
85 - on(event: string, listener: (...args: any[]) => void): this;
86 - on(event: 'resize', listener: () => void): this;
87 - once(event: string, listener: (...args: any[]) => void): this;
88 - once(event: 'resize', listener: () => void): this;
89 - prependListener(event: string, listener: (...args: any[]) => void): this;
90 - prependListener(event: 'resize', listener: () => void): this;
91 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
92 - prependOnceListener(event: 'resize', listener: () => void): this;
93 - /**
94 - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a
95 - * direction identified by `dir`.
96 - * @since v0.7.7
97 - * @param callback Invoked once the operation completes.
98 - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
99 - */
100 - clearLine(dir: Direction, callback?: () => void): boolean;
101 - /**
102 - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current
103 - * cursor down.
104 - * @since v0.7.7
105 - * @param callback Invoked once the operation completes.
106 - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
107 - */
108 - clearScreenDown(callback?: () => void): boolean;
109 - /**
110 - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
111 - * position.
112 - * @since v0.7.7
113 - * @param callback Invoked once the operation completes.
114 - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
115 - */
116 - cursorTo(x: number, y?: number, callback?: () => void): boolean;
117 - cursorTo(x: number, callback: () => void): boolean;
118 - /**
119 - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
120 - * current position.
121 - * @since v0.7.7
122 - * @param callback Invoked once the operation completes.
123 - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
124 - */
125 - moveCursor(dx: number, dy: number, callback?: () => void): boolean;
126 - /**
127 - * Returns:
128 - *
129 - * * `1` for 2,
130 - * * `4` for 16,
131 - * * `8` for 256,
132 - * * `24` for 16,777,216 colors supported.
133 - *
134 - * Use this to determine what colors the terminal supports. Due to the nature of
135 - * colors in terminals it is possible to either have false positives or false
136 - * negatives. It depends on process information and the environment variables that
137 - * may lie about what terminal is used.
138 - * It is possible to pass in an `env` object to simulate the usage of a specific
139 - * terminal. This can be useful to check how specific environment settings behave.
140 - *
141 - * To enforce a specific color support, use one of the below environment settings.
142 - *
143 - * * 2 colors: `FORCE_COLOR = 0` (Disables colors)
144 - * * 16 colors: `FORCE_COLOR = 1`
145 - * * 256 colors: `FORCE_COLOR = 2`
146 - * * 16,777,216 colors: `FORCE_COLOR = 3`
147 - *
148 - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables.
149 - * @since v9.9.0
150 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
151 - */
152 - getColorDepth(env?: object): number;
153 - /**
154 - * Returns `true` if the `writeStream` supports at least as many colors as provided
155 - * in `count`. Minimum support is 2 (black and white).
156 - *
157 - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
158 - *
159 - * ```js
160 - * process.stdout.hasColors();
161 - * // Returns true or false depending on if `stdout` supports at least 16 colors.
162 - * process.stdout.hasColors(256);
163 - * // Returns true or false depending on if `stdout` supports at least 256 colors.
164 - * process.stdout.hasColors({ TMUX: '1' });
165 - * // Returns true.
166 - * process.stdout.hasColors(2 ** 24, { TMUX: '1' });
167 - * // Returns false (the environment setting pretends to support 2 ** 8 colors).
168 - * ```
169 - * @since v11.13.0, v10.16.0
170 - * @param [count=16] The number of colors that are requested (minimum 2).
171 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
172 - */
173 - hasColors(count?: number): boolean;
174 - hasColors(env?: object): boolean;
175 - hasColors(count: number, env?: object): boolean;
176 - /**
177 - * `writeStream.getWindowSize()` returns the size of the TTY
178 - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number
179 - * of columns and rows in the corresponding TTY.
180 - * @since v0.7.7
181 - */
182 - getWindowSize(): [number, number];
183 - /**
184 - * A `number` specifying the number of columns the TTY currently has. This property
185 - * is updated whenever the `'resize'` event is emitted.
186 - * @since v0.7.7
187 - */
188 - columns: number;
189 - /**
190 - * A `number` specifying the number of rows the TTY currently has. This property
191 - * is updated whenever the `'resize'` event is emitted.
192 - * @since v0.7.7
193 - */
194 - rows: number;
195 - /**
196 - * A `boolean` that is always `true`.
197 - * @since v0.5.8
198 - */
199 - isTTY: boolean;
200 - }
201 -}
202 -declare module 'node:tty' {
203 - export * from 'tty';
204 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -/**
2 - * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
3 - * underlying operating system via a collection of POSIX-like functions.
4 - *
5 - * ```js
6 - * import { readFile } from 'fs/promises';
7 - * import { WASI } from 'wasi';
8 - * import { argv, env } from 'process';
9 - *
10 - * const wasi = new WASI({
11 - * args: argv,
12 - * env,
13 - * preopens: {
14 - * '/sandbox': '/some/real/path/that/wasm/can/access'
15 - * }
16 - * });
17 - *
18 - * // Some WASI binaries require:
19 - * // const importObject = { wasi_unstable: wasi.wasiImport };
20 - * const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
21 - *
22 - * const wasm = await WebAssembly.compile(
23 - * await readFile(new URL('./demo.wasm', import.meta.url))
24 - * );
25 - * const instance = await WebAssembly.instantiate(wasm, importObject);
26 - *
27 - * wasi.start(instance);
28 - * ```
29 - *
30 - * To run the above example, create a new WebAssembly text format file named`demo.wat`:
31 - *
32 - * ```text
33 - * (module
34 - * ;; Import the required fd_write WASI function which will write the given io vectors to stdout
35 - * ;; The function signature for fd_write is:
36 - * ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written
37 - * (import "wasi_snapshot_preview1" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
38 - *
39 - * (memory 1)
40 - * (export "memory" (memory 0))
41 - *
42 - * ;; Write 'hello world\n' to memory at an offset of 8 bytes
43 - * ;; Note the trailing newline which is required for the text to appear
44 - * (data (i32.const 8) "hello world\n")
45 - *
46 - * (func $main (export "_start")
47 - * ;; Creating a new io vector within linear memory
48 - * (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov_base - This is a pointer to the start of the 'hello world\n' string
49 - * (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov_len - The length of the 'hello world\n' string
50 - *
51 - * (call $fd_write
52 - * (i32.const 1) ;; file_descriptor - 1 for stdout
53 - * (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0
54 - * (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one.
55 - * (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written
56 - * )
57 - * drop ;; Discard the number of bytes written from the top of the stack
58 - * )
59 - * )
60 - * ```
61 - *
62 - * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
63 - *
64 - * ```console
65 - * $ wat2wasm demo.wat
66 - * ```
67 - *
68 - * The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
69 - * example to run.
70 - * @experimental
71 - * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/wasi.js)
72 - */
73 -declare module 'wasi' {
74 - interface WASIOptions {
75 - /**
76 - * An array of strings that the WebAssembly application will
77 - * see as command line arguments. The first argument is the virtual path to the
78 - * WASI command itself.
79 - */
80 - args?: string[] | undefined;
81 - /**
82 - * An object similar to `process.env` that the WebAssembly
83 - * application will see as its environment.
84 - */
85 - env?: object | undefined;
86 - /**
87 - * This object represents the WebAssembly application's
88 - * sandbox directory structure. The string keys of `preopens` are treated as
89 - * directories within the sandbox. The corresponding values in `preopens` are
90 - * the real paths to those directories on the host machine.
91 - */
92 - preopens?: NodeJS.Dict<string> | undefined;
93 - /**
94 - * By default, WASI applications terminate the Node.js
95 - * process via the `__wasi_proc_exit()` function. Setting this option to `true`
96 - * causes `wasi.start()` to return the exit code rather than terminate the
97 - * process.
98 - * @default false
99 - */
100 - returnOnExit?: boolean | undefined;
101 - /**
102 - * The file descriptor used as standard input in the WebAssembly application.
103 - * @default 0
104 - */
105 - stdin?: number | undefined;
106 - /**
107 - * The file descriptor used as standard output in the WebAssembly application.
108 - * @default 1
109 - */
110 - stdout?: number | undefined;
111 - /**
112 - * The file descriptor used as standard error in the WebAssembly application.
113 - * @default 2
114 - */
115 - stderr?: number | undefined;
116 - }
117 - /**
118 - * The `WASI` class provides the WASI system call API and additional convenience
119 - * methods for working with WASI-based applications. Each `WASI` instance
120 - * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and
121 - * sandbox directory structure configured explicitly.
122 - * @since v13.3.0, v12.16.0
123 - */
124 - class WASI {
125 - constructor(options?: WASIOptions);
126 - /**
127 - * Attempt to begin execution of `instance` as a WASI command by invoking its`_start()` export. If `instance` does not contain a `_start()` export, or if`instance` contains an `_initialize()`
128 - * export, then an exception is thrown.
129 - *
130 - * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`. If
131 - * `instance` does not have a `memory` export an exception is thrown.
132 - *
133 - * If `start()` is called more than once, an exception is thrown.
134 - * @since v13.3.0, v12.16.0
135 - */
136 - start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
137 - /**
138 - * Attempt to initialize `instance` as a WASI reactor by invoking its`_initialize()` export, if it is present. If `instance` contains a `_start()`export, then an exception is thrown.
139 - *
140 - * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`.
141 - * If `instance` does not have a `memory` export an exception is thrown.
142 - *
143 - * If `initialize()` is called more than once, an exception is thrown.
144 - * @since v14.6.0, v12.19.0
145 - */
146 - initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
147 - /**
148 - * `wasiImport` is an object that implements the WASI system call API. This object
149 - * should be passed as the `wasi_snapshot_preview1` import during the instantiation
150 - * of a [`WebAssembly.Instance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance).
151 - * @since v13.3.0, v12.16.0
152 - */
153 - readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
154 - }
155 -}
156 -declare module 'node:wasi' {
157 - export * from 'wasi';
158 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 - MIT License
2 -
3 - Copyright (c) Microsoft Corporation.
4 -
5 - Permission is hereby granted, free of charge, to any person obtaining a copy
6 - of this software and associated documentation files (the "Software"), to deal
7 - in the Software without restriction, including without limitation the rights
8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 - copies of the Software, and to permit persons to whom the Software is
10 - furnished to do so, subject to the following conditions:
11 -
12 - The above copyright notice and this permission notice shall be included in all
13 - copies or substantial portions of the Software.
14 -
15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 - SOFTWARE
1 -# Installation
2 -> `npm install --save @types/yauzl`
3 -
4 -# Summary
5 -This package contains type definitions for yauzl (https://github.com/thejoshwolfe/yauzl).
6 -
7 -# Details
8 -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl.
9 -
10 -### Additional Details
11 - * Last updated: Mon, 11 Apr 2022 02:01:17 GMT
12 - * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
13 - * Global values: none
14 -
15 -# Credits
16 -These definitions were written by [Florian Keller](https://github.com/ffflorian).
1 -// Type definitions for yauzl 2.10
2 -// Project: https://github.com/thejoshwolfe/yauzl
3 -// Definitions by: Florian Keller <https://github.com/ffflorian>
4 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 -
6 -/// <reference types="node" />
7 -
8 -import { EventEmitter } from 'events';
9 -import { Readable } from 'stream';
10 -
11 -export abstract class RandomAccessReader extends EventEmitter {
12 - _readStreamForRange(start: number, end: number): void;
13 - createReadStream(options: { start: number; end: number }): void;
14 - read(buffer: Buffer, offset: number, length: number, position: number, callback: (err: Error | null) => void): void;
15 - close(callback: (err: Error | null) => void): void;
16 -}
17 -
18 -export class Entry {
19 - comment: string;
20 - compressedSize: number;
21 - compressionMethod: number;
22 - crc32: number;
23 - externalFileAttributes: number;
24 - extraFieldLength: number;
25 - extraFields: Array<{ id: number; data: Buffer }>;
26 - fileCommentLength: number;
27 - fileName: string;
28 - fileNameLength: number;
29 - generalPurposeBitFlag: number;
30 - internalFileAttributes: number;
31 - lastModFileDate: number;
32 - lastModFileTime: number;
33 - relativeOffsetOfLocalHeader: number;
34 - uncompressedSize: number;
35 - versionMadeBy: number;
36 - versionNeededToExtract: number;
37 -
38 - getLastModDate(): Date;
39 - isEncrypted(): boolean;
40 - isCompressed(): boolean;
41 -}
42 -
43 -export interface ZipFileOptions {
44 - decompress: boolean | null;
45 - decrypt: boolean | null;
46 - start: number | null;
47 - end: number | null;
48 -}
49 -
50 -export class ZipFile extends EventEmitter {
51 - autoClose: boolean;
52 - comment: string;
53 - decodeStrings: boolean;
54 - emittedError: boolean;
55 - entriesRead: number;
56 - entryCount: number;
57 - fileSize: number;
58 - isOpen: boolean;
59 - lazyEntries: boolean;
60 - readEntryCursor: boolean;
61 - validateEntrySizes: boolean;
62 -
63 - constructor(
64 - reader: RandomAccessReader,
65 - centralDirectoryOffset: number,
66 - fileSize: number,
67 - entryCount: number,
68 - comment: string,
69 - autoClose: boolean,
70 - lazyEntries: boolean,
71 - decodeStrings: boolean,
72 - validateEntrySizes: boolean,
73 - );
74 -
75 - openReadStream(entry: Entry, options: ZipFileOptions, callback: (err: Error | null, stream: Readable) => void): void;
76 - openReadStream(entry: Entry, callback: (err: Error | null, stream: Readable) => void): void;
77 - close(): void;
78 - readEntry(): void;
79 -}
80 -
81 -export interface Options {
82 - autoClose?: boolean | undefined;
83 - lazyEntries?: boolean | undefined;
84 - decodeStrings?: boolean | undefined;
85 - validateEntrySizes?: boolean | undefined;
86 - strictFileNames?: boolean | undefined;
87 -}
88 -
89 -export function open(path: string, options: Options, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
90 -export function open(path: string, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
91 -export function fromFd(fd: number, options: Options, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
92 -export function fromFd(fd: number, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
93 -export function fromBuffer(buffer: Buffer, options: Options, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
94 -export function fromBuffer(buffer: Buffer, callback?: (err: Error | null, zipfile: ZipFile) => void): void;
95 -export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, options: Options, callback: (err: Error | null, zipfile: ZipFile) => void): void;
96 -export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, callback: (err: Error | null, zipfile: ZipFile) => void): void;
97 -export function dosDateTimeToDate(date: number, time: number): Date;
98 -export function validateFileName(fileName: string): string | null;
1 -{
2 - "name": "@types/yauzl",
3 - "version": "2.10.0",
4 - "description": "TypeScript definitions for yauzl",
5 - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl",
6 - "license": "MIT",
7 - "contributors": [
8 - {
9 - "name": "Florian Keller",
10 - "url": "https://github.com/ffflorian",
11 - "githubUsername": "ffflorian"
12 - }
13 - ],
14 - "main": "",
15 - "types": "index.d.ts",
16 - "repository": {
17 - "type": "git",
18 - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
19 - "directory": "types/yauzl"
20 - },
21 - "scripts": {},
22 - "dependencies": {
23 - "@types/node": "*"
24 - },
25 - "typesPublisherContentHash": "183e6a31c00c4e59b6e6ffe0cf97b06d4b843b2d1208d8917820cbb70b57eae9",
26 - "typeScriptVersion": "3.9"
27 -}
...\ No newline at end of file ...\ No newline at end of file
1 -1.3.8 / 2022-02-02
2 -==================
3 -
4 - * deps: mime-types@~2.1.34
5 - - deps: mime-db@~1.51.0
6 - * deps: negotiator@0.6.3
7 -
8 -1.3.7 / 2019-04-29
9 -==================
10 -
11 - * deps: negotiator@0.6.2
12 - - Fix sorting charset, encoding, and language with extra parameters
13 -
14 -1.3.6 / 2019-04-28
15 -==================
16 -
17 - * deps: mime-types@~2.1.24
18 - - deps: mime-db@~1.40.0
19 -
20 -1.3.5 / 2018-02-28
21 -==================
22 -
23 - * deps: mime-types@~2.1.18
24 - - deps: mime-db@~1.33.0
25 -
26 -1.3.4 / 2017-08-22
27 -==================
28 -
29 - * deps: mime-types@~2.1.16
30 - - deps: mime-db@~1.29.0
31 -
32 -1.3.3 / 2016-05-02
33 -==================
34 -
35 - * deps: mime-types@~2.1.11
36 - - deps: mime-db@~1.23.0
37 - * deps: negotiator@0.6.1
38 - - perf: improve `Accept` parsing speed
39 - - perf: improve `Accept-Charset` parsing speed
40 - - perf: improve `Accept-Encoding` parsing speed
41 - - perf: improve `Accept-Language` parsing speed
42 -
43 -1.3.2 / 2016-03-08
44 -==================
45 -
46 - * deps: mime-types@~2.1.10
47 - - Fix extension of `application/dash+xml`
48 - - Update primary extension for `audio/mp4`
49 - - deps: mime-db@~1.22.0
50 -
51 -1.3.1 / 2016-01-19
52 -==================
53 -
54 - * deps: mime-types@~2.1.9
55 - - deps: mime-db@~1.21.0
56 -
57 -1.3.0 / 2015-09-29
58 -==================
59 -
60 - * deps: mime-types@~2.1.7
61 - - deps: mime-db@~1.19.0
62 - * deps: negotiator@0.6.0
63 - - Fix including type extensions in parameters in `Accept` parsing
64 - - Fix parsing `Accept` parameters with quoted equals
65 - - Fix parsing `Accept` parameters with quoted semicolons
66 - - Lazy-load modules from main entry point
67 - - perf: delay type concatenation until needed
68 - - perf: enable strict mode
69 - - perf: hoist regular expressions
70 - - perf: remove closures getting spec properties
71 - - perf: remove a closure from media type parsing
72 - - perf: remove property delete from media type parsing
73 -
74 -1.2.13 / 2015-09-06
75 -===================
76 -
77 - * deps: mime-types@~2.1.6
78 - - deps: mime-db@~1.18.0
79 -
80 -1.2.12 / 2015-07-30
81 -===================
82 -
83 - * deps: mime-types@~2.1.4
84 - - deps: mime-db@~1.16.0
85 -
86 -1.2.11 / 2015-07-16
87 -===================
88 -
89 - * deps: mime-types@~2.1.3
90 - - deps: mime-db@~1.15.0
91 -
92 -1.2.10 / 2015-07-01
93 -===================
94 -
95 - * deps: mime-types@~2.1.2
96 - - deps: mime-db@~1.14.0
97 -
98 -1.2.9 / 2015-06-08
99 -==================
100 -
101 - * deps: mime-types@~2.1.1
102 - - perf: fix deopt during mapping
103 -
104 -1.2.8 / 2015-06-07
105 -==================
106 -
107 - * deps: mime-types@~2.1.0
108 - - deps: mime-db@~1.13.0
109 - * perf: avoid argument reassignment & argument slice
110 - * perf: avoid negotiator recursive construction
111 - * perf: enable strict mode
112 - * perf: remove unnecessary bitwise operator
113 -
114 -1.2.7 / 2015-05-10
115 -==================
116 -
117 - * deps: negotiator@0.5.3
118 - - Fix media type parameter matching to be case-insensitive
119 -
120 -1.2.6 / 2015-05-07
121 -==================
122 -
123 - * deps: mime-types@~2.0.11
124 - - deps: mime-db@~1.9.1
125 - * deps: negotiator@0.5.2
126 - - Fix comparing media types with quoted values
127 - - Fix splitting media types with quoted commas
128 -
129 -1.2.5 / 2015-03-13
130 -==================
131 -
132 - * deps: mime-types@~2.0.10
133 - - deps: mime-db@~1.8.0
134 -
135 -1.2.4 / 2015-02-14
136 -==================
137 -
138 - * Support Node.js 0.6
139 - * deps: mime-types@~2.0.9
140 - - deps: mime-db@~1.7.0
141 - * deps: negotiator@0.5.1
142 - - Fix preference sorting to be stable for long acceptable lists
143 -
144 -1.2.3 / 2015-01-31
145 -==================
146 -
147 - * deps: mime-types@~2.0.8
148 - - deps: mime-db@~1.6.0
149 -
150 -1.2.2 / 2014-12-30
151 -==================
152 -
153 - * deps: mime-types@~2.0.7
154 - - deps: mime-db@~1.5.0
155 -
156 -1.2.1 / 2014-12-30
157 -==================
158 -
159 - * deps: mime-types@~2.0.5
160 - - deps: mime-db@~1.3.1
161 -
162 -1.2.0 / 2014-12-19
163 -==================
164 -
165 - * deps: negotiator@0.5.0
166 - - Fix list return order when large accepted list
167 - - Fix missing identity encoding when q=0 exists
168 - - Remove dynamic building of Negotiator class
169 -
170 -1.1.4 / 2014-12-10
171 -==================
172 -
173 - * deps: mime-types@~2.0.4
174 - - deps: mime-db@~1.3.0
175 -
176 -1.1.3 / 2014-11-09
177 -==================
178 -
179 - * deps: mime-types@~2.0.3
180 - - deps: mime-db@~1.2.0
181 -
182 -1.1.2 / 2014-10-14
183 -==================
184 -
185 - * deps: negotiator@0.4.9
186 - - Fix error when media type has invalid parameter
187 -
188 -1.1.1 / 2014-09-28
189 -==================
190 -
191 - * deps: mime-types@~2.0.2
192 - - deps: mime-db@~1.1.0
193 - * deps: negotiator@0.4.8
194 - - Fix all negotiations to be case-insensitive
195 - - Stable sort preferences of same quality according to client order
196 -
197 -1.1.0 / 2014-09-02
198 -==================
199 -
200 - * update `mime-types`
201 -
202 -1.0.7 / 2014-07-04
203 -==================
204 -
205 - * Fix wrong type returned from `type` when match after unknown extension
206 -
207 -1.0.6 / 2014-06-24
208 -==================
209 -
210 - * deps: negotiator@0.4.7
211 -
212 -1.0.5 / 2014-06-20
213 -==================
214 -
215 - * fix crash when unknown extension given
216 -
217 -1.0.4 / 2014-06-19
218 -==================
219 -
220 - * use `mime-types`
221 -
222 -1.0.3 / 2014-06-11
223 -==================
224 -
225 - * deps: negotiator@0.4.6
226 - - Order by specificity when quality is the same
227 -
228 -1.0.2 / 2014-05-29
229 -==================
230 -
231 - * Fix interpretation when header not in request
232 - * deps: pin negotiator@0.4.5
233 -
234 -1.0.1 / 2014-01-18
235 -==================
236 -
237 - * Identity encoding isn't always acceptable
238 - * deps: negotiator@~0.4.0
239 -
240 -1.0.0 / 2013-12-27
241 -==================
242 -
243 - * Genesis
1 -(The MIT License)
2 -
3 -Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
4 -Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
5 -
6 -Permission is hereby granted, free of charge, to any person obtaining
7 -a copy of this software and associated documentation files (the
8 -'Software'), to deal in the Software without restriction, including
9 -without limitation the rights to use, copy, modify, merge, publish,
10 -distribute, sublicense, and/or sell copies of the Software, and to
11 -permit persons to whom the Software is furnished to do so, subject to
12 -the following conditions:
13 -
14 -The above copyright notice and this permission notice shall be
15 -included in all copies or substantial portions of the Software.
16 -
17 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 -# accepts
2 -
3 -[![NPM Version][npm-version-image]][npm-url]
4 -[![NPM Downloads][npm-downloads-image]][npm-url]
5 -[![Node.js Version][node-version-image]][node-version-url]
6 -[![Build Status][github-actions-ci-image]][github-actions-ci-url]
7 -[![Test Coverage][coveralls-image]][coveralls-url]
8 -
9 -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
10 -Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
11 -
12 -In addition to negotiator, it allows:
13 -
14 -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
15 - as well as `('text/html', 'application/json')`.
16 -- Allows type shorthands such as `json`.
17 -- Returns `false` when no types match
18 -- Treats non-existent headers as `*`
19 -
20 -## Installation
21 -
22 -This is a [Node.js](https://nodejs.org/en/) module available through the
23 -[npm registry](https://www.npmjs.com/). Installation is done using the
24 -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
25 -
26 -```sh
27 -$ npm install accepts
28 -```
29 -
30 -## API
31 -
32 -```js
33 -var accepts = require('accepts')
34 -```
35 -
36 -### accepts(req)
37 -
38 -Create a new `Accepts` object for the given `req`.
39 -
40 -#### .charset(charsets)
41 -
42 -Return the first accepted charset. If nothing in `charsets` is accepted,
43 -then `false` is returned.
44 -
45 -#### .charsets()
46 -
47 -Return the charsets that the request accepts, in the order of the client's
48 -preference (most preferred first).
49 -
50 -#### .encoding(encodings)
51 -
52 -Return the first accepted encoding. If nothing in `encodings` is accepted,
53 -then `false` is returned.
54 -
55 -#### .encodings()
56 -
57 -Return the encodings that the request accepts, in the order of the client's
58 -preference (most preferred first).
59 -
60 -#### .language(languages)
61 -
62 -Return the first accepted language. If nothing in `languages` is accepted,
63 -then `false` is returned.
64 -
65 -#### .languages()
66 -
67 -Return the languages that the request accepts, in the order of the client's
68 -preference (most preferred first).
69 -
70 -#### .type(types)
71 -
72 -Return the first accepted type (and it is returned as the same text as what
73 -appears in the `types` array). If nothing in `types` is accepted, then `false`
74 -is returned.
75 -
76 -The `types` array can contain full MIME types or file extensions. Any value
77 -that is not a full MIME types is passed to `require('mime-types').lookup`.
78 -
79 -#### .types()
80 -
81 -Return the types that the request accepts, in the order of the client's
82 -preference (most preferred first).
83 -
84 -## Examples
85 -
86 -### Simple type negotiation
87 -
88 -This simple example shows how to use `accepts` to return a different typed
89 -respond body based on what the client wants to accept. The server lists it's
90 -preferences in order and will get back the best match between the client and
91 -server.
92 -
93 -```js
94 -var accepts = require('accepts')
95 -var http = require('http')
96 -
97 -function app (req, res) {
98 - var accept = accepts(req)
99 -
100 - // the order of this list is significant; should be server preferred order
101 - switch (accept.type(['json', 'html'])) {
102 - case 'json':
103 - res.setHeader('Content-Type', 'application/json')
104 - res.write('{"hello":"world!"}')
105 - break
106 - case 'html':
107 - res.setHeader('Content-Type', 'text/html')
108 - res.write('<b>hello, world!</b>')
109 - break
110 - default:
111 - // the fallback is text/plain, so no need to specify it above
112 - res.setHeader('Content-Type', 'text/plain')
113 - res.write('hello, world!')
114 - break
115 - }
116 -
117 - res.end()
118 -}
119 -
120 -http.createServer(app).listen(3000)
121 -```
122 -
123 -You can test this out with the cURL program:
124 -```sh
125 -curl -I -H'Accept: text/html' http://localhost:3000/
126 -```
127 -
128 -## License
129 -
130 -[MIT](LICENSE)
131 -
132 -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
133 -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
134 -[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci
135 -[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml
136 -[node-version-image]: https://badgen.net/npm/node/accepts
137 -[node-version-url]: https://nodejs.org/en/download
138 -[npm-downloads-image]: https://badgen.net/npm/dm/accepts
139 -[npm-url]: https://npmjs.org/package/accepts
140 -[npm-version-image]: https://badgen.net/npm/v/accepts
1 -/*!
2 - * accepts
3 - * Copyright(c) 2014 Jonathan Ong
4 - * Copyright(c) 2015 Douglas Christopher Wilson
5 - * MIT Licensed
6 - */
7 -
8 -'use strict'
9 -
10 -/**
11 - * Module dependencies.
12 - * @private
13 - */
14 -
15 -var Negotiator = require('negotiator')
16 -var mime = require('mime-types')
17 -
18 -/**
19 - * Module exports.
20 - * @public
21 - */
22 -
23 -module.exports = Accepts
24 -
25 -/**
26 - * Create a new Accepts object for the given req.
27 - *
28 - * @param {object} req
29 - * @public
30 - */
31 -
32 -function Accepts (req) {
33 - if (!(this instanceof Accepts)) {
34 - return new Accepts(req)
35 - }
36 -
37 - this.headers = req.headers
38 - this.negotiator = new Negotiator(req)
39 -}
40 -
41 -/**
42 - * Check if the given `type(s)` is acceptable, returning
43 - * the best match when true, otherwise `undefined`, in which
44 - * case you should respond with 406 "Not Acceptable".
45 - *
46 - * The `type` value may be a single mime type string
47 - * such as "application/json", the extension name
48 - * such as "json" or an array `["json", "html", "text/plain"]`. When a list
49 - * or array is given the _best_ match, if any is returned.
50 - *
51 - * Examples:
52 - *
53 - * // Accept: text/html
54 - * this.types('html');
55 - * // => "html"
56 - *
57 - * // Accept: text/*, application/json
58 - * this.types('html');
59 - * // => "html"
60 - * this.types('text/html');
61 - * // => "text/html"
62 - * this.types('json', 'text');
63 - * // => "json"
64 - * this.types('application/json');
65 - * // => "application/json"
66 - *
67 - * // Accept: text/*, application/json
68 - * this.types('image/png');
69 - * this.types('png');
70 - * // => undefined
71 - *
72 - * // Accept: text/*;q=.5, application/json
73 - * this.types(['html', 'json']);
74 - * this.types('html', 'json');
75 - * // => "json"
76 - *
77 - * @param {String|Array} types...
78 - * @return {String|Array|Boolean}
79 - * @public
80 - */
81 -
82 -Accepts.prototype.type =
83 -Accepts.prototype.types = function (types_) {
84 - var types = types_
85 -
86 - // support flattened arguments
87 - if (types && !Array.isArray(types)) {
88 - types = new Array(arguments.length)
89 - for (var i = 0; i < types.length; i++) {
90 - types[i] = arguments[i]
91 - }
92 - }
93 -
94 - // no types, return all requested types
95 - if (!types || types.length === 0) {
96 - return this.negotiator.mediaTypes()
97 - }
98 -
99 - // no accept header, return first given type
100 - if (!this.headers.accept) {
101 - return types[0]
102 - }
103 -
104 - var mimes = types.map(extToMime)
105 - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
106 - var first = accepts[0]
107 -
108 - return first
109 - ? types[mimes.indexOf(first)]
110 - : false
111 -}
112 -
113 -/**
114 - * Return accepted encodings or best fit based on `encodings`.
115 - *
116 - * Given `Accept-Encoding: gzip, deflate`
117 - * an array sorted by quality is returned:
118 - *
119 - * ['gzip', 'deflate']
120 - *
121 - * @param {String|Array} encodings...
122 - * @return {String|Array}
123 - * @public
124 - */
125 -
126 -Accepts.prototype.encoding =
127 -Accepts.prototype.encodings = function (encodings_) {
128 - var encodings = encodings_
129 -
130 - // support flattened arguments
131 - if (encodings && !Array.isArray(encodings)) {
132 - encodings = new Array(arguments.length)
133 - for (var i = 0; i < encodings.length; i++) {
134 - encodings[i] = arguments[i]
135 - }
136 - }
137 -
138 - // no encodings, return all requested encodings
139 - if (!encodings || encodings.length === 0) {
140 - return this.negotiator.encodings()
141 - }
142 -
143 - return this.negotiator.encodings(encodings)[0] || false
144 -}
145 -
146 -/**
147 - * Return accepted charsets or best fit based on `charsets`.
148 - *
149 - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
150 - * an array sorted by quality is returned:
151 - *
152 - * ['utf-8', 'utf-7', 'iso-8859-1']
153 - *
154 - * @param {String|Array} charsets...
155 - * @return {String|Array}
156 - * @public
157 - */
158 -
159 -Accepts.prototype.charset =
160 -Accepts.prototype.charsets = function (charsets_) {
161 - var charsets = charsets_
162 -
163 - // support flattened arguments
164 - if (charsets && !Array.isArray(charsets)) {
165 - charsets = new Array(arguments.length)
166 - for (var i = 0; i < charsets.length; i++) {
167 - charsets[i] = arguments[i]
168 - }
169 - }
170 -
171 - // no charsets, return all requested charsets
172 - if (!charsets || charsets.length === 0) {
173 - return this.negotiator.charsets()
174 - }
175 -
176 - return this.negotiator.charsets(charsets)[0] || false
177 -}
178 -
179 -/**
180 - * Return accepted languages or best fit based on `langs`.
181 - *
182 - * Given `Accept-Language: en;q=0.8, es, pt`
183 - * an array sorted by quality is returned:
184 - *
185 - * ['es', 'pt', 'en']
186 - *
187 - * @param {String|Array} langs...
188 - * @return {Array|String}
189 - * @public
190 - */
191 -
192 -Accepts.prototype.lang =
193 -Accepts.prototype.langs =
194 -Accepts.prototype.language =
195 -Accepts.prototype.languages = function (languages_) {
196 - var languages = languages_
197 -
198 - // support flattened arguments
199 - if (languages && !Array.isArray(languages)) {
200 - languages = new Array(arguments.length)
201 - for (var i = 0; i < languages.length; i++) {
202 - languages[i] = arguments[i]
203 - }
204 - }
205 -
206 - // no languages, return all requested languages
207 - if (!languages || languages.length === 0) {
208 - return this.negotiator.languages()
209 - }
210 -
211 - return this.negotiator.languages(languages)[0] || false
212 -}
213 -
214 -/**
215 - * Convert extnames to mime.
216 - *
217 - * @param {String} type
218 - * @return {String}
219 - * @private
220 - */
221 -
222 -function extToMime (type) {
223 - return type.indexOf('/') === -1
224 - ? mime.lookup(type)
225 - : type
226 -}
227 -
228 -/**
229 - * Check if mime is valid.
230 - *
231 - * @param {String} type
232 - * @return {String}
233 - * @private
234 - */
235 -
236 -function validMime (type) {
237 - return typeof type === 'string'
238 -}
1 -{
2 - "name": "accepts",
3 - "description": "Higher-level content negotiation",
4 - "version": "1.3.8",
5 - "contributors": [
6 - "Douglas Christopher Wilson <doug@somethingdoug.com>",
7 - "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
8 - ],
9 - "license": "MIT",
10 - "repository": "jshttp/accepts",
11 - "dependencies": {
12 - "mime-types": "~2.1.34",
13 - "negotiator": "0.6.3"
14 - },
15 - "devDependencies": {
16 - "deep-equal": "1.0.1",
17 - "eslint": "7.32.0",
18 - "eslint-config-standard": "14.1.1",
19 - "eslint-plugin-import": "2.25.4",
20 - "eslint-plugin-markdown": "2.2.1",
21 - "eslint-plugin-node": "11.1.0",
22 - "eslint-plugin-promise": "4.3.1",
23 - "eslint-plugin-standard": "4.1.0",
24 - "mocha": "9.2.0",
25 - "nyc": "15.1.0"
26 - },
27 - "files": [
28 - "LICENSE",
29 - "HISTORY.md",
30 - "index.js"
31 - ],
32 - "engines": {
33 - "node": ">= 0.6"
34 - },
35 - "scripts": {
36 - "lint": "eslint .",
37 - "test": "mocha --reporter spec --check-leaks --bail test/",
38 - "test-ci": "nyc --reporter=lcov --reporter=text npm test",
39 - "test-cov": "nyc --reporter=html --reporter=text npm test"
40 - },
41 - "keywords": [
42 - "content",
43 - "negotiation",
44 - "accept",
45 - "accepts"
46 - ]
47 -}
1 -agent-base
2 -==========
3 -### Turn a function into an [`http.Agent`][http.Agent] instance
4 -[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)
5 -
6 -This module provides an `http.Agent` generator. That is, you pass it an async
7 -callback function, and it returns a new `http.Agent` instance that will invoke the
8 -given callback function when sending outbound HTTP requests.
9 -
10 -#### Some subclasses:
11 -
12 -Here's some more interesting uses of `agent-base`.
13 -Send a pull request to list yours!
14 -
15 - * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
16 - * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
17 - * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
18 - * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
19 -
20 -
21 -Installation
22 -------------
23 -
24 -Install with `npm`:
25 -
26 -``` bash
27 -$ npm install agent-base
28 -```
29 -
30 -
31 -Example
32 --------
33 -
34 -Here's a minimal example that creates a new `net.Socket` connection to the server
35 -for every HTTP request (i.e. the equivalent of `agent: false` option):
36 -
37 -```js
38 -var net = require('net');
39 -var tls = require('tls');
40 -var url = require('url');
41 -var http = require('http');
42 -var agent = require('agent-base');
43 -
44 -var endpoint = 'http://nodejs.org/api/';
45 -var parsed = url.parse(endpoint);
46 -
47 -// This is the important part!
48 -parsed.agent = agent(function (req, opts) {
49 - var socket;
50 - // `secureEndpoint` is true when using the https module
51 - if (opts.secureEndpoint) {
52 - socket = tls.connect(opts);
53 - } else {
54 - socket = net.connect(opts);
55 - }
56 - return socket;
57 -});
58 -
59 -// Everything else works just like normal...
60 -http.get(parsed, function (res) {
61 - console.log('"response" event!', res.headers);
62 - res.pipe(process.stdout);
63 -});
64 -```
65 -
66 -Returning a Promise or using an `async` function is also supported:
67 -
68 -```js
69 -agent(async function (req, opts) {
70 - await sleep(1000);
71 - // etc…
72 -});
73 -```
74 -
75 -Return another `http.Agent` instance to "pass through" the responsibility
76 -for that HTTP request to that agent:
77 -
78 -```js
79 -agent(function (req, opts) {
80 - return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
81 -});
82 -```
83 -
84 -
85 -API
86 ----
87 -
88 -## Agent(Function callback[, Object options]) → [http.Agent][]
89 -
90 -Creates a base `http.Agent` that will execute the callback function `callback`
91 -for every HTTP request that it is used as the `agent` for. The callback function
92 -is responsible for creating a `stream.Duplex` instance of some kind that will be
93 -used as the underlying socket in the HTTP request.
94 -
95 -The `options` object accepts the following properties:
96 -
97 - * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).
98 -
99 -The callback function should have the following signature:
100 -
101 -### callback(http.ClientRequest req, Object options, Function cb) → undefined
102 -
103 -The ClientRequest `req` can be accessed to read request headers and
104 -and the path, etc. The `options` object contains the options passed
105 -to the `http.request()`/`https.request()` function call, and is formatted
106 -to be directly passed to `net.connect()`/`tls.connect()`, or however
107 -else you want a Socket to be created. Pass the created socket to
108 -the callback function `cb` once created, and the HTTP request will
109 -continue to proceed.
110 -
111 -If the `https` module is used to invoke the HTTP request, then the
112 -`secureEndpoint` property on `options` _will be set to `true`_.
113 -
114 -
115 -License
116 --------
117 -
118 -(The MIT License)
119 -
120 -Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
121 -
122 -Permission is hereby granted, free of charge, to any person obtaining
123 -a copy of this software and associated documentation files (the
124 -'Software'), to deal in the Software without restriction, including
125 -without limitation the rights to use, copy, modify, merge, publish,
126 -distribute, sublicense, and/or sell copies of the Software, and to
127 -permit persons to whom the Software is furnished to do so, subject to
128 -the following conditions:
129 -
130 -The above copyright notice and this permission notice shall be
131 -included in all copies or substantial portions of the Software.
132 -
133 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
134 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
135 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
136 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
137 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
138 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
139 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140 -
141 -[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
142 -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
143 -[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
144 -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
145 -[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
1 -/// <reference types="node" />
2 -import net from 'net';
3 -import http from 'http';
4 -import https from 'https';
5 -import { Duplex } from 'stream';
6 -import { EventEmitter } from 'events';
7 -declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
8 -declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent;
9 -declare namespace createAgent {
10 - interface ClientRequest extends http.ClientRequest {
11 - _last?: boolean;
12 - _hadError?: boolean;
13 - method: string;
14 - }
15 - interface AgentRequestOptions {
16 - host?: string;
17 - path?: string;
18 - port: number;
19 - }
20 - interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> {
21 - secureEndpoint: false;
22 - }
23 - interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> {
24 - secureEndpoint: true;
25 - }
26 - type RequestOptions = HttpRequestOptions | HttpsRequestOptions;
27 - type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;
28 - type AgentCallbackReturn = Duplex | AgentLike;
29 - type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void;
30 - type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
31 - type AgentCallback = typeof Agent.prototype.callback;
32 - type AgentOptions = {
33 - timeout?: number;
34 - };
35 - /**
36 - * Base `http.Agent` implementation.
37 - * No pooling/keep-alive is implemented by default.
38 - *
39 - * @param {Function} callback
40 - * @api public
41 - */
42 - class Agent extends EventEmitter {
43 - timeout: number | null;
44 - maxFreeSockets: number;
45 - maxTotalSockets: number;
46 - maxSockets: number;
47 - sockets: {
48 - [key: string]: net.Socket[];
49 - };
50 - freeSockets: {
51 - [key: string]: net.Socket[];
52 - };
53 - requests: {
54 - [key: string]: http.IncomingMessage[];
55 - };
56 - options: https.AgentOptions;
57 - private promisifiedCallback?;
58 - private explicitDefaultPort?;
59 - private explicitProtocol?;
60 - constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions);
61 - get defaultPort(): number;
62 - set defaultPort(v: number);
63 - get protocol(): string;
64 - set protocol(v: string);
65 - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void;
66 - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
67 - /**
68 - * Called by node-core's "_http_client.js" module when creating
69 - * a new HTTP request with this Agent instance.
70 - *
71 - * @api public
72 - */
73 - addRequest(req: ClientRequest, _opts: RequestOptions): void;
74 - freeSocket(socket: net.Socket, opts: AgentOptions): void;
75 - destroy(): void;
76 - }
77 -}
78 -export = createAgent;
1 -"use strict";
2 -var __importDefault = (this && this.__importDefault) || function (mod) {
3 - return (mod && mod.__esModule) ? mod : { "default": mod };
4 -};
5 -const events_1 = require("events");
6 -const debug_1 = __importDefault(require("debug"));
7 -const promisify_1 = __importDefault(require("./promisify"));
8 -const debug = debug_1.default('agent-base');
9 -function isAgent(v) {
10 - return Boolean(v) && typeof v.addRequest === 'function';
11 -}
12 -function isSecureEndpoint() {
13 - const { stack } = new Error();
14 - if (typeof stack !== 'string')
15 - return false;
16 - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
17 -}
18 -function createAgent(callback, opts) {
19 - return new createAgent.Agent(callback, opts);
20 -}
21 -(function (createAgent) {
22 - /**
23 - * Base `http.Agent` implementation.
24 - * No pooling/keep-alive is implemented by default.
25 - *
26 - * @param {Function} callback
27 - * @api public
28 - */
29 - class Agent extends events_1.EventEmitter {
30 - constructor(callback, _opts) {
31 - super();
32 - let opts = _opts;
33 - if (typeof callback === 'function') {
34 - this.callback = callback;
35 - }
36 - else if (callback) {
37 - opts = callback;
38 - }
39 - // Timeout for the socket to be returned from the callback
40 - this.timeout = null;
41 - if (opts && typeof opts.timeout === 'number') {
42 - this.timeout = opts.timeout;
43 - }
44 - // These aren't actually used by `agent-base`, but are required
45 - // for the TypeScript definition files in `@types/node` :/
46 - this.maxFreeSockets = 1;
47 - this.maxSockets = 1;
48 - this.maxTotalSockets = Infinity;
49 - this.sockets = {};
50 - this.freeSockets = {};
51 - this.requests = {};
52 - this.options = {};
53 - }
54 - get defaultPort() {
55 - if (typeof this.explicitDefaultPort === 'number') {
56 - return this.explicitDefaultPort;
57 - }
58 - return isSecureEndpoint() ? 443 : 80;
59 - }
60 - set defaultPort(v) {
61 - this.explicitDefaultPort = v;
62 - }
63 - get protocol() {
64 - if (typeof this.explicitProtocol === 'string') {
65 - return this.explicitProtocol;
66 - }
67 - return isSecureEndpoint() ? 'https:' : 'http:';
68 - }
69 - set protocol(v) {
70 - this.explicitProtocol = v;
71 - }
72 - callback(req, opts, fn) {
73 - throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
74 - }
75 - /**
76 - * Called by node-core's "_http_client.js" module when creating
77 - * a new HTTP request with this Agent instance.
78 - *
79 - * @api public
80 - */
81 - addRequest(req, _opts) {
82 - const opts = Object.assign({}, _opts);
83 - if (typeof opts.secureEndpoint !== 'boolean') {
84 - opts.secureEndpoint = isSecureEndpoint();
85 - }
86 - if (opts.host == null) {
87 - opts.host = 'localhost';
88 - }
89 - if (opts.port == null) {
90 - opts.port = opts.secureEndpoint ? 443 : 80;
91 - }
92 - if (opts.protocol == null) {
93 - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
94 - }
95 - if (opts.host && opts.path) {
96 - // If both a `host` and `path` are specified then it's most
97 - // likely the result of a `url.parse()` call... we need to
98 - // remove the `path` portion so that `net.connect()` doesn't
99 - // attempt to open that as a unix socket file.
100 - delete opts.path;
101 - }
102 - delete opts.agent;
103 - delete opts.hostname;
104 - delete opts._defaultAgent;
105 - delete opts.defaultPort;
106 - delete opts.createConnection;
107 - // Hint to use "Connection: close"
108 - // XXX: non-documented `http` module API :(
109 - req._last = true;
110 - req.shouldKeepAlive = false;
111 - let timedOut = false;
112 - let timeoutId = null;
113 - const timeoutMs = opts.timeout || this.timeout;
114 - const onerror = (err) => {
115 - if (req._hadError)
116 - return;
117 - req.emit('error', err);
118 - // For Safety. Some additional errors might fire later on
119 - // and we need to make sure we don't double-fire the error event.
120 - req._hadError = true;
121 - };
122 - const ontimeout = () => {
123 - timeoutId = null;
124 - timedOut = true;
125 - const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
126 - err.code = 'ETIMEOUT';
127 - onerror(err);
128 - };
129 - const callbackError = (err) => {
130 - if (timedOut)
131 - return;
132 - if (timeoutId !== null) {
133 - clearTimeout(timeoutId);
134 - timeoutId = null;
135 - }
136 - onerror(err);
137 - };
138 - const onsocket = (socket) => {
139 - if (timedOut)
140 - return;
141 - if (timeoutId != null) {
142 - clearTimeout(timeoutId);
143 - timeoutId = null;
144 - }
145 - if (isAgent(socket)) {
146 - // `socket` is actually an `http.Agent` instance, so
147 - // relinquish responsibility for this `req` to the Agent
148 - // from here on
149 - debug('Callback returned another Agent instance %o', socket.constructor.name);
150 - socket.addRequest(req, opts);
151 - return;
152 - }
153 - if (socket) {
154 - socket.once('free', () => {
155 - this.freeSocket(socket, opts);
156 - });
157 - req.onSocket(socket);
158 - return;
159 - }
160 - const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
161 - onerror(err);
162 - };
163 - if (typeof this.callback !== 'function') {
164 - onerror(new Error('`callback` is not defined'));
165 - return;
166 - }
167 - if (!this.promisifiedCallback) {
168 - if (this.callback.length >= 3) {
169 - debug('Converting legacy callback function to promise');
170 - this.promisifiedCallback = promisify_1.default(this.callback);
171 - }
172 - else {
173 - this.promisifiedCallback = this.callback;
174 - }
175 - }
176 - if (typeof timeoutMs === 'number' && timeoutMs > 0) {
177 - timeoutId = setTimeout(ontimeout, timeoutMs);
178 - }
179 - if ('port' in opts && typeof opts.port !== 'number') {
180 - opts.port = Number(opts.port);
181 - }
182 - try {
183 - debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
184 - Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
185 - }
186 - catch (err) {
187 - Promise.reject(err).catch(callbackError);
188 - }
189 - }
190 - freeSocket(socket, opts) {
191 - debug('Freeing socket %o %o', socket.constructor.name, opts);
192 - socket.destroy();
193 - }
194 - destroy() {
195 - debug('Destroying agent %o', this.constructor.name);
196 - }
197 - }
198 - createAgent.Agent = Agent;
199 - // So that `instanceof` works correctly
200 - createAgent.prototype = createAgent.Agent.prototype;
201 -})(createAgent || (createAgent = {}));
202 -module.exports = createAgent;
203 -//# sourceMappingURL=index.js.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAOD,SAAS,WAAW,CACnB,QAA+D,EAC/D,IAA+B;IAE/B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,WAAU,WAAW;IAmDpB;;;;;;OAMG;IACH,MAAa,KAAM,SAAQ,qBAAY;QAmBtC,YACC,QAA+D,EAC/D,KAAgC;YAEhC,KAAK,EAAE,CAAC;YAER,IAAI,IAAI,GAAG,KAAK,CAAC;YACjB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;gBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;aACzB;iBAAM,IAAI,QAAQ,EAAE;gBACpB,IAAI,GAAG,QAAQ,CAAC;aAChB;YAED,0DAA0D;YAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;aAC5B;YAED,+DAA+D;YAC/D,0DAA0D;YAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YACpB,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,WAAW;YACd,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,EAAE;gBACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC;aAChC;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QAED,IAAI,WAAW,CAAC,CAAS;YACxB,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ;YACX,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE;gBAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC;aAC7B;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,CAAC,CAAS;YACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC3B,CAAC;QAaD,QAAQ,CACP,GAA8B,EAC9B,IAA8B,EAC9B,EAAsC;YAKtC,MAAM,IAAI,KAAK,CACd,yFAAyF,CACzF,CAAC;QACH,CAAC;QAED;;;;;WAKG;QACH,UAAU,CAAC,GAAkB,EAAE,KAAqB;YACnD,MAAM,IAAI,qBAAwB,KAAK,CAAE,CAAC;YAE1C,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;gBAC7C,IAAI,CAAC,cAAc,GAAG,gBAAgB,EAAE,CAAC;aACzC;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;aACxB;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3C;YAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;aACzD;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;gBAC3B,2DAA2D;gBAC3D,0DAA0D;gBAC1D,4DAA4D;gBAC5D,8CAA8C;gBAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;aACjB;YAED,OAAO,IAAI,CAAC,KAAK,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACrB,OAAO,IAAI,CAAC,aAAa,CAAC;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC;YACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAE7B,kCAAkC;YAClC,2CAA2C;YAC3C,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC;YAE5B,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,SAAS,GAAyC,IAAI,CAAC;YAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;YAE/C,MAAM,OAAO,GAAG,CAAC,GAA0B,EAAE,EAAE;gBAC9C,IAAI,GAAG,CAAC,SAAS;oBAAE,OAAO;gBAC1B,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvB,yDAAyD;gBACzD,iEAAiE;gBACjE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC;YAEF,MAAM,SAAS,GAAG,GAAG,EAAE;gBACtB,SAAS,GAAG,IAAI,CAAC;gBACjB,QAAQ,GAAG,IAAI,CAAC;gBAChB,MAAM,GAAG,GAA0B,IAAI,KAAK,CAC3C,sDAAsD,SAAS,IAAI,CACnE,CAAC;gBACF,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,aAAa,GAAG,CAAC,GAA0B,EAAE,EAAE;gBACpD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,KAAK,IAAI,EAAE;oBACvB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBACD,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,QAAQ,GAAG,CAAC,MAA2B,EAAE,EAAE;gBAChD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,IAAI,IAAI,EAAE;oBACtB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;oBACpB,oDAAoD;oBACpD,wDAAwD;oBACxD,eAAe;oBACf,KAAK,CACJ,6CAA6C,EAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CACvB,CAAC;oBACD,MAA4B,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACpD,OAAO;iBACP;gBAED,IAAI,MAAM,EAAE;oBACX,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;wBACxB,IAAI,CAAC,UAAU,CAAC,MAAoB,EAAE,IAAI,CAAC,CAAC;oBAC7C,CAAC,CAAC,CAAC;oBACH,GAAG,CAAC,QAAQ,CAAC,MAAoB,CAAC,CAAC;oBACnC,OAAO;iBACP;gBAED,MAAM,GAAG,GAAG,IAAI,KAAK,CACpB,qDAAqD,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,CAC/E,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE;gBACxC,OAAO,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;gBAChD,OAAO;aACP;YAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;oBAC9B,KAAK,CAAC,gDAAgD,CAAC,CAAC;oBACxD,IAAI,CAAC,mBAAmB,GAAG,mBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACpD;qBAAM;oBACN,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC;iBACzC;aACD;YAED,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,CAAC,EAAE;gBACnD,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAED,IAAI;gBACH,KAAK,CACJ,qCAAqC,EACrC,IAAI,CAAC,QAAQ,EACb,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAC3B,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CACxD,QAAQ,EACR,aAAa,CACb,CAAC;aACF;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACzC;QACF,CAAC;QAED,UAAU,CAAC,MAAkB,EAAE,IAAkB;YAChD,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAxPY,iBAAK,QAwPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAtTS,WAAW,KAAX,WAAW,QAsTpB;AAED,iBAAS,WAAW,CAAC"}
...\ No newline at end of file ...\ No newline at end of file
1 -import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index';
2 -declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void;
3 -export default function promisify(fn: LegacyCallback): AgentCallbackPromise;
4 -export {};
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -function promisify(fn) {
4 - return function (req, opts) {
5 - return new Promise((resolve, reject) => {
6 - fn.call(this, req, opts, (err, rtn) => {
7 - if (err) {
8 - reject(err);
9 - }
10 - else {
11 - resolve(rtn);
12 - }
13 - });
14 - });
15 - };
16 -}
17 -exports.default = promisify;
18 -//# sourceMappingURL=promisify.js.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"}
...\ No newline at end of file ...\ No newline at end of file
1 -(The MIT License)
2 -
3 -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
4 -Copyright (c) 2018-2021 Josh Junon
5 -
6 -Permission is hereby granted, free of charge, to any person obtaining a copy of this software
7 -and associated documentation files (the 'Software'), to deal in the Software without restriction,
8 -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10 -subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in all copies or substantial
13 -portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 -
This diff is collapsed. Click to expand it.
1 -{
2 - "name": "debug",
3 - "version": "4.3.4",
4 - "repository": {
5 - "type": "git",
6 - "url": "git://github.com/debug-js/debug.git"
7 - },
8 - "description": "Lightweight debugging utility for Node.js and the browser",
9 - "keywords": [
10 - "debug",
11 - "log",
12 - "debugger"
13 - ],
14 - "files": [
15 - "src",
16 - "LICENSE",
17 - "README.md"
18 - ],
19 - "author": "Josh Junon <josh.junon@protonmail.com>",
20 - "contributors": [
21 - "TJ Holowaychuk <tj@vision-media.ca>",
22 - "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
23 - "Andrew Rhyne <rhyneandrew@gmail.com>"
24 - ],
25 - "license": "MIT",
26 - "scripts": {
27 - "lint": "xo",
28 - "test": "npm run test:node && npm run test:browser && npm run lint",
29 - "test:node": "istanbul cover _mocha -- test.js",
30 - "test:browser": "karma start --single-run",
31 - "test:coverage": "cat ./coverage/lcov.info | coveralls"
32 - },
33 - "dependencies": {
34 - "ms": "2.1.2"
35 - },
36 - "devDependencies": {
37 - "brfs": "^2.0.1",
38 - "browserify": "^16.2.3",
39 - "coveralls": "^3.0.2",
40 - "istanbul": "^0.4.5",
41 - "karma": "^3.1.4",
42 - "karma-browserify": "^6.0.0",
43 - "karma-chrome-launcher": "^2.2.0",
44 - "karma-mocha": "^1.3.0",
45 - "mocha": "^5.2.0",
46 - "mocha-lcov-reporter": "^1.2.0",
47 - "xo": "^0.23.0"
48 - },
49 - "peerDependenciesMeta": {
50 - "supports-color": {
51 - "optional": true
52 - }
53 - },
54 - "main": "./src/index.js",
55 - "browser": "./src/browser.js",
56 - "engines": {
57 - "node": ">=6.0"
58 - }
59 -}
1 -/* eslint-env browser */
2 -
3 -/**
4 - * This is the web browser implementation of `debug()`.
5 - */
6 -
7 -exports.formatArgs = formatArgs;
8 -exports.save = save;
9 -exports.load = load;
10 -exports.useColors = useColors;
11 -exports.storage = localstorage();
12 -exports.destroy = (() => {
13 - let warned = false;
14 -
15 - return () => {
16 - if (!warned) {
17 - warned = true;
18 - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
19 - }
20 - };
21 -})();
22 -
23 -/**
24 - * Colors.
25 - */
26 -
27 -exports.colors = [
28 - '#0000CC',
29 - '#0000FF',
30 - '#0033CC',
31 - '#0033FF',
32 - '#0066CC',
33 - '#0066FF',
34 - '#0099CC',
35 - '#0099FF',
36 - '#00CC00',
37 - '#00CC33',
38 - '#00CC66',
39 - '#00CC99',
40 - '#00CCCC',
41 - '#00CCFF',
42 - '#3300CC',
43 - '#3300FF',
44 - '#3333CC',
45 - '#3333FF',
46 - '#3366CC',
47 - '#3366FF',
48 - '#3399CC',
49 - '#3399FF',
50 - '#33CC00',
51 - '#33CC33',
52 - '#33CC66',
53 - '#33CC99',
54 - '#33CCCC',
55 - '#33CCFF',
56 - '#6600CC',
57 - '#6600FF',
58 - '#6633CC',
59 - '#6633FF',
60 - '#66CC00',
61 - '#66CC33',
62 - '#9900CC',
63 - '#9900FF',
64 - '#9933CC',
65 - '#9933FF',
66 - '#99CC00',
67 - '#99CC33',
68 - '#CC0000',
69 - '#CC0033',
70 - '#CC0066',
71 - '#CC0099',
72 - '#CC00CC',
73 - '#CC00FF',
74 - '#CC3300',
75 - '#CC3333',
76 - '#CC3366',
77 - '#CC3399',
78 - '#CC33CC',
79 - '#CC33FF',
80 - '#CC6600',
81 - '#CC6633',
82 - '#CC9900',
83 - '#CC9933',
84 - '#CCCC00',
85 - '#CCCC33',
86 - '#FF0000',
87 - '#FF0033',
88 - '#FF0066',
89 - '#FF0099',
90 - '#FF00CC',
91 - '#FF00FF',
92 - '#FF3300',
93 - '#FF3333',
94 - '#FF3366',
95 - '#FF3399',
96 - '#FF33CC',
97 - '#FF33FF',
98 - '#FF6600',
99 - '#FF6633',
100 - '#FF9900',
101 - '#FF9933',
102 - '#FFCC00',
103 - '#FFCC33'
104 -];
105 -
106 -/**
107 - * Currently only WebKit-based Web Inspectors, Firefox >= v31,
108 - * and the Firebug extension (any Firefox version) are known
109 - * to support "%c" CSS customizations.
110 - *
111 - * TODO: add a `localStorage` variable to explicitly enable/disable colors
112 - */
113 -
114 -// eslint-disable-next-line complexity
115 -function useColors() {
116 - // NB: In an Electron preload script, document will be defined but not fully
117 - // initialized. Since we know we're in Chrome, we'll just detect this case
118 - // explicitly
119 - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
120 - return true;
121 - }
122 -
123 - // Internet Explorer and Edge do not support colors.
124 - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
125 - return false;
126 - }
127 -
128 - // Is webkit? http://stackoverflow.com/a/16459606/376773
129 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
130 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
131 - // Is firebug? http://stackoverflow.com/a/398120/376773
132 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
133 - // Is firefox >= v31?
134 - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
135 - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
136 - // Double check webkit in userAgent just in case we are in a worker
137 - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
138 -}
139 -
140 -/**
141 - * Colorize log arguments if enabled.
142 - *
143 - * @api public
144 - */
145 -
146 -function formatArgs(args) {
147 - args[0] = (this.useColors ? '%c' : '') +
148 - this.namespace +
149 - (this.useColors ? ' %c' : ' ') +
150 - args[0] +
151 - (this.useColors ? '%c ' : ' ') +
152 - '+' + module.exports.humanize(this.diff);
153 -
154 - if (!this.useColors) {
155 - return;
156 - }
157 -
158 - const c = 'color: ' + this.color;
159 - args.splice(1, 0, c, 'color: inherit');
160 -
161 - // The final "%c" is somewhat tricky, because there could be other
162 - // arguments passed either before or after the %c, so we need to
163 - // figure out the correct index to insert the CSS into
164 - let index = 0;
165 - let lastC = 0;
166 - args[0].replace(/%[a-zA-Z%]/g, match => {
167 - if (match === '%%') {
168 - return;
169 - }
170 - index++;
171 - if (match === '%c') {
172 - // We only are interested in the *last* %c
173 - // (the user may have provided their own)
174 - lastC = index;
175 - }
176 - });
177 -
178 - args.splice(lastC, 0, c);
179 -}
180 -
181 -/**
182 - * Invokes `console.debug()` when available.
183 - * No-op when `console.debug` is not a "function".
184 - * If `console.debug` is not available, falls back
185 - * to `console.log`.
186 - *
187 - * @api public
188 - */
189 -exports.log = console.debug || console.log || (() => {});
190 -
191 -/**
192 - * Save `namespaces`.
193 - *
194 - * @param {String} namespaces
195 - * @api private
196 - */
197 -function save(namespaces) {
198 - try {
199 - if (namespaces) {
200 - exports.storage.setItem('debug', namespaces);
201 - } else {
202 - exports.storage.removeItem('debug');
203 - }
204 - } catch (error) {
205 - // Swallow
206 - // XXX (@Qix-) should we be logging these?
207 - }
208 -}
209 -
210 -/**
211 - * Load `namespaces`.
212 - *
213 - * @return {String} returns the previously persisted debug modes
214 - * @api private
215 - */
216 -function load() {
217 - let r;
218 - try {
219 - r = exports.storage.getItem('debug');
220 - } catch (error) {
221 - // Swallow
222 - // XXX (@Qix-) should we be logging these?
223 - }
224 -
225 - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
226 - if (!r && typeof process !== 'undefined' && 'env' in process) {
227 - r = process.env.DEBUG;
228 - }
229 -
230 - return r;
231 -}
232 -
233 -/**
234 - * Localstorage attempts to return the localstorage.
235 - *
236 - * This is necessary because safari throws
237 - * when a user disables cookies/localstorage
238 - * and you attempt to access it.
239 - *
240 - * @return {LocalStorage}
241 - * @api private
242 - */
243 -
244 -function localstorage() {
245 - try {
246 - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
247 - // The Browser also has localStorage in the global context.
248 - return localStorage;
249 - } catch (error) {
250 - // Swallow
251 - // XXX (@Qix-) should we be logging these?
252 - }
253 -}
254 -
255 -module.exports = require('./common')(exports);
256 -
257 -const {formatters} = module.exports;
258 -
259 -/**
260 - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
261 - */
262 -
263 -formatters.j = function (v) {
264 - try {
265 - return JSON.stringify(v);
266 - } catch (error) {
267 - return '[UnexpectedJSONParseError]: ' + error.message;
268 - }
269 -};
1 -
2 -/**
3 - * This is the common logic for both the Node.js and web browser
4 - * implementations of `debug()`.
5 - */
6 -
7 -function setup(env) {
8 - createDebug.debug = createDebug;
9 - createDebug.default = createDebug;
10 - createDebug.coerce = coerce;
11 - createDebug.disable = disable;
12 - createDebug.enable = enable;
13 - createDebug.enabled = enabled;
14 - createDebug.humanize = require('ms');
15 - createDebug.destroy = destroy;
16 -
17 - Object.keys(env).forEach(key => {
18 - createDebug[key] = env[key];
19 - });
20 -
21 - /**
22 - * The currently active debug mode names, and names to skip.
23 - */
24 -
25 - createDebug.names = [];
26 - createDebug.skips = [];
27 -
28 - /**
29 - * Map of special "%n" handling functions, for the debug "format" argument.
30 - *
31 - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
32 - */
33 - createDebug.formatters = {};
34 -
35 - /**
36 - * Selects a color for a debug namespace
37 - * @param {String} namespace The namespace string for the debug instance to be colored
38 - * @return {Number|String} An ANSI color code for the given namespace
39 - * @api private
40 - */
41 - function selectColor(namespace) {
42 - let hash = 0;
43 -
44 - for (let i = 0; i < namespace.length; i++) {
45 - hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
46 - hash |= 0; // Convert to 32bit integer
47 - }
48 -
49 - return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
50 - }
51 - createDebug.selectColor = selectColor;
52 -
53 - /**
54 - * Create a debugger with the given `namespace`.
55 - *
56 - * @param {String} namespace
57 - * @return {Function}
58 - * @api public
59 - */
60 - function createDebug(namespace) {
61 - let prevTime;
62 - let enableOverride = null;
63 - let namespacesCache;
64 - let enabledCache;
65 -
66 - function debug(...args) {
67 - // Disabled?
68 - if (!debug.enabled) {
69 - return;
70 - }
71 -
72 - const self = debug;
73 -
74 - // Set `diff` timestamp
75 - const curr = Number(new Date());
76 - const ms = curr - (prevTime || curr);
77 - self.diff = ms;
78 - self.prev = prevTime;
79 - self.curr = curr;
80 - prevTime = curr;
81 -
82 - args[0] = createDebug.coerce(args[0]);
83 -
84 - if (typeof args[0] !== 'string') {
85 - // Anything else let's inspect with %O
86 - args.unshift('%O');
87 - }
88 -
89 - // Apply any `formatters` transformations
90 - let index = 0;
91 - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
92 - // If we encounter an escaped % then don't increase the array index
93 - if (match === '%%') {
94 - return '%';
95 - }
96 - index++;
97 - const formatter = createDebug.formatters[format];
98 - if (typeof formatter === 'function') {
99 - const val = args[index];
100 - match = formatter.call(self, val);
101 -
102 - // Now we need to remove `args[index]` since it's inlined in the `format`
103 - args.splice(index, 1);
104 - index--;
105 - }
106 - return match;
107 - });
108 -
109 - // Apply env-specific formatting (colors, etc.)
110 - createDebug.formatArgs.call(self, args);
111 -
112 - const logFn = self.log || createDebug.log;
113 - logFn.apply(self, args);
114 - }
115 -
116 - debug.namespace = namespace;
117 - debug.useColors = createDebug.useColors();
118 - debug.color = createDebug.selectColor(namespace);
119 - debug.extend = extend;
120 - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
121 -
122 - Object.defineProperty(debug, 'enabled', {
123 - enumerable: true,
124 - configurable: false,
125 - get: () => {
126 - if (enableOverride !== null) {
127 - return enableOverride;
128 - }
129 - if (namespacesCache !== createDebug.namespaces) {
130 - namespacesCache = createDebug.namespaces;
131 - enabledCache = createDebug.enabled(namespace);
132 - }
133 -
134 - return enabledCache;
135 - },
136 - set: v => {
137 - enableOverride = v;
138 - }
139 - });
140 -
141 - // Env-specific initialization logic for debug instances
142 - if (typeof createDebug.init === 'function') {
143 - createDebug.init(debug);
144 - }
145 -
146 - return debug;
147 - }
148 -
149 - function extend(namespace, delimiter) {
150 - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
151 - newDebug.log = this.log;
152 - return newDebug;
153 - }
154 -
155 - /**
156 - * Enables a debug mode by namespaces. This can include modes
157 - * separated by a colon and wildcards.
158 - *
159 - * @param {String} namespaces
160 - * @api public
161 - */
162 - function enable(namespaces) {
163 - createDebug.save(namespaces);
164 - createDebug.namespaces = namespaces;
165 -
166 - createDebug.names = [];
167 - createDebug.skips = [];
168 -
169 - let i;
170 - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
171 - const len = split.length;
172 -
173 - for (i = 0; i < len; i++) {
174 - if (!split[i]) {
175 - // ignore empty strings
176 - continue;
177 - }
178 -
179 - namespaces = split[i].replace(/\*/g, '.*?');
180 -
181 - if (namespaces[0] === '-') {
182 - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
183 - } else {
184 - createDebug.names.push(new RegExp('^' + namespaces + '$'));
185 - }
186 - }
187 - }
188 -
189 - /**
190 - * Disable debug output.
191 - *
192 - * @return {String} namespaces
193 - * @api public
194 - */
195 - function disable() {
196 - const namespaces = [
197 - ...createDebug.names.map(toNamespace),
198 - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
199 - ].join(',');
200 - createDebug.enable('');
201 - return namespaces;
202 - }
203 -
204 - /**
205 - * Returns true if the given mode name is enabled, false otherwise.
206 - *
207 - * @param {String} name
208 - * @return {Boolean}
209 - * @api public
210 - */
211 - function enabled(name) {
212 - if (name[name.length - 1] === '*') {
213 - return true;
214 - }
215 -
216 - let i;
217 - let len;
218 -
219 - for (i = 0, len = createDebug.skips.length; i < len; i++) {
220 - if (createDebug.skips[i].test(name)) {
221 - return false;
222 - }
223 - }
224 -
225 - for (i = 0, len = createDebug.names.length; i < len; i++) {
226 - if (createDebug.names[i].test(name)) {
227 - return true;
228 - }
229 - }
230 -
231 - return false;
232 - }
233 -
234 - /**
235 - * Convert regexp to namespace
236 - *
237 - * @param {RegExp} regxep
238 - * @return {String} namespace
239 - * @api private
240 - */
241 - function toNamespace(regexp) {
242 - return regexp.toString()
243 - .substring(2, regexp.toString().length - 2)
244 - .replace(/\.\*\?$/, '*');
245 - }
246 -
247 - /**
248 - * Coerce `val`.
249 - *
250 - * @param {Mixed} val
251 - * @return {Mixed}
252 - * @api private
253 - */
254 - function coerce(val) {
255 - if (val instanceof Error) {
256 - return val.stack || val.message;
257 - }
258 - return val;
259 - }
260 -
261 - /**
262 - * XXX DO NOT USE. This is a temporary stub function.
263 - * XXX It WILL be removed in the next major release.
264 - */
265 - function destroy() {
266 - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
267 - }
268 -
269 - createDebug.enable(createDebug.load());
270 -
271 - return createDebug;
272 -}
273 -
274 -module.exports = setup;
1 -/**
2 - * Detect Electron renderer / nwjs process, which is node, but we should
3 - * treat as a browser.
4 - */
5 -
6 -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
7 - module.exports = require('./browser.js');
8 -} else {
9 - module.exports = require('./node.js');
10 -}
1 -/**
2 - * Module dependencies.
3 - */
4 -
5 -const tty = require('tty');
6 -const util = require('util');
7 -
8 -/**
9 - * This is the Node.js implementation of `debug()`.
10 - */
11 -
12 -exports.init = init;
13 -exports.log = log;
14 -exports.formatArgs = formatArgs;
15 -exports.save = save;
16 -exports.load = load;
17 -exports.useColors = useColors;
18 -exports.destroy = util.deprecate(
19 - () => {},
20 - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
21 -);
22 -
23 -/**
24 - * Colors.
25 - */
26 -
27 -exports.colors = [6, 2, 3, 4, 5, 1];
28 -
29 -try {
30 - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
31 - // eslint-disable-next-line import/no-extraneous-dependencies
32 - const supportsColor = require('supports-color');
33 -
34 - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
35 - exports.colors = [
36 - 20,
37 - 21,
38 - 26,
39 - 27,
40 - 32,
41 - 33,
42 - 38,
43 - 39,
44 - 40,
45 - 41,
46 - 42,
47 - 43,
48 - 44,
49 - 45,
50 - 56,
51 - 57,
52 - 62,
53 - 63,
54 - 68,
55 - 69,
56 - 74,
57 - 75,
58 - 76,
59 - 77,
60 - 78,
61 - 79,
62 - 80,
63 - 81,
64 - 92,
65 - 93,
66 - 98,
67 - 99,
68 - 112,
69 - 113,
70 - 128,
71 - 129,
72 - 134,
73 - 135,
74 - 148,
75 - 149,
76 - 160,
77 - 161,
78 - 162,
79 - 163,
80 - 164,
81 - 165,
82 - 166,
83 - 167,
84 - 168,
85 - 169,
86 - 170,
87 - 171,
88 - 172,
89 - 173,
90 - 178,
91 - 179,
92 - 184,
93 - 185,
94 - 196,
95 - 197,
96 - 198,
97 - 199,
98 - 200,
99 - 201,
100 - 202,
101 - 203,
102 - 204,
103 - 205,
104 - 206,
105 - 207,
106 - 208,
107 - 209,
108 - 214,
109 - 215,
110 - 220,
111 - 221
112 - ];
113 - }
114 -} catch (error) {
115 - // Swallow - we only care if `supports-color` is available; it doesn't have to be.
116 -}
117 -
118 -/**
119 - * Build up the default `inspectOpts` object from the environment variables.
120 - *
121 - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
122 - */
123 -
124 -exports.inspectOpts = Object.keys(process.env).filter(key => {
125 - return /^debug_/i.test(key);
126 -}).reduce((obj, key) => {
127 - // Camel-case
128 - const prop = key
129 - .substring(6)
130 - .toLowerCase()
131 - .replace(/_([a-z])/g, (_, k) => {
132 - return k.toUpperCase();
133 - });
134 -
135 - // Coerce string value into JS value
136 - let val = process.env[key];
137 - if (/^(yes|on|true|enabled)$/i.test(val)) {
138 - val = true;
139 - } else if (/^(no|off|false|disabled)$/i.test(val)) {
140 - val = false;
141 - } else if (val === 'null') {
142 - val = null;
143 - } else {
144 - val = Number(val);
145 - }
146 -
147 - obj[prop] = val;
148 - return obj;
149 -}, {});
150 -
151 -/**
152 - * Is stdout a TTY? Colored output is enabled when `true`.
153 - */
154 -
155 -function useColors() {
156 - return 'colors' in exports.inspectOpts ?
157 - Boolean(exports.inspectOpts.colors) :
158 - tty.isatty(process.stderr.fd);
159 -}
160 -
161 -/**
162 - * Adds ANSI color escape codes if enabled.
163 - *
164 - * @api public
165 - */
166 -
167 -function formatArgs(args) {
168 - const {namespace: name, useColors} = this;
169 -
170 - if (useColors) {
171 - const c = this.color;
172 - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
173 - const prefix = ` ${colorCode};1m${name} \u001B[0m`;
174 -
175 - args[0] = prefix + args[0].split('\n').join('\n' + prefix);
176 - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
177 - } else {
178 - args[0] = getDate() + name + ' ' + args[0];
179 - }
180 -}
181 -
182 -function getDate() {
183 - if (exports.inspectOpts.hideDate) {
184 - return '';
185 - }
186 - return new Date().toISOString() + ' ';
187 -}
188 -
189 -/**
190 - * Invokes `util.format()` with the specified arguments and writes to stderr.
191 - */
192 -
193 -function log(...args) {
194 - return process.stderr.write(util.format(...args) + '\n');
195 -}
196 -
197 -/**
198 - * Save `namespaces`.
199 - *
200 - * @param {String} namespaces
201 - * @api private
202 - */
203 -function save(namespaces) {
204 - if (namespaces) {
205 - process.env.DEBUG = namespaces;
206 - } else {
207 - // If you set a process.env field to null or undefined, it gets cast to the
208 - // string 'null' or 'undefined'. Just delete instead.
209 - delete process.env.DEBUG;
210 - }
211 -}
212 -
213 -/**
214 - * Load `namespaces`.
215 - *
216 - * @return {String} returns the previously persisted debug modes
217 - * @api private
218 - */
219 -
220 -function load() {
221 - return process.env.DEBUG;
222 -}
223 -
224 -/**
225 - * Init logic for `debug` instances.
226 - *
227 - * Create a new `inspectOpts` object in case `useColors` is set
228 - * differently for a particular `debug` instance.
229 - */
230 -
231 -function init(debug) {
232 - debug.inspectOpts = {};
233 -
234 - const keys = Object.keys(exports.inspectOpts);
235 - for (let i = 0; i < keys.length; i++) {
236 - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
237 - }
238 -}
239 -
240 -module.exports = require('./common')(exports);
241 -
242 -const {formatters} = module.exports;
243 -
244 -/**
245 - * Map %o to `util.inspect()`, all on a single line.
246 - */
247 -
248 -formatters.o = function (v) {
249 - this.inspectOpts.colors = this.useColors;
250 - return util.inspect(v, this.inspectOpts)
251 - .split('\n')
252 - .map(str => str.trim())
253 - .join(' ');
254 -};
255 -
256 -/**
257 - * Map %O to `util.inspect()`, allowing multiple lines if needed.
258 - */
259 -
260 -formatters.O = function (v) {
261 - this.inspectOpts.colors = this.useColors;
262 - return util.inspect(v, this.inspectOpts);
263 -};
1 -/**
2 - * Helpers.
3 - */
4 -
5 -var s = 1000;
6 -var m = s * 60;
7 -var h = m * 60;
8 -var d = h * 24;
9 -var w = d * 7;
10 -var y = d * 365.25;
11 -
12 -/**
13 - * Parse or format the given `val`.
14 - *
15 - * Options:
16 - *
17 - * - `long` verbose formatting [false]
18 - *
19 - * @param {String|Number} val
20 - * @param {Object} [options]
21 - * @throws {Error} throw an error if val is not a non-empty string or a number
22 - * @return {String|Number}
23 - * @api public
24 - */
25 -
26 -module.exports = function(val, options) {
27 - options = options || {};
28 - var type = typeof val;
29 - if (type === 'string' && val.length > 0) {
30 - return parse(val);
31 - } else if (type === 'number' && isFinite(val)) {
32 - return options.long ? fmtLong(val) : fmtShort(val);
33 - }
34 - throw new Error(
35 - 'val is not a non-empty string or a valid number. val=' +
36 - JSON.stringify(val)
37 - );
38 -};
39 -
40 -/**
41 - * Parse the given `str` and return milliseconds.
42 - *
43 - * @param {String} str
44 - * @return {Number}
45 - * @api private
46 - */
47 -
48 -function parse(str) {
49 - str = String(str);
50 - if (str.length > 100) {
51 - return;
52 - }
53 - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
54 - str
55 - );
56 - if (!match) {
57 - return;
58 - }
59 - var n = parseFloat(match[1]);
60 - var type = (match[2] || 'ms').toLowerCase();
61 - switch (type) {
62 - case 'years':
63 - case 'year':
64 - case 'yrs':
65 - case 'yr':
66 - case 'y':
67 - return n * y;
68 - case 'weeks':
69 - case 'week':
70 - case 'w':
71 - return n * w;
72 - case 'days':
73 - case 'day':
74 - case 'd':
75 - return n * d;
76 - case 'hours':
77 - case 'hour':
78 - case 'hrs':
79 - case 'hr':
80 - case 'h':
81 - return n * h;
82 - case 'minutes':
83 - case 'minute':
84 - case 'mins':
85 - case 'min':
86 - case 'm':
87 - return n * m;
88 - case 'seconds':
89 - case 'second':
90 - case 'secs':
91 - case 'sec':
92 - case 's':
93 - return n * s;
94 - case 'milliseconds':
95 - case 'millisecond':
96 - case 'msecs':
97 - case 'msec':
98 - case 'ms':
99 - return n;
100 - default:
101 - return undefined;
102 - }
103 -}
104 -
105 -/**
106 - * Short format for `ms`.
107 - *
108 - * @param {Number} ms
109 - * @return {String}
110 - * @api private
111 - */
112 -
113 -function fmtShort(ms) {
114 - var msAbs = Math.abs(ms);
115 - if (msAbs >= d) {
116 - return Math.round(ms / d) + 'd';
117 - }
118 - if (msAbs >= h) {
119 - return Math.round(ms / h) + 'h';
120 - }
121 - if (msAbs >= m) {
122 - return Math.round(ms / m) + 'm';
123 - }
124 - if (msAbs >= s) {
125 - return Math.round(ms / s) + 's';
126 - }
127 - return ms + 'ms';
128 -}
129 -
130 -/**
131 - * Long format for `ms`.
132 - *
133 - * @param {Number} ms
134 - * @return {String}
135 - * @api private
136 - */
137 -
138 -function fmtLong(ms) {
139 - var msAbs = Math.abs(ms);
140 - if (msAbs >= d) {
141 - return plural(ms, msAbs, d, 'day');
142 - }
143 - if (msAbs >= h) {
144 - return plural(ms, msAbs, h, 'hour');
145 - }
146 - if (msAbs >= m) {
147 - return plural(ms, msAbs, m, 'minute');
148 - }
149 - if (msAbs >= s) {
150 - return plural(ms, msAbs, s, 'second');
151 - }
152 - return ms + ' ms';
153 -}
154 -
155 -/**
156 - * Pluralization helper.
157 - */
158 -
159 -function plural(ms, msAbs, n, name) {
160 - var isPlural = msAbs >= n * 1.5;
161 - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
162 -}
1 -The MIT License (MIT)
2 -
3 -Copyright (c) 2016 Zeit, Inc.
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy
6 -of this software and associated documentation files (the "Software"), to deal
7 -in the Software without restriction, including without limitation the rights
8 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 -copies of the Software, and to permit persons to whom the Software is
10 -furnished to do so, subject to the following conditions:
11 -
12 -The above copyright notice and this permission notice shall be included in all
13 -copies or substantial portions of the Software.
14 -
15 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 -SOFTWARE.
1 -{
2 - "name": "ms",
3 - "version": "2.1.2",
4 - "description": "Tiny millisecond conversion utility",
5 - "repository": "zeit/ms",
6 - "main": "./index",
7 - "files": [
8 - "index.js"
9 - ],
10 - "scripts": {
11 - "precommit": "lint-staged",
12 - "lint": "eslint lib/* bin/*",
13 - "test": "mocha tests.js"
14 - },
15 - "eslintConfig": {
16 - "extends": "eslint:recommended",
17 - "env": {
18 - "node": true,
19 - "es6": true
20 - }
21 - },
22 - "lint-staged": {
23 - "*.js": [
24 - "npm run lint",
25 - "prettier --single-quote --write",
26 - "git add"
27 - ]
28 - },
29 - "license": "MIT",
30 - "devDependencies": {
31 - "eslint": "4.12.1",
32 - "expect.js": "0.3.1",
33 - "husky": "0.14.3",
34 - "lint-staged": "5.0.0",
35 - "mocha": "4.0.1"
36 - }
37 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.