content
large_stringlengths
3
20.5k
url
large_stringlengths
54
193
branch
large_stringclasses
4 values
source
large_stringclasses
42 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
If the support is enabled for files in `node\_modules`. \* `generatedCode` {boolean} If the support is enabled for generated code from `eval` or `new Function`. This method returns whether the [Source Map v3][Source Map] support for stack traces is enabled. ### `module.findSourceMap(path)` \* `path` {string} \* Returns...
https://github.com/nodejs/node/blob/main//doc/api/module.md
main
nodejs
[ -0.03235114365816116, -0.0051540895365178585, -0.025572171434760094, 0.06196877360343933, 0.12073881179094315, 0.005691823549568653, -0.03629130497574806, 0.00291833677329123, -0.07814981788396835, -0.009743702597916126, 0.07553575187921524, -0.013691620901226997, -0.030359728261828423, -0...
0.018336
the `lineNumber` and `columnNumber` provided are not found in any source map, then an empty object is returned. Otherwise, the returned object contains the following keys: \* `name` {string|undefined} The name of the range in the source map, if one was provided \* `fileName` {string} The file name of the original sourc...
https://github.com/nodejs/node/blob/main//doc/api/module.md
main
nodejs
[ -0.03721105307340622, 0.053108733147382736, -0.03263889253139496, -0.0064443498849868774, 0.13562661409378052, -0.01744568720459938, 0.019422031939029694, 0.026528656482696533, 0.020649565383791924, 0.03212974965572357, 0.011384008452296257, -0.07673153281211853, -0.057954464107751846, -0....
0.062775
# Errors Applications running in Node.js will generally experience the following categories of errors: \* Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError}, {ReferenceError}, {TypeError}, and {URIError}. \* Standard `DOMException`s. \* System errors triggered by underlying operating system con...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.062240272760391235, 0.027866180986166, 0.06844081729650497, 0.0728336051106453, 0.09863225370645523, -0.06461440771818161, -0.012466990388929844, 0.04624300077557564, 0.04126453027129173, 0.020869484171271324, -0.04785948619246483, 0.05119163915514946, 0.06125248596072197, -0.0235360264...
0.126919
of error encountered by // the connection, the error will be sent here. console.error(err); }); connection.pipe(process.stdout); ``` \* A handful of typically asynchronous methods in the Node.js API may still use the `throw` mechanism to raise exceptions that must be handled using `try…catch`. There is no comprehensive...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ 0.013868861831724644, 0.02359529584646225, 0.02841118350625038, 0.04951511695981026, 0.05448136851191521, -0.015219088643789291, -0.028526542708277702, 0.075242780148983, 0.054756369441747665, 0.010190844535827637, -0.08372510224580765, 0.004300975706428289, -0.031394604593515396, -0.03355...
0.11877
Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ### `Error.stackTraceLimit` \* Type: {number} The `Error.stackTraceLimit` property specifies the number of stack fra...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.03872191905975342, -0.05922430381178856, -0.008602508343756199, 0.021820390596985817, 0.025894371792674065, -0.0223535168915987, 0.013964652083814144, 0.08591453731060028, 0.05758989229798317, -0.045849207788705826, -0.01605682075023651, -0.04489414766430855, -0.004165926482528448, -0.0...
0.100577
occasionally it will not be able to find a suitable name. If V8 cannot determine a name for the function, only location information will be displayed for that frame. Otherwise, the determined function name will be displayed with location information appended in parentheses. Frames are only generated for JavaScript func...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.07417674362659454, -0.028880858793854713, 0.0074216690845787525, 0.0248465184122324, 0.03207665681838989, -0.06286196410655975, -0.022847436368465424, -0.003805391024798155, 0.08518581092357635, -0.13090798258781433, 0.03821457177400589, 0.022982530295848846, -0.09431666880846024, -0.06...
0.090949
program. ```js try { require('node:vm').runInThisContext('binary ! isNotOk'); } catch (err) { // 'err' will be a SyntaxError. } ``` `SyntaxError` instances are unrecoverable in the context that created them – they may only be caught by other contexts. ## Class: `SystemError` \* Extends: {errors.Error} Node.js generates...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.04694998264312744, 0.03325439617037773, 0.0050604999996721745, 0.030107714235782623, 0.09047097712755203, -0.05614336207509041, -0.0011030883761122823, 0.10608445107936859, 0.011791262775659561, 0.013818138279020786, -0.01088580209761858, 0.016272127628326416, 0.07433000952005386, -0.05...
0.172757
operation expected a file, but the given pathname was a directory. \* `EMFILE` (Too many open files in system): Maximum number of [file descriptors][] allowable on the system has been reached, and requests for another descriptor cannot be fulfilled until at least one has been closed. This is encountered when opening ma...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.045455675572156906, -0.025309303775429726, -0.021494638174772263, -0.013178040273487568, 0.1046394631266594, -0.10728993266820908, -0.03569211810827255, 0.10907094925642014, 0.07354087382555008, 0.06412189453840256, 0.004177632741630077, 0.03204290196299553, -0.005423711147159338, -0.02...
0.199073
this code. This code does not use the regular `ERR\_\*` convention Node.js errors use in order to be compatible with the web platform's `AbortError`. ### `ERR\_ACCESS\_DENIED` A special type of error that is triggered whenever Node.js tries to get access to a resource restricted by the [Permission Model][]. ### `ERR\_A...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.080411896109581, 0.06647758930921555, 0.013404667377471924, 0.055416274815797806, 0.11287738382816315, -0.09904157370328903, 0.053018637001514435, 0.014683492481708527, 0.010033268481492996, -0.04591939225792885, 0.01268809661269188, 0.02381403185427189, 0.03846760466694832, 0.008971942...
0.106196
size is reached when the context is created. ### `ERR\_CPU\_PROFILE\_ALREADY\_STARTED` The CPU profile with the given name is already started. ### `ERR\_CPU\_PROFILE\_NOT\_STARTED` The CPU profile with the given name is not started. ### `ERR\_CPU\_PROFILE\_TOO\_MANY` There are too many CPU profiles being collected. ###...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.011182716116309166, 0.05812237784266472, -0.09189756959676743, 0.07162582129240036, 0.055424537509679794, -0.09152072668075562, -0.06197568029165268, 0.062039997428655624, -0.022503485903143883, -0.09965211153030396, 0.02668803744018078, -0.050896719098091125, -0.0034333516377955675, -0...
0.037503
unknown cipher was specified. ### `ERR\_CRYPTO\_UNKNOWN\_DH\_GROUP` An unknown Diffie-Hellman group name was given. See [`crypto.getDiffieHellman()`][] for a list of valid group names. ### `ERR\_CRYPTO\_UNSUPPORTED\_OPERATION` An attempt to invoke an unsupported crypto operation was made. ### `ERR\_DEBUGGER\_ERROR` An ...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.09884605556726456, 0.0536111481487751, -0.05791372060775757, 0.034581564366817474, 0.03067348524928093, -0.10173151642084122, -0.04368463158607483, -0.05653514713048935, -0.004530230071395636, 0.00980209931731224, 0.08426576852798462, -0.05384346470236778, -0.04596666991710663, 0.041680...
0.050567
`ERR\_HTTP2\_CONNECT\_PATH` For HTTP/2 requests using the `CONNECT` method, the `:path` pseudo-header is forbidden. ### `ERR\_HTTP2\_CONNECT\_SCHEME` For HTTP/2 requests using the `CONNECT` method, the `:scheme` pseudo-header is forbidden. ### `ERR\_HTTP2\_ERROR` A non-specific HTTP/2 error has occurred. ### `ERR\_HTTP...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.043647650629282, -0.012857827357947826, -0.06306590139865875, -0.05229335278272629, -0.0028638625517487526, -0.06277959793806076, -0.017286263406276703, -0.02124519646167755, 0.022597309201955795, 0.03641591593623161, -0.012640094384551048, -0.012793893925845623, 0.009941576048731804, 0...
0.046405
### `ERR\_HTTP2\_SOCKET\_UNBOUND` An attempt was made to use the `socket` property of an `Http2Session` that has already been closed. ### `ERR\_HTTP2\_STATUS\_101` Use of the `101` Informational status code is forbidden in HTTP/2. ### `ERR\_HTTP2\_STATUS\_INVALID` An invalid HTTP status code has been specified. Status ...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.06568393856287003, 0.017818540334701538, -0.04515776410698891, -0.06392990052700043, 0.018977463245391846, -0.06106553599238396, -0.024006372317671776, 0.02215006574988365, 0.02033054269850254, 0.05612141638994217, 0.03689063712954521, 0.02464146725833416, -0.012041039764881134, 0.03980...
0.096003
`ERR\_INSPECTOR\_NOT\_CONNECTED` While using the `node:inspector` module, an attempt was made to use the inspector before it was connected. ### `ERR\_INSPECTOR\_NOT\_WORKER` An API was called on the main thread that can only be used from the worker thread. ### `ERR\_INTERNAL\_ASSERTION` There was a bug in Node.js or in...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.10321997106075287, 0.045243438333272934, -0.016017595306038857, 0.0679735392332077, 0.06855779141187668, -0.0869818925857544, -0.04743414372205734, -0.04184100404381752, 0.062320467084646225, -0.010941682383418083, -0.04606049880385399, 0.01768733188509941, -0.005116576328873634, -0.001...
0.119568
to return a promise. ### `ERR\_INVALID\_STATE` Indicates that an operation cannot be completed due to an invalid state. For instance, an object may have already been destroyed, or may be performing another operation. ### `ERR\_INVALID\_SYNC\_FORK\_INPUT` A `Buffer`, `TypedArray`, `DataView`, or `string` was provided as...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.11484553664922714, 0.02760939672589302, 0.0035225767642259598, 0.0180983766913414, -0.013695423491299152, -0.029735879972577095, 0.0028440963942557573, 0.018846338614821434, 0.02259211800992489, -0.028716454282402992, -0.052199266850948334, 0.03663220256567001, -0.05172374099493027, -0....
0.09526
an encrypted key without specifying a passphrase. ### `ERR\_MISSING\_PLATFORM\_FOR\_WORKER` The V8 platform used by this instance of Node.js does not support creating Workers. This is caused by lack of embedder support for Workers. In particular, this error will not occur with standard builds of Node.js. ### `ERR\_MODU...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.12106373906135559, 0.004479990340769291, -0.004442836623638868, 0.051888663321733475, 0.07398826628923416, -0.03665214031934738, -0.02031564526259899, 0.03331628441810608, 0.022438252344727516, -0.061211492866277695, -0.027115851640701294, 0.0016683292342349887, 0.028584271669387817, -0...
0.055071
### `ERR\_PERFORMANCE\_MEASURE\_INVALID\_OPTIONS` Invalid options were provided for a performance measure. ### `ERR\_PROTO\_ACCESS` Accessing `Object.prototype.\_\_proto\_\_` has been forbidden using [`--disable-proto=throw`][]. [`Object.getPrototypeOf`][] and [`Object.setPrototypeOf`][] should be used to get and set t...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.08355990052223206, 0.02321825921535492, -0.043979354202747345, -0.055457476526498795, -0.021029038354754448, -0.06966565549373627, 0.02559809572994709, 0.07708916068077087, -0.09507428854703903, 0.0689391940832138, -0.017650246620178223, -0.04382307827472687, -0.025836776942014694, 0.01...
0.074087
an already connected socket. ### `ERR\_SOCKET\_DGRAM\_NOT\_CONNECTED` A [`dgram.disconnect()`][] or [`dgram.remoteAddress()`][] call was made on a disconnected socket. ### `ERR\_SOCKET\_DGRAM\_NOT\_RUNNING` A call was made and the UDP subsystem was not running. ### `ERR\_SOURCE\_MAP\_CORRUPT` The source map could not b...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.07383225858211517, -0.08070523291826248, -0.030259905382990837, -0.022892219945788383, 0.01933380588889122, -0.06583426147699356, 0.0220684502273798, 0.021618932485580444, -0.07191578298807144, 0.006290351506322622, 0.02628200873732567, -0.02645575813949108, 0.045319605618715286, -0.051...
0.092632
this case, the server must also abort the connection. ### `ERR\_TLS\_INVALID\_CONTEXT` The context must be a `SecureContext`. ### `ERR\_TLS\_INVALID\_PROTOCOL\_METHOD` The specified `secureProtocol` method is invalid. It is either unknown, or disabled because it is insecure. ### `ERR\_TLS\_INVALID\_PROTOCOL\_VERSION` V...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.03217427060008049, 0.04982037842273712, -0.08798035234212875, -0.017745651304721832, -0.04381272941827774, -0.05296296998858452, 0.00864142831414938, -0.028529765084385872, 0.04191206395626068, 0.017632704228162766, 0.03511849418282509, -0.023358598351478577, 0.04746083542704582, 0.0657...
-0.012657
resolve an invalid module referrer. This can happen when importing or calling `import.meta.resolve()` with either: \* a bare specifier that is not a builtin module from a module whose URL scheme is not `file`. \* a [relative URL][] from a module whose URL scheme is not a [special scheme][]. ```mjs try { // Trying to im...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.08350694179534912, -0.020913608372211456, 0.03461161628365517, 0.04035014286637306, 0.07579096406698227, -0.029300766065716743, -0.02118854783475399, 0.11379457265138626, -0.022903243079781532, -0.008898145519196987, -0.0274151973426342, -0.0023813855368644, -0.02645513042807579, 0.0737...
0.037758
stream. ### `HPE\_CHUNK\_EXTENSIONS\_OVERFLOW` Too much data was received for a chunk extensions. In order to protect against malicious or malconfigured clients, if more than 16 KiB of data is received then an `Error` with this code will be emitted. ### `HPE\_HEADER\_OVERFLOW` Too much HTTP header data was received. In...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.08736814558506012, 0.06356387585401535, -0.0035429755225777626, -0.054136134684085846, 0.03324132040143013, -0.09760478138923645, -0.0421026237308979, 0.03822614252567291, -0.00588985113427043, 0.004015996586531401, 0.0004243448202032596, -0.025194261223077774, -0.03063340112566948, -0....
0.052454
`ERR\_MANIFEST\_INTEGRITY\_MISMATCH` An attempt was made to load a policy manifest, but the manifest had multiple entries for a resource which did not match each other. Update the manifest entries to match in order to resolve this error. See the documentation for policy manifests for more information. ### `ERR\_MANIFES...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.025755105540156364, -0.015120644122362137, 0.07755787670612335, -0.060312118381261826, 0.034010812640190125, -0.04664720967411995, 0.08414267748594284, -0.02852301299571991, -0.04140939190983772, 0.029199441894888878, 0.03026966191828251, -0.06327754259109497, 0.017898423597216606, 0.03...
0.054154
non-specific way. ### `ERR\_TRANSFERRING\_EXTERNALIZED\_SHAREDARRAYBUFFER` A `SharedArrayBuffer` whose memory is not managed by the JavaScript engine or by Node.js was encountered during serialization. Such a `SharedArrayBuffer` cannot be serialized. This can only happen when native addons create `SharedArrayBuffer`s i...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.0043953172862529755, -0.04391298070549965, -0.04925059899687767, 0.03599220886826515, 0.01692134328186512, 0.006398344412446022, -0.016626060009002686, 0.024246810004115105, -0.01688532531261444, -0.02864806167781353, -0.0827975943684578, 0.05425751209259033, -0.057881180197000504, 0.02...
0.126042
The certificate notBefore field contains an invalid time. #### `ERROR\_IN\_CERT\_NOT\_AFTER\_FIELD` The certificate notAfter field contains an invalid time. #### `ERROR\_IN\_CRL\_LAST\_UPDATE\_FIELD` The CRL lastUpdate field contains an invalid time. #### `ERROR\_IN\_CRL\_NEXT\_UPDATE\_FIELD` The CRL nextUpdate field c...
https://github.com/nodejs/node/blob/main//doc/api/errors.md
main
nodejs
[ -0.04369216412305832, 0.07841688394546509, -0.02744344063103199, -0.02096986025571823, 0.0002901491825468838, -0.028785238042473793, -0.034561872482299805, 0.030512670055031776, 0.060846488922834396, -0.014683051966130733, 0.038963332772254944, -0.041566770523786545, 0.08941543847322464, 0...
-0.017876
# Modules: CommonJS modules > Stability: 2 - Stable CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the [ECMAScript modules][] standard used by browsers and other JavaScript runtimes. In Node.js, each file is treated as a separate module. For example, consider a file ...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.06691720336675644, -0.03138328716158867, -0.06275985389947891, 0.035192977637052536, 0.10024439543485641, -0.07523903250694275, -0.021385211497545242, 0.07603301107883453, 0.04074399173259735, -0.08752841502428055, -0.003419172950088978, 0.10602999478578568, 0.014731495641171932, -0.014...
0.118993
run by `require('./foo')`. When the entry point is not a CommonJS module, `require.main` is `undefined`, and the main module is out of reach. ## Package manager tips The semantics of the Node.js `require()` function were designed to be general enough to support reasonable directory structures. Package manager programs ...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.10264954715967178, -0.041541773825883865, 0.06899230182170868, 0.005314739421010017, 0.1156504899263382, -0.052568137645721436, -0.038669880479574203, 0.00287651433609426, 0.038403939455747604, -0.05555387958884239, 0.021369226276874542, 0.06982244551181793, -0.01484702993184328, 0.0201...
0.022552
y) { this.x = x; this.y = y; } } ``` A CommonJS module can load them with `require()`: ```cjs const distance = require('./distance.mjs'); console.log(distance); // [Module: null prototype] { // distance: [Function: distance] // } const point = require('./point.mjs'); console.log(point); // [Module: null prototype] { //...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.11176524311304092, -0.015322253108024597, -0.010198231786489487, 0.009793155826628208, 0.031966641545295715, -0.030169621109962463, 0.011579148471355438, 0.03654399514198303, 0.014128472656011581, -0.07141111046075821, 0.05209651216864586, -0.015687117353081703, -0.029851024970412254, 0...
0.140454
`require.resolve()` function. Putting together all of the above, here is the high-level algorithm in pseudocode of what `require()` does: ```text require(X) from module at path Y 1. If X is a core module, a. return the core module b. STOP 2. If X begins with '/' a. set Y to the file system root 3. If X is equal to '.',...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.1052820160984993, -0.03379833698272705, 0.01657370664179325, 0.004877648316323757, 0.07055217027664185, -0.06387032568454742, 0.03593612462282181, 0.022664429619908333, -0.06257795542478561, -0.040598202496767044, 0.01057346723973751, 0.007153186481446028, 0.015068372711539268, -0.01710...
0.071311
a @scope/ prefix and the subpath begins with a slash (`/`). 2. If X does not match this pattern or DIR/NAME/package.json is not a file, return. 3. Parse DIR/NAME/package.json, and look for "exports" field. 4. If "exports" is null or undefined, return. 5. If `--no-require-module` is not enabled a. let CONDITIONS = ["nod...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.08199312537908554, -0.022514736279845238, 0.04334390163421631, -0.0020124909933656454, 0.06836909055709839, -0.06415118277072906, -0.03804559260606766, 0.03628956899046898, -0.022839277982711792, -0.011207972653210163, 0.007158210035413504, -0.008495221845805645, -0.03868957236409187, 0...
0.060217
packages that already have taken the name. Currently the built-in modules that requires the `node:` prefix are: \* [`node:sea`][] \* [`node:sqlite`][] \* [`node:test`][] \* [`node:test/reporters`][] The list of these modules is exposed in [`module.builtinModules`][], including the prefix. ## Cycles When there are circu...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.09495173394680023, -0.0316164493560791, -0.03596206381917, 0.032675519585609436, 0.08272676914930344, -0.0818784087896347, -0.002071094000712037, -0.009502215310931206, 0.015789605677127838, -0.04885512962937355, 0.016839973628520966, 0.04429952800273895, 0.007378973998129368, -0.002430...
0.072855
to load an `index.js` or `index.node` file out of that directory. For example, if there was no [`package.json`][] file in the previous example, then `require('./some-library')` would attempt to load: \* `./some-library/index.js` \* `./some-library/index.node` If these attempts fail, then Node.js will report the entire ...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.10183996707201004, -0.03538057208061218, 0.012992084957659245, 0.04386312514543533, 0.11858982592821121, -0.03482399508357048, -0.01817261055111885, 0.027548708021640778, 0.022779574617743492, -0.0657825842499733, -0.00044654987868852913, 0.06937256455421448, -0.008581234142184258, 0.05...
0.039377
the module. \* The convenience variables `\_\_filename` and `\_\_dirname`, containing the module's absolute filename and directory path. ## The module scope ### `\_\_dirname` \* Type: {string} The directory name of the current module. This is the same as the [`path.dirname()`][] of the [`\_\_filename`][]. Example: runn...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.0779617503285408, 0.008361966349184513, 0.0006171846762299538, 0.01502278447151184, 0.08029352873563766, -0.044105589389801025, -0.011871200986206532, 0.12362385541200638, 0.054108474403619766, -0.037632640451192856, 0.07096832990646362, 0.08253882080316544, 0.020848887041211128, 0.0148...
0.116399
better ways to do this, such as loading modules via some other Node.js program, or compiling them to JavaScript ahead of time. Avoid using `require.extensions`. Use could cause subtle bugs and resolving the extensions gets slower with each registered extension. #### `require.main` \* Type: {module | undefined} The `Mod...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.03559013828635216, -0.023179206997156143, 0.005690163467079401, 0.05081737041473389, 0.09129868447780609, -0.02498256042599678, -0.06785064190626144, 0.09497463703155518, 0.02461978606879711, -0.046524230390787125, -0.042397625744342804, 0.0772644579410553, -0.029581991955637932, 0.0069...
-0.015878
`exports`, it is no longer bound to `module.exports`: ```js module.exports.hello = true; // Exported from require of module exports = { hello: false }; // Not exported, only available in the module ``` When the `module.exports` property is being completely replaced by a new object, it is common to also reassign `export...
https://github.com/nodejs/node/blob/main//doc/api/modules.md
main
nodejs
[ -0.09440815448760986, 0.0036945012398064137, 0.026831353083252907, 0.0783105418086052, 0.058473702520132065, -0.034891705960035324, -0.029649006202816963, -0.008289255201816559, 0.04931367561221123, -0.05189351364970207, 0.025201614946126938, 0.08625528216362, -0.044444404542446136, 0.0107...
0.069088
# Query string > Stability: 2 - Stable The `node:querystring` module provides utilities for parsing and formatting URL query strings. It can be accessed using: ```js const querystring = require('node:querystring'); ``` `querystring` is more performant than {URLSearchParams} but is not a standardized API. Use {URLSearch...
https://github.com/nodejs/node/blob/main//doc/api/querystring.md
main
nodejs
[ -0.048644568771123886, 0.027213305234909058, 0.0035046301782131195, 0.07160233706235886, -0.057916104793548584, -0.02534446492791176, -0.038168713450431824, 0.08668124675750732, 0.034214846789836884, -0.06537166982889175, -0.08898723125457764, 0.05048222094774246, 0.019994717091321945, -0....
0.084473
The `querystring.unescape()` method performs decoding of URL percent-encoded characters on the given `str`. The `querystring.unescape()` method is used by `querystring.parse()` and is generally not expected to be used directly. It is exported primarily to allow application code to provide a replacement decoding impleme...
https://github.com/nodejs/node/blob/main//doc/api/querystring.md
main
nodejs
[ -0.047207314521074295, 0.024064015597105026, -0.013092556037008762, 0.05069391801953316, -0.05869501456618309, -0.07120076566934586, -0.02822227217257023, 0.036380913108587265, 0.07973242551088333, -0.07109981775283813, -0.022132284939289093, 0.04757248982787132, -0.03349994122982025, -0.0...
0.023263
# Timers > Stability: 2 - Stable The `timer` module exposes a global API for scheduling functions to be called at some future period of time. Because the timer functions are globals, there is no need to call `require('node:timers')` to use the API. The timer functions within Node.js implement a similar API as the timer...
https://github.com/nodejs/node/blob/main//doc/api/timers.md
main
nodejs
[ -0.09082208573818207, 0.027707358822226524, 0.01752338372170925, 0.10213161259889603, 0.05979125201702118, -0.045130930840969086, 0.007935401983559132, 0.0034078152384608984, 0.08811315894126892, -0.01686895452439785, -0.03673655167222023, 0.07841208577156067, -0.0355905257165432, -0.01711...
0.13158
running, the process may exit before the `Timeout` object's callback is invoked. Calling `timeout.unref()` multiple times will have no effect. ### `timeout[Symbol.toPrimitive]()` \* Returns: {integer} a number that can be used to reference this `timeout` Coerce a `Timeout` to a primitive. The primitive can be used to c...
https://github.com/nodejs/node/blob/main//doc/api/timers.md
main
nodejs
[ -0.048878319561481476, 0.047176092863082886, -0.0020248843356966972, 0.07504799216985703, 0.0541132315993309, -0.030131125822663307, 0.0020039239898324013, 0.0034817024134099483, 0.10969088971614838, -0.01395130343735218, -0.06321832537651062, 0.10032439976930618, -0.05321147292852402, -0....
0.137802
used to cancel the timer and prevent it from triggering. For the promisified variants of [`setImmediate()`][] and [`setTimeout()`][], an [`AbortController`][] may be used to cancel the timer. When canceled, the returned Promises will be rejected with an `'AbortError'`. For `setImmediate()`: ```mjs import { setImmediate...
https://github.com/nodejs/node/blob/main//doc/api/timers.md
main
nodejs
[ -0.06759874522686005, 0.05300980806350708, 0.022177787497639656, 0.08902863413095474, 0.04054546728730202, 0.041108570992946625, 0.00176405836828053, 0.07190489023923874, 0.09765051305294037, -0.003147051203995943, 0.01618345081806183, 0.02522881329059601, 0.02424660511314869, -0.039044197...
0.096801
interval of `delay` ms. If `ref` is `true`, you need to call `next()` of async iterator explicitly or implicitly to keep the event loop alive. \* `delay` {number} The number of milliseconds to wait between iterations. \*\*Default:\*\* `1`. \* `value` {any} A value with which the iterator returns. \* `options` {Object} ...
https://github.com/nodejs/node/blob/main//doc/api/timers.md
main
nodejs
[ -0.03943680226802826, 0.0513380765914917, 0.007953829132020473, 0.09637946635484695, -0.018323002383112907, 0.0016992627643048763, 0.008567307144403458, 0.051167454570531845, 0.08402968943119049, -0.06485089659690857, -0.03827589750289917, 0.009416049346327782, -0.021657198667526245, -0.03...
0.05271
# Diagnostics Channel > Stability: 2 - Stable The `node:diagnostics\_channel` module provides an API to create named channels to report arbitrary message data for diagnostics purposes. It can be accessed using: ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; ``` ```cjs const diagnostics\_channel = ...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.009241531603038311, -0.025852924212813377, -0.0759783387184143, 0.07378707826137543, 0.027643177658319473, -0.059041038155555725, 0.0448746532201767, 0.10415211319923401, -0.013999151065945625, -0.05216115340590477, -0.015063857659697533, 0.009031165391206741, 0.05785708501935005, 0.043...
0.177936
onMessage)` \* `name` {string|symbol} The channel name \* `onMessage` {Function} The previous subscribed handler to remove \* Returns: {boolean} `true` if the handler was found, `false` otherwise. Remove a message handler previously registered to this channel with [`diagnostics\_channel.subscribe(name, onMessage)`][]. ...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.015696672722697258, 0.012686003930866718, 0.06568972021341324, 0.07390378415584564, 0.06399331241846085, -0.051089271903038025, 0.08446679264307022, -0.024296069517731667, 0.051017872989177704, -0.04683621972799301, -0.01111337635666132, -0.010892672464251518, 0.03546389937400818, 0.053...
0.106469
[`channel.subscribe(onMessage)`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channel = diagnostics\_channel.channel('my-channel'); function onMessage(message, name) { // Received data } channel.subscribe(onMessage); channel.unsubscribe(onMessage); ``` ```cjs const diagnostics\_channel ...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.027331670746207237, 0.0059219710528850555, -0.01662508025765419, 0.07660141587257385, 0.003697879845276475, -0.058790020644664764, 0.03768095001578331, 0.016802987083792686, 0.04114677011966705, -0.03676818683743477, -0.0030251620337367058, -0.018026798963546753, 0.03597182035446167, 0....
0.072562
Channels][] which together express a single traceable action. It is used to formalize and simplify the process of producing events for tracing application flow. [`diagnostics\_channel.tracingChannel()`][] is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a single `TracingC...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.04567486420273781, -0.0801306664943695, -0.04236514866352081, 0.05546174943447113, 0.024123255163431168, -0.08538969606161118, 0.05832347273826599, 0.04175044968724251, 0.035881370306015015, -0.04662267491221428, -0.04864620044827461, 0.03671908751130104, -0.03644036129117012, 0.0284161...
0.194664
diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.traceSync(() => { // Do something }, { some: 'thing', }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.05445696413516998, -0.003521126927807927, 0.022117234766483307, 0.07312453538179398, 0.03680552914738655, -0.05819477513432503, 0.09804634749889374, 0.03896874934434891, 0.0010853129206225276, -0.055606164038181305, -0.06030553951859474, -0.005484003573656082, -0.07960300147533417, 0.04...
0.119177
some: 'thing', }, thisArg, arg1, callback); ``` The callback will also be run with [`channel.runStores(context, ...)`][] which enables context loss recovery in some cases. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; import { AsyncLocalStorage } from 'node:async\_hooks'; const channels = diagnos...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.03620843216776848, -0.01808503456413746, -0.0624241828918457, 0.12299368530511856, -0.020552538335323334, -0.012959684245288372, 0.05043817311525345, 0.048081714659929276, -0.022038299590349197, -0.03126592934131622, -0.04095916077494621, 0.0711575299501419, 0.0042105973698198795, -0.05...
0.021339
when the promise returned not when the function itself makes a return statement internally. At this point, if the traced function was synchronous the `result` field will be set to the return value of the function. Alternatively, the `error` field may be present to represent any thrown errors. It is recommended to liste...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.10549210011959076, 0.007145682815462351, -0.023309271782636642, 0.1180427074432373, 0.0359506756067276, -0.024043213576078415, -0.019735677167773247, 0.011331820860505104, 0.08902622759342194, -0.03596304729580879, -0.02554023638367653, 0.03182360529899597, -0.023716464638710022, -0.073...
0.030864
a request object. Unlike `http.client.request.start`, this event is emitted before the request has been sent. ##### Event: `'http.client.request.start'` \* `request` {http.ClientRequest} Emitted when client starts a request. ##### Event: `'http.client.request.error'` \* `request` {http.ClientRequest} \* `error` {Error}...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.0964193269610405, 0.027236049994826317, 0.03928513079881668, 0.01314580999314785, -0.014025992713868618, -0.09801192581653595, 0.0029606667812913656, 0.007191888988018036, 0.11315983533859253, 0.05582233518362045, -0.05831768736243248, 0.0398043729364872, -0.019848454743623734, 0.017868...
0.083682
the following properties \* `id` Argument passed to `import()`. Module name. \* `parentURL` URL object of the module that attempted to import(id). Emitted when `import()` is invoked. See [`asyncStart` event][]. ##### Event: `'module.import.asyncEnd'` \* `event` {Object} containing the following properties \* `id` Argum...
https://github.com/nodejs/node/blob/main//doc/api/diagnostics_channel.md
main
nodejs
[ -0.09813693910837173, 0.017105428501963615, -0.055053554475307465, 0.08415614813566208, 0.0713711678981781, -0.04285237565636635, 0.011977644637227058, 0.0037819265853613615, 0.00712566077709198, -0.031740378588438034, 0.04218985140323639, -0.022183099761605263, 0.016706444323062897, 0.043...
0.062307
# TTY > Stability: 2 - Stable The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module directly. However, it can be accessed using: ```js const tty = require('node:tty'); ``` When Node.js detects that it is being run with a...
https://github.com/nodejs/node/blob/main//doc/api/tty.md
main
nodejs
[ 0.01936916634440422, -0.03535817563533783, -0.04614942520856857, 0.028719071298837662, 0.04027513787150383, -0.03305881470441818, -0.04877490550279617, 0.04630224034190178, 0.01012741681188345, -0.01798398233950138, -0.057235997170209885, 0.06595499813556671, -0.014969916082918644, -0.0317...
0.132572
identified by `dir`. ### `writeStream.clearScreenDown([callback])` \* `callback` {Function} Invoked once the operation completes. \* Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. `writeStre...
https://github.com/nodejs/node/blob/main//doc/api/tty.md
main
nodejs
[ -0.036973606795072556, -0.03610604628920555, -0.05888062343001366, 0.0029515025671571493, -0.029623009264469147, -0.09290022403001785, 0.018407117575407028, 0.03457516431808472, 0.05147507041692734, -0.016163138672709465, 0.0027441808488219976, 0.10322585701942444, -0.03476015478372574, -0...
0.075554
the TTY currently has. This property is updated whenever the `'resize'` event is emitted. ## `tty.isatty(fd)` \* `fd` {number} A numeric file descriptor \* Returns: {boolean} The `tty.isatty()` method returns `true` if the given `fd` is associated with a TTY and `false` if it is not, including whenever `fd` is not a no...
https://github.com/nodejs/node/blob/main//doc/api/tty.md
main
nodejs
[ 0.01507151871919632, 0.014038010500371456, -0.052811745554208755, 0.011127212084829807, -0.01674763485789299, -0.032929711043834686, 0.017448250204324722, 0.07599947601556778, 0.0040200804360210896, 0.03167560696601868, 0.024265026673674583, 0.056477416306734085, -0.05679778754711151, 0.01...
0.136731
# QUIC > Stability: 1.0 - Early development The 'node:quic' module provides an implementation of the QUIC protocol. To access it, start Node.js with the `--experimental-quic` option and: ```mjs import quic from 'node:quic'; ``` ```cjs const quic = require('node:quic'); ``` The module is only available under the `node:`...
https://github.com/nodejs/node/blob/main//doc/api/quic.md
main
nodejs
[ -0.10465363413095474, 0.038273416459560394, -0.026412133127450943, -0.003570828353986144, -0.015087447129189968, -0.07107565551996231, 0.06489947438240051, 0.08157005906105042, 0.043938908725976944, 0.062338732182979584, -0.01595655083656311, 0.0032082137186080217, -0.04788386449217796, 0....
0.082494
Type: {Promise} A promise that is fulfilled when the endpoint is destroyed. This will be the same promise that is returned by the `endpoint.close()` function. Read only. ### `endpoint.closing` \* Type: {boolean} True if `endpoint.close()` has been called and closing the endpoint has not yet completed. Read only. ### `e...
https://github.com/nodejs/node/blob/main//doc/api/quic.md
main
nodejs
[ -0.08111540228128433, 0.0667126327753067, -0.01731213368475437, 0.04387439042329788, 0.03692003712058067, -0.08252573013305664, 0.019053291529417038, 0.07833605259656906, 0.10864067822694778, 0.07391189783811569, -0.06899839639663696, 0.055728979408741, -0.06618078798055649, 0.003291012253...
0.12654
invoke when a new session ticket is received. Read/write. ### `session.onversionnegotiation` \* Type: {quic.OnVersionNegotiationCallback} The callback to invoke when a version negotiation is initiated. Read/write. ### `session.onhandshake` \* Type: {quic.OnHandshakeCallback} The callback to invoke when the TLS handshak...
https://github.com/nodejs/node/blob/main//doc/api/quic.md
main
nodejs
[ -0.08532404899597168, 0.09506604075431824, -0.010834909044206142, -0.06412782520055771, -0.04864255338907242, -0.10161150246858597, 0.060744233429431915, 0.035554833710193634, 0.07475508004426956, 0.10248174518346786, -0.054528653621673584, -0.037734683603048325, -0.03194177523255348, 0.05...
0.010542
instance. #### `endpointOptions.address` \* Type: {net.SocketAddress | string} The local UDP address and port the endpoint should bind to. If not specified the endpoint will bind to IPv4 `localhost` on a random port. #### `endpointOptions.addressLRUSize` \* Type: {bigint|number} The endpoint maintains an internal cache...
https://github.com/nodejs/node/blob/main//doc/api/quic.md
main
nodejs
[ 0.005155532155185938, 0.011754482984542847, -0.011110527440905571, -0.0341971218585968, -0.05964512750506401, -0.00852652732282877, -0.035163313150405884, -0.0015082621248438954, -0.028381437063217163, 0.04899105429649353, -0.03459746763110161, 0.06785161793231964, -0.051442813128232956, -...
0.039811
True to enable TLS tracing output. #### `sessionOptions.transportParams` \* Type: {quic.TransportParams} The QUIC transport parameters to use for the session. #### `sessionOptions.unacknowledgedPacketThreshold` \* Type: {bigint|number} Specifies the maximum number of unacknowledged packets a session should allow. #### ...
https://github.com/nodejs/node/blob/main//doc/api/quic.md
main
nodejs
[ -0.06583455950021744, 0.07382206618785858, -0.015618949197232723, -0.008846431039273739, 0.03193772956728935, -0.0920185074210167, 0.11451081186532974, 0.015050799585878849, 0.005815199576318264, 0.0760764554142952, -0.006449172738939524, -0.06889301538467407, -0.007799649611115456, 0.0774...
-0.036675
# C++ embedder API Node.js provides a number of C++ APIs that can be used to execute JavaScript in a Node.js environment from other C++ software. The documentation for these APIs can be found in [src/node.h][] in the Node.js source tree. In addition to the APIs exposed by Node.js, some required concepts are provided by...
https://github.com/nodejs/node/blob/main//doc/api/embedding.md
main
nodejs
[ -0.07510527223348618, -0.033505767583847046, 0.09608617424964905, 0.02464737556874752, 0.11644420027732849, -0.01335647888481617, -0.14083488285541534, 0.06871029734611511, 0.015714965760707855, -0.03817690908908844, -0.04204577952623367, 0.047254353761672974, 0.012132825329899788, -0.0825...
0.081451
RunNodeInstance(MultiIsolatePlatform* platform, const std::vector& args, const std::vector& exec_args) { int exit_code = 0; // Setup up a libuv event loop, v8::Isolate, and Node.js Environment. std::vector errors; std::unique_ptr setup = CommonEnvironmentSetup::Create(platform, &errors, args, exec_args); if (!setup) { ...
https://github.com/nodejs/node/blob/main//doc/api/embedding.md
main
nodejs
[ -0.016795538365840912, 0.032813481986522675, -0.06207776442170143, -0.02085106633603573, 0.06370922923088074, -0.04375762492418289, -0.05402105301618576, 0.06271965056657791, -0.045160528272390366, -0.07167959958314896, 0.009374924935400486, -0.07161810249090195, -0.019243184477090836, -0....
0.035335
# HTTPS > Stability: 2 - Stable HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module. ## Determining if crypto support is unavailable It is possible for Node.js to be built without including support for the `node:crypto` module. In such cases, attempting to `import` from `https` ...
https://github.com/nodejs/node/blob/main//doc/api/https.md
main
nodejs
[ -0.06304945796728134, -0.01270033698529005, 0.0059420643374323845, 0.04362523555755615, 0.09922359138727188, -0.057515084743499756, -0.06254534423351288, 0.003107793629169464, 0.011350040324032307, -0.014357635751366615, -0.020439041778445244, 0.04316488653421402, 0.025290625169873238, 0.0...
0.07366
[`server.maxHeadersCount`][] in the `node:http` module. ### `server.requestTimeout` \* Type: {number} \*\*Default:\*\* `300000` See [`server.requestTimeout`][] in the `node:http` module. ### `server.setTimeout([msecs][, callback])` \* `msecs` {number} \*\*Default:\*\* `120000` (2 minutes) \* `callback` {Function} \* Re...
https://github.com/nodejs/node/blob/main//doc/api/https.md
main
nodejs
[ -0.03853214904665947, 0.06899458914995193, -0.03815263882279396, 0.058922622352838516, -0.0043250988237559795, -0.07532894611358643, -0.08792275190353394, -0.011803362518548965, 0.10849866271018982, 0.003958337474614382, -0.017897194251418114, 0.011428585276007652, -0.010182015597820282, -...
0.067354
with [`new URL()`][]. If it is a [`URL`][] object, it will be automatically converted to an ordinary `options` object. `https.request()` returns an instance of the [`http.ClientRequest`][] class. The `ClientRequest` instance is a writable stream. If one needs to upload a file with a POST request, then write to the `Cli...
https://github.com/nodejs/node/blob/main//doc/api/https.md
main
nodejs
[ -0.055004000663757324, 0.07575953751802444, 0.0005284218350425363, -0.007227678783237934, -0.004727022722363472, -0.11024056375026703, -0.04277771711349487, 0.03800186142325401, 0.02723696455359459, 0.01303104404360056, -0.07248803228139877, 0.05020234361290932, -0.0049624075181782246, -0....
-0.035492
{ return crypto.createHash('sha256').update(s).digest('base64'); } const options = { hostname: 'github.com', port: 443, path: '/', method: 'GET', checkServerIdentity: function(host, cert) { // Make sure the certificate is issued to the host we are connected to const err = tls.checkServerIdentity(host, cert); if (err) {...
https://github.com/nodejs/node/blob/main//doc/api/https.md
main
nodejs
[ 0.0028057023882865906, 0.06581457704305649, -0.06487499922513962, -0.04171067848801613, 0.0381137989461422, -0.0485343262553215, -0.06811819970607758, -0.027205226942896843, 0.06658271700143814, -0.0016976820770651102, 0.000812129583209753, -0.011280081234872341, 0.024835294112563133, -0.0...
-0.06368
# Domain > Stability: 0 - Deprecated \*\*This module is pending deprecation.\*\* Once a replacement API has been finalized, this module will be fully deprecated. Most developers should \*\*not\*\* have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the...
https://github.com/nodejs/node/blob/main//doc/api/domain.md
main
nodejs
[ -0.08889972418546677, -0.0369335412979126, 0.05813979730010033, 0.049105025827884674, 0.07885585725307465, -0.14039765298366547, 0.0075292522087693214, -0.0016913411673158407, 0.10380326211452484, -0.06864293664693832, -0.055325694382190704, 0.04966561123728752, 0.004492681939154863, -0.01...
0.128622
domain = require('node:domain'); // See the cluster documentation for more details about using // worker processes to serve requests. How it works, caveats, etc. const server = require('node:http').createServer((req, res) => { const d = domain.create(); d.on('error', (er) => { console.error(`error ${er.stack}`); // We'...
https://github.com/nodejs/node/blob/main//doc/api/domain.md
main
nodejs
[ -0.055287186056375504, -0.014301184564828873, -0.012959843501448631, 0.0375419557094574, 0.021011993288993835, -0.08765923976898193, -0.08716379851102829, 0.015375681221485138, 0.03347020223736763, 0.02706310898065567, -0.07581637054681778, 0.01896572858095169, -0.03161480277776718, -0.036...
0.124142
to some other domain. For example, there could be one domain in use for an HTTP server, but perhaps we would like to have a separate domain to use for each request. That is possible via explicit binding. ```js // Create a top-level domain for the server const domain = require('node:domain'); const http = require('node:...
https://github.com/nodejs/node/blob/main//doc/api/domain.md
main
nodejs
[ -0.10885162651538849, -0.032287053763866425, -0.030565114691853523, -0.025641456246376038, -0.04736052080988884, -0.09787584841251373, -0.06428314000368118, 0.03473038226366043, 0.07526900619268417, 0.022737273946404457, -0.09724676609039307, -0.011758663691580296, 0.02010137028992176, 0.0...
-0.006754
a domain. If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. Calling `exit()` changes only the active domain, and does not alter the domain itself. `enter()` and `exit()` can be called an arbitrary number of times on a single domain. #...
https://github.com/nodejs/node/blob/main//doc/api/domain.md
main
nodejs
[ -0.06590251624584198, 0.011794278398156166, -0.03759453073143959, 0.006501965224742889, 0.03106572851538658, -0.13001324236392975, -0.02843768335878849, 0.05966075137257576, 0.09302151203155518, -0.012379049323499203, -0.04196581989526749, 0.06949431449174881, 0.013186310417950153, -0.0558...
0.10338
# DNS > Stability: 2 - Stable The `node:dns` module enables name resolution. For example, use it to look up IP addresses of host names. Although named for the [Domain Name System (DNS)][], it does not always use the DNS protocol for lookups. [`dns.lookup()`][] uses the operating system facilities to perform name resolu...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.09178681671619415, 0.039951641112565994, -0.017105553299188614, -0.03432729095220566, -0.058179836720228195, -0.12533076107501984, -0.09614711999893188, 0.022721391171216965, 0.06766930967569351, -0.017879022285342216, -0.05619112774729729, 0.025395317003130913, -0.017651211470365524, -...
0.072842
to the default and the operating system will choose a local address automatically. The resolver will use the v4 local address when making requests to IPv4 DNS servers, and the v6 local address when making requests to IPv6 DNS servers. The `rrtype` of resolution requests has no impact on the local address used. ## `dns....
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.057513974606990814, 0.031081801280379295, -0.008408588357269764, -0.01532235462218523, -0.07321179658174515, -0.03413308784365654, -0.11019598692655563, 0.0021360847167670727, 0.03519793599843979, -0.022697098553180695, -0.05392317473888397, 0.08207802474498749, -0.06703896820545197, 0....
-0.032501
vice versa. This implementation can have subtle but important consequences on the behavior of any Node.js program. Please take some time to consult the [Implementation considerations section][] before using `dns.lookup()`. Example usage: ```mjs import dns from 'node:dns'; const options = { family: 6, hints: dns.ADDRCON...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.09784316271543503, 0.06409601122140884, 0.010722432285547256, -0.010375624522566795, -0.0026671651285141706, -0.07332411408424377, -0.07919023185968399, -0.016100475564599037, 0.0804901048541069, -0.013919224962592125, -0.04235435277223587, 0.07747873663902283, -0.048015348613262177, -0...
0.077452
any records | {Object} | [`dns.resolveAny()`][] | | `'CAA'` | CA authorization records | {Object} | [`dns.resolveCaa()`][] | | `'CNAME'` | canonical name records | {string} | [`dns.resolveCname()`][] | | `'MX'` | mail exchange records | {Object} | [`dns.resolveMx()`][] | | `'NAPTR'` | name authority pointer records | {...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.04583972319960594, 0.03402526676654816, -0.026582788676023483, -0.03358202055096626, -0.10398631542921066, -0.12351109087467194, 0.012407025322318077, 0.030301759019494057, -0.00014300695329438895, 0.05284067615866661, -0.01711537316441536, -0.03698697313666344, 0.0017767887329682708, -...
0.027408
'ns1.example.com', hostmaster: 'admin.example.com', serial: 156696742, refresh: 900, retry: 900, expire: 1800, minttl: 60 } ] ``` DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like [`dns.resolve4()`][], [`dns.resolveMx()`][], and so on. For more details, se...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.025618966668844223, -0.05244479328393936, 0.003600170835852623, -0.013247311115264893, -0.11530359834432602, -0.11588110774755478, -0.04986587539315224, 0.014202524907886982, 0.006118645891547203, 0.027845950797200203, -0.04268753528594971, 0.0001571650500409305, 0.008475559763610363, 0...
0.016047
the `hostname`. The `records` argument passed to the `callback` function is an array of objects with these properties: \* `certUsage` \* `selector` \* `match` \* `data` ```js { certUsage: 3, selector: 1, match: 1, data: [ArrayBuffer] } ``` ## `dns.resolveTxt(hostname, callback)` \* `hostname` {string} \* `callback` {Fu...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.09215357899665833, 0.032296620309352875, -0.027238938957452774, 0.03426157310605049, -0.06389331072568893, -0.10500269383192062, 0.011326603591442108, -0.014309380203485489, 0.08303452283143997, -0.06411682814359665, -0.03536872938275337, 0.02537614107131958, 0.012999460101127625, -0.00...
0.061109
... }); // Alternatively, the same code can be written using async-await style. (async function() { const addresses = await resolver.resolve4('example.org'); })(); ``` The following methods from the `dnsPromises` API are available: \* [`resolver.getServers()`][`dnsPromises.getServers()`] \* [`resolver.resolve()`][`dnsP...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.10093672573566437, 0.0005812039016745985, -0.0044288234785199165, 0.014376447536051273, -0.08340651541948318, -0.07469826936721802, -0.08848337084054947, 0.005550120957195759, 0.03819239139556885, -0.009917770512402058, -0.08472877740859985, -0.030232101678848267, -0.04330119118094444, ...
0.021987
of any Node.js program. Please take some time to consult the [Implementation considerations section][] before using `dnsPromises.lookup()`. Example usage: ```mjs import dns from 'node:dns'; const dnsPromises = dns.promises; const options = { family: 6, hints: dns.ADDRCONFIG | dns.V4MAPPED, }; await dnsPromises.lookup('...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.11451297998428345, 0.07457450032234192, 0.009159551933407784, 0.012133218348026276, -0.009172369726002216, -0.05107474327087402, -0.07662875205278397, 0.013641241006553173, 0.06798076629638672, -0.014029265381395817, -0.057614658027887344, 0.010749436914920807, -0.046594198793172836, -0...
0.054434
DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). ### `dnsPromises.resolve6(hostname[, options])` \* `hostname` {string} Host name to resolve. \* `options` {Object} ...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.10332873463630676, 0.08561532199382782, 0.012632100842893124, 0.023366956040263176, -0.10373546183109283, -0.06355351954698563, -0.038223933428525925, -0.04015595093369484, 0.10531347244977951, 0.0001781437749741599, -0.07498149573802948, 0.005281511228531599, -0.051473554223775864, -0....
0.044231
name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). ### `dnsPromises.resolvePtr(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings containing the r...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.14797872304916382, -0.009745186194777489, 0.02095448598265648, 0.004315012600272894, -0.09497372061014175, -0.11790677160024643, -0.054436542093753815, 0.0007008312968537211, 0.07933284342288971, 0.027642089873552322, -0.02888283133506775, 0.004436846822500229, -0.01075427234172821, 0.0...
0.089575
error codes: \* `dns.NODATA`: DNS server returned an answer with no data. \* `dns.FORMERR`: DNS server claims query was misformatted. \* `dns.SERVFAIL`: DNS server returned general failure. \* `dns.NOTFOUND`: Domain name not found. \* `dns.NOTIMP`: DNS server does not implement the requested operation. \* `dns.REFUSED`...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.0981815755367279, 0.006102076265960932, 0.007328561507165432, -0.00514829671010375, -0.07810145616531372, -0.08603058755397797, -0.06654214859008789, -0.014797547832131386, 0.060655660927295685, 0.05049975961446762, 0.026882354170084, -0.03210870549082756, -0.06686467677354813, 0.021792...
0.044579
[`dnsPromises.resolveSoa()`]: #dnspromisesresolvesoahostname [`dnsPromises.resolveSrv()`]: #dnspromisesresolvesrvhostname [`dnsPromises.resolveTlsa()`]: #dnspromisesresolvetlsahostname [`dnsPromises.resolveTxt()`]: #dnspromisesresolvetxthostname [`dnsPromises.reverse()`]: #dnspromisesreverseip [`dnsPromises.setDefaultR...
https://github.com/nodejs/node/blob/main//doc/api/dns.md
main
nodejs
[ -0.09124112129211426, -0.020182320848107338, 0.016221698373556137, -0.004081826191395521, -0.08933340013027191, -0.06623335927724838, -0.06051096320152283, -0.0348731130361557, 0.019328178837895393, 0.03716874122619629, -0.04556583613157272, -0.024677762761712074, -0.007218879647552967, -0...
0.016017
\* [About this documentation](documentation.md) \* [Usage and example](synopsis.md) --- \* [Assertion testing](assert.md) \* [Asynchronous context tracking](async\_context.md) \* [Async hooks](async\_hooks.md) \* [Buffer](buffer.md) \* [C++ addons](addons.md) \* [C/C++ addons with Node-API](n-api.md) \* [C++ embedder A...
https://github.com/nodejs/node/blob/main//doc/api/index.md
main
nodejs
[ -0.05610283464193344, 0.005751291289925575, -0.09320607781410217, 0.012481228448450565, 0.11613835394382477, -0.049018871039152145, -0.016238989308476448, 0.015952540561556816, -0.010200303979218006, 0.011047476902604103, -0.022399330511689186, -0.04675930365920067, 0.03590492531657219, -0...
0.151398
# Internationalization support Node.js has many features that make it easier to write internationalized programs. Some of them are: \* Locale-sensitive or Unicode-aware functions in the [ECMAScript Language Specification][ECMA-262]: \* [`String.prototype.normalize()`][] \* [`String.prototype.toLowerCase()`][] \* [`Stri...
https://github.com/nodejs/node/blob/main//doc/api/intl.md
main
nodejs
[ -0.031485479325056076, 0.0629584938287735, 0.048401620239019394, -0.053527869284152985, -0.015259780921041965, -0.03734574839472771, -0.043487876653671265, 0.02748791128396988, -0.022838376462459564, -0.000012110474017390516, -0.08654391020536423, -0.055664148181676865, -0.02163679152727127,...
0.119314
require ICU locale data in addition, such as [`Intl.DateTimeFormat`][] \_may\_ be fully or partially supported, depending on the completeness of the ICU data installed on the system. ### Embed a limited set of ICU data (`small-icu`) This option makes the resulting binary link against the ICU library statically, and inc...
https://github.com/nodejs/node/blob/main//doc/api/intl.md
main
nodejs
[ -0.017695924267172813, 0.04489996284246445, 0.022401776164770126, -0.035903509706258774, -0.0023524921853095293, -0.00042127547203563154, -0.08895517140626907, 0.08090120553970337, -0.02109367400407791, -0.04446835443377495, -0.012780158780515194, -0.03743579983711243, -0.059003252536058426,...
0.159371
const hasICU = typeof Intl === 'object'; ``` Alternatively, checking for `process.versions.icu`, a property defined only when ICU is enabled, works too: ```js const hasICU = typeof process.versions.icu === 'string'; ``` To check for support for a non-English locale (i.e. `full-icu` or `system-icu`), [`Intl.DateTimeForm...
https://github.com/nodejs/node/blob/main//doc/api/intl.md
main
nodejs
[ 0.0018702842062339187, 0.03255748376250267, 0.04121194779872894, -0.015445002354681492, 0.008525840938091278, 0.018792767077684402, -0.001061833230778575, 0.0480496883392334, -0.01388009823858738, -0.044414959847927094, -0.05591120198369026, -0.08169420808553696, -0.06116339936852455, 0.02...
0.216826
# Readline > Stability: 2 - Stable The `node:readline` module provides an interface for reading data from a [Readable][] stream (such as [`process.stdin`][]) one line at a time. To use the promise-based APIs: ```mjs import \* as readline from 'node:readline/promises'; ``` ```cjs const readline = require('node:readline/...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.10451702028512955, -0.03343605622649193, -0.05311103165149689, 0.07068569213151932, -0.056227266788482666, -0.024758270010352135, -0.01881655678153038, 0.09285206347703934, 0.004806389566510916, -0.04670833423733711, -0.07913005352020264, 0.08072623610496521, 0.03162518888711929, -0.040...
0.127389
{ console.log(`Received: ${history}`); }); ``` ### Event: `'pause'` The `'pause'` event is emitted when one of the following occur: \* The `input` stream is paused. \* The `input` stream is not paused and receives the `'SIGCONT'` event. (See events [`'SIGTSTP'`][] and [`'SIGCONT'`][].) The listener function is called w...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.02064644545316696, -0.026453569531440735, -0.022535525262355804, 0.002395716728642583, 0.06004054844379425, 0.048531483858823776, 0.05200310796499252, -0.011840025894343853, 0.13300999999046326, -0.08688414841890335, -0.007573368493467569, 0.03002406656742096, -0.07766949385404587, 0.02...
0.109871
The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. ### `rl.getPrompt()` \* Returns: {string} the current prompt string The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. ### `rl.write(data[, key])` \* `data` {string} \* `key` {Object...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ 0.010675773955881596, -0.002881582360714674, -0.07978705316781998, 0.037533409893512726, -0.038863133639097214, 0.012985960580408573, 0.04690112546086311, 0.1044461652636528, 0.005063612014055252, 0.005803459323942661, -0.004595441743731499, -0.015902375802397728, 0.08774515241384506, -0.0...
0.023031
prompt the cursor currently lands on \* `cols` {number} the screen column the cursor currently lands on Returns the real position of the cursor in relation to the input prompt + string. Long input (wrapping) strings, as well as multiple line prompts are included in the calculations. ## Promises API ### Class: `readline...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.09067852050065994, -0.01543011236935854, -0.05948058143258095, 0.022462310269474983, -0.06467960774898529, -0.010036051273345947, 0.05124053731560707, 0.08704999834299088, -0.0036478794645518064, -0.00948759913444519, -0.06031769886612892, -0.02048247493803501, 0.09958657622337341, -0.0...
0.094027
the cursor \_relative\_ to its current position in the associated `stream`. Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. #### `rl.rollback()` \* Returns: this The `rl.rollback` methods clears the internal list of pending actions without sending it to the ...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.07900247722864151, -0.054334599524736404, -0.06141136959195137, 0.007435062900185585, -0.0008722528582438827, 0.01845680922269821, 0.061097629368305206, 0.017321964725852013, 0.023557687178254128, 0.045705653727054596, -0.009446640498936176, 0.05746668204665184, 0.005312731489539146, 0....
0.058596
for the completion. \* The substring that was used for the matching. For instance: `[[substr1, substr2, ...], originalsubstring]`. ```js function completer(line) { const completions = '.help .error .exit .quit .q'.split(' '); const hits = completions.filter((c) => c.startsWith(line)); // Show all completions if none fo...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.16070079803466797, 0.053169410675764084, 0.022314101457595825, 0.03278307989239693, -0.026082366704940796, -0.011578976176679134, -0.021594006568193436, 0.009953639470040798, 0.03826913610100746, -0.09128917008638382, -0.0926160216331482, 0.04860898479819298, -0.03359290584921837, 0.006...
0.071734
autocompletion. \* `terminal` {boolean} `true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it. \*\*Default:\*\* checking `isTTY` on the `output` stream upon instantiation. \* `history` {string\[]} Initial list of history lines. This option makes sense on...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.007308863569051027, 0.03674588352441788, -0.058620844036340714, -0.010869873687624931, -0.05422446131706238, 0.04521646723151207, 0.009625320322811604, -0.017891742289066315, -0.0056306226179003716, 0.02292170748114586, -0.010018405504524708, -0.0025356910191476345, 0.023912502452731133, ...
0.052293
line]; } ``` The `completer` function can be called asynchronously if it accepts two arguments: ```js function completer(linePartial, callback) { callback(null, [['123'], linePartial]); } ``` ### `readline.cursorTo(stream, x[, y][, callback])` \* `stream` {stream.Writable} \* `x` {number} \* `y` {number} \* `callback` ...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.10780798643827438, -0.058764390647411346, -0.01866224780678749, -0.012883740477263927, -0.06653933227062225, -0.07762181013822556, 0.019930317997932434, 0.017869241535663605, 0.016791626811027527, -0.05550094321370125, -0.034795477986335754, 0.09628476202487946, -0.05997370183467865, -0...
0.065803
single line break. for await (const line of rl) { // Each line in input.txt will be successively available here as `line`. console.log(`Line from file: ${line}`); } } processLineByLine(); ``` Alternatively, one could use the [`'line'`][] event: ```mjs import { createReadStream } from 'node:fs'; import { createInterface...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ -0.08875766396522522, 0.02630920708179474, 0.00039617816219106317, 0.040564823895692825, 0.030868245288729668, 0.032348792999982834, -0.02711034007370472, 0.08935753256082535, 0.008867500349879265, 0.018284469842910767, -0.0760144367814064, 0.021945586428046227, 0.008394675329327583, -0.04...
0.036918
| `Ctrl`+`Backspace` Doesn't work on Linux, Mac and Windows | | `Ctrl`+`Delete` | Delete forward to a word boundary | Doesn't work on Mac | | `Ctrl`+`Left arrow` or `Meta`+`B` | Word left | `Ctrl`+`Left arrow` Doesn't work on Mac | | `Ctrl`+`Right arrow` or `Meta`+`F` | Word right | `Ctrl`+`Right arrow` Doesn't work on...
https://github.com/nodejs/node/blob/main//doc/api/readline.md
main
nodejs
[ 0.024695947766304016, -0.11654406040906906, -0.0007116099004633725, 0.008721989579498768, -0.02342461608350277, 0.012177948839962482, 0.02533237263560295, -0.028534168377518654, 0.032228946685791016, 0.052330132573843, 0.09176386147737503, 0.03288589417934418, 0.042331576347351074, -0.0023...
0.061828
# Punycode > Stability: 0 - Deprecated \*\*The version of the punycode module bundled in Node.js is being deprecated.\*\* In a future major version of Node.js this module will be removed. Users currently depending on the `punycode` module should switch to using the userland-provided [Punycode.js][] module instead. For ...
https://github.com/nodejs/node/blob/main//doc/api/punycode.md
main
nodejs
[ -0.041146501898765564, -0.017116617411375046, 0.0026556523516774178, -0.02385886199772358, -0.01238738652318716, -0.01806218922138214, -0.007180941756814718, 0.01182885654270649, 0.02545512095093727, -0.0063492232002317905, -0.008889845572412014, 0.03887016698718071, -0.020917555317282677, ...
0.114463
# Performance measurement APIs > Stability: 2 - Stable This module provides an implementation of a subset of the W3C [Web Performance APIs][] as well as additional APIs for Node.js-specific performance measurements. Node.js supports the following [Web Performance APIs][]: \* [High Resolution Time][] \* [Performance Tim...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ 0.0007594400085508823, 0.02527609094977379, -0.0921873152256012, 0.0871971920132637, 0.004179504234343767, -0.059309616684913635, -0.01553946454077959, 0.015323817729949951, 0.036082666367292404, -0.01572529412806034, -0.09256549179553986, -0.014409113675355911, -0.04097921773791313, -0.04...
0.117812
'fetch' \* `global` {Object} \* `cacheMode` {string} The cache mode must be an empty string ('') or 'local' \* `bodyInfo` {Object} [Fetch Response Body Info][] \* `responseStatus` {number} The response's status code \* `deliveryType` {string} The delivery type. \*\*Default:\*\* `''`. \_This property is an extension by ...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ -0.03971755504608154, 0.08303532749414444, -0.033715616911649704, 0.08569204062223434, -0.021206004545092583, -0.07056355476379395, 0.039440225809812546, -0.016797691583633423, 0.03403430059552193, -0.015245822258293629, -0.059658221900463104, 0.03852570056915283, -0.025046445429325104, -0...
0.09411
Adjust resource timing buffer size with `performance.setResourceTimingBufferSize()` or clear the buffer with `performance.clearResourceTimings()` in the event listener to allow more entries to be added to the performance timeline buffer. ## Class: `PerformanceEntry` The constructor of this class is not exposed to users...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ -0.0023779720067977905, 0.03328104317188263, -0.010945422574877739, 0.01762147806584835, -0.0209574643522501, -0.06607696413993835, 0.003164913272485137, -0.023715263232588768, 0.0646204724907875, -0.04491829872131348, -0.09947527199983597, 0.008070879615843296, -0.07065998762845993, -0.06...
0.041215
{Object} containing additional performance information. If `performanceEntry.name` is equal to `Http2Stream`, the `detail` will contain the following properties: \* `bytesRead` {number} The number of `DATA` frame bytes received for this `Http2Stream`. \* `bytesWritten` {number} The number of `DATA` frame bytes sent for...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ -0.02556901052594185, 0.0621253065764904, -0.10122546553611755, 0.0008276394219137728, 0.004438664764165878, -0.0801110491156578, 0.005173586308956146, 0.04247356578707695, 0.05655401200056076, -0.02256837487220764, -0.07503802329301834, -0.02036091312766075, 0.007330228108912706, -0.05439...
0.117931
{number} The high resolution millisecond timestamp at which the Node.js event loop exited. If the event loop has not yet exited, the property has the value of -1. It can only have a value of not -1 in a handler of the [`'exit'`][] event. ### `performanceNodeTiming.loopStart` \* Type: {number} The high resolution millis...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ -0.000375744653865695, 0.04694228246808052, -0.009595362469553947, 0.06631244719028473, 0.03362482041120529, -0.05206907168030739, 0.052190665155649185, 0.041858937591314316, 0.0655224621295929, -0.004568454809486866, -0.05352829396724701, -0.00034927428350783885, -0.02214229665696621, -0....
0.076
whichever comes first. ### `performanceResourceTiming.transferSize` \* Type: {number} A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body. ### `performanceResourceTiming.encodedBodySize` \* Type: {number} A number representing t...
https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md
main
nodejs
[ -0.057179924100637436, 0.08956260234117508, -0.07202589511871338, 0.05355572700500488, -0.013585888780653477, -0.05535243824124336, 0.03855061158537865, 0.00434973556548357, 0.01490104105323553, -0.03560102730989456, -0.03612629324197769, 0.049357760697603226, -0.043413370847702026, -0.015...
0.089864