서예진

node modules

Showing 1000 changed files with 4488 additions and 0 deletions

Too many changes to show.

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

1 +../acorn/bin/acorn
...\ No newline at end of file ...\ No newline at end of file
1 +../atob/bin/atob.js
...\ No newline at end of file ...\ No newline at end of file
1 +../babylon/bin/babylon.js
...\ No newline at end of file ...\ No newline at end of file
1 +../detect-libc/bin/detect-libc.js
...\ No newline at end of file ...\ No newline at end of file
1 +../is-ci/bin.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 +../mkdirp/bin/cmd.js
...\ No newline at end of file ...\ No newline at end of file
1 +../needle/bin/needle
...\ No newline at end of file ...\ No newline at end of file
1 +../node-pre-gyp/bin/node-pre-gyp
...\ No newline at end of file ...\ No newline at end of file
1 +../nodemon/bin/nodemon.js
...\ No newline at end of file ...\ No newline at end of file
1 +../touch/bin/nodetouch.js
...\ No newline at end of file ...\ No newline at end of file
1 +../nopt/bin/nopt.js
...\ No newline at end of file ...\ No newline at end of file
1 +../rc/cli.js
...\ 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 +../semver/bin/semver
...\ No newline at end of file ...\ No newline at end of file
1 +../uglify-js/bin/uglifyjs
...\ 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
1 +../which/bin/which
...\ No newline at end of file ...\ No newline at end of file
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation. All rights reserved.
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/babel-types`
3 +
4 +# Summary
5 +This package contains type definitions for babel-types (https://github.com/babel/babel/tree/master/packages/babel-types).
6 +
7 +# Details
8 +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped.git/tree/master/types/babel-types
9 +
10 +Additional Details
11 + * Last updated: Tue, 08 May 2018 16:35:40 GMT
12 + * Dependencies: none
13 + * Global values: none
14 +
15 +# Credits
16 +These definitions were written by Troy Gerwien <https://github.com/yortus>, Sam Baxter <https://github.com/baxtersa>, Marvin Hagemeister <https://github.com/marvinhagemeister>, Boris Cherny <https://github.com/bcherny>.
This diff is collapsed. Click to expand it.
1 +{
2 + "_args": [
3 + [
4 + "@types/babel-types@7.0.2",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "@types/babel-types@7.0.2",
9 + "_id": "@types/babel-types@7.0.2",
10 + "_inBundle": false,
11 + "_integrity": "sha512-ylggu8DwwxT6mk3jVoJeohWAePWMNWEYm06MSoJ19kwp3hT9eY2Z4NNZn3oevzgFmClgNQ2GQF500hPDvNsGHg==",
12 + "_location": "/@types/babel-types",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "@types/babel-types@7.0.2",
18 + "name": "@types/babel-types",
19 + "escapedName": "@types%2fbabel-types",
20 + "scope": "@types",
21 + "rawSpec": "7.0.2",
22 + "saveSpec": null,
23 + "fetchSpec": "7.0.2"
24 + },
25 + "_requiredBy": [
26 + "/@types/babylon",
27 + "/constantinople"
28 + ],
29 + "_resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.2.tgz",
30 + "_spec": "7.0.2",
31 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
32 + "bugs": {
33 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git/issues"
34 + },
35 + "contributors": [
36 + {
37 + "name": "Troy Gerwien",
38 + "url": "https://github.com/yortus"
39 + },
40 + {
41 + "name": "Sam Baxter",
42 + "url": "https://github.com/baxtersa"
43 + },
44 + {
45 + "name": "Marvin Hagemeister",
46 + "url": "https://github.com/marvinhagemeister"
47 + },
48 + {
49 + "name": "Boris Cherny",
50 + "url": "https://github.com/bcherny"
51 + }
52 + ],
53 + "dependencies": {},
54 + "description": "TypeScript definitions for babel-types",
55 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped.git#readme",
56 + "license": "MIT",
57 + "main": "",
58 + "name": "@types/babel-types",
59 + "repository": {
60 + "type": "git",
61 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git.git"
62 + },
63 + "scripts": {},
64 + "typeScriptVersion": "2.3",
65 + "typesPublisherContentHash": "2fb27a0883383db8849c1e0ae8b63ef8dc0d0ba56059ada118e92839923e0f87",
66 + "version": "7.0.2"
67 +}
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation. All rights reserved.
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/babylon`
3 +
4 +# Summary
5 +This package contains type definitions for babylon (https://github.com/babel/babylon).
6 +
7 +# Details
8 +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babylon
9 +
10 +Additional Details
11 + * Last updated: Thu, 20 Jul 2017 13:50:42 GMT
12 + * Dependencies: babel-types
13 + * Global values: none
14 +
15 +# Credits
16 +These definitions were written by Troy Gerwien <https://github.com/yortus>, Marvin Hagemeister <https://github.com/marvinhagemeister>.
1 +// Type definitions for babylon 6.16
2 +// Project: https://github.com/babel/babylon
3 +// Definitions by: Troy Gerwien <https://github.com/yortus>
4 +// Marvin Hagemeister <https://github.com/marvinhagemeister>
5 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6 +// TypeScript Version: 2.3
7 +
8 +import { File, Expression } from 'babel-types';
9 +
10 +export function parse(code: string, opts?: BabylonOptions): File;
11 +
12 +export function parseExpression(input: string, options?: BabylonOptions): Expression;
13 +
14 +export interface BabylonOptions {
15 + /**
16 + * By default, import and export declarations can only appear at a program's top level.
17 + * Setting this option to true allows them anywhere where a statement is allowed.
18 + */
19 + allowImportExportEverywhere?: boolean;
20 +
21 + /**
22 + * By default, a return statement at the top level raises an error. Set this to true to accept such code.
23 + */
24 + allowReturnOutsideFunction?: boolean;
25 +
26 + allowSuperOutsideMethod?: boolean;
27 +
28 + /**
29 + * Indicate the mode the code should be parsed in. Can be either "script" or "module".
30 + */
31 + sourceType?: 'script' | 'module';
32 +
33 + /**
34 + * Correlate output AST nodes with their source filename. Useful when
35 + * generating code and source maps from the ASTs of multiple input files.
36 + */
37 + sourceFilename?: string;
38 +
39 + /**
40 + * Array containing the plugins that you want to enable.
41 + */
42 + plugins?: PluginName[];
43 +}
44 +
45 +export type PluginName =
46 + 'estree' |
47 + 'jsx' |
48 + 'flow' |
49 + 'classConstructorCall' |
50 + 'doExpressions' |
51 + 'objectRestSpread' |
52 + 'decorators' |
53 + 'classProperties' |
54 + 'exportExtensions' |
55 + 'asyncGenerators' |
56 + 'functionBind' |
57 + 'functionSent' |
58 + 'dynamicImport';
1 +{
2 + "_args": [
3 + [
4 + "@types/babylon@6.16.2",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "@types/babylon@6.16.2",
9 + "_id": "@types/babylon@6.16.2",
10 + "_inBundle": false,
11 + "_integrity": "sha512-+Jty46mPaWe1VAyZbfvgJM4BAdklLWxrT5tc/RjvCgLrtk6gzRY6AOnoWFv4p6hVxhJshDdr2hGVn56alBp97Q==",
12 + "_location": "/@types/babylon",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "@types/babylon@6.16.2",
18 + "name": "@types/babylon",
19 + "escapedName": "@types%2fbabylon",
20 + "scope": "@types",
21 + "rawSpec": "6.16.2",
22 + "saveSpec": null,
23 + "fetchSpec": "6.16.2"
24 + },
25 + "_requiredBy": [
26 + "/constantinople"
27 + ],
28 + "_resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.2.tgz",
29 + "_spec": "6.16.2",
30 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
31 + "bugs": {
32 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
33 + },
34 + "contributors": [
35 + {
36 + "name": "Troy Gerwien",
37 + "url": "https://github.com/yortus"
38 + },
39 + {
40 + "name": "Marvin Hagemeister",
41 + "url": "https://github.com/marvinhagemeister"
42 + }
43 + ],
44 + "dependencies": {
45 + "@types/babel-types": "*"
46 + },
47 + "description": "TypeScript definitions for babylon",
48 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
49 + "license": "MIT",
50 + "main": "",
51 + "name": "@types/babylon",
52 + "peerDependencies": {},
53 + "repository": {
54 + "type": "git",
55 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
56 + },
57 + "scripts": {},
58 + "typeScriptVersion": "2.3",
59 + "typesPublisherContentHash": "9db531ab1438202c176c2bf38211cdf5a4137d0e001bc1908e8ff3ee8317f237",
60 + "version": "6.16.2"
61 +}
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation. All rights reserved.
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/geojson`
3 +
4 +# Summary
5 +This package contains type definitions for GeoJSON Format Specification Revision (http://geojson.org/).
6 +
7 +# Details
8 +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson
9 +
10 +Additional Details
11 + * Last updated: Wed, 01 Nov 2017 15:55:40 GMT
12 + * Dependencies: none
13 + * Global values: GeoJSON
14 +
15 +# Credits
16 +These definitions were written by Jacob Bruun <https://github.com/cobster>, Arne Schubert <https://github.com/atd-schubert>.
1 +// Type definitions for GeoJSON Format Specification Revision 1.0
2 +// Project: http://geojson.org/
3 +// Definitions by: Jacob Bruun <https://github.com/cobster>
4 +// Arne Schubert <https://github.com/atd-schubert>
5 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6 +// TypeScript Version: 2.3
7 +
8 +export as namespace GeoJSON;
9 +
10 +/***
11 + * http://geojson.org/geojson-spec.html#geojson-objects
12 + */
13 +export interface GeoJsonObject {
14 + type: string;
15 + bbox?: number[];
16 + crs?: CoordinateReferenceSystem;
17 +}
18 +
19 +/***
20 + * http://geojson.org/geojson-spec.html#positions
21 + */
22 +export type Position = number[];
23 +
24 +/***
25 + * http://geojson.org/geojson-spec.html#geometry-objects
26 + */
27 +export interface DirectGeometryObject extends GeoJsonObject {
28 + coordinates: Position[][][] | Position[][] | Position[] | Position;
29 +}
30 +/**
31 + * GeometryObject supports geometry collection as well
32 + */
33 +export type GeometryObject = DirectGeometryObject | GeometryCollection;
34 +
35 +/***
36 + * http://geojson.org/geojson-spec.html#point
37 + */
38 +export interface Point extends DirectGeometryObject {
39 + type: "Point";
40 + coordinates: Position;
41 +}
42 +
43 +/***
44 + * http://geojson.org/geojson-spec.html#multipoint
45 + */
46 +export interface MultiPoint extends DirectGeometryObject {
47 + type: "MultiPoint";
48 + coordinates: Position[];
49 +}
50 +
51 +/***
52 + * http://geojson.org/geojson-spec.html#linestring
53 + */
54 +export interface LineString extends DirectGeometryObject {
55 + type: "LineString";
56 + coordinates: Position[];
57 +}
58 +
59 +/***
60 + * http://geojson.org/geojson-spec.html#multilinestring
61 + */
62 +export interface MultiLineString extends DirectGeometryObject {
63 + type: "MultiLineString";
64 + coordinates: Position[][];
65 +}
66 +
67 +/***
68 + * http://geojson.org/geojson-spec.html#polygon
69 + */
70 +export interface Polygon extends DirectGeometryObject {
71 + type: "Polygon";
72 + coordinates: Position[][];
73 +}
74 +
75 +/***
76 + * http://geojson.org/geojson-spec.html#multipolygon
77 + */
78 +export interface MultiPolygon extends DirectGeometryObject {
79 + type: "MultiPolygon";
80 + coordinates: Position[][][];
81 +}
82 +
83 +/***
84 + * http://geojson.org/geojson-spec.html#geometry-collection
85 + */
86 +export interface GeometryCollection extends GeoJsonObject {
87 + type: "GeometryCollection";
88 + geometries: GeometryObject[];
89 +}
90 +
91 +/***
92 + * https://tools.ietf.org/html/rfc7946#section-3.2
93 + */
94 +export interface Feature<G extends GeometryObject, P = any> extends GeoJsonObject {
95 + type: "Feature";
96 + geometry: G;
97 + properties: P;
98 + id?: string | number;
99 +}
100 +
101 +/***
102 + * http://geojson.org/geojson-spec.html#feature-collection-objects
103 + */
104 +export interface FeatureCollection<G extends GeometryObject, P = any> extends GeoJsonObject {
105 + type: "FeatureCollection";
106 + features: Array<Feature<G, P>>;
107 +}
108 +
109 +/***
110 + * http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
111 + */
112 +export interface CoordinateReferenceSystem {
113 + type: string;
114 + properties: any;
115 +}
116 +
117 +export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem {
118 + properties: { name: string };
119 +}
120 +
121 +export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem {
122 + properties: { href: string; type: string };
123 +}
1 +{
2 + "_args": [
3 + [
4 + "@types/geojson@1.0.6",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "@types/geojson@1.0.6",
9 + "_id": "@types/geojson@1.0.6",
10 + "_inBundle": false,
11 + "_integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w==",
12 + "_location": "/@types/geojson",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "@types/geojson@1.0.6",
18 + "name": "@types/geojson",
19 + "escapedName": "@types%2fgeojson",
20 + "scope": "@types",
21 + "rawSpec": "1.0.6",
22 + "saveSpec": null,
23 + "fetchSpec": "1.0.6"
24 + },
25 + "_requiredBy": [
26 + "/terraformer",
27 + "/terraformer-wkt-parser"
28 + ],
29 + "_resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz",
30 + "_spec": "1.0.6",
31 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
32 + "bugs": {
33 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
34 + },
35 + "contributors": [
36 + {
37 + "name": "Jacob Bruun",
38 + "url": "https://github.com/cobster"
39 + },
40 + {
41 + "name": "Arne Schubert",
42 + "url": "https://github.com/atd-schubert"
43 + }
44 + ],
45 + "dependencies": {},
46 + "description": "TypeScript definitions for GeoJSON Format Specification Revision",
47 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
48 + "license": "MIT",
49 + "main": "",
50 + "name": "@types/geojson",
51 + "repository": {
52 + "type": "git",
53 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
54 + },
55 + "scripts": {},
56 + "typeScriptVersion": "2.3",
57 + "typesPublisherContentHash": "2a374692a48615d90fde45b274e247a1ec98647d93fe7c7ee355386108689bcd",
58 + "version": "1.0.6"
59 +}
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation. All rights reserved.
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 ( http://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: Tue, 26 Mar 2019 20:23:36 GMT
12 + * Dependencies: none
13 + * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
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>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, 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>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, 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>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Jeremie Rodriguez <https://github.com/jeremiergz>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, Thanik Bhongbhibhat <https://github.com/bhongy>.
1 +declare module "assert" {
2 + function internal(value: any, message?: string | Error): void;
3 + namespace internal {
4 + class AssertionError implements Error {
5 + name: string;
6 + message: string;
7 + actual: any;
8 + expected: any;
9 + operator: string;
10 + generatedMessage: boolean;
11 + code: 'ERR_ASSERTION';
12 +
13 + constructor(options?: {
14 + message?: string; actual?: any; expected?: any;
15 + operator?: string; stackStartFn?: Function
16 + });
17 + }
18 +
19 + function fail(message?: string | Error): never;
20 + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
21 + function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
22 + function ok(value: any, message?: string | Error): void;
23 + /** @deprecated since v9.9.0 - use strictEqual() instead. */
24 + function equal(actual: any, expected: any, message?: string | Error): void;
25 + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
26 + function notEqual(actual: any, expected: any, message?: string | Error): void;
27 + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
28 + function deepEqual(actual: any, expected: any, message?: string | Error): void;
29 + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
30 + function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
31 + function strictEqual(actual: any, expected: any, message?: string | Error): void;
32 + function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
33 + function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
34 + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
35 +
36 + function throws(block: () => any, message?: string | Error): void;
37 + function throws(block: () => any, error: RegExp | Function | Object | Error, message?: string | Error): void;
38 + function doesNotThrow(block: () => any, message?: string | Error): void;
39 + function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
40 +
41 + function ifError(value: any): void;
42 +
43 + function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
44 + function rejects(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
45 + function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
46 + function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
47 +
48 + const strict: typeof internal;
49 + }
50 +
51 + export = internal;
52 +}
1 +/**
2 + * Async Hooks module: https://nodejs.org/api/async_hooks.html
3 + */
4 +declare module "async_hooks" {
5 + /**
6 + * Returns the asyncId of the current execution context.
7 + */
8 + function executionAsyncId(): number;
9 +
10 + /**
11 + * Returns the ID of the resource responsible for calling the callback that is currently being executed.
12 + */
13 + function triggerAsyncId(): number;
14 +
15 + interface HookCallbacks {
16 + /**
17 + * Called when a class is constructed that has the possibility to emit an asynchronous event.
18 + * @param asyncId a unique ID for the async resource
19 + * @param type the type of the async resource
20 + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
21 + * @param resource reference to the resource representing the async operation, needs to be released during destroy
22 + */
23 + init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void;
24 +
25 + /**
26 + * When an asynchronous operation is initiated or completes a callback is called to notify the user.
27 + * The before callback is called just before said callback is executed.
28 + * @param asyncId the unique identifier assigned to the resource about to execute the callback.
29 + */
30 + before?(asyncId: number): void;
31 +
32 + /**
33 + * Called immediately after the callback specified in before is completed.
34 + * @param asyncId the unique identifier assigned to the resource which has executed the callback.
35 + */
36 + after?(asyncId: number): void;
37 +
38 + /**
39 + * Called when a promise has resolve() called. This may not be in the same execution id
40 + * as the promise itself.
41 + * @param asyncId the unique id for the promise that was resolve()d.
42 + */
43 + promiseResolve?(asyncId: number): void;
44 +
45 + /**
46 + * Called after the resource corresponding to asyncId is destroyed
47 + * @param asyncId a unique ID for the async resource
48 + */
49 + destroy?(asyncId: number): void;
50 + }
51 +
52 + interface AsyncHook {
53 + /**
54 + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
55 + */
56 + enable(): this;
57 +
58 + /**
59 + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
60 + */
61 + disable(): this;
62 + }
63 +
64 + /**
65 + * Registers functions to be called for different lifetime events of each async operation.
66 + * @param options the callbacks to register
67 + * @return an AsyncHooks instance used for disabling and enabling hooks
68 + */
69 + function createHook(options: HookCallbacks): AsyncHook;
70 +
71 + interface AsyncResourceOptions {
72 + /**
73 + * The ID of the execution context that created this async event.
74 + * Default: `executionAsyncId()`
75 + */
76 + triggerAsyncId?: number;
77 +
78 + /**
79 + * Disables automatic `emitDestroy` when the object is garbage collected.
80 + * This usually does not need to be set (even if `emitDestroy` is called
81 + * manually), unless the resource's `asyncId` is retrieved and the
82 + * sensitive API's `emitDestroy` is called with it.
83 + * Default: `false`
84 + */
85 + requireManualDestroy?: boolean;
86 + }
87 +
88 + /**
89 + * The class AsyncResource was designed to be extended by the embedder's async resources.
90 + * Using this users can easily trigger the lifetime events of their own resources.
91 + */
92 + class AsyncResource {
93 + /**
94 + * AsyncResource() is meant to be extended. Instantiating a
95 + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
96 + * async_hook.executionAsyncId() is used.
97 + * @param type The type of async event.
98 + * @param triggerAsyncId The ID of the execution context that created
99 + * this async event (default: `executionAsyncId()`), or an
100 + * AsyncResourceOptions object (since 9.3)
101 + */
102 + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
103 +
104 + /**
105 + * Call AsyncHooks before callbacks.
106 + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
107 + */
108 + emitBefore(): void;
109 +
110 + /**
111 + * Call AsyncHooks after callbacks.
112 + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
113 + */
114 + emitAfter(): void;
115 +
116 + /**
117 + * Call the provided function with the provided arguments in the
118 + * execution context of the async resource. This will establish the
119 + * context, trigger the AsyncHooks before callbacks, call the function,
120 + * trigger the AsyncHooks after callbacks, and then restore the original
121 + * execution context.
122 + * @param fn The function to call in the execution context of this
123 + * async resource.
124 + * @param thisArg The receiver to be used for the function call.
125 + * @param args Optional arguments to pass to the function.
126 + */
127 + runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
128 +
129 + /**
130 + * Call AsyncHooks destroy callbacks.
131 + */
132 + emitDestroy(): void;
133 +
134 + /**
135 + * @return the unique ID assigned to this AsyncResource instance.
136 + */
137 + asyncId(): number;
138 +
139 + /**
140 + * @return the trigger ID for this AsyncResource instance.
141 + */
142 + triggerAsyncId(): number;
143 + }
144 +}
1 +// base definnitions for all NodeJS modules that are not specific to any version of TypeScript
2 +/// <reference path="globals.d.ts" />
3 +/// <reference path="assert.d.ts" />
4 +/// <reference path="async_hooks.d.ts" />
5 +/// <reference path="buffer.d.ts" />
6 +/// <reference path="child_process.d.ts" />
7 +/// <reference path="cluster.d.ts" />
8 +/// <reference path="console.d.ts" />
9 +/// <reference path="constants.d.ts" />
10 +/// <reference path="crypto.d.ts" />
11 +/// <reference path="dgram.d.ts" />
12 +/// <reference path="dns.d.ts" />
13 +/// <reference path="domain.d.ts" />
14 +/// <reference path="events.d.ts" />
15 +/// <reference path="fs.d.ts" />
16 +/// <reference path="http.d.ts" />
17 +/// <reference path="http2.d.ts" />
18 +/// <reference path="https.d.ts" />
19 +/// <reference path="inspector.d.ts" />
20 +/// <reference path="module.d.ts" />
21 +/// <reference path="net.d.ts" />
22 +/// <reference path="os.d.ts" />
23 +/// <reference path="path.d.ts" />
24 +/// <reference path="perf_hooks.d.ts" />
25 +/// <reference path="process.d.ts" />
26 +/// <reference path="punycode.d.ts" />
27 +/// <reference path="querystring.d.ts" />
28 +/// <reference path="readline.d.ts" />
29 +/// <reference path="repl.d.ts" />
30 +/// <reference path="stream.d.ts" />
31 +/// <reference path="string_decoder.d.ts" />
32 +/// <reference path="timers.d.ts" />
33 +/// <reference path="tls.d.ts" />
34 +/// <reference path="trace_events.d.ts" />
35 +/// <reference path="tty.d.ts" />
36 +/// <reference path="url.d.ts" />
37 +/// <reference path="util.d.ts" />
38 +/// <reference path="v8.d.ts" />
39 +/// <reference path="vm.d.ts" />
40 +/// <reference path="worker_threads.d.ts" />
41 +/// <reference path="zlib.d.ts" />
1 +declare module "buffer" {
2 + export const INSPECT_MAX_BYTES: number;
3 + const BuffType: typeof Buffer;
4 +
5 + export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
6 +
7 + export function transcode(source: Buffer | Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
8 +
9 + export const SlowBuffer: {
10 + /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */
11 + new(size: number): Buffer;
12 + prototype: Buffer;
13 + };
14 +
15 + export { BuffType as Buffer };
16 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare module "console" {
2 + export = console;
3 +}
1 +declare module "constants" {
2 + const E2BIG: number;
3 + const EACCES: number;
4 + const EADDRINUSE: number;
5 + const EADDRNOTAVAIL: number;
6 + const EAFNOSUPPORT: number;
7 + const EAGAIN: number;
8 + const EALREADY: number;
9 + const EBADF: number;
10 + const EBADMSG: number;
11 + const EBUSY: number;
12 + const ECANCELED: number;
13 + const ECHILD: number;
14 + const ECONNABORTED: number;
15 + const ECONNREFUSED: number;
16 + const ECONNRESET: number;
17 + const EDEADLK: number;
18 + const EDESTADDRREQ: number;
19 + const EDOM: number;
20 + const EEXIST: number;
21 + const EFAULT: number;
22 + const EFBIG: number;
23 + const EHOSTUNREACH: number;
24 + const EIDRM: number;
25 + const EILSEQ: number;
26 + const EINPROGRESS: number;
27 + const EINTR: number;
28 + const EINVAL: number;
29 + const EIO: number;
30 + const EISCONN: number;
31 + const EISDIR: number;
32 + const ELOOP: number;
33 + const EMFILE: number;
34 + const EMLINK: number;
35 + const EMSGSIZE: number;
36 + const ENAMETOOLONG: number;
37 + const ENETDOWN: number;
38 + const ENETRESET: number;
39 + const ENETUNREACH: number;
40 + const ENFILE: number;
41 + const ENOBUFS: number;
42 + const ENODATA: number;
43 + const ENODEV: number;
44 + const ENOENT: number;
45 + const ENOEXEC: number;
46 + const ENOLCK: number;
47 + const ENOLINK: number;
48 + const ENOMEM: number;
49 + const ENOMSG: number;
50 + const ENOPROTOOPT: number;
51 + const ENOSPC: number;
52 + const ENOSR: number;
53 + const ENOSTR: number;
54 + const ENOSYS: number;
55 + const ENOTCONN: number;
56 + const ENOTDIR: number;
57 + const ENOTEMPTY: number;
58 + const ENOTSOCK: number;
59 + const ENOTSUP: number;
60 + const ENOTTY: number;
61 + const ENXIO: number;
62 + const EOPNOTSUPP: number;
63 + const EOVERFLOW: number;
64 + const EPERM: number;
65 + const EPIPE: number;
66 + const EPROTO: number;
67 + const EPROTONOSUPPORT: number;
68 + const EPROTOTYPE: number;
69 + const ERANGE: number;
70 + const EROFS: number;
71 + const ESPIPE: number;
72 + const ESRCH: number;
73 + const ETIME: number;
74 + const ETIMEDOUT: number;
75 + const ETXTBSY: number;
76 + const EWOULDBLOCK: number;
77 + const EXDEV: number;
78 + const WSAEINTR: number;
79 + const WSAEBADF: number;
80 + const WSAEACCES: number;
81 + const WSAEFAULT: number;
82 + const WSAEINVAL: number;
83 + const WSAEMFILE: number;
84 + const WSAEWOULDBLOCK: number;
85 + const WSAEINPROGRESS: number;
86 + const WSAEALREADY: number;
87 + const WSAENOTSOCK: number;
88 + const WSAEDESTADDRREQ: number;
89 + const WSAEMSGSIZE: number;
90 + const WSAEPROTOTYPE: number;
91 + const WSAENOPROTOOPT: number;
92 + const WSAEPROTONOSUPPORT: number;
93 + const WSAESOCKTNOSUPPORT: number;
94 + const WSAEOPNOTSUPP: number;
95 + const WSAEPFNOSUPPORT: number;
96 + const WSAEAFNOSUPPORT: number;
97 + const WSAEADDRINUSE: number;
98 + const WSAEADDRNOTAVAIL: number;
99 + const WSAENETDOWN: number;
100 + const WSAENETUNREACH: number;
101 + const WSAENETRESET: number;
102 + const WSAECONNABORTED: number;
103 + const WSAECONNRESET: number;
104 + const WSAENOBUFS: number;
105 + const WSAEISCONN: number;
106 + const WSAENOTCONN: number;
107 + const WSAESHUTDOWN: number;
108 + const WSAETOOMANYREFS: number;
109 + const WSAETIMEDOUT: number;
110 + const WSAECONNREFUSED: number;
111 + const WSAELOOP: number;
112 + const WSAENAMETOOLONG: number;
113 + const WSAEHOSTDOWN: number;
114 + const WSAEHOSTUNREACH: number;
115 + const WSAENOTEMPTY: number;
116 + const WSAEPROCLIM: number;
117 + const WSAEUSERS: number;
118 + const WSAEDQUOT: number;
119 + const WSAESTALE: number;
120 + const WSAEREMOTE: number;
121 + const WSASYSNOTREADY: number;
122 + const WSAVERNOTSUPPORTED: number;
123 + const WSANOTINITIALISED: number;
124 + const WSAEDISCON: number;
125 + const WSAENOMORE: number;
126 + const WSAECANCELLED: number;
127 + const WSAEINVALIDPROCTABLE: number;
128 + const WSAEINVALIDPROVIDER: number;
129 + const WSAEPROVIDERFAILEDINIT: number;
130 + const WSASYSCALLFAILURE: number;
131 + const WSASERVICE_NOT_FOUND: number;
132 + const WSATYPE_NOT_FOUND: number;
133 + const WSA_E_NO_MORE: number;
134 + const WSA_E_CANCELLED: number;
135 + const WSAEREFUSED: number;
136 + const SIGHUP: number;
137 + const SIGINT: number;
138 + const SIGILL: number;
139 + const SIGABRT: number;
140 + const SIGFPE: number;
141 + const SIGKILL: number;
142 + const SIGSEGV: number;
143 + const SIGTERM: number;
144 + const SIGBREAK: number;
145 + const SIGWINCH: number;
146 + const SSL_OP_ALL: number;
147 + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
148 + const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
149 + const SSL_OP_CISCO_ANYCONNECT: number;
150 + const SSL_OP_COOKIE_EXCHANGE: number;
151 + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
152 + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
153 + const SSL_OP_EPHEMERAL_RSA: number;
154 + const SSL_OP_LEGACY_SERVER_CONNECT: number;
155 + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
156 + const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
157 + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
158 + const SSL_OP_NETSCAPE_CA_DN_BUG: number;
159 + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
160 + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
161 + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
162 + const SSL_OP_NO_COMPRESSION: number;
163 + const SSL_OP_NO_QUERY_MTU: number;
164 + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
165 + const SSL_OP_NO_SSLv2: number;
166 + const SSL_OP_NO_SSLv3: number;
167 + const SSL_OP_NO_TICKET: number;
168 + const SSL_OP_NO_TLSv1: number;
169 + const SSL_OP_NO_TLSv1_1: number;
170 + const SSL_OP_NO_TLSv1_2: number;
171 + const SSL_OP_PKCS1_CHECK_1: number;
172 + const SSL_OP_PKCS1_CHECK_2: number;
173 + const SSL_OP_SINGLE_DH_USE: number;
174 + const SSL_OP_SINGLE_ECDH_USE: number;
175 + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
176 + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
177 + const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
178 + const SSL_OP_TLS_D5_BUG: number;
179 + const SSL_OP_TLS_ROLLBACK_BUG: number;
180 + const ENGINE_METHOD_DSA: number;
181 + const ENGINE_METHOD_DH: number;
182 + const ENGINE_METHOD_RAND: number;
183 + const ENGINE_METHOD_ECDH: number;
184 + const ENGINE_METHOD_ECDSA: number;
185 + const ENGINE_METHOD_CIPHERS: number;
186 + const ENGINE_METHOD_DIGESTS: number;
187 + const ENGINE_METHOD_STORE: number;
188 + const ENGINE_METHOD_PKEY_METHS: number;
189 + const ENGINE_METHOD_PKEY_ASN1_METHS: number;
190 + const ENGINE_METHOD_ALL: number;
191 + const ENGINE_METHOD_NONE: number;
192 + const DH_CHECK_P_NOT_SAFE_PRIME: number;
193 + const DH_CHECK_P_NOT_PRIME: number;
194 + const DH_UNABLE_TO_CHECK_GENERATOR: number;
195 + const DH_NOT_SUITABLE_GENERATOR: number;
196 + const NPN_ENABLED: number;
197 + const RSA_PKCS1_PADDING: number;
198 + const RSA_SSLV23_PADDING: number;
199 + const RSA_NO_PADDING: number;
200 + const RSA_PKCS1_OAEP_PADDING: number;
201 + const RSA_X931_PADDING: number;
202 + const RSA_PKCS1_PSS_PADDING: number;
203 + const POINT_CONVERSION_COMPRESSED: number;
204 + const POINT_CONVERSION_UNCOMPRESSED: number;
205 + const POINT_CONVERSION_HYBRID: number;
206 + const O_RDONLY: number;
207 + const O_WRONLY: number;
208 + const O_RDWR: number;
209 + const S_IFMT: number;
210 + const S_IFREG: number;
211 + const S_IFDIR: number;
212 + const S_IFCHR: number;
213 + const S_IFBLK: number;
214 + const S_IFIFO: number;
215 + const S_IFSOCK: number;
216 + const S_IRWXU: number;
217 + const S_IRUSR: number;
218 + const S_IWUSR: number;
219 + const S_IXUSR: number;
220 + const S_IRWXG: number;
221 + const S_IRGRP: number;
222 + const S_IWGRP: number;
223 + const S_IXGRP: number;
224 + const S_IRWXO: number;
225 + const S_IROTH: number;
226 + const S_IWOTH: number;
227 + const S_IXOTH: number;
228 + const S_IFLNK: number;
229 + const O_CREAT: number;
230 + const O_EXCL: number;
231 + const O_NOCTTY: number;
232 + const O_DIRECTORY: number;
233 + const O_NOATIME: number;
234 + const O_NOFOLLOW: number;
235 + const O_SYNC: number;
236 + const O_DSYNC: number;
237 + const O_SYMLINK: number;
238 + const O_DIRECT: number;
239 + const O_NONBLOCK: number;
240 + const O_TRUNC: number;
241 + const O_APPEND: number;
242 + const F_OK: number;
243 + const R_OK: number;
244 + const W_OK: number;
245 + const X_OK: number;
246 + const COPYFILE_EXCL: number;
247 + const COPYFILE_FICLONE: number;
248 + const COPYFILE_FICLONE_FORCE: number;
249 + const UV_UDP_REUSEADDR: number;
250 + const SIGQUIT: number;
251 + const SIGTRAP: number;
252 + const SIGIOT: number;
253 + const SIGBUS: number;
254 + const SIGUSR1: number;
255 + const SIGUSR2: number;
256 + const SIGPIPE: number;
257 + const SIGALRM: number;
258 + const SIGCHLD: number;
259 + const SIGSTKFLT: number;
260 + const SIGCONT: number;
261 + const SIGSTOP: number;
262 + const SIGTSTP: number;
263 + const SIGTTIN: number;
264 + const SIGTTOU: number;
265 + const SIGURG: number;
266 + const SIGXCPU: number;
267 + const SIGXFSZ: number;
268 + const SIGVTALRM: number;
269 + const SIGPROF: number;
270 + const SIGIO: number;
271 + const SIGPOLL: number;
272 + const SIGPWR: number;
273 + const SIGSYS: number;
274 + const SIGUNUSED: number;
275 + const defaultCoreCipherList: string;
276 + const defaultCipherList: string;
277 + const ENGINE_METHOD_RSA: number;
278 + const ALPN_ENABLED: number;
279 +}
This diff is collapsed. Click to expand it.
1 +declare module "dgram" {
2 + import { AddressInfo } from "net";
3 + import * as dns from "dns";
4 + import * as events from "events";
5 +
6 + interface RemoteInfo {
7 + address: string;
8 + family: 'IPv4' | 'IPv6';
9 + port: number;
10 + size: number;
11 + }
12 +
13 + interface BindOptions {
14 + port: number;
15 + address?: string;
16 + exclusive?: boolean;
17 + }
18 +
19 + type SocketType = "udp4" | "udp6";
20 +
21 + interface SocketOptions {
22 + type: SocketType;
23 + reuseAddr?: boolean;
24 + /**
25 + * @default false
26 + */
27 + ipv6Only?: boolean;
28 + recvBufferSize?: number;
29 + sendBufferSize?: number;
30 + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void;
31 + }
32 +
33 + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
34 + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35 +
36 + class Socket extends events.EventEmitter {
37 + send(msg: Buffer | string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
38 + send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
39 + bind(port?: number, address?: string, callback?: () => void): void;
40 + bind(port?: number, callback?: () => void): void;
41 + bind(callback?: () => void): void;
42 + bind(options: BindOptions, callback?: () => void): void;
43 + close(callback?: () => void): void;
44 + address(): AddressInfo | string;
45 + setBroadcast(flag: boolean): void;
46 + setTTL(ttl: number): void;
47 + setMulticastTTL(ttl: number): void;
48 + setMulticastInterface(multicastInterface: string): void;
49 + setMulticastLoopback(flag: boolean): void;
50 + addMembership(multicastAddress: string, multicastInterface?: string): void;
51 + dropMembership(multicastAddress: string, multicastInterface?: string): void;
52 + ref(): this;
53 + unref(): this;
54 + setRecvBufferSize(size: number): void;
55 + setSendBufferSize(size: number): void;
56 + getRecvBufferSize(): number;
57 + getSendBufferSize(): number;
58 +
59 + /**
60 + * events.EventEmitter
61 + * 1. close
62 + * 2. error
63 + * 3. listening
64 + * 4. message
65 + */
66 + addListener(event: string, listener: (...args: any[]) => void): this;
67 + addListener(event: "close", listener: () => void): this;
68 + addListener(event: "error", listener: (err: Error) => void): this;
69 + addListener(event: "listening", listener: () => void): this;
70 + addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
71 +
72 + emit(event: string | symbol, ...args: any[]): boolean;
73 + emit(event: "close"): boolean;
74 + emit(event: "error", err: Error): boolean;
75 + emit(event: "listening"): boolean;
76 + emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
77 +
78 + on(event: string, listener: (...args: any[]) => void): this;
79 + on(event: "close", listener: () => void): this;
80 + on(event: "error", listener: (err: Error) => void): this;
81 + on(event: "listening", listener: () => void): this;
82 + on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
83 +
84 + once(event: string, listener: (...args: any[]) => void): this;
85 + once(event: "close", listener: () => void): this;
86 + once(event: "error", listener: (err: Error) => void): this;
87 + once(event: "listening", listener: () => void): this;
88 + once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
89 +
90 + prependListener(event: string, listener: (...args: any[]) => void): this;
91 + prependListener(event: "close", listener: () => void): this;
92 + prependListener(event: "error", listener: (err: Error) => void): this;
93 + prependListener(event: "listening", listener: () => void): this;
94 + prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
95 +
96 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
97 + prependOnceListener(event: "close", listener: () => void): this;
98 + prependOnceListener(event: "error", listener: (err: Error) => void): this;
99 + prependOnceListener(event: "listening", listener: () => void): this;
100 + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
101 + }
102 +}
This diff is collapsed. Click to expand it.
1 +declare module "domain" {
2 + import * as events from "events";
3 +
4 + class Domain extends events.EventEmitter implements NodeJS.Domain {
5 + run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
6 + add(emitter: events.EventEmitter | NodeJS.Timer): void;
7 + remove(emitter: events.EventEmitter | NodeJS.Timer): void;
8 + bind<T extends Function>(cb: T): T;
9 + intercept<T extends Function>(cb: T): T;
10 + members: Array<events.EventEmitter | NodeJS.Timer>;
11 + enter(): void;
12 + exit(): void;
13 + }
14 +
15 + function create(): Domain;
16 +}
1 +declare module "events" {
2 + class internal extends NodeJS.EventEmitter { }
3 +
4 + namespace internal {
5 + class EventEmitter extends internal {
6 + /** @deprecated since v4.0.0 */
7 + static listenerCount(emitter: EventEmitter, event: string | symbol): number;
8 + static defaultMaxListeners: number;
9 +
10 + addListener(event: string | symbol, listener: (...args: any[]) => void): this;
11 + on(event: string | symbol, listener: (...args: any[]) => void): this;
12 + once(event: string | symbol, listener: (...args: any[]) => void): this;
13 + prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
14 + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
15 + removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
16 + off(event: string | symbol, listener: (...args: any[]) => void): this;
17 + removeAllListeners(event?: string | symbol): this;
18 + setMaxListeners(n: number): this;
19 + getMaxListeners(): number;
20 + listeners(event: string | symbol): Function[];
21 + rawListeners(event: string | symbol): Function[];
22 + emit(event: string | symbol, ...args: any[]): boolean;
23 + eventNames(): Array<string | symbol>;
24 + listenerCount(type: string | symbol): number;
25 + }
26 + }
27 +
28 + export = internal;
29 +}
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +declare module "http" {
2 + import * as events from "events";
3 + import * as stream from "stream";
4 + import { URL } from "url";
5 + import { Socket, Server as NetServer } from "net";
6 +
7 + // incoming headers will never contain number
8 + interface IncomingHttpHeaders {
9 + 'accept'?: string;
10 + 'accept-patch'?: string;
11 + 'accept-ranges'?: string;
12 + 'access-control-allow-credentials'?: string;
13 + 'access-control-allow-headers'?: string;
14 + 'access-control-allow-methods'?: string;
15 + 'access-control-allow-origin'?: string;
16 + 'access-control-expose-headers'?: string;
17 + 'access-control-max-age'?: string;
18 + 'age'?: string;
19 + 'allow'?: string;
20 + 'alt-svc'?: string;
21 + 'authorization'?: string;
22 + 'cache-control'?: string;
23 + 'connection'?: string;
24 + 'content-disposition'?: string;
25 + 'content-encoding'?: string;
26 + 'content-language'?: string;
27 + 'content-length'?: string;
28 + 'content-location'?: string;
29 + 'content-range'?: string;
30 + 'content-type'?: string;
31 + 'cookie'?: string;
32 + 'date'?: string;
33 + 'expect'?: string;
34 + 'expires'?: string;
35 + 'forwarded'?: string;
36 + 'from'?: string;
37 + 'host'?: string;
38 + 'if-match'?: string;
39 + 'if-modified-since'?: string;
40 + 'if-none-match'?: string;
41 + 'if-unmodified-since'?: string;
42 + 'last-modified'?: string;
43 + 'location'?: string;
44 + 'pragma'?: string;
45 + 'proxy-authenticate'?: string;
46 + 'proxy-authorization'?: string;
47 + 'public-key-pins'?: string;
48 + 'range'?: string;
49 + 'referer'?: string;
50 + 'retry-after'?: string;
51 + 'set-cookie'?: string[];
52 + 'strict-transport-security'?: string;
53 + 'tk'?: string;
54 + 'trailer'?: string;
55 + 'transfer-encoding'?: string;
56 + 'upgrade'?: string;
57 + 'user-agent'?: string;
58 + 'vary'?: string;
59 + 'via'?: string;
60 + 'warning'?: string;
61 + 'www-authenticate'?: string;
62 + [header: string]: string | string[] | undefined;
63 + }
64 +
65 + // outgoing headers allows numbers (as they are converted internally to strings)
66 + interface OutgoingHttpHeaders {
67 + [header: string]: number | string | string[] | undefined;
68 + }
69 +
70 + interface ClientRequestArgs {
71 + protocol?: string;
72 + host?: string;
73 + hostname?: string;
74 + family?: number;
75 + port?: number | string;
76 + defaultPort?: number | string;
77 + localAddress?: string;
78 + socketPath?: string;
79 + method?: string;
80 + path?: string;
81 + headers?: OutgoingHttpHeaders;
82 + auth?: string;
83 + agent?: Agent | boolean;
84 + _defaultAgent?: Agent;
85 + timeout?: number;
86 + setHost?: boolean;
87 + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
88 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
89 + }
90 +
91 + interface ServerOptions {
92 + IncomingMessage?: typeof IncomingMessage;
93 + ServerResponse?: typeof ServerResponse;
94 + }
95 +
96 + type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
97 +
98 + class Server extends NetServer {
99 + constructor(requestListener?: RequestListener);
100 + constructor(options: ServerOptions, requestListener?: RequestListener);
101 +
102 + setTimeout(msecs?: number, callback?: () => void): this;
103 + setTimeout(callback: () => void): this;
104 + /**
105 + * Limits maximum incoming headers count. If set to 0, no limit will be applied.
106 + * @default 2000
107 + * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
108 + */
109 + maxHeadersCount: number | null;
110 + timeout: number;
111 + /**
112 + * Limit the amount of time the parser will wait to receive the complete HTTP headers.
113 + * @default 40000
114 + * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
115 + */
116 + headersTimeout: number;
117 + keepAliveTimeout: number;
118 + }
119 +
120 + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
121 + class OutgoingMessage extends stream.Writable {
122 + upgrading: boolean;
123 + chunkedEncoding: boolean;
124 + shouldKeepAlive: boolean;
125 + useChunkedEncodingByDefault: boolean;
126 + sendDate: boolean;
127 + finished: boolean;
128 + headersSent: boolean;
129 + connection: Socket;
130 +
131 + constructor();
132 +
133 + setTimeout(msecs: number, callback?: () => void): this;
134 + setHeader(name: string, value: number | string | string[]): void;
135 + getHeader(name: string): number | string | string[] | undefined;
136 + getHeaders(): OutgoingHttpHeaders;
137 + getHeaderNames(): string[];
138 + hasHeader(name: string): boolean;
139 + removeHeader(name: string): void;
140 + addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
141 + flushHeaders(): void;
142 + }
143 +
144 + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256
145 + class ServerResponse extends OutgoingMessage {
146 + statusCode: number;
147 + statusMessage: string;
148 +
149 + constructor(req: IncomingMessage);
150 +
151 + assignSocket(socket: Socket): void;
152 + detachSocket(socket: Socket): void;
153 + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
154 + // no args in writeContinue callback
155 + writeContinue(callback?: () => void): void;
156 + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
157 + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
158 + }
159 +
160 + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
161 + class ClientRequest extends OutgoingMessage {
162 + connection: Socket;
163 + socket: Socket;
164 + aborted: number;
165 +
166 + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
167 +
168 + readonly path: string;
169 + abort(): void;
170 + onSocket(socket: Socket): void;
171 + setTimeout(timeout: number, callback?: () => void): this;
172 + setNoDelay(noDelay?: boolean): void;
173 + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
174 + }
175 +
176 + class IncomingMessage extends stream.Readable {
177 + constructor(socket: Socket);
178 +
179 + httpVersion: string;
180 + httpVersionMajor: number;
181 + httpVersionMinor: number;
182 + connection: Socket;
183 + headers: IncomingHttpHeaders;
184 + rawHeaders: string[];
185 + trailers: { [key: string]: string | undefined };
186 + rawTrailers: string[];
187 + setTimeout(msecs: number, callback: () => void): this;
188 + /**
189 + * Only valid for request obtained from http.Server.
190 + */
191 + method?: string;
192 + /**
193 + * Only valid for request obtained from http.Server.
194 + */
195 + url?: string;
196 + /**
197 + * Only valid for response obtained from http.ClientRequest.
198 + */
199 + statusCode?: number;
200 + /**
201 + * Only valid for response obtained from http.ClientRequest.
202 + */
203 + statusMessage?: string;
204 + socket: Socket;
205 + destroy(error?: Error): void;
206 + }
207 +
208 + interface AgentOptions {
209 + /**
210 + * Keep sockets around in a pool to be used by other requests in the future. Default = false
211 + */
212 + keepAlive?: boolean;
213 + /**
214 + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
215 + * Only relevant if keepAlive is set to true.
216 + */
217 + keepAliveMsecs?: number;
218 + /**
219 + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
220 + */
221 + maxSockets?: number;
222 + /**
223 + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
224 + */
225 + maxFreeSockets?: number;
226 + /**
227 + * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
228 + */
229 + timeout?: number;
230 + }
231 +
232 + class Agent {
233 + maxFreeSockets: number;
234 + maxSockets: number;
235 + readonly sockets: {
236 + readonly [key: string]: Socket[];
237 + };
238 + readonly requests: {
239 + readonly [key: string]: IncomingMessage[];
240 + };
241 +
242 + constructor(opts?: AgentOptions);
243 +
244 + /**
245 + * Destroy any sockets that are currently in use by the agent.
246 + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
247 + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
248 + * sockets may hang open for quite a long time before the server terminates them.
249 + */
250 + destroy(): void;
251 + }
252 +
253 + const METHODS: string[];
254 +
255 + const STATUS_CODES: {
256 + [errorCode: number]: string | undefined;
257 + [errorCode: string]: string | undefined;
258 + };
259 +
260 + function createServer(requestListener?: RequestListener): Server;
261 + function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
262 +
263 + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
264 + // create interface RequestOptions would make the naming more clear to developers
265 + interface RequestOptions extends ClientRequestArgs { }
266 + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
267 + function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
268 + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
269 + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
270 + let globalAgent: Agent;
271 +
272 + /**
273 + * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
274 + * Defaults to 8KB. Configurable using the [`--max-http-header-size`][] CLI option.
275 + */
276 + const maxHeaderSize: number;
277 +}
This diff is collapsed. Click to expand it.
1 +declare module "https" {
2 + import * as tls from "tls";
3 + import * as events from "events";
4 + import * as http from "http";
5 + import { URL } from "url";
6 +
7 + type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
8 +
9 + type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
10 + rejectUnauthorized?: boolean; // Defaults to true
11 + servername?: string; // SNI TLS Extension
12 + };
13 +
14 + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
15 + rejectUnauthorized?: boolean;
16 + maxCachedSessions?: number;
17 + }
18 +
19 + class Agent extends http.Agent {
20 + constructor(options?: AgentOptions);
21 + options: AgentOptions;
22 + }
23 +
24 + class Server extends tls.Server {
25 + constructor(options: ServerOptions, requestListener?: http.RequestListener);
26 +
27 + setTimeout(callback: () => void): this;
28 + setTimeout(msecs?: number, callback?: () => void): this;
29 + /**
30 + * Limits maximum incoming headers count. If set to 0, no limit will be applied.
31 + * @default 2000
32 + * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
33 + */
34 + maxHeadersCount: number | null;
35 + timeout: number;
36 + /**
37 + * Limit the amount of time the parser will wait to receive the complete HTTP headers.
38 + * @default 40000
39 + * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
40 + */
41 + headersTimeout: number;
42 + keepAliveTimeout: number;
43 + }
44 +
45 + function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
46 + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
47 + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
48 + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
49 + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
50 + let globalAgent: Agent;
51 +}
1 +// Type definitions for non-npm package Node.js 11.12
2 +// Project: http://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 +// Alexander T. <https://github.com/a-tarasyuk>
7 +// Alvis HT Tang <https://github.com/alvis>
8 +// Andrew Makarov <https://github.com/r3nya>
9 +// Benjamin Toueg <https://github.com/btoueg>
10 +// Bruno Scheufler <https://github.com/brunoscheufler>
11 +// Chigozirim C. <https://github.com/smac89>
12 +// Christian Vaagland Tellnes <https://github.com/tellnes>
13 +// David Junger <https://github.com/touffy>
14 +// Deividas Bakanas <https://github.com/DeividasBakanas>
15 +// Eugene Y. Q. Shen <https://github.com/eyqs>
16 +// Flarna <https://github.com/Flarna>
17 +// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
18 +// Hoàng Văn Khải <https://github.com/KSXGitHub>
19 +// Huw <https://github.com/hoo29>
20 +// Kelvin Jin <https://github.com/kjin>
21 +// Klaus Meinhardt <https://github.com/ajafff>
22 +// Lishude <https://github.com/islishude>
23 +// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
24 +// Matthieu Sieben <https://github.com/matthieusieben>
25 +// Mohsen Azimi <https://github.com/mohsen1>
26 +// Nicolas Even <https://github.com/n-e>
27 +// Nicolas Voigt <https://github.com/octo-sniffle>
28 +// Parambir Singh <https://github.com/parambirs>
29 +// Sebastian Silbermann <https://github.com/eps1lon>
30 +// Simon Schick <https://github.com/SimonSchick>
31 +// Thomas den Hollander <https://github.com/ThomasdenH>
32 +// Wilco Bakker <https://github.com/WilcoBakker>
33 +// wwwy3y3 <https://github.com/wwwy3y3>
34 +// Zane Hannan AU <https://github.com/ZaneHannanAU>
35 +// Jeremie Rodriguez <https://github.com/jeremiergz>
36 +// Samuel Ainsworth <https://github.com/samuela>
37 +// Kyle Uehlein <https://github.com/kuehlein>
38 +// Jordi Oliveras Rovira <https://github.com/j-oliveras>
39 +// Thanik Bhongbhibhat <https://github.com/bhongy>
40 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
41 +
42 +// NOTE: These definitions support NodeJS and TypeScript 3.2.
43 +
44 +// NOTE: TypeScript version-specific augmentations can be found in the following paths:
45 +// - ~/base.d.ts - Shared definitions common to all TypeScript versions
46 +// - ~/index.d.ts - Definitions specific to TypeScript 2.1
47 +// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
48 +
49 +// NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides
50 +// within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions
51 +// prior to TypeScript 3.2, so the older definitions will be found here.
52 +
53 +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
54 +/// <reference path="base.d.ts" />
55 +
56 +// TypeScript 2.1-specific augmentations:
57 +
58 +// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
59 +// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
60 +// just to ensure the names are known and node typings can be sued without importing these libs.
61 +// if someone really needs these types the libs need to be added via --lib or in tsconfig.json
62 +interface MapConstructor { }
63 +interface WeakMapConstructor { }
64 +interface SetConstructor { }
65 +interface WeakSetConstructor { }
66 +interface Set<T> {}
67 +interface Map<K, V> {}
68 +interface ReadonlySet<T> {}
69 +interface IteratorResult<T> { }
70 +interface Iterable<T> { }
71 +interface Iterator<T> {
72 + next(value?: any): IteratorResult<T>;
73 +}
74 +interface IterableIterator<T> { }
75 +interface AsyncIterableIterator<T> {}
76 +interface SymbolConstructor {
77 + readonly iterator: symbol;
78 + readonly asyncIterator: symbol;
79 +}
80 +declare var Symbol: SymbolConstructor;
81 +// even this is just a forward declaration some properties are added otherwise
82 +// it would be allowed to pass anything to e.g. Buffer.from()
83 +interface SharedArrayBuffer {
84 + readonly byteLength: number;
85 + slice(begin?: number, end?: number): SharedArrayBuffer;
86 +}
87 +
88 +declare module "util" {
89 + namespace inspect {
90 + const custom: symbol;
91 + }
92 + namespace promisify {
93 + const custom: symbol;
94 + }
95 + namespace types {
96 + function isBigInt64Array(value: any): boolean;
97 + function isBigUint64Array(value: any): boolean;
98 + }
99 +}
This diff could not be displayed because it is too large.
1 +declare module "module" {
2 + export = NodeJS.Module;
3 +}
This diff is collapsed. Click to expand it.
1 +declare module "os" {
2 + interface CpuInfo {
3 + model: string;
4 + speed: number;
5 + times: {
6 + user: number;
7 + nice: number;
8 + sys: number;
9 + idle: number;
10 + irq: number;
11 + };
12 + }
13 +
14 + interface NetworkInterfaceBase {
15 + address: string;
16 + netmask: string;
17 + mac: string;
18 + internal: boolean;
19 + cidr: string | null;
20 + }
21 +
22 + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
23 + family: "IPv4";
24 + }
25 +
26 + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
27 + family: "IPv6";
28 + scopeid: number;
29 + }
30 +
31 + interface UserInfo<T> {
32 + username: T;
33 + uid: number;
34 + gid: number;
35 + shell: T;
36 + homedir: T;
37 + }
38 +
39 + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
40 +
41 + function hostname(): string;
42 + function loadavg(): number[];
43 + function uptime(): number;
44 + function freemem(): number;
45 + function totalmem(): number;
46 + function cpus(): CpuInfo[];
47 + function type(): string;
48 + function release(): string;
49 + function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
50 + function homedir(): string;
51 + function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52 + function userInfo(options?: { encoding: string }): UserInfo<string>;
53 + const constants: {
54 + UV_UDP_REUSEADDR: number;
55 + signals: {
56 + SIGHUP: number;
57 + SIGINT: number;
58 + SIGQUIT: number;
59 + SIGILL: number;
60 + SIGTRAP: number;
61 + SIGABRT: number;
62 + SIGIOT: number;
63 + SIGBUS: number;
64 + SIGFPE: number;
65 + SIGKILL: number;
66 + SIGUSR1: number;
67 + SIGSEGV: number;
68 + SIGUSR2: number;
69 + SIGPIPE: number;
70 + SIGALRM: number;
71 + SIGTERM: number;
72 + SIGCHLD: number;
73 + SIGSTKFLT: number;
74 + SIGCONT: number;
75 + SIGSTOP: number;
76 + SIGTSTP: number;
77 + SIGTTIN: number;
78 + SIGTTOU: number;
79 + SIGURG: number;
80 + SIGXCPU: number;
81 + SIGXFSZ: number;
82 + SIGVTALRM: number;
83 + SIGPROF: number;
84 + SIGWINCH: number;
85 + SIGIO: number;
86 + SIGPOLL: number;
87 + SIGPWR: number;
88 + SIGSYS: number;
89 + SIGUNUSED: number;
90 + };
91 + errno: {
92 + E2BIG: number;
93 + EACCES: number;
94 + EADDRINUSE: number;
95 + EADDRNOTAVAIL: number;
96 + EAFNOSUPPORT: number;
97 + EAGAIN: number;
98 + EALREADY: number;
99 + EBADF: number;
100 + EBADMSG: number;
101 + EBUSY: number;
102 + ECANCELED: number;
103 + ECHILD: number;
104 + ECONNABORTED: number;
105 + ECONNREFUSED: number;
106 + ECONNRESET: number;
107 + EDEADLK: number;
108 + EDESTADDRREQ: number;
109 + EDOM: number;
110 + EDQUOT: number;
111 + EEXIST: number;
112 + EFAULT: number;
113 + EFBIG: number;
114 + EHOSTUNREACH: number;
115 + EIDRM: number;
116 + EILSEQ: number;
117 + EINPROGRESS: number;
118 + EINTR: number;
119 + EINVAL: number;
120 + EIO: number;
121 + EISCONN: number;
122 + EISDIR: number;
123 + ELOOP: number;
124 + EMFILE: number;
125 + EMLINK: number;
126 + EMSGSIZE: number;
127 + EMULTIHOP: number;
128 + ENAMETOOLONG: number;
129 + ENETDOWN: number;
130 + ENETRESET: number;
131 + ENETUNREACH: number;
132 + ENFILE: number;
133 + ENOBUFS: number;
134 + ENODATA: number;
135 + ENODEV: number;
136 + ENOENT: number;
137 + ENOEXEC: number;
138 + ENOLCK: number;
139 + ENOLINK: number;
140 + ENOMEM: number;
141 + ENOMSG: number;
142 + ENOPROTOOPT: number;
143 + ENOSPC: number;
144 + ENOSR: number;
145 + ENOSTR: number;
146 + ENOSYS: number;
147 + ENOTCONN: number;
148 + ENOTDIR: number;
149 + ENOTEMPTY: number;
150 + ENOTSOCK: number;
151 + ENOTSUP: number;
152 + ENOTTY: number;
153 + ENXIO: number;
154 + EOPNOTSUPP: number;
155 + EOVERFLOW: number;
156 + EPERM: number;
157 + EPIPE: number;
158 + EPROTO: number;
159 + EPROTONOSUPPORT: number;
160 + EPROTOTYPE: number;
161 + ERANGE: number;
162 + EROFS: number;
163 + ESPIPE: number;
164 + ESRCH: number;
165 + ESTALE: number;
166 + ETIME: number;
167 + ETIMEDOUT: number;
168 + ETXTBSY: number;
169 + EWOULDBLOCK: number;
170 + EXDEV: number;
171 + };
172 + priority: {
173 + PRIORITY_LOW: number;
174 + PRIORITY_BELOW_NORMAL: number;
175 + PRIORITY_NORMAL: number;
176 + PRIORITY_ABOVE_NORMAL: number;
177 + PRIORITY_HIGH: number;
178 + PRIORITY_HIGHEST: number;
179 + }
180 + };
181 + function arch(): string;
182 + function platform(): NodeJS.Platform;
183 + function tmpdir(): string;
184 + const EOL: string;
185 + function endianness(): "BE" | "LE";
186 + /**
187 + * Gets the priority of a process.
188 + * Defaults to current process.
189 + */
190 + function getPriority(pid?: number): number;
191 + /**
192 + * Sets the priority of the current process.
193 + * @param priority Must be in range of -20 to 19
194 + */
195 + function setPriority(priority: number): void;
196 + /**
197 + * Sets the priority of the process specified process.
198 + * @param priority Must be in range of -20 to 19
199 + */
200 + function setPriority(pid: number, priority: number): void;
201 +}
1 +{
2 + "_args": [
3 + [
4 + "@types/node@11.12.0",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "@types/node@11.12.0",
9 + "_id": "@types/node@11.12.0",
10 + "_inBundle": false,
11 + "_integrity": "sha512-Lg00egj78gM+4aE0Erw05cuDbvX9sLJbaaPwwRtdCdAMnIudqrQZ0oZX98Ek0yiSK/A2nubHgJfvII/rTT2Dwg==",
12 + "_location": "/@types/node",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "@types/node@11.12.0",
18 + "name": "@types/node",
19 + "escapedName": "@types%2fnode",
20 + "scope": "@types",
21 + "rawSpec": "11.12.0",
22 + "saveSpec": null,
23 + "fetchSpec": "11.12.0"
24 + },
25 + "_requiredBy": [
26 + "/wkx"
27 + ],
28 + "_resolved": "https://registry.npmjs.org/@types/node/-/node-11.12.0.tgz",
29 + "_spec": "11.12.0",
30 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
31 + "bugs": {
32 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
33 + },
34 + "contributors": [
35 + {
36 + "name": "Microsoft TypeScript",
37 + "url": "https://github.com/Microsoft"
38 + },
39 + {
40 + "name": "DefinitelyTyped",
41 + "url": "https://github.com/DefinitelyTyped"
42 + },
43 + {
44 + "name": "Alberto Schiabel",
45 + "url": "https://github.com/jkomyno"
46 + },
47 + {
48 + "name": "Alexander T.",
49 + "url": "https://github.com/a-tarasyuk"
50 + },
51 + {
52 + "name": "Alvis HT Tang",
53 + "url": "https://github.com/alvis"
54 + },
55 + {
56 + "name": "Andrew Makarov",
57 + "url": "https://github.com/r3nya"
58 + },
59 + {
60 + "name": "Benjamin Toueg",
61 + "url": "https://github.com/btoueg"
62 + },
63 + {
64 + "name": "Bruno Scheufler",
65 + "url": "https://github.com/brunoscheufler"
66 + },
67 + {
68 + "name": "Chigozirim C.",
69 + "url": "https://github.com/smac89"
70 + },
71 + {
72 + "name": "Christian Vaagland Tellnes",
73 + "url": "https://github.com/tellnes"
74 + },
75 + {
76 + "name": "David Junger",
77 + "url": "https://github.com/touffy"
78 + },
79 + {
80 + "name": "Deividas Bakanas",
81 + "url": "https://github.com/DeividasBakanas"
82 + },
83 + {
84 + "name": "Eugene Y. Q. Shen",
85 + "url": "https://github.com/eyqs"
86 + },
87 + {
88 + "name": "Flarna",
89 + "url": "https://github.com/Flarna"
90 + },
91 + {
92 + "name": "Hannes Magnusson",
93 + "url": "https://github.com/Hannes-Magnusson-CK"
94 + },
95 + {
96 + "name": "Hoàng Văn Khải",
97 + "url": "https://github.com/KSXGitHub"
98 + },
99 + {
100 + "name": "Huw",
101 + "url": "https://github.com/hoo29"
102 + },
103 + {
104 + "name": "Kelvin Jin",
105 + "url": "https://github.com/kjin"
106 + },
107 + {
108 + "name": "Klaus Meinhardt",
109 + "url": "https://github.com/ajafff"
110 + },
111 + {
112 + "name": "Lishude",
113 + "url": "https://github.com/islishude"
114 + },
115 + {
116 + "name": "Mariusz Wiktorczyk",
117 + "url": "https://github.com/mwiktorczyk"
118 + },
119 + {
120 + "name": "Matthieu Sieben",
121 + "url": "https://github.com/matthieusieben"
122 + },
123 + {
124 + "name": "Mohsen Azimi",
125 + "url": "https://github.com/mohsen1"
126 + },
127 + {
128 + "name": "Nicolas Even",
129 + "url": "https://github.com/n-e"
130 + },
131 + {
132 + "name": "Nicolas Voigt",
133 + "url": "https://github.com/octo-sniffle"
134 + },
135 + {
136 + "name": "Parambir Singh",
137 + "url": "https://github.com/parambirs"
138 + },
139 + {
140 + "name": "Sebastian Silbermann",
141 + "url": "https://github.com/eps1lon"
142 + },
143 + {
144 + "name": "Simon Schick",
145 + "url": "https://github.com/SimonSchick"
146 + },
147 + {
148 + "name": "Thomas den Hollander",
149 + "url": "https://github.com/ThomasdenH"
150 + },
151 + {
152 + "name": "Wilco Bakker",
153 + "url": "https://github.com/WilcoBakker"
154 + },
155 + {
156 + "name": "wwwy3y3",
157 + "url": "https://github.com/wwwy3y3"
158 + },
159 + {
160 + "name": "Zane Hannan AU",
161 + "url": "https://github.com/ZaneHannanAU"
162 + },
163 + {
164 + "name": "Jeremie Rodriguez",
165 + "url": "https://github.com/jeremiergz"
166 + },
167 + {
168 + "name": "Samuel Ainsworth",
169 + "url": "https://github.com/samuela"
170 + },
171 + {
172 + "name": "Kyle Uehlein",
173 + "url": "https://github.com/kuehlein"
174 + },
175 + {
176 + "name": "Jordi Oliveras Rovira",
177 + "url": "https://github.com/j-oliveras"
178 + },
179 + {
180 + "name": "Thanik Bhongbhibhat",
181 + "url": "https://github.com/bhongy"
182 + }
183 + ],
184 + "dependencies": {},
185 + "description": "TypeScript definitions for Node.js",
186 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
187 + "license": "MIT",
188 + "main": "",
189 + "name": "@types/node",
190 + "repository": {
191 + "type": "git",
192 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
193 + "directory": "types/node"
194 + },
195 + "scripts": {},
196 + "typeScriptVersion": "2.0",
197 + "types": "index",
198 + "typesPublisherContentHash": "8e6e38ea6d4123e645bb9bae11238d4c35590b3433292b649e2cb9fba834fe0b",
199 + "typesVersions": {
200 + ">=3.2.0-0": {
201 + "*": [
202 + "ts3.2/*"
203 + ]
204 + }
205 + },
206 + "version": "11.12.0"
207 +}
1 +declare module "path" {
2 + /**
3 + * A parsed path object generated by path.parse() or consumed by path.format().
4 + */
5 + interface ParsedPath {
6 + /**
7 + * The root of the path such as '/' or 'c:\'
8 + */
9 + root: string;
10 + /**
11 + * The full directory path such as '/home/user/dir' or 'c:\path\dir'
12 + */
13 + dir: string;
14 + /**
15 + * The file name including extension (if any) such as 'index.html'
16 + */
17 + base: string;
18 + /**
19 + * The file extension (if any) such as '.html'
20 + */
21 + ext: string;
22 + /**
23 + * The file name without extension (if any) such as 'index'
24 + */
25 + name: string;
26 + }
27 + interface FormatInputPathObject {
28 + /**
29 + * The root of the path such as '/' or 'c:\'
30 + */
31 + root?: string;
32 + /**
33 + * The full directory path such as '/home/user/dir' or 'c:\path\dir'
34 + */
35 + dir?: string;
36 + /**
37 + * The file name including extension (if any) such as 'index.html'
38 + */
39 + base?: string;
40 + /**
41 + * The file extension (if any) such as '.html'
42 + */
43 + ext?: string;
44 + /**
45 + * The file name without extension (if any) such as 'index'
46 + */
47 + name?: string;
48 + }
49 +
50 + /**
51 + * Normalize a string path, reducing '..' and '.' parts.
52 + * 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.
53 + *
54 + * @param p string path to normalize.
55 + */
56 + function normalize(p: string): string;
57 + /**
58 + * Join all arguments together and normalize the resulting path.
59 + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
60 + *
61 + * @param paths paths to join.
62 + */
63 + function join(...paths: string[]): string;
64 + /**
65 + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
66 + *
67 + * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
68 + *
69 + * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
70 + * until an absolute path is found. If after using all {from} paths still no absolute path is found,
71 + * the current working directory is used as well. The resulting path is normalized,
72 + * and trailing slashes are removed unless the path gets resolved to the root directory.
73 + *
74 + * @param pathSegments string paths to join. Non-string arguments are ignored.
75 + */
76 + function resolve(...pathSegments: string[]): string;
77 + /**
78 + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
79 + *
80 + * @param path path to test.
81 + */
82 + function isAbsolute(path: string): boolean;
83 + /**
84 + * Solve the relative path from {from} to {to}.
85 + * 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.
86 + */
87 + function relative(from: string, to: string): string;
88 + /**
89 + * Return the directory name of a path. Similar to the Unix dirname command.
90 + *
91 + * @param p the path to evaluate.
92 + */
93 + function dirname(p: string): string;
94 + /**
95 + * Return the last portion of a path. Similar to the Unix basename command.
96 + * Often used to extract the file name from a fully qualified path.
97 + *
98 + * @param p the path to evaluate.
99 + * @param ext optionally, an extension to remove from the result.
100 + */
101 + function basename(p: string, ext?: string): string;
102 + /**
103 + * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
104 + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
105 + *
106 + * @param p the path to evaluate.
107 + */
108 + function extname(p: string): string;
109 + /**
110 + * The platform-specific file separator. '\\' or '/'.
111 + */
112 + const sep: '\\' | '/';
113 + /**
114 + * The platform-specific file delimiter. ';' or ':'.
115 + */
116 + const delimiter: ';' | ':';
117 + /**
118 + * Returns an object from a path string - the opposite of format().
119 + *
120 + * @param pathString path to evaluate.
121 + */
122 + function parse(pathString: string): ParsedPath;
123 + /**
124 + * Returns a path string from an object - the opposite of parse().
125 + *
126 + * @param pathString path to evaluate.
127 + */
128 + function format(pathObject: FormatInputPathObject): string;
129 +
130 + namespace posix {
131 + function normalize(p: string): string;
132 + function join(...paths: string[]): string;
133 + function resolve(...pathSegments: string[]): string;
134 + function isAbsolute(p: string): boolean;
135 + function relative(from: string, to: string): string;
136 + function dirname(p: string): string;
137 + function basename(p: string, ext?: string): string;
138 + function extname(p: string): string;
139 + const sep: string;
140 + const delimiter: string;
141 + function parse(p: string): ParsedPath;
142 + function format(pP: FormatInputPathObject): string;
143 + }
144 +
145 + namespace win32 {
146 + function normalize(p: string): string;
147 + function join(...paths: string[]): string;
148 + function resolve(...pathSegments: string[]): string;
149 + function isAbsolute(p: string): boolean;
150 + function relative(from: string, to: string): string;
151 + function dirname(p: string): string;
152 + function basename(p: string, ext?: string): string;
153 + function extname(p: string): string;
154 + const sep: string;
155 + const delimiter: string;
156 + function parse(p: string): ParsedPath;
157 + function format(pP: FormatInputPathObject): string;
158 + }
159 +}
This diff is collapsed. Click to expand it.
1 +declare module "process" {
2 + export = process;
3 +}
1 +declare module "punycode" {
2 + function decode(string: string): string;
3 + function encode(string: string): string;
4 + function toUnicode(domain: string): string;
5 + function toASCII(domain: string): string;
6 + const ucs2: ucs2;
7 + interface ucs2 {
8 + decode(string: string): number[];
9 + encode(codePoints: number[]): string;
10 + }
11 + const version: string;
12 +}
1 +declare module "querystring" {
2 + interface StringifyOptions {
3 + encodeURIComponent?: (str: string) => string;
4 + }
5 +
6 + interface ParseOptions {
7 + maxKeys?: number;
8 + decodeURIComponent?: (str: string) => string;
9 + }
10 +
11 + interface ParsedUrlQuery { [key: string]: string | string[]; }
12 +
13 + function stringify(obj?: {}, sep?: string, eq?: string, options?: StringifyOptions): string;
14 + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
15 + function escape(str: string): string;
16 + function unescape(str: string): string;
17 +}
1 +declare module "readline" {
2 + import * as events from "events";
3 + import * as stream from "stream";
4 +
5 + interface Key {
6 + sequence?: string;
7 + name?: string;
8 + ctrl?: boolean;
9 + meta?: boolean;
10 + shift?: boolean;
11 + }
12 +
13 + class Interface extends events.EventEmitter {
14 + readonly terminal: boolean;
15 +
16 + /**
17 + * NOTE: According to the documentation:
18 + *
19 + * > Instances of the `readline.Interface` class are constructed using the
20 + * > `readline.createInterface()` method.
21 + *
22 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
23 + */
24 + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
25 + /**
26 + * NOTE: According to the documentation:
27 + *
28 + * > Instances of the `readline.Interface` class are constructed using the
29 + * > `readline.createInterface()` method.
30 + *
31 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
32 + */
33 + protected constructor(options: ReadLineOptions);
34 +
35 + setPrompt(prompt: string): void;
36 + prompt(preserveCursor?: boolean): void;
37 + question(query: string, callback: (answer: string) => void): void;
38 + pause(): this;
39 + resume(): this;
40 + close(): void;
41 + write(data: string | Buffer, key?: Key): void;
42 +
43 + /**
44 + * events.EventEmitter
45 + * 1. close
46 + * 2. line
47 + * 3. pause
48 + * 4. resume
49 + * 5. SIGCONT
50 + * 6. SIGINT
51 + * 7. SIGTSTP
52 + */
53 +
54 + addListener(event: string, listener: (...args: any[]) => void): this;
55 + addListener(event: "close", listener: () => void): this;
56 + addListener(event: "line", listener: (input: string) => void): this;
57 + addListener(event: "pause", listener: () => void): this;
58 + addListener(event: "resume", listener: () => void): this;
59 + addListener(event: "SIGCONT", listener: () => void): this;
60 + addListener(event: "SIGINT", listener: () => void): this;
61 + addListener(event: "SIGTSTP", listener: () => void): this;
62 +
63 + emit(event: string | symbol, ...args: any[]): boolean;
64 + emit(event: "close"): boolean;
65 + emit(event: "line", input: string): boolean;
66 + emit(event: "pause"): boolean;
67 + emit(event: "resume"): boolean;
68 + emit(event: "SIGCONT"): boolean;
69 + emit(event: "SIGINT"): boolean;
70 + emit(event: "SIGTSTP"): boolean;
71 +
72 + on(event: string, listener: (...args: any[]) => void): this;
73 + on(event: "close", listener: () => void): this;
74 + on(event: "line", listener: (input: string) => void): this;
75 + on(event: "pause", listener: () => void): this;
76 + on(event: "resume", listener: () => void): this;
77 + on(event: "SIGCONT", listener: () => void): this;
78 + on(event: "SIGINT", listener: () => void): this;
79 + on(event: "SIGTSTP", listener: () => void): this;
80 +
81 + once(event: string, listener: (...args: any[]) => void): this;
82 + once(event: "close", listener: () => void): this;
83 + once(event: "line", listener: (input: string) => void): this;
84 + once(event: "pause", listener: () => void): this;
85 + once(event: "resume", listener: () => void): this;
86 + once(event: "SIGCONT", listener: () => void): this;
87 + once(event: "SIGINT", listener: () => void): this;
88 + once(event: "SIGTSTP", listener: () => void): this;
89 +
90 + prependListener(event: string, listener: (...args: any[]) => void): this;
91 + prependListener(event: "close", listener: () => void): this;
92 + prependListener(event: "line", listener: (input: string) => void): this;
93 + prependListener(event: "pause", listener: () => void): this;
94 + prependListener(event: "resume", listener: () => void): this;
95 + prependListener(event: "SIGCONT", listener: () => void): this;
96 + prependListener(event: "SIGINT", listener: () => void): this;
97 + prependListener(event: "SIGTSTP", listener: () => void): this;
98 +
99 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
100 + prependOnceListener(event: "close", listener: () => void): this;
101 + prependOnceListener(event: "line", listener: (input: string) => void): this;
102 + prependOnceListener(event: "pause", listener: () => void): this;
103 + prependOnceListener(event: "resume", listener: () => void): this;
104 + prependOnceListener(event: "SIGCONT", listener: () => void): this;
105 + prependOnceListener(event: "SIGINT", listener: () => void): this;
106 + prependOnceListener(event: "SIGTSTP", listener: () => void): this;
107 + [Symbol.asyncIterator](): AsyncIterableIterator<string>;
108 + }
109 +
110 + type ReadLine = Interface; // type forwarded for backwards compatiblity
111 +
112 + type Completer = (line: string) => CompleterResult;
113 + type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
114 +
115 + type CompleterResult = [string[], string];
116 +
117 + interface ReadLineOptions {
118 + input: NodeJS.ReadableStream;
119 + output?: NodeJS.WritableStream;
120 + completer?: Completer | AsyncCompleter;
121 + terminal?: boolean;
122 + historySize?: number;
123 + prompt?: string;
124 + crlfDelay?: number;
125 + removeHistoryDuplicates?: boolean;
126 + }
127 +
128 + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
129 + function createInterface(options: ReadLineOptions): Interface;
130 +
131 + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
132 + function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void;
133 + function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
134 + function clearLine(stream: NodeJS.WritableStream, dir: number): void;
135 + function clearScreenDown(stream: NodeJS.WritableStream): void;
136 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare module "string_decoder" {
2 + interface NodeStringDecoder {
3 + write(buffer: Buffer): string;
4 + end(buffer?: Buffer): string;
5 + }
6 + const StringDecoder: {
7 + new(encoding?: string): NodeStringDecoder;
8 + };
9 +}
1 +declare module "timers" {
2 + function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
3 + namespace setTimeout {
4 + function __promisify__(ms: number): Promise<void>;
5 + function __promisify__<T>(ms: number, value: T): Promise<T>;
6 + }
7 + function clearTimeout(timeoutId: NodeJS.Timeout): void;
8 + function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
9 + function clearInterval(intervalId: NodeJS.Timeout): void;
10 + function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
11 + namespace setImmediate {
12 + function __promisify__(): Promise<void>;
13 + function __promisify__<T>(value: T): Promise<T>;
14 + }
15 + function clearImmediate(immediateId: NodeJS.Immediate): void;
16 +}
This diff is collapsed. Click to expand it.
1 +declare module "trace_events" {
2 + /**
3 + * The `Tracing` object is used to enable or disable tracing for sets of
4 + * categories. Instances are created using the
5 + * `trace_events.createTracing()` method.
6 + *
7 + * When created, the `Tracing` object is disabled. Calling the
8 + * `tracing.enable()` method adds the categories to the set of enabled trace
9 + * event categories. Calling `tracing.disable()` will remove the categories
10 + * from the set of enabled trace event categories.
11 + */
12 + export interface Tracing {
13 + /**
14 + * A comma-separated list of the trace event categories covered by this
15 + * `Tracing` object.
16 + */
17 + readonly categories: string;
18 +
19 + /**
20 + * Disables this `Tracing` object.
21 + *
22 + * Only trace event categories _not_ covered by other enabled `Tracing`
23 + * objects and _not_ specified by the `--trace-event-categories` flag
24 + * will be disabled.
25 + */
26 + disable(): void;
27 +
28 + /**
29 + * Enables this `Tracing` object for the set of categories covered by
30 + * the `Tracing` object.
31 + */
32 + enable(): void;
33 +
34 + /**
35 + * `true` only if the `Tracing` object has been enabled.
36 + */
37 + readonly enabled: boolean;
38 + }
39 +
40 + interface CreateTracingOptions {
41 + /**
42 + * An array of trace category names. Values included in the array are
43 + * coerced to a string when possible. An error will be thrown if the
44 + * value cannot be coerced.
45 + */
46 + categories: string[];
47 + }
48 +
49 + /**
50 + * Creates and returns a Tracing object for the given set of categories.
51 + */
52 + export function createTracing(options: CreateTracingOptions): Tracing;
53 +
54 + /**
55 + * Returns a comma-separated list of all currently-enabled trace event
56 + * categories. The current set of enabled trace event categories is
57 + * determined by the union of all currently-enabled `Tracing` objects and
58 + * any categories enabled using the `--trace-event-categories` flag.
59 + */
60 + export function getEnabledCategories(): string;
61 +}
1 +// tslint:disable-next-line:no-bad-reference
2 +/// <reference path="../globals.d.ts" />
3 +
4 +declare namespace NodeJS {
5 + interface HRTime {
6 + bigint(): bigint;
7 + }
8 +}
1 +// NOTE: These definitions support NodeJS and TypeScript 3.2.
2 +
3 +// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 +// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 +// - ~/index.d.ts - Definitions specific to TypeScript 2.1
6 +// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
7 +
8 +// Reference required types from the default lib:
9 +/// <reference lib="es2018" />
10 +/// <reference lib="esnext.asynciterable" />
11 +/// <reference lib="esnext.intl" />
12 +/// <reference lib="esnext.bigint" />
13 +
14 +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
15 +// tslint:disable-next-line:no-bad-reference
16 +/// <reference path="../base.d.ts" />
17 +
18 +// TypeScript 3.2-specific augmentations:
19 +/// <reference path="util.d.ts" />
20 +/// <reference path="globals.d.ts" />
1 +// tslint:disable-next-line:no-bad-reference
2 +/// <reference path="../util.d.ts" />
3 +
4 +declare module "util" {
5 + namespace inspect {
6 + const custom: unique symbol;
7 + }
8 + namespace promisify {
9 + const custom: unique symbol;
10 + }
11 + namespace types {
12 + function isBigInt64Array(value: any): value is BigInt64Array;
13 + function isBigUint64Array(value: any): value is BigUint64Array;
14 + }
15 +}
1 +declare module "tty" {
2 + import * as net from "net";
3 +
4 + function isatty(fd: number): boolean;
5 + class ReadStream extends net.Socket {
6 + isRaw: boolean;
7 + setRawMode(mode: boolean): void;
8 + isTTY: boolean;
9 + }
10 + /**
11 + * -1 - to the left from cursor
12 + * 0 - the entire line
13 + * 1 - to the right from cursor
14 + */
15 + type Direction = -1 | 0 | 1;
16 + class WriteStream extends net.Socket {
17 + addListener(event: string, listener: (...args: any[]) => void): this;
18 + addListener(event: "resize", listener: () => void): this;
19 +
20 + emit(event: string | symbol, ...args: any[]): boolean;
21 + emit(event: "resize"): boolean;
22 +
23 + on(event: string, listener: (...args: any[]) => void): this;
24 + on(event: "resize", listener: () => void): this;
25 +
26 + once(event: string, listener: (...args: any[]) => void): this;
27 + once(event: "resize", listener: () => void): this;
28 +
29 + prependListener(event: string, listener: (...args: any[]) => void): this;
30 + prependListener(event: "resize", listener: () => void): this;
31 +
32 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
33 + prependOnceListener(event: "resize", listener: () => void): this;
34 +
35 + clearLine(dir: Direction): void;
36 + clearScreenDown(): void;
37 + cursorTo(x: number, y: number): void;
38 + /**
39 + * @default `process.env`
40 + */
41 + getColorDepth(env?: {}): number;
42 + getWindowSize(): [number, number];
43 + columns: number;
44 + rows: number;
45 + isTTY: boolean;
46 + }
47 +}
1 +declare module "url" {
2 + import { ParsedUrlQuery } from 'querystring';
3 +
4 + interface UrlObjectCommon {
5 + auth?: string;
6 + hash?: string;
7 + host?: string;
8 + hostname?: string;
9 + href?: string;
10 + path?: string;
11 + pathname?: string;
12 + protocol?: string;
13 + search?: string;
14 + slashes?: boolean;
15 + }
16 +
17 + // Input to `url.format`
18 + interface UrlObject extends UrlObjectCommon {
19 + port?: string | number;
20 + query?: string | null | { [key: string]: any };
21 + }
22 +
23 + // Output of `url.parse`
24 + interface Url extends UrlObjectCommon {
25 + port?: string;
26 + query?: string | null | ParsedUrlQuery;
27 + }
28 +
29 + interface UrlWithParsedQuery extends Url {
30 + query: ParsedUrlQuery;
31 + }
32 +
33 + interface UrlWithStringQuery extends Url {
34 + query: string | null;
35 + }
36 +
37 + function parse(urlStr: string): UrlWithStringQuery;
38 + function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
39 + function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
40 + function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
41 +
42 + function format(URL: URL, options?: URLFormatOptions): string;
43 + function format(urlObject: UrlObject | string): string;
44 + function resolve(from: string, to: string): string;
45 +
46 + function domainToASCII(domain: string): string;
47 + function domainToUnicode(domain: string): string;
48 +
49 + /**
50 + * This function ensures the correct decodings of percent-encoded characters as
51 + * well as ensuring a cross-platform valid absolute path string.
52 + * @param url The file URL string or URL object to convert to a path.
53 + */
54 + function fileURLToPath(url: string | URL): string;
55 +
56 + /**
57 + * This function ensures that path is resolved absolutely, and that the URL
58 + * control characters are correctly encoded when converting into a File URL.
59 + * @param url The path to convert to a File URL.
60 + */
61 + function pathToFileURL(url: string): URL;
62 +
63 + interface URLFormatOptions {
64 + auth?: boolean;
65 + fragment?: boolean;
66 + search?: boolean;
67 + unicode?: boolean;
68 + }
69 +
70 + class URL {
71 + constructor(input: string, base?: string | URL);
72 + hash: string;
73 + host: string;
74 + hostname: string;
75 + href: string;
76 + readonly origin: string;
77 + password: string;
78 + pathname: string;
79 + port: string;
80 + protocol: string;
81 + search: string;
82 + readonly searchParams: URLSearchParams;
83 + username: string;
84 + toString(): string;
85 + toJSON(): string;
86 + }
87 +
88 + class URLSearchParams implements Iterable<[string, string]> {
89 + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>);
90 + append(name: string, value: string): void;
91 + delete(name: string): void;
92 + entries(): IterableIterator<[string, string]>;
93 + forEach(callback: (value: string, name: string, searchParams: this) => void): void;
94 + get(name: string): string | null;
95 + getAll(name: string): string[];
96 + has(name: string): boolean;
97 + keys(): IterableIterator<string>;
98 + set(name: string, value: string): void;
99 + sort(): void;
100 + toString(): string;
101 + values(): IterableIterator<string>;
102 + [Symbol.iterator](): IterableIterator<[string, string]>;
103 + }
104 +}
This diff is collapsed. Click to expand it.
1 +declare module "v8" {
2 + interface HeapSpaceInfo {
3 + space_name: string;
4 + space_size: number;
5 + space_used_size: number;
6 + space_available_size: number;
7 + physical_space_size: number;
8 + }
9 +
10 + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
11 + type DoesZapCodeSpaceFlag = 0 | 1;
12 +
13 + interface HeapInfo {
14 + total_heap_size: number;
15 + total_heap_size_executable: number;
16 + total_physical_size: number;
17 + total_available_size: number;
18 + used_heap_size: number;
19 + heap_size_limit: number;
20 + malloced_memory: number;
21 + peak_malloced_memory: number;
22 + does_zap_garbage: DoesZapCodeSpaceFlag;
23 + }
24 +
25 + function getHeapStatistics(): HeapInfo;
26 + function getHeapSpaceStatistics(): HeapSpaceInfo[];
27 + function setFlagsFromString(flags: string): void;
28 +}
1 +declare module "vm" {
2 + interface Context {
3 + [key: string]: any;
4 + }
5 + interface BaseOptions {
6 + /**
7 + * Specifies the filename used in stack traces produced by this script.
8 + * Default: `''`.
9 + */
10 + filename?: string;
11 + /**
12 + * Specifies the line number offset that is displayed in stack traces produced by this script.
13 + * Default: `0`.
14 + */
15 + lineOffset?: number;
16 + /**
17 + * Specifies the column number offset that is displayed in stack traces produced by this script.
18 + * Default: `0`
19 + */
20 + columnOffset?: number;
21 + }
22 + interface ScriptOptions extends BaseOptions {
23 + displayErrors?: boolean;
24 + timeout?: number;
25 + cachedData?: Buffer;
26 + produceCachedData?: boolean;
27 + }
28 + interface RunningScriptOptions extends BaseOptions {
29 + displayErrors?: boolean;
30 + timeout?: number;
31 + }
32 + interface CompileFunctionOptions extends BaseOptions {
33 + /**
34 + * Provides an optional data with V8's code cache data for the supplied source.
35 + */
36 + cachedData?: Buffer;
37 + /**
38 + * Specifies whether to produce new cache data.
39 + * Default: `false`,
40 + */
41 + produceCachedData?: boolean;
42 + /**
43 + * The sandbox/context in which the said function should be compiled in.
44 + */
45 + parsingContext?: Context;
46 +
47 + /**
48 + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
49 + */
50 + contextExtensions?: Object[];
51 + }
52 + class Script {
53 + constructor(code: string, options?: ScriptOptions);
54 + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
55 + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
56 + runInThisContext(options?: RunningScriptOptions): any;
57 + }
58 + function createContext(sandbox?: Context): Context;
59 + function isContext(sandbox: Context): boolean;
60 + function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
61 + function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
62 + function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
63 + function compileFunction(code: string, params: string[], options: CompileFunctionOptions): Function;
64 +}
1 +declare module "worker_threads" {
2 + import { EventEmitter } from "events";
3 + import { Readable, Writable } from "stream";
4 +
5 + const isMainThread: boolean;
6 + const parentPort: null | MessagePort;
7 + const threadId: number;
8 + const workerData: any;
9 +
10 + class MessageChannel {
11 + readonly port1: MessagePort;
12 + readonly port2: MessagePort;
13 + }
14 +
15 + class MessagePort extends EventEmitter {
16 + close(): void;
17 + postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
18 + ref(): void;
19 + unref(): void;
20 + start(): void;
21 +
22 + addListener(event: "close", listener: () => void): this;
23 + addListener(event: "message", listener: (value: any) => void): this;
24 + addListener(event: string | symbol, listener: (...args: any[]) => void): this;
25 +
26 + emit(event: "close"): boolean;
27 + emit(event: "message", value: any): boolean;
28 + emit(event: string | symbol, ...args: any[]): boolean;
29 +
30 + on(event: "close", listener: () => void): this;
31 + on(event: "message", listener: (value: any) => void): this;
32 + on(event: string | symbol, listener: (...args: any[]) => void): this;
33 +
34 + once(event: "close", listener: () => void): this;
35 + once(event: "message", listener: (value: any) => void): this;
36 + once(event: string | symbol, listener: (...args: any[]) => void): this;
37 +
38 + prependListener(event: "close", listener: () => void): this;
39 + prependListener(event: "message", listener: (value: any) => void): this;
40 + prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
41 +
42 + prependOnceListener(event: "close", listener: () => void): this;
43 + prependOnceListener(event: "message", listener: (value: any) => void): this;
44 + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
45 +
46 + removeListener(event: "close", listener: () => void): this;
47 + removeListener(event: "message", listener: (value: any) => void): this;
48 + removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
49 +
50 + off(event: "close", listener: () => void): this;
51 + off(event: "message", listener: (value: any) => void): this;
52 + off(event: string | symbol, listener: (...args: any[]) => void): this;
53 + }
54 +
55 + interface WorkerOptions {
56 + eval?: boolean;
57 + workerData?: any;
58 + stdin?: boolean;
59 + stdout?: boolean;
60 + stderr?: boolean;
61 + execArgv?: string[];
62 + }
63 +
64 + class Worker extends EventEmitter {
65 + readonly stdin: Writable | null;
66 + readonly stdout: Readable;
67 + readonly stderr: Readable;
68 + readonly threadId: number;
69 +
70 + constructor(filename: string, options?: WorkerOptions);
71 +
72 + postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
73 + ref(): void;
74 + unref(): void;
75 + terminate(callback?: (err: Error, exitCode: number) => void): void;
76 +
77 + addListener(event: "error", listener: (err: Error) => void): this;
78 + addListener(event: "exit", listener: (exitCode: number) => void): this;
79 + addListener(event: "message", listener: (value: any) => void): this;
80 + addListener(event: "online", listener: () => void): this;
81 + addListener(event: string | symbol, listener: (...args: any[]) => void): this;
82 +
83 + emit(event: "error", err: Error): boolean;
84 + emit(event: "exit", exitCode: number): boolean;
85 + emit(event: "message", value: any): boolean;
86 + emit(event: "online"): boolean;
87 + emit(event: string | symbol, ...args: any[]): boolean;
88 +
89 + on(event: "error", listener: (err: Error) => void): this;
90 + on(event: "exit", listener: (exitCode: number) => void): this;
91 + on(event: "message", listener: (value: any) => void): this;
92 + on(event: "online", listener: () => void): this;
93 + on(event: string | symbol, listener: (...args: any[]) => void): this;
94 +
95 + once(event: "error", listener: (err: Error) => void): this;
96 + once(event: "exit", listener: (exitCode: number) => void): this;
97 + once(event: "message", listener: (value: any) => void): this;
98 + once(event: "online", listener: () => void): this;
99 + once(event: string | symbol, listener: (...args: any[]) => void): this;
100 +
101 + prependListener(event: "error", listener: (err: Error) => void): this;
102 + prependListener(event: "exit", listener: (exitCode: number) => void): this;
103 + prependListener(event: "message", listener: (value: any) => void): this;
104 + prependListener(event: "online", listener: () => void): this;
105 + prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
106 +
107 + prependOnceListener(event: "error", listener: (err: Error) => void): this;
108 + prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
109 + prependOnceListener(event: "message", listener: (value: any) => void): this;
110 + prependOnceListener(event: "online", listener: () => void): this;
111 + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
112 +
113 + removeListener(event: "error", listener: (err: Error) => void): this;
114 + removeListener(event: "exit", listener: (exitCode: number) => void): this;
115 + removeListener(event: "message", listener: (value: any) => void): this;
116 + removeListener(event: "online", listener: () => void): this;
117 + removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
118 +
119 + off(event: "error", listener: (err: Error) => void): this;
120 + off(event: "exit", listener: (exitCode: number) => void): this;
121 + off(event: "message", listener: (value: any) => void): this;
122 + off(event: "online", listener: () => void): this;
123 + off(event: string | symbol, listener: (...args: any[]) => void): this;
124 + }
125 +}
This diff is collapsed. Click to expand it.
1 +This software is dual-licensed under the ISC and MIT licenses.
2 +You may use this software under EITHER of the following licenses.
3 +
4 +----------
5 +
6 +The ISC License
7 +
8 +Copyright (c) Isaac Z. Schlueter and Contributors
9 +
10 +Permission to use, copy, modify, and/or distribute this software for any
11 +purpose with or without fee is hereby granted, provided that the above
12 +copyright notice and this permission notice appear in all copies.
13 +
14 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
20 +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 +
22 +----------
23 +
24 +Copyright Isaac Z. Schlueter and Contributors
25 +All rights reserved.
26 +
27 +Permission is hereby granted, free of charge, to any person
28 +obtaining a copy of this software and associated documentation
29 +files (the "Software"), to deal in the Software without
30 +restriction, including without limitation the rights to use,
31 +copy, modify, merge, publish, distribute, sublicense, and/or sell
32 +copies of the Software, and to permit persons to whom the
33 +Software is furnished to do so, subject to the following
34 +conditions:
35 +
36 +The above copyright notice and this permission notice shall be
37 +included in all copies or substantial portions of the Software.
38 +
39 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
41 +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
42 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
43 +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
44 +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46 +OTHER DEALINGS IN THE SOFTWARE.
1 +# abbrev-js
2 +
3 +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
4 +
5 +Usage:
6 +
7 + var abbrev = require("abbrev");
8 + abbrev("foo", "fool", "folding", "flop");
9 +
10 + // returns:
11 + { fl: 'flop'
12 + , flo: 'flop'
13 + , flop: 'flop'
14 + , fol: 'folding'
15 + , fold: 'folding'
16 + , foldi: 'folding'
17 + , foldin: 'folding'
18 + , folding: 'folding'
19 + , foo: 'foo'
20 + , fool: 'fool'
21 + }
22 +
23 +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
1 +module.exports = exports = abbrev.abbrev = abbrev
2 +
3 +abbrev.monkeyPatch = monkeyPatch
4 +
5 +function monkeyPatch () {
6 + Object.defineProperty(Array.prototype, 'abbrev', {
7 + value: function () { return abbrev(this) },
8 + enumerable: false, configurable: true, writable: true
9 + })
10 +
11 + Object.defineProperty(Object.prototype, 'abbrev', {
12 + value: function () { return abbrev(Object.keys(this)) },
13 + enumerable: false, configurable: true, writable: true
14 + })
15 +}
16 +
17 +function abbrev (list) {
18 + if (arguments.length !== 1 || !Array.isArray(list)) {
19 + list = Array.prototype.slice.call(arguments, 0)
20 + }
21 + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
22 + args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
23 + }
24 +
25 + // sort them lexicographically, so that they're next to their nearest kin
26 + args = args.sort(lexSort)
27 +
28 + // walk through each, seeing how much it has in common with the next and previous
29 + var abbrevs = {}
30 + , prev = ""
31 + for (var i = 0, l = args.length ; i < l ; i ++) {
32 + var current = args[i]
33 + , next = args[i + 1] || ""
34 + , nextMatches = true
35 + , prevMatches = true
36 + if (current === next) continue
37 + for (var j = 0, cl = current.length ; j < cl ; j ++) {
38 + var curChar = current.charAt(j)
39 + nextMatches = nextMatches && curChar === next.charAt(j)
40 + prevMatches = prevMatches && curChar === prev.charAt(j)
41 + if (!nextMatches && !prevMatches) {
42 + j ++
43 + break
44 + }
45 + }
46 + prev = current
47 + if (j === cl) {
48 + abbrevs[current] = current
49 + continue
50 + }
51 + for (var a = current.substr(0, j) ; j <= cl ; j ++) {
52 + abbrevs[a] = current
53 + a += current.charAt(j)
54 + }
55 + }
56 + return abbrevs
57 +}
58 +
59 +function lexSort (a, b) {
60 + return a === b ? 0 : a > b ? 1 : -1
61 +}
1 +{
2 + "_args": [
3 + [
4 + "abbrev@1.1.1",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "abbrev@1.1.1",
9 + "_id": "abbrev@1.1.1",
10 + "_inBundle": false,
11 + "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
12 + "_location": "/abbrev",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "abbrev@1.1.1",
18 + "name": "abbrev",
19 + "escapedName": "abbrev",
20 + "rawSpec": "1.1.1",
21 + "saveSpec": null,
22 + "fetchSpec": "1.1.1"
23 + },
24 + "_requiredBy": [
25 + "/node-pre-gyp/nopt",
26 + "/nopt"
27 + ],
28 + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
29 + "_spec": "1.1.1",
30 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
31 + "author": {
32 + "name": "Isaac Z. Schlueter",
33 + "email": "i@izs.me"
34 + },
35 + "bugs": {
36 + "url": "https://github.com/isaacs/abbrev-js/issues"
37 + },
38 + "description": "Like ruby's abbrev module, but in js",
39 + "devDependencies": {
40 + "tap": "^10.1"
41 + },
42 + "files": [
43 + "abbrev.js"
44 + ],
45 + "homepage": "https://github.com/isaacs/abbrev-js#readme",
46 + "license": "ISC",
47 + "main": "abbrev.js",
48 + "name": "abbrev",
49 + "repository": {
50 + "type": "git",
51 + "url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
52 + },
53 + "scripts": {
54 + "postpublish": "git push origin --all; git push origin --tags",
55 + "postversion": "npm publish",
56 + "preversion": "npm test",
57 + "test": "tap test.js --100"
58 + },
59 + "version": "1.1.1"
60 +}
1 +1.3.5 / 2018-02-28
2 +==================
3 +
4 + * deps: mime-types@~2.1.18
5 + - deps: mime-db@~1.33.0
6 +
7 +1.3.4 / 2017-08-22
8 +==================
9 +
10 + * deps: mime-types@~2.1.16
11 + - deps: mime-db@~1.29.0
12 +
13 +1.3.3 / 2016-05-02
14 +==================
15 +
16 + * deps: mime-types@~2.1.11
17 + - deps: mime-db@~1.23.0
18 + * deps: negotiator@0.6.1
19 + - perf: improve `Accept` parsing speed
20 + - perf: improve `Accept-Charset` parsing speed
21 + - perf: improve `Accept-Encoding` parsing speed
22 + - perf: improve `Accept-Language` parsing speed
23 +
24 +1.3.2 / 2016-03-08
25 +==================
26 +
27 + * deps: mime-types@~2.1.10
28 + - Fix extension of `application/dash+xml`
29 + - Update primary extension for `audio/mp4`
30 + - deps: mime-db@~1.22.0
31 +
32 +1.3.1 / 2016-01-19
33 +==================
34 +
35 + * deps: mime-types@~2.1.9
36 + - deps: mime-db@~1.21.0
37 +
38 +1.3.0 / 2015-09-29
39 +==================
40 +
41 + * deps: mime-types@~2.1.7
42 + - deps: mime-db@~1.19.0
43 + * deps: negotiator@0.6.0
44 + - Fix including type extensions in parameters in `Accept` parsing
45 + - Fix parsing `Accept` parameters with quoted equals
46 + - Fix parsing `Accept` parameters with quoted semicolons
47 + - Lazy-load modules from main entry point
48 + - perf: delay type concatenation until needed
49 + - perf: enable strict mode
50 + - perf: hoist regular expressions
51 + - perf: remove closures getting spec properties
52 + - perf: remove a closure from media type parsing
53 + - perf: remove property delete from media type parsing
54 +
55 +1.2.13 / 2015-09-06
56 +===================
57 +
58 + * deps: mime-types@~2.1.6
59 + - deps: mime-db@~1.18.0
60 +
61 +1.2.12 / 2015-07-30
62 +===================
63 +
64 + * deps: mime-types@~2.1.4
65 + - deps: mime-db@~1.16.0
66 +
67 +1.2.11 / 2015-07-16
68 +===================
69 +
70 + * deps: mime-types@~2.1.3
71 + - deps: mime-db@~1.15.0
72 +
73 +1.2.10 / 2015-07-01
74 +===================
75 +
76 + * deps: mime-types@~2.1.2
77 + - deps: mime-db@~1.14.0
78 +
79 +1.2.9 / 2015-06-08
80 +==================
81 +
82 + * deps: mime-types@~2.1.1
83 + - perf: fix deopt during mapping
84 +
85 +1.2.8 / 2015-06-07
86 +==================
87 +
88 + * deps: mime-types@~2.1.0
89 + - deps: mime-db@~1.13.0
90 + * perf: avoid argument reassignment & argument slice
91 + * perf: avoid negotiator recursive construction
92 + * perf: enable strict mode
93 + * perf: remove unnecessary bitwise operator
94 +
95 +1.2.7 / 2015-05-10
96 +==================
97 +
98 + * deps: negotiator@0.5.3
99 + - Fix media type parameter matching to be case-insensitive
100 +
101 +1.2.6 / 2015-05-07
102 +==================
103 +
104 + * deps: mime-types@~2.0.11
105 + - deps: mime-db@~1.9.1
106 + * deps: negotiator@0.5.2
107 + - Fix comparing media types with quoted values
108 + - Fix splitting media types with quoted commas
109 +
110 +1.2.5 / 2015-03-13
111 +==================
112 +
113 + * deps: mime-types@~2.0.10
114 + - deps: mime-db@~1.8.0
115 +
116 +1.2.4 / 2015-02-14
117 +==================
118 +
119 + * Support Node.js 0.6
120 + * deps: mime-types@~2.0.9
121 + - deps: mime-db@~1.7.0
122 + * deps: negotiator@0.5.1
123 + - Fix preference sorting to be stable for long acceptable lists
124 +
125 +1.2.3 / 2015-01-31
126 +==================
127 +
128 + * deps: mime-types@~2.0.8
129 + - deps: mime-db@~1.6.0
130 +
131 +1.2.2 / 2014-12-30
132 +==================
133 +
134 + * deps: mime-types@~2.0.7
135 + - deps: mime-db@~1.5.0
136 +
137 +1.2.1 / 2014-12-30
138 +==================
139 +
140 + * deps: mime-types@~2.0.5
141 + - deps: mime-db@~1.3.1
142 +
143 +1.2.0 / 2014-12-19
144 +==================
145 +
146 + * deps: negotiator@0.5.0
147 + - Fix list return order when large accepted list
148 + - Fix missing identity encoding when q=0 exists
149 + - Remove dynamic building of Negotiator class
150 +
151 +1.1.4 / 2014-12-10
152 +==================
153 +
154 + * deps: mime-types@~2.0.4
155 + - deps: mime-db@~1.3.0
156 +
157 +1.1.3 / 2014-11-09
158 +==================
159 +
160 + * deps: mime-types@~2.0.3
161 + - deps: mime-db@~1.2.0
162 +
163 +1.1.2 / 2014-10-14
164 +==================
165 +
166 + * deps: negotiator@0.4.9
167 + - Fix error when media type has invalid parameter
168 +
169 +1.1.1 / 2014-09-28
170 +==================
171 +
172 + * deps: mime-types@~2.0.2
173 + - deps: mime-db@~1.1.0
174 + * deps: negotiator@0.4.8
175 + - Fix all negotiations to be case-insensitive
176 + - Stable sort preferences of same quality according to client order
177 +
178 +1.1.0 / 2014-09-02
179 +==================
180 +
181 + * update `mime-types`
182 +
183 +1.0.7 / 2014-07-04
184 +==================
185 +
186 + * Fix wrong type returned from `type` when match after unknown extension
187 +
188 +1.0.6 / 2014-06-24
189 +==================
190 +
191 + * deps: negotiator@0.4.7
192 +
193 +1.0.5 / 2014-06-20
194 +==================
195 +
196 + * fix crash when unknown extension given
197 +
198 +1.0.4 / 2014-06-19
199 +==================
200 +
201 + * use `mime-types`
202 +
203 +1.0.3 / 2014-06-11
204 +==================
205 +
206 + * deps: negotiator@0.4.6
207 + - Order by specificity when quality is the same
208 +
209 +1.0.2 / 2014-05-29
210 +==================
211 +
212 + * Fix interpretation when header not in request
213 + * deps: pin negotiator@0.4.5
214 +
215 +1.0.1 / 2014-01-18
216 +==================
217 +
218 + * Identity encoding isn't always acceptable
219 + * deps: negotiator@~0.4.0
220 +
221 +1.0.0 / 2013-12-27
222 +==================
223 +
224 + * 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-image]][npm-url]
4 +[![NPM Downloads][downloads-image]][downloads-url]
5 +[![Node.js Version][node-version-image]][node-version-url]
6 +[![Build Status][travis-image]][travis-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 +<!-- eslint-disable no-unused-vars -->
33 +
34 +```js
35 +var accepts = require('accepts')
36 +```
37 +
38 +### accepts(req)
39 +
40 +Create a new `Accepts` object for the given `req`.
41 +
42 +#### .charset(charsets)
43 +
44 +Return the first accepted charset. If nothing in `charsets` is accepted,
45 +then `false` is returned.
46 +
47 +#### .charsets()
48 +
49 +Return the charsets that the request accepts, in the order of the client's
50 +preference (most preferred first).
51 +
52 +#### .encoding(encodings)
53 +
54 +Return the first accepted encoding. If nothing in `encodings` is accepted,
55 +then `false` is returned.
56 +
57 +#### .encodings()
58 +
59 +Return the encodings that the request accepts, in the order of the client's
60 +preference (most preferred first).
61 +
62 +#### .language(languages)
63 +
64 +Return the first accepted language. If nothing in `languages` is accepted,
65 +then `false` is returned.
66 +
67 +#### .languages()
68 +
69 +Return the languages that the request accepts, in the order of the client's
70 +preference (most preferred first).
71 +
72 +#### .type(types)
73 +
74 +Return the first accepted type (and it is returned as the same text as what
75 +appears in the `types` array). If nothing in `types` is accepted, then `false`
76 +is returned.
77 +
78 +The `types` array can contain full MIME types or file extensions. Any value
79 +that is not a full MIME types is passed to `require('mime-types').lookup`.
80 +
81 +#### .types()
82 +
83 +Return the types that the request accepts, in the order of the client's
84 +preference (most preferred first).
85 +
86 +## Examples
87 +
88 +### Simple type negotiation
89 +
90 +This simple example shows how to use `accepts` to return a different typed
91 +respond body based on what the client wants to accept. The server lists it's
92 +preferences in order and will get back the best match between the client and
93 +server.
94 +
95 +```js
96 +var accepts = require('accepts')
97 +var http = require('http')
98 +
99 +function app (req, res) {
100 + var accept = accepts(req)
101 +
102 + // the order of this list is significant; should be server preferred order
103 + switch (accept.type(['json', 'html'])) {
104 + case 'json':
105 + res.setHeader('Content-Type', 'application/json')
106 + res.write('{"hello":"world!"}')
107 + break
108 + case 'html':
109 + res.setHeader('Content-Type', 'text/html')
110 + res.write('<b>hello, world!</b>')
111 + break
112 + default:
113 + // the fallback is text/plain, so no need to specify it above
114 + res.setHeader('Content-Type', 'text/plain')
115 + res.write('hello, world!')
116 + break
117 + }
118 +
119 + res.end()
120 +}
121 +
122 +http.createServer(app).listen(3000)
123 +```
124 +
125 +You can test this out with the cURL program:
126 +```sh
127 +curl -I -H'Accept: text/html' http://localhost:3000/
128 +```
129 +
130 +## License
131 +
132 +[MIT](LICENSE)
133 +
134 +[npm-image]: https://img.shields.io/npm/v/accepts.svg
135 +[npm-url]: https://npmjs.org/package/accepts
136 +[node-version-image]: https://img.shields.io/node/v/accepts.svg
137 +[node-version-url]: https://nodejs.org/en/download/
138 +[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
139 +[travis-url]: https://travis-ci.org/jshttp/accepts
140 +[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
141 +[coveralls-url]: https://coveralls.io/r/jshttp/accepts
142 +[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
143 +[downloads-url]: https://npmjs.org/package/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 + "_args": [
3 + [
4 + "accepts@1.3.5",
5 + "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction"
6 + ]
7 + ],
8 + "_from": "accepts@1.3.5",
9 + "_id": "accepts@1.3.5",
10 + "_inBundle": false,
11 + "_integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
12 + "_location": "/accepts",
13 + "_phantomChildren": {},
14 + "_requested": {
15 + "type": "version",
16 + "registry": true,
17 + "raw": "accepts@1.3.5",
18 + "name": "accepts",
19 + "escapedName": "accepts",
20 + "rawSpec": "1.3.5",
21 + "saveSpec": null,
22 + "fetchSpec": "1.3.5"
23 + },
24 + "_requiredBy": [
25 + "/engine.io",
26 + "/express"
27 + ],
28 + "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
29 + "_spec": "1.3.5",
30 + "_where": "/Users/ye/Desktop/NodeBook/nodejs-book/ch12/12.4/node-auction",
31 + "bugs": {
32 + "url": "https://github.com/jshttp/accepts/issues"
33 + },
34 + "contributors": [
35 + {
36 + "name": "Douglas Christopher Wilson",
37 + "email": "doug@somethingdoug.com"
38 + },
39 + {
40 + "name": "Jonathan Ong",
41 + "email": "me@jongleberry.com",
42 + "url": "http://jongleberry.com"
43 + }
44 + ],
45 + "dependencies": {
46 + "mime-types": "~2.1.18",
47 + "negotiator": "0.6.1"
48 + },
49 + "description": "Higher-level content negotiation",
50 + "devDependencies": {
51 + "eslint": "4.18.1",
52 + "eslint-config-standard": "11.0.0",
53 + "eslint-plugin-import": "2.9.0",
54 + "eslint-plugin-markdown": "1.0.0-beta.6",
55 + "eslint-plugin-node": "6.0.1",
56 + "eslint-plugin-promise": "3.6.0",
57 + "eslint-plugin-standard": "3.0.1",
58 + "istanbul": "0.4.5",
59 + "mocha": "~1.21.5"
60 + },
61 + "engines": {
62 + "node": ">= 0.6"
63 + },
64 + "files": [
65 + "LICENSE",
66 + "HISTORY.md",
67 + "index.js"
68 + ],
69 + "homepage": "https://github.com/jshttp/accepts#readme",
70 + "keywords": [
71 + "content",
72 + "negotiation",
73 + "accept",
74 + "accepts"
75 + ],
76 + "license": "MIT",
77 + "name": "accepts",
78 + "repository": {
79 + "type": "git",
80 + "url": "git+https://github.com/jshttp/accepts.git"
81 + },
82 + "scripts": {
83 + "lint": "eslint --plugin markdown --ext js,md .",
84 + "test": "mocha --reporter spec --check-leaks --bail test/",
85 + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
86 + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
87 + },
88 + "version": "1.3.5"
89 +}
1 +Copyright (c) 2014 Forbes Lindesay
2 +
3 +Permission is hereby granted, free of charge, to any person obtaining a copy
4 +of this software and associated documentation files (the "Software"), to deal
5 +in the Software without restriction, including without limitation the rights
6 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 +copies of the Software, and to permit persons to whom the Software is
8 +furnished to do so, subject to the following conditions:
9 +
10 +The above copyright notice and this permission notice shall be included in
11 +all copies or substantial portions of the Software.
12 +
13 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 +THE SOFTWARE.
...\ No newline at end of file ...\ No newline at end of file
1 +# acorn-globals
2 +
3 +Detect global variables in JavaScript using acorn
4 +
5 +[![Build Status](https://img.shields.io/travis/ForbesLindesay/acorn-globals/master.svg)](https://travis-ci.org/ForbesLindesay/acorn-globals)
6 +[![Dependency Status](https://img.shields.io/david/ForbesLindesay/acorn-globals.svg)](https://david-dm.org/ForbesLindesay/acorn-globals)
7 +[![NPM version](https://img.shields.io/npm/v/acorn-globals.svg)](https://www.npmjs.org/package/acorn-globals)
8 +
9 +## Installation
10 +
11 + npm install acorn-globals
12 +
13 +## Usage
14 +
15 +detect.js
16 +
17 +```js
18 +var fs = require('fs');
19 +var detect = require('acorn-globals');
20 +
21 +var src = fs.readFileSync(__dirname + '/input.js', 'utf8');
22 +
23 +var scope = detect(src);
24 +console.dir(scope);
25 +```
26 +
27 +input.js
28 +
29 +```js
30 +var x = 5;
31 +var y = 3, z = 2;
32 +
33 +w.foo();
34 +w = 2;
35 +
36 +RAWR=444;
37 +RAWR.foo();
38 +
39 +BLARG=3;
40 +
41 +foo(function () {
42 + var BAR = 3;
43 + process.nextTick(function (ZZZZZZZZZZZZ) {
44 + console.log('beep boop');
45 + var xyz = 4;
46 + x += 10;
47 + x.zzzzzz;
48 + ZZZ=6;
49 + });
50 + function doom () {
51 + }
52 + ZZZ.foo();
53 +
54 +});
55 +
56 +console.log(xyz);
57 +```
58 +
59 +output:
60 +
61 +```
62 +$ node example/detect.js
63 +[ { name: 'BLARG', nodes: [ [Object] ] },
64 + { name: 'RAWR', nodes: [ [Object], [Object] ] },
65 + { name: 'ZZZ', nodes: [ [Object], [Object] ] },
66 + { name: 'console', nodes: [ [Object], [Object] ] },
67 + { name: 'foo', nodes: [ [Object] ] },
68 + { name: 'process', nodes: [ [Object] ] },
69 + { name: 'w', nodes: [ [Object], [Object] ] },
70 + { name: 'xyz', nodes: [ [Object] ] } ]
71 +```
72 +
73 +
74 +## License
75 +
76 + MIT
1 +'use strict';
2 +
3 +var acorn = require('acorn');
4 +var walk = require('acorn/dist/walk');
5 +
6 +function isScope(node) {
7 + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program';
8 +}
9 +function isBlockScope(node) {
10 + return node.type === 'BlockStatement' || isScope(node);
11 +}
12 +
13 +function declaresArguments(node) {
14 + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
15 +}
16 +
17 +function declaresThis(node) {
18 + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
19 +}
20 +
21 +function reallyParse(source) {
22 + return acorn.parse(source, {
23 + allowReturnOutsideFunction: true,
24 + allowImportExportEverywhere: true,
25 + allowHashBang: true
26 + });
27 +}
28 +module.exports = findGlobals;
29 +module.exports.parse = reallyParse;
30 +function findGlobals(source) {
31 + var globals = [];
32 + var ast;
33 + // istanbul ignore else
34 + if (typeof source === 'string') {
35 + ast = reallyParse(source);
36 + } else {
37 + ast = source;
38 + }
39 + // istanbul ignore if
40 + if (!(ast && typeof ast === 'object' && ast.type === 'Program')) {
41 + throw new TypeError('Source must be either a string of JavaScript or an acorn AST');
42 + }
43 + var declareFunction = function (node) {
44 + var fn = node;
45 + fn.locals = fn.locals || {};
46 + node.params.forEach(function (node) {
47 + declarePattern(node, fn);
48 + });
49 + if (node.id) {
50 + fn.locals[node.id.name] = true;
51 + }
52 + }
53 + var declarePattern = function (node, parent) {
54 + switch (node.type) {
55 + case 'Identifier':
56 + parent.locals[node.name] = true;
57 + break;
58 + case 'ObjectPattern':
59 + node.properties.forEach(function (node) {
60 + declarePattern(node.value, parent);
61 + });
62 + break;
63 + case 'ArrayPattern':
64 + node.elements.forEach(function (node) {
65 + if (node) declarePattern(node, parent);
66 + });
67 + break;
68 + case 'RestElement':
69 + declarePattern(node.argument, parent);
70 + break;
71 + case 'AssignmentPattern':
72 + declarePattern(node.left, parent);
73 + break;
74 + // istanbul ignore next
75 + default:
76 + throw new Error('Unrecognized pattern type: ' + node.type);
77 + }
78 + }
79 + var declareModuleSpecifier = function (node, parents) {
80 + ast.locals = ast.locals || {};
81 + ast.locals[node.local.name] = true;
82 + }
83 + walk.ancestor(ast, {
84 + 'VariableDeclaration': function (node, parents) {
85 + var parent = null;
86 + for (var i = parents.length - 1; i >= 0 && parent === null; i--) {
87 + if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) {
88 + parent = parents[i];
89 + }
90 + }
91 + parent.locals = parent.locals || {};
92 + node.declarations.forEach(function (declaration) {
93 + declarePattern(declaration.id, parent);
94 + });
95 + },
96 + 'FunctionDeclaration': function (node, parents) {
97 + var parent = null;
98 + for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
99 + if (isScope(parents[i])) {
100 + parent = parents[i];
101 + }
102 + }
103 + parent.locals = parent.locals || {};
104 + parent.locals[node.id.name] = true;
105 + declareFunction(node);
106 + },
107 + 'Function': declareFunction,
108 + 'ClassDeclaration': function (node, parents) {
109 + var parent = null;
110 + for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
111 + if (isScope(parents[i])) {
112 + parent = parents[i];
113 + }
114 + }
115 + parent.locals = parent.locals || {};
116 + parent.locals[node.id.name] = true;
117 + },
118 + 'TryStatement': function (node) {
119 + if (node.handler === null) return;
120 + node.handler.locals = node.handler.locals || {};
121 + node.handler.locals[node.handler.param.name] = true;
122 + },
123 + 'ImportDefaultSpecifier': declareModuleSpecifier,
124 + 'ImportSpecifier': declareModuleSpecifier,
125 + 'ImportNamespaceSpecifier': declareModuleSpecifier
126 + });
127 + function identifier(node, parents) {
128 + var name = node.name;
129 + if (name === 'undefined') return;
130 + for (var i = 0; i < parents.length; i++) {
131 + if (name === 'arguments' && declaresArguments(parents[i])) {
132 + return;
133 + }
134 + if (parents[i].locals && name in parents[i].locals) {
135 + return;
136 + }
137 + }
138 + node.parents = parents;
139 + globals.push(node);
140 + }
141 + walk.ancestor(ast, {
142 + 'VariablePattern': identifier,
143 + 'Identifier': identifier,
144 + 'ThisExpression': function (node, parents) {
145 + for (var i = 0; i < parents.length; i++) {
146 + if (declaresThis(parents[i])) {
147 + return;
148 + }
149 + }
150 + node.parents = parents;
151 + globals.push(node);
152 + }
153 + });
154 + var groupedGlobals = {};
155 + globals.forEach(function (node) {
156 + var name = node.type === 'ThisExpression' ? 'this' : node.name;
157 + groupedGlobals[name] = (groupedGlobals[name] || []);
158 + groupedGlobals[name].push(node);
159 + });
160 + return Object.keys(groupedGlobals).sort().map(function (name) {
161 + return {name: name, nodes: groupedGlobals[name]};
162 + });
163 +}
1 +../acorn/bin/acorn
...\ No newline at end of file ...\ No newline at end of file
1 +/.tern-port
2 +/test
3 +/local
4 +/rollup
5 +/bin/generate-identifier-regex.js
6 +/bin/update_authors.sh
7 +.editorconfig
8 +.gitattributes
9 +.tern-project
10 +.travis.yml
1 +List of Acorn contributors. Updated before every release.
2 +
3 +Adrian Rakovsky
4 +Alistair Braidwood
5 +Amila Welihinda
6 +Andres Suarez
7 +Angelo
8 +Aparajita Fishman
9 +Arian Stolwijk
10 +Artem Govorov
11 +Brandon Mills
12 +Charles Hughes
13 +Conrad Irwin
14 +Daniel Tschinder
15 +David Bonnet
16 +Domenico Matteo
17 +Forbes Lindesay
18 +Gilad Peleg
19 +impinball
20 +Ingvar Stepanyan
21 +Jackson Ray Hamilton
22 +Jesse McCarthy
23 +Jiaxing Wang
24 +Joel Kemp
25 +Johannes Herr
26 +Jordan Klassen
27 +Jürg Lehni
28 +Kai Cataldo
29 +keeyipchan
30 +Keheliya Gallaba
31 +Kevin Irish
32 +Kevin Kwok
33 +krator
34 +Marijn Haverbeke
35 +Martin Carlberg
36 +Mat Garcia
37 +Mathias Bynens
38 +Mathieu 'p01' Henri
39 +Matthew Bastien
40 +Max Schaefer
41 +Max Zerzouri
42 +Mihai Bazon
43 +Mike Rennie
44 +naoh
45 +Nicholas C. Zakas
46 +Nick Fitzgerald
47 +Olivier Thomann
48 +Oskar Schöldström
49 +Paul Harper
50 +Peter Rust
51 +PlNG
52 +Prayag Verma
53 +ReadmeCritic
54 +r-e-d
55 +Richard Gibson
56 +Rich Harris
57 +Sebastian McKenzie
58 +Simen Bekkhus
59 +Timothy Gu
60 +Toru Nagashima
61 +Wexpo Lyu
62 +zsjforcn
1 +## 4.0.11 (2017-02-07)
2 +
3 +### Bug fixes
4 +
5 +Allow all forms of member expressions to be parenthesized as lvalue.
6 +
7 +## 4.0.10 (2017-02-07)
8 +
9 +### Bug fixes
10 +
11 +Don't expect semicolons after default-exported functions or classes,
12 +even when they are expressions.
13 +
14 +Check for use of `'use strict'` directives in non-simple parameter
15 +functions, even when already in strict mode.
16 +
17 +## 4.0.9 (2017-02-06)
18 +
19 +### Bug fixes
20 +
21 +Fix incorrect error raised for parenthesized simple assignment
22 +targets, so that `(x) = 1` parses again.
23 +
24 +## 4.0.8 (2017-02-03)
25 +
26 +### Bug fixes
27 +
28 +Solve spurious parenthesized pattern errors by temporarily erring on
29 +the side of accepting programs that our delayed errors don't handle
30 +correctly yet.
31 +
32 +## 4.0.7 (2017-02-02)
33 +
34 +### Bug fixes
35 +
36 +Accept invalidly rejected code like `(x).y = 2` again.
37 +
38 +Don't raise an error when a function _inside_ strict code has a
39 +non-simple parameter list.
40 +
41 +## 4.0.6 (2017-02-02)
42 +
43 +### Bug fixes
44 +
45 +Fix exponential behavior (manifesting itself as a complete hang for
46 +even relatively small source files) introduced by the new 'use strict'
47 +check.
48 +
49 +## 4.0.5 (2017-02-02)
50 +
51 +### Bug fixes
52 +
53 +Disallow parenthesized pattern expressions.
54 +
55 +Allow keywords as export names.
56 +
57 +Don't allow the `async` keyword to be parenthesized.
58 +
59 +Properly raise an error when a keyword contains a character escape.
60 +
61 +Allow `"use strict"` to appear after other string literal expressions.
62 +
63 +Disallow labeled declarations.
64 +
65 +## 4.0.4 (2016-12-19)
66 +
67 +### Bug fixes
68 +
69 +Fix issue with loading acorn_loose.js with an AMD loader.
70 +
71 +Fix crash when `export` was followed by a keyword that can't be
72 +exported.
73 +
74 +## 4.0.3 (2016-08-16)
75 +
76 +### Bug fixes
77 +
78 +Allow regular function declarations inside single-statement `if`
79 +branches in loose mode. Forbid them entirely in strict mode.
80 +
81 +Properly parse properties named `async` in ES2017 mode.
82 +
83 +Fix bug where reserved words were broken in ES2017 mode.
84 +
85 +## 4.0.2 (2016-08-11)
86 +
87 +### Bug fixes
88 +
89 +Don't ignore period or 'e' characters after octal numbers.
90 +
91 +Fix broken parsing for call expressions in default parameter values
92 +of arrow functions.
93 +
94 +## 4.0.1 (2016-08-08)
95 +
96 +### Bug fixes
97 +
98 +Fix false positives in duplicated export name errors.
99 +
100 +## 4.0.0 (2016-08-07)
101 +
102 +### Breaking changes
103 +
104 +The default `ecmaVersion` option value is now 7.
105 +
106 +A number of internal method signatures changed, so plugins might need
107 +to be updated.
108 +
109 +### Bug fixes
110 +
111 +The parser now raises errors on duplicated export names.
112 +
113 +`arguments` and `eval` can now be used in shorthand properties.
114 +
115 +Duplicate parameter names in non-simple argument lists now always
116 +produce an error.
117 +
118 +### New features
119 +
120 +The `ecmaVersion` option now also accepts year-style version numbers
121 +(2015, etc).
122 +
123 +Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
124 +
125 +Support for trailing commas in call expressions when `ecmaVersion`
126 +is >= 8.
127 +
128 +## 3.3.0 (2016-07-25)
129 +
130 +### Bug fixes
131 +
132 +Fix bug in tokenizing of regexp operator after a function declaration.
133 +
134 +Fix parser crash when parsing an array pattern with a hole.
135 +
136 +### New features
137 +
138 +Implement check against complex argument lists in functions that
139 +enable strict mode in ES7.
140 +
141 +## 3.2.0 (2016-06-07)
142 +
143 +### Bug fixes
144 +
145 +Improve handling of lack of unicode regexp support in host
146 +environment.
147 +
148 +Properly reject shorthand properties whose name is a keyword.
149 +
150 +Don't crash when the loose parser is called without options object.
151 +
152 +### New features
153 +
154 +Visitors created with `visit.make` now have their base as _prototype_,
155 +rather than copying properties into a fresh object.
156 +
157 +Make it possible to use `visit.ancestor` with a walk state.
158 +
159 +## 3.1.0 (2016-04-18)
160 +
161 +### Bug fixes
162 +
163 +Fix issue where the loose parser created invalid TemplateElement nodes
164 +for unclosed template literals.
165 +
166 +Properly tokenize the division operator directly after a function
167 +expression.
168 +
169 +Allow trailing comma in destructuring arrays.
170 +
171 +### New features
172 +
173 +The walker now allows defining handlers for `CatchClause` nodes.
174 +
175 +## 3.0.4 (2016-02-25)
176 +
177 +### Fixes
178 +
179 +Allow update expressions as left-hand-side of the ES7 exponential
180 +operator.
181 +
182 +## 3.0.2 (2016-02-10)
183 +
184 +### Fixes
185 +
186 +Fix bug that accidentally made `undefined` a reserved word when
187 +parsing ES7.
188 +
189 +## 3.0.0 (2016-02-10)
190 +
191 +### Breaking changes
192 +
193 +The default value of the `ecmaVersion` option is now 6 (used to be 5).
194 +
195 +Support for comprehension syntax (which was dropped from the draft
196 +spec) has been removed.
197 +
198 +### Fixes
199 +
200 +`let` and `yield` are now “contextual keywords”, meaning you can
201 +mostly use them as identifiers in ES5 non-strict code.
202 +
203 +A parenthesized class or function expression after `export default` is
204 +now parsed correctly.
205 +
206 +### New features
207 +
208 +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation
209 +operator (`**`).
210 +
211 +The identifier character ranges are now based on Unicode 8.0.0.
212 +
213 +Plugins can now override the `raiseRecoverable` method to override the
214 +way non-critical errors are handled.
215 +
216 +## 2.7.0 (2016-01-04)
217 +
218 +### Fixes
219 +
220 +Stop allowing rest parameters in setters.
221 +
222 +Make sure the loose parser always attaches a `local` property to
223 +`ImportNamespaceSpecifier` nodes.
224 +
225 +Disallow `y` rexexp flag in ES5.
226 +
227 +Disallow `\00` and `\000` escapes in strict mode.
228 +
229 +Raise an error when an import name is a reserved word.
230 +
231 +## 2.6.4 (2015-11-12)
232 +
233 +### Fixes
234 +
235 +Fix crash in loose parser when parsing invalid object pattern.
236 +
237 +### New features
238 +
239 +Support plugins in the loose parser.
240 +
241 +## 2.6.2 (2015-11-10)
242 +
243 +### Fixes
244 +
245 +Don't crash when no options object is passed.
246 +
247 +## 2.6.0 (2015-11-09)
248 +
249 +### Fixes
250 +
251 +Add `await` as a reserved word in module sources.
252 +
253 +Disallow `yield` in a parameter default value for a generator.
254 +
255 +Forbid using a comma after a rest pattern in an array destructuring.
256 +
257 +### New features
258 +
259 +Support parsing stdin in command-line tool.
260 +
261 +## 2.5.2 (2015-10-27)
262 +
263 +### Fixes
264 +
265 +Fix bug where the walker walked an exported `let` statement as an
266 +expression.
267 +
268 +## 2.5.0 (2015-10-27)
269 +
270 +### Fixes
271 +
272 +Fix tokenizer support in the command-line tool.
273 +
274 +In the loose parser, don't allow non-string-literals as import
275 +sources.
276 +
277 +Stop allowing `new.target` outside of functions.
278 +
279 +Remove legacy `guard` and `guardedHandler` properties from try nodes.
280 +
281 +Stop allowing multiple `__proto__` properties on an object literal in
282 +strict mode.
283 +
284 +Don't allow rest parameters to be non-identifier patterns.
285 +
286 +Check for duplicate paramter names in arrow functions.
1 +Copyright (C) 2012-2016 by various contributors (see AUTHORS)
2 +
3 +Permission is hereby granted, free of charge, to any person obtaining a copy
4 +of this software and associated documentation files (the "Software"), to deal
5 +in the Software without restriction, including without limitation the rights
6 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 +copies of the Software, and to permit persons to whom the Software is
8 +furnished to do so, subject to the following conditions:
9 +
10 +The above copyright notice and this permission notice shall be included in
11 +all copies or substantial portions of the Software.
12 +
13 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 +THE SOFTWARE.
This diff is collapsed. Click to expand it.
1 +#!/usr/bin/env node
2 +'use strict';
3 +
4 +var path = require('path');
5 +var fs = require('fs');
6 +var acorn = require('../dist/acorn.js');
7 +
8 +var infile;
9 +var forceFile;
10 +var silent = false;
11 +var compact = false;
12 +var tokenize = false;
13 +var options = {}
14 +
15 +function help(status) {
16 + var print = (status == 0) ? console.log : console.error
17 + print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|...|--ecma2015|--ecma2016|...]")
18 + print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]")
19 + process.exit(status)
20 +}
21 +
22 +for (var i = 2; i < process.argv.length; ++i) {
23 + var arg = process.argv[i]
24 + if ((arg == "-" || arg[0] != "-") && !infile) infile = arg
25 + else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i]
26 + else if (arg == "--locations") options.locations = true
27 + else if (arg == "--allow-hash-bang") options.allowHashBang = true
28 + else if (arg == "--silent") silent = true
29 + else if (arg == "--compact") compact = true
30 + else if (arg == "--help") help(0)
31 + else if (arg == "--tokenize") tokenize = true
32 + else if (arg == "--module") options.sourceType = 'module'
33 + else {
34 + var match = arg.match(/^--ecma(\d+)$/)
35 + if (match)
36 + options.ecmaVersion = +match[1]
37 + else
38 + help(1)
39 + }
40 +}
41 +
42 +function run(code) {
43 + var result
44 + if (!tokenize) {
45 + try { result = acorn.parse(code, options) }
46 + catch(e) { console.error(e.message); process.exit(1) }
47 + } else {
48 + result = []
49 + var tokenizer = acorn.tokenizer(code, options), token
50 + while (true) {
51 + try { token = tokenizer.getToken() }
52 + catch(e) { console.error(e.message); process.exit(1) }
53 + result.push(token)
54 + if (token.type == acorn.tokTypes.eof) break
55 + }
56 + }
57 + if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2))
58 +}
59 +
60 +if (forceFile || infile && infile != "-") {
61 + run(fs.readFileSync(infile, "utf8"))
62 +} else {
63 + var code = ""
64 + process.stdin.resume()
65 + process.stdin.on("data", function (chunk) { return code += chunk; })
66 + process.stdin.on("end", function () { return run(code); })
67 +}
...\ No newline at end of file ...\ No newline at end of file
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 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 is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff 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.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff 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 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.