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 |
|---|---|---|---|---|---|
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\_MODULE\_LINK\_MISMATCH` A module can not be linked because the same module requests in it are not resolved to the same module. ### `ERR\_MODULE\_NOT\_FOUND` A module file could not be resolved by the ECMAScript modules loader while attempting an `import` operation or when loading the program entry point. ### `ERR\_MULTIPLE\_CALLBACK` A callback was called more than once. A callback is almost always meant to only be called once as the query can either be fulfilled or rejected but not both at the same time. The latter would be possible by calling a callback more than once. ### `ERR\_NAPI\_CONS\_FUNCTION` While using `Node-API`, a constructor passed was not a function. ### `ERR\_NAPI\_INVALID\_DATAVIEW\_ARGS` While calling `napi\_create\_dataview()`, a given `offset` was outside the bounds of the dataview or `offset + length` was larger than a length of given `buffer`. ### `ERR\_NAPI\_INVALID\_TYPEDARRAY\_ALIGNMENT` While calling `napi\_create\_typedarray()`, the provided `offset` was not a multiple of the element size. ### `ERR\_NAPI\_INVALID\_TYPEDARRAY\_LENGTH` While calling `napi\_create\_typedarray()`, `(length \* size\_of\_element) + byte\_offset` was larger than the length of given `buffer`. ### `ERR\_NAPI\_TSFN\_CALL\_JS` An error occurred while invoking the JavaScript portion of the thread-safe function. ### `ERR\_NAPI\_TSFN\_GET\_UNDEFINED` An error occurred while attempting to retrieve the JavaScript `undefined` value. ### `ERR\_NON\_CONTEXT\_AWARE\_DISABLED` A non-context-aware native addon was loaded in a process that disallows them. ### `ERR\_NOT\_BUILDING\_SNAPSHOT` An attempt was made to use operations that can only be used when building V8 startup snapshot even though Node.js isn't building one. ### `ERR\_NOT\_IN\_SINGLE\_EXECUTABLE\_APPLICATION` The operation cannot be performed when it's not in a single-executable application. ### `ERR\_NOT\_SUPPORTED\_IN\_SNAPSHOT` An attempt was made to perform operations that are not supported when building a startup snapshot. ### `ERR\_NO\_CRYPTO` An attempt was made to use crypto features while Node.js was not compiled with OpenSSL crypto support. ### `ERR\_NO\_ICU` An attempt was made to use features that require [ICU][], but Node.js was not compiled with ICU support. ### `ERR\_NO\_TYPESCRIPT` An attempt was made to use features that require [Native TypeScript support][], but Node.js was not compiled with TypeScript support. ### `ERR\_OPERATION\_FAILED` An operation failed. This is typically used to signal the general failure of an asynchronous operation. ### `ERR\_OPTIONS\_BEFORE\_BOOTSTRAPPING` An attempt was made to get options before the bootstrapping was completed. ### `ERR\_OUT\_OF\_RANGE` A given value is out of the accepted range. ### `ERR\_PACKAGE\_IMPORT\_NOT\_DEFINED` The `package.json` [`"imports"`][] field does not define the given internal package specifier mapping. ### `ERR\_PACKAGE\_PATH\_NOT\_EXPORTED` The `package.json` [`"exports"`][] field does not export the requested subpath. Because exports are encapsulated, private internal modules that are not exported cannot be imported through the package resolution, unless using an absolute URL. ### `ERR\_PARSE\_ARGS\_INVALID\_OPTION\_VALUE` When `strict` set to `true`, thrown by [`util.parseArgs()`][] if a {boolean} value is provided for an option of type {string}, or if a {string} value is provided for an option of type {boolean}. ### `ERR\_PARSE\_ARGS\_UNEXPECTED\_POSITIONAL` Thrown by [`util.parseArgs()`][], when a positional argument is provided and `allowPositionals` is set to `false`. ### `ERR\_PARSE\_ARGS\_UNKNOWN\_OPTION` When `strict` set to `true`, thrown by [`util.parseArgs()`][] if an argument is not configured in `options`. ### `ERR\_PERFORMANCE\_INVALID\_TIMESTAMP` An invalid timestamp value was provided for a performance mark or measure. ### `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 the prototype of an object. ### `ERR\_PROXY\_INVALID\_CONFIG` Failed to proxy a request because the proxy configuration is invalid. ### `ERR\_PROXY\_TUNNEL` Failed | 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.018100935965776443,
0.0634799525141716,
0.013267448171973228,
-0.05758542940020561,
0.010458164848387241,
0.008939549326896667,
-0.022558346390724182,
0.0005030899192206562,
-0.05277033522725105,
0.044615428894758224,
0.029950648546218872,
-0.032591238617897034,
-0.05806290730834007,
0.00611655879765749,
0.02936808578670025,
-0.03552145138382912,
-0.009736559353768826,
0.0011299427133053541,
-0.013297559693455696,
-0.07312443852424622,
0.0289196465164423,
0.022311711683869362,
0.16575896739959717,
-0.010806421749293804,
-0.08156882971525192,
-0.037584081292152405,
-0.0010150120360776782,
0.04863112047314644,
0.0759136900305748,
-0.09225265681743622,
-0.03756280243396759,
-0.012145234271883965,
-0.03643627464771271,
-0.06909270584583282,
-0.017026957124471664,
-0.06721065938472748,
-0.05312938243150711,
-0.019408512860536575,
0.02551448345184326,
0.011051177978515625,
-0.050557639449834824,
-0.06729786843061447,
0.0024050353094935417,
-0.07307026535272598,
0.0058934129774570465,
0.05379714071750641,
0.04093705117702484,
0.06974488496780396,
-0.007832036353647709,
0.07763990759849548,
-0.04140752553939819,
0.013116189278662205,
0.0758729800581932,
-0.03657436743378639,
-0.07178546488285065,
-0.017798351123929024,
0.09317885339260101,
0.01575317047536373,
-0.038898877799510956,
-0.05240209400653839,
0.062205735594034195,
-0.03392798826098442,
-0.03984403982758522,
-0.03372851759195328,
-0.07384127378463745,
-0.033308930695056915,
-0.0005984780145809054,
-0.054347194731235504,
-0.1100635826587677,
-0.029477622359991074,
0.051370155066251755,
-0.017199089750647545,
0.05318071320652962,
0.0010811557294800878,
-0.04320739582180977,
0.05967818573117256,
0.06019624322652817,
-0.0774746760725975,
-0.09754175692796707,
0.0039051640778779984,
0.05445851758122444,
0.10598774999380112,
0.0039598881267011166,
0.0047010136768221855,
0.06950158625841141,
-0.05274796858429909,
-0.053936563432216644,
-0.02329903468489647,
-0.003347590798512101,
0.07465057820081711,
-0.06820183247327805,
0.05744018033146858,
0.06929432600736618,
-0.0010736064286902547,
-0.024449359625577927,
-0.014597131870687008,
-0.012105736881494522,
0.004605509806424379,
0.021036969497799873,
0.029459470883011818,
-0.04915845766663551,
-0.015712298452854156,
0.04797838255763054,
0.009852435439825058,
-0.04670567438006401,
0.02627994306385517,
0.15650229156017303,
0.09311310946941376,
0.0403287410736084,
-0.021365756168961525,
0.019762571901082993,
-0.04923653602600098,
-0.05857069417834282,
0.024678930640220642,
3.3352110198048755e-33,
0.004916670266538858,
-0.07971715927124023,
0.0015029492788016796,
0.07389816641807556,
0.06537148356437683,
0.045319393277168274,
0.0528080090880394,
0.034563787281513214,
-0.1259845644235611,
-0.020612414926290512,
-0.03416474908590317,
0.03291308879852295,
0.0016074737068265676,
0.0024712143931537867,
-0.011027131229639053,
-0.017178822308778763,
0.06165369972586632,
-0.0025266315788030624,
0.028779176995158195,
0.03415359556674957,
0.03895016387104988,
-0.028003746643662453,
0.009448676370084286,
0.0437636524438858,
0.010607916861772537,
0.02929595485329628,
0.0040108379907906055,
-0.009871533140540123,
0.08179809153079987,
-0.010210344567894936,
-0.008094036020338535,
0.0651138499379158,
-0.030899133533239365,
0.07479396462440491,
0.045095380395650864,
-0.006163666490465403,
0.08196882903575897,
0.01736288145184517,
-0.14835985004901886,
-0.05138682946562767,
0.019617363810539246,
0.06620421260595322,
-0.01935339719057083,
-0.06010452285408974,
0.010258791968226433,
-0.08947823941707611,
-0.021012132987380028,
-0.0066512636840343475,
0.09230587631464005,
0.07464469969272614,
-0.06965938955545425,
0.05280422046780586,
0.03351495414972305,
-0.1186981201171875,
0.07209537923336029,
-0.05115523189306259,
-0.026166852563619614,
0.030956516042351723,
0.002065015956759453,
-0.04305242374539375,
-0.0039013787172734737,
-0.02574075013399124,
-0.027927204966545105,
0.0032285526394844055,
0.03217383474111557,
-0.03156689554452896,
-0.008526885882019997,
0.0062333159148693085,
-0.0772966668009758,
0.03773605823516846,
-0.029452450573444366,
-0.010635321028530598,
0.03146350383758545,
0.048345454037189484,
0.0413258895277977,
0.0007530729635618627,
-0.12423832714557648,
-0.03849175572395325,
-0.002006367314606905,
-0.019626623019576073,
0.002423008671030402,
-0.07382027804851532,
-0.015098105184733868,
0.01579173281788826,
0.01242390088737011,
0.07977317273616791,
-0.07954536378383636,
0.04422736540436745,
0.06311727315187454,
0.07110283523797989,
0.07257135212421417,
-0.03537660092115402,
-0.048253633081912994,
-0.04060830920934677,
-0.09956049919128418,
-6.619255709254334e-33,
0.003063763724640012,
-0.017051417380571365,
-0.048269376158714294,
0.08889700472354889,
0.010684131644666195,
0.008752959780395031,
-0.04789014160633087,
0.014617249369621277,
0.06984370201826096,
0.0472262017428875,
-0.005099941045045853,
-0.009020308963954449,
0.09967488050460815,
-0.04418424144387245,
0.04379710927605629,
0.07103075832128525,
-0.12297805398702621,
0.029224589467048645,
-0.013283167034387589,
0.0005681117763742805,
-0.012430336326360703,
0.005639882292598486,
-0.015163806267082691,
0.06956691294908524,
0.04218018427491188,
0.04746432229876518,
-0.06098610907793045,
-0.0012980405008420348,
-0.009225118905305862,
-0.0747276172041893,
-0.07135889679193497,
0.0939016342163086,
-0.033830221742391586,
0.03485574573278427,
-0.01480912510305643,
-0.06735899299383163,
0.00474513228982687,
0.024663913995027542,
0.017668025568127632,
-0.12619295716285706,
0.05574433505535126,
0.004100427031517029,
-0.0022916016168892384,
-0.029188210144639015,
0.044612277299165726,
-0.05949597433209419,
-0.0014502619160339236,
0.013430795632302761,
0.009737488813698292,
0.0129369692876935,
-0.050729744136333466,
-0.08252505213022232,
-0.01455202791839838,
-0.039960674941539764,
-0.03748398274183273,
-0.03948385268449783,
-0.01500159315764904,
0.06584647297859192,
0.028190942481160164,
0.027876004576683044,
0.09291516989469528,
-0.05459229275584221,
0.04095993563532829,
0.0007044876692816615,
-0.020629392936825752,
-0.05108000710606575,
-0.1432262659072876,
-0.011862184852361679,
0.08757863193750381,
0.03967781364917755,
0.009234762750566006,
-0.04084531217813492,
-0.002532097976654768,
0.00757116312161088,
-0.02885754406452179,
-0.00013868774112779647,
-0.04576992616057396,
-0.11123678833246231,
-0.004747096914798021,
0.06529121845960617,
0.02602340653538704,
0.008461208082735538,
0.016604537144303322,
0.07672405242919922,
0.05473044514656067,
0.013749496079981327,
0.02295832708477974,
0.07357782870531082,
-0.04704209417104721,
0.019306279718875885,
-0.005130731500685215,
-0.05686531215906143,
-0.09544939547777176,
0.07540570944547653,
0.029249848797917366,
-6.183727663255922e-8,
0.009486758150160313,
0.09407942742109299,
-0.14737193286418915,
-0.0364241749048233,
0.031902603805065155,
-0.07500910013914108,
0.01798293925821781,
-0.004490329418331385,
0.02165256068110466,
0.03498896583914757,
0.0380803607404232,
-0.03051724284887314,
0.04422219842672348,
0.03313731402158737,
0.020518550649285316,
0.02244076319038868,
-0.07700226455926895,
0.04546136409044266,
0.027906091883778572,
-0.05302279442548752,
0.030243661254644394,
-0.00944612082093954,
-0.06522654742002487,
0.1074538603425026,
-0.03680642321705818,
0.03859589621424675,
0.016732214018702507,
0.10442101210355759,
-0.015654204413294792,
-0.004117099102586508,
-0.11626988649368286,
-0.01931409165263176,
0.038805823773145676,
-0.03250359743833542,
-0.07579691708087921,
0.021213168278336525,
0.025178492069244385,
-0.06746470183134079,
0.01272384263575077,
-0.012407953850924969,
0.01952376216650009,
0.020540371537208557,
-0.04400750249624252,
-0.006608870346099138,
-0.01286337710916996,
0.017146272584795952,
-0.015700088813900948,
0.06829798221588135,
-0.027653485536575317,
0.005515899043530226,
0.010720874182879925,
-0.03229965642094612,
-0.054868243634700775,
0.026881331577897072,
-0.0027751713059842587,
0.012446975335478783,
0.005040395073592663,
-0.10617286711931229,
-0.009567299857735634,
-0.07954054325819016,
0.0635070651769638,
-0.035108719021081924,
0.04003579542040825,
-0.04535643011331558
] | 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 the prototype of an object. ### `ERR\_PROXY\_INVALID\_CONFIG` Failed to proxy a request because the proxy configuration is invalid. ### `ERR\_PROXY\_TUNNEL` Failed to establish proxy tunnel when `NODE\_USE\_ENV\_PROXY` or `--use-env-proxy` is enabled. ### `ERR\_QUIC\_APPLICATION\_ERROR` > Stability: 1 - Experimental A QUIC application error occurred. ### `ERR\_QUIC\_CONNECTION\_FAILED` > Stability: 1 - Experimental Establishing a QUIC connection failed. ### `ERR\_QUIC\_ENDPOINT\_CLOSED` > Stability: 1 - Experimental A QUIC Endpoint closed with an error. ### `ERR\_QUIC\_OPEN\_STREAM\_FAILED` > Stability: 1 - Experimental Opening a QUIC stream failed. ### `ERR\_QUIC\_TRANSPORT\_ERROR` > Stability: 1 - Experimental A QUIC transport error occurred. ### `ERR\_QUIC\_VERSION\_NEGOTIATION\_ERROR` > Stability: 1 - Experimental A QUIC session failed because version negotiation is required. ### `ERR\_REQUIRE\_ASYNC\_MODULE` When trying to `require()` a [ES Module][], the module turns out to be asynchronous. That is, it contains top-level await. To see where the top-level await is, use `--experimental-print-required-tla` (this would execute the modules before looking for the top-level awaits). ### `ERR\_REQUIRE\_CYCLE\_MODULE` When trying to `require()` a [ES Module][], a CommonJS to ESM or ESM to CommonJS edge participates in an immediate cycle. This is not allowed because ES Modules cannot be evaluated while they are already being evaluated. To avoid the cycle, the `require()` call involved in a cycle should not happen at the top-level of either an ES Module (via `createRequire()`) or a CommonJS module, and should be done lazily in an inner function. ### `ERR\_REQUIRE\_ESM` > Stability: 0 - Deprecated An attempt was made to `require()` an [ES Module][]. This error has been deprecated since `require()` now supports loading synchronous ES modules. When `require()` encounters an ES module that contains top-level `await`, it will throw [`ERR\_REQUIRE\_ASYNC\_MODULE`][] instead. ### `ERR\_SCRIPT\_EXECUTION\_INTERRUPTED` Script execution was interrupted by `SIGINT` (For example, `Ctrl`+`C` was pressed.) ### `ERR\_SCRIPT\_EXECUTION\_TIMEOUT` Script execution timed out, possibly due to bugs in the script being executed. ### `ERR\_SERVER\_ALREADY\_LISTEN` The [`server.listen()`][] method was called while a `net.Server` was already listening. This applies to all instances of `net.Server`, including HTTP, HTTPS, and HTTP/2 `Server` instances. ### `ERR\_SERVER\_NOT\_RUNNING` The [`server.close()`][] method was called when a `net.Server` was not running. This applies to all instances of `net.Server`, including HTTP, HTTPS, and HTTP/2 `Server` instances. ### `ERR\_SINGLE\_EXECUTABLE\_APPLICATION\_ASSET\_NOT\_FOUND` A key was passed to single executable application APIs to identify an asset, but no match could be found. ### `ERR\_SOCKET\_ALREADY\_BOUND` An attempt was made to bind a socket that has already been bound. ### `ERR\_SOCKET\_BAD\_BUFFER\_SIZE` An invalid (negative) size was passed for either the `recvBufferSize` or `sendBufferSize` options in [`dgram.createSocket()`][]. ### `ERR\_SOCKET\_BAD\_PORT` An API function expecting a port >= 0 and < 65536 received an invalid value. ### `ERR\_SOCKET\_BAD\_TYPE` An API function expecting a socket type (`udp4` or `udp6`) received an invalid value. ### `ERR\_SOCKET\_BUFFER\_SIZE` While using [`dgram.createSocket()`][], the size of the receive or send `Buffer` could not be determined. ### `ERR\_SOCKET\_CLOSED` An attempt was made to operate on an already closed socket. ### `ERR\_SOCKET\_CLOSED\_BEFORE\_CONNECTION` When calling [`net.Socket.write()`][] on a connecting socket and the socket was closed before the connection was established. ### `ERR\_SOCKET\_CONNECTION\_TIMEOUT` The socket was unable to connect to any address returned by the DNS within the allowed timeout when using the family autoselection algorithm. ### `ERR\_SOCKET\_DGRAM\_IS\_CONNECTED` A [`dgram.connect()`][] call was made on 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 be parsed because it does not exist, or is corrupt. ### `ERR\_SOURCE\_MAP\_MISSING\_SOURCE` A | 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.017328256741166115,
0.06360982358455658,
0.10123718529939651,
0.10228905081748962,
-0.03816893324255943,
0.008817166090011597,
0.059243593364953995,
-0.06610528379678726,
-0.07803882658481598,
0.03125728294253349,
0.009858952835202217,
-0.029699163511395454,
-0.07744502276182175,
-0.09057828783988953,
0.05325331166386604,
-0.011326855048537254,
-0.012959626503288746,
-0.003473438322544098,
0.03573736548423767,
-0.1700798124074936,
0.00241468520835042,
0.06220516934990883,
0.06309867650270462,
0.011528980918228626,
-0.05280238017439842,
-0.00984458439052105,
-0.002822230802848935,
0.08573614060878754,
0.03208224102854729,
-0.04770248010754585,
-0.04363167658448219,
0.009807795286178589,
0.03437048941850662,
0.022621622309088707,
-0.04774554446339607,
-0.0008283460047096014,
-0.052261464297771454,
-0.08281216025352478,
0.012896404601633549,
0.0325668528676033,
-0.004870911128818989,
0.009410122409462929,
-0.0021182498894631863,
0.029767349362373352,
0.07423941791057587,
0.0919169932603836,
0.08387100696563721,
-0.030517389997839928,
-0.018301988020539284,
-0.008047420531511307,
-0.0359400175511837,
-0.12029305845499039,
-0.008392349816858768,
-0.06737475842237473,
0.028316833078861237,
0.03237610682845116,
0.10093455016613007,
-0.06984055042266846,
0.05101742595434189,
-0.0757671445608139,
0.014888928271830082,
0.05309732258319855,
0.013703582808375359,
0.004659847356379032,
-0.010749717243015766,
-0.007584783248603344,
-0.11364470422267914,
-0.0049904645420610905,
-0.025791378691792488,
-0.07945562899112701,
0.07956504821777344,
-0.007423636503517628,
0.04427291452884674,
0.0515473410487175,
-0.02680240012705326,
0.08948118984699249,
0.020771203562617302,
-0.012486135587096214,
-0.00693394523113966,
-0.004415167961269617,
0.03494817391037941,
0.024966059252619743,
0.017214784398674965,
0.03918633982539177,
-0.0522441640496254,
-0.018458768725395203,
0.07452884316444397,
0.0071571944281458855,
-0.05296263471245766,
0.10739738494157791,
0.006266267038881779,
-0.05878537893295288,
0.0419546402990818,
0.024493031203746796,
0.04331887885928154,
0.07071475684642792,
0.059367381036281586,
-0.027762960642576218,
0.019325798377394676,
0.017989441752433777,
-0.05548721179366112,
-0.049539078027009964,
0.053297922015190125,
-0.01316768303513527,
-0.03950054943561554,
0.04338964819908142,
0.05505535006523132,
0.05380236357450485,
-0.0488346628844738,
0.013991405256092548,
0.0025213868357241154,
0.0212805587798357,
-0.01810465380549431,
0.033834487199783325,
-1.1674807854275412e-34,
0.03602832555770874,
-0.09600217640399933,
-0.023969067260622978,
0.11621078848838806,
0.09759862720966339,
0.008299116045236588,
0.029056744650006294,
0.030359458178281784,
-0.10437794774770737,
-0.036265674978494644,
-0.02156447432935238,
-0.07449040561914444,
-0.08683348447084427,
0.027412263676524162,
0.028503764420747757,
0.03223201259970665,
-0.00019981003424618393,
-0.0012902154121547937,
0.052990853786468506,
0.014997275546193123,
0.019543759524822235,
-0.08826585859060287,
-0.048194579780101776,
-0.011223919689655304,
0.005789541639387608,
0.05215299502015114,
-0.00811663269996643,
0.01165129616856575,
0.012767464853823185,
0.017307449132204056,
0.07776789367198944,
0.03752708062529564,
0.06072283163666725,
0.07081668078899384,
-0.009380905888974667,
-0.06631618738174438,
0.030515046790242195,
0.0009349009487777948,
-0.11855073273181915,
0.0058905272744596004,
-0.01965452916920185,
0.03361363708972931,
-0.012551046907901764,
-0.03723127767443657,
0.03560632839798927,
-0.13662900030612946,
0.017625557258725166,
0.006786734331399202,
0.07354112714529037,
-0.006909649353474379,
-0.06811746954917908,
0.024936649948358536,
-0.006939438637346029,
-0.06205853819847107,
0.06532430648803711,
-0.0453077107667923,
-0.05645885318517685,
0.03832481801509857,
0.005480348132550716,
-0.10421418398618698,
0.04299164563417435,
0.09118124842643738,
-0.04134458303451538,
0.006047287955880165,
0.04040133208036423,
0.018022242933511734,
-0.08121150732040405,
-0.025364791974425316,
0.02246265485882759,
0.0798928290605545,
-0.05477764829993248,
-0.026619773358106613,
-0.008329527452588081,
-0.007836397737264633,
-0.06484105437994003,
-0.04742678999900818,
0.002086533699184656,
-0.04711807519197464,
0.015699904412031174,
0.01168158557265997,
0.018998268991708755,
-0.045094773173332214,
-0.03953852504491806,
0.008899465203285217,
-0.09044470638036728,
-0.026515865698456764,
0.006452157162129879,
0.0038327123038470745,
-0.006159632466733456,
0.03334926441311836,
0.002650387352332473,
-0.012511457316577435,
-0.01173036266118288,
-0.03901034593582153,
-0.16671954095363617,
-2.688541271703803e-33,
-0.031666919589042664,
0.03433108329772949,
-0.027614271268248558,
0.07185482233762741,
0.04709151014685631,
-0.030718427151441574,
0.04614518955349922,
-0.003699128981679678,
-0.011082049459218979,
-0.01942073181271553,
0.008655864745378494,
-0.026843763887882233,
0.07913379371166229,
-0.06297410279512405,
-0.009820165112614632,
-0.02820567414164543,
-0.1177356168627739,
-0.09662530571222305,
0.015222648158669472,
0.039014119654893875,
-0.02776518650352955,
0.03544452786445618,
0.04525260254740715,
0.04255799949169159,
-0.07624595612287521,
-0.0018739777151495218,
-0.004732219967991114,
0.016517069190740585,
-0.039505522698163986,
-0.03888823464512825,
-0.01311405934393406,
0.06698949635028839,
-0.0833045020699501,
0.1282205581665039,
0.021833110600709915,
-0.054929353296756744,
0.015724601224064827,
0.026783674955368042,
-0.015680450946092606,
-0.13212861120700836,
0.08444775640964508,
-0.004871351644396782,
-0.017379049211740494,
-0.02393285371363163,
0.024602988734841347,
0.021070828661322594,
-0.015616227872669697,
-0.008032104931771755,
0.03534630686044693,
-0.032278817147016525,
-0.006798303220421076,
0.0003725387796293944,
0.015887578949332237,
-0.03188839554786682,
0.02396828681230545,
0.02388063818216324,
0.02138645574450493,
-0.01209483202546835,
0.014626502059400082,
0.05226031690835953,
0.056542400270700455,
-0.11594746261835098,
-0.05662574619054794,
0.006693208124488592,
0.02133759669959545,
0.07739099115133286,
-0.14781320095062256,
0.0643092542886734,
0.026516053825616837,
-0.004994766786694527,
-0.01135618332773447,
0.010850396938621998,
0.005847204942256212,
-0.02061636932194233,
-0.016573378816246986,
-0.0077904341742396355,
-0.012710698880255222,
-0.00846636388450861,
0.02925783395767212,
0.12947219610214233,
-0.04045207053422928,
0.08391910791397095,
-0.06674544513225555,
-0.0451308935880661,
-0.009433330036699772,
0.01023086067289114,
-0.09710203856229782,
0.10447791963815689,
0.030198514461517334,
-0.01318485476076603,
0.02399534359574318,
-0.017111066728830338,
-0.04273845627903938,
0.0650954321026802,
0.03808272257447243,
-4.7234642863713816e-8,
0.024329066276550293,
-0.041110649704933167,
-0.01966073177754879,
-0.024031879380345345,
-0.019064977765083313,
0.01984471268951893,
0.027211476117372513,
-0.06921304762363434,
-0.005445912480354309,
0.048376522958278656,
-0.047578275203704834,
0.051448021084070206,
-0.05397883057594299,
0.07006405293941498,
0.04064978286623955,
-0.044501084834337234,
-0.05343206226825714,
0.07981722056865692,
-0.018459057435393333,
-0.018141720443964005,
0.028113847598433495,
-0.01641746237874031,
-0.03477951139211655,
0.02417331002652645,
-0.04874071478843689,
-0.02463619038462639,
-0.011954832822084427,
0.009285559877753258,
-0.07506739348173141,
0.022192301228642464,
-0.09452936798334122,
0.0024812333285808563,
-0.019663317129015923,
-0.009706645272672176,
-0.016378121450543404,
0.09932823479175568,
-0.059265825897455215,
0.06951365619897842,
-0.004022889770567417,
-0.0348307304084301,
0.08915285021066666,
0.04971969872713089,
-0.06297963857650757,
-0.02008787915110588,
-0.012347507290542126,
-0.016721993684768677,
0.008346222341060638,
0.067647784948349,
0.024879105389118195,
0.05703311786055565,
0.049322109669446945,
0.01016518846154213,
-0.029313063248991966,
-0.020438719540834427,
-0.022493897005915642,
0.021956250071525574,
-0.027560222893953323,
-0.07882575690746307,
-0.09207451343536377,
-0.011727193370461464,
0.12053342908620834,
-0.01883077435195446,
-0.0010142878163605928,
0.007766238879412413
] | 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 be parsed because it does not exist, or is corrupt. ### `ERR\_SOURCE\_MAP\_MISSING\_SOURCE` A file imported from a source map was not found. ### `ERR\_SOURCE\_PHASE\_NOT\_DEFINED` The provided module import does not provide a source phase imports representation for source phase import syntax `import source x from 'x'` or `import.source(x)`. ### `ERR\_SQLITE\_ERROR` An error was returned from [SQLite][]. ### `ERR\_SRI\_PARSE` A string was provided for a Subresource Integrity check, but was unable to be parsed. Check the format of integrity attributes by looking at the [Subresource Integrity specification][]. ### `ERR\_STREAM\_ALREADY\_FINISHED` A stream method was called that cannot complete because the stream was finished. ### `ERR\_STREAM\_CANNOT\_PIPE` An attempt was made to call [`stream.pipe()`][] on a [`Writable`][] stream. ### `ERR\_STREAM\_DESTROYED` A stream method was called that cannot complete because the stream was destroyed using `stream.destroy()`. ### `ERR\_STREAM\_NULL\_VALUES` An attempt was made to call [`stream.write()`][] with a `null` chunk. ### `ERR\_STREAM\_PREMATURE\_CLOSE` An error returned by `stream.finished()` and `stream.pipeline()`, when a stream or a pipeline ends non gracefully with no explicit error. ### `ERR\_STREAM\_PUSH\_AFTER\_EOF` An attempt was made to call [`stream.push()`][] after a `null`(EOF) had been pushed to the stream. ### `ERR\_STREAM\_UNABLE\_TO\_PIPE` An attempt was made to pipe to a closed or destroyed stream in a pipeline. ### `ERR\_STREAM\_UNSHIFT\_AFTER\_END\_EVENT` An attempt was made to call [`stream.unshift()`][] after the `'end'` event was emitted. ### `ERR\_STREAM\_WRAP` Prevents an abort if a string decoder was set on the Socket or if the decoder is in `objectMode`. ```js const Socket = require('node:net').Socket; const instance = new Socket(); instance.setEncoding('utf8'); ``` ### `ERR\_STREAM\_WRITE\_AFTER\_END` An attempt was made to call [`stream.write()`][] after `stream.end()` has been called. ### `ERR\_STRING\_TOO\_LONG` An attempt has been made to create a string longer than the maximum allowed length. ### `ERR\_SYNTHETIC` An artificial error object used to capture the call stack for diagnostic reports. ### `ERR\_SYSTEM\_ERROR` An unspecified or non-specific system error has occurred within the Node.js process. The error object will have an `err.info` object property with additional details. ### `ERR\_TEST\_FAILURE` This error represents a failed test. Additional information about the failure is available via the `cause` property. The `failureType` property specifies what the test was doing when the failure occurred. ### `ERR\_TLS\_ALPN\_CALLBACK\_INVALID\_RESULT` This error is thrown when an `ALPNCallback` returns a value that is not in the list of ALPN protocols offered by the client. ### `ERR\_TLS\_ALPN\_CALLBACK\_WITH\_PROTOCOLS` This error is thrown when creating a `TLSServer` if the TLS options include both `ALPNProtocols` and `ALPNCallback`. These options are mutually exclusive. ### `ERR\_TLS\_CERT\_ALTNAME\_FORMAT` This error is thrown by `checkServerIdentity` if a user-supplied `subjectaltname` property violates encoding rules. Certificate objects produced by Node.js itself always comply with encoding rules and will never cause this error. ### `ERR\_TLS\_CERT\_ALTNAME\_INVALID` While using TLS, the host name/IP of the peer did not match any of the `subjectAltNames` in its certificate. ### `ERR\_TLS\_DH\_PARAM\_SIZE` While using TLS, the parameter offered for the Diffie-Hellman (`DH`) key-agreement protocol is too small. By default, the key length must be greater than or equal to 1024 bits to avoid vulnerabilities, even though it is strongly recommended to use 2048 bits or larger for stronger security. ### `ERR\_TLS\_HANDSHAKE\_TIMEOUT` A TLS/SSL handshake timed out. In 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` Valid TLS protocol versions are `'TLSv1'`, `'TLSv1.1'`, or `'TLSv1.2'`. ### `ERR\_TLS\_INVALID\_STATE` The TLS | 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.05154060199856758,
0.04474049061536789,
0.020744338631629944,
-0.02485944889485836,
-0.028589216992259026,
0.04551733285188675,
0.0059918249025940895,
-0.03745115548372269,
0.08747225254774094,
-0.0025980554055422544,
0.015340883284807205,
0.044306494295597076,
-0.03489075228571892,
0.06545925885438919,
-0.0013826062204316258,
-0.036957062780857086,
0.009057551622390747,
-0.04069319739937782,
0.07232457399368286,
-0.10199697315692902,
0.05209234356880188,
0.1142522394657135,
0.13505429029464722,
0.050926126539707184,
0.010499021969735622,
-0.07092226296663284,
-0.002876811195164919,
0.13438229262828827,
-0.042407575994729996,
-0.06664024293422699,
-0.009510744363069534,
-0.08357654511928558,
-0.003822294995188713,
-0.05862489715218544,
-0.00968318060040474,
-0.06801624596118927,
-0.07270418852567673,
-0.08837731182575226,
0.08578469604253769,
-0.04001568257808685,
0.04457956925034523,
0.06699510663747787,
-0.03038269281387329,
0.0391014963388443,
0.05390852317214012,
-0.01007234025746584,
-0.007404914125800133,
-0.040900249034166336,
0.049355313181877136,
0.05497085675597191,
-0.07058797031641006,
-0.03118061274290085,
0.0259637963026762,
-0.0006182712968438864,
0.07128071039915085,
0.07474347203969955,
0.023755334317684174,
-0.09924145042896271,
0.006318361032754183,
-0.10482081770896912,
0.008680541068315506,
-0.007800381630659103,
0.010524488054215908,
0.03255518153309822,
-0.04868384078145027,
-0.026162339374423027,
-0.10333149135112762,
-0.049593836069107056,
-0.03952585905790329,
-0.005961025133728981,
0.082565538585186,
-0.011059765703976154,
-0.058327816426754,
-0.01329791359603405,
0.0032674262765794992,
0.06203513965010643,
0.002982493257150054,
-0.06433994323015213,
0.031677450984716415,
-0.003521632170304656,
0.042565952986478806,
0.10567249357700348,
0.06532713770866394,
-0.0019497046014294028,
0.01543561089783907,
0.05275719240307808,
0.032009027898311615,
0.012504573911428452,
-0.02145828865468502,
-0.07426684349775314,
-0.04363848268985748,
-0.0372079461812973,
-0.04904946684837341,
-0.006206093356013298,
-0.11853519827127457,
0.00801338441669941,
-0.015581735409796238,
-0.02474692463874817,
-0.0423031710088253,
0.04161219298839569,
-0.07931926846504211,
0.022202610969543457,
0.0393650159239769,
-0.03106508031487465,
0.04922338202595711,
-0.05286533012986183,
0.03757438063621521,
-0.006050735712051392,
-0.02821997180581093,
0.047710686922073364,
-0.005253844428807497,
-0.004322890192270279,
-0.06248822435736656,
0.04974022135138512,
1.863985800202717e-33,
-0.07412175834178925,
-0.03998967260122299,
-0.048812538385391235,
0.0429680198431015,
0.06728196144104004,
0.026613865047693253,
0.022448644042015076,
0.030491430312395096,
-0.104035884141922,
0.03214849531650543,
-0.05457340553402901,
0.03662971034646034,
-0.05681999772787094,
0.02924191579222679,
-0.008036098442971706,
0.010056860744953156,
0.11526940017938614,
0.026431256905198097,
0.016570348292589188,
0.0236203633248806,
0.027642281726002693,
0.003409730037674308,
-0.005760398227721453,
-0.01626727357506752,
0.005434807389974594,
0.03029521182179451,
-0.05289406329393387,
-0.01957760378718376,
0.0846768170595169,
0.005490113981068134,
0.0008341422071680427,
-0.019401149824261665,
0.011213883757591248,
0.04011210426688194,
0.03684515506029129,
-0.07771971821784973,
-0.04772324487566948,
-0.015353554859757423,
-0.1484830528497696,
-0.011583037674427032,
-0.016249937936663628,
-0.009615182876586914,
-0.07500430941581726,
0.0031602971721440554,
0.03548794612288475,
-0.05877447873353958,
-0.07399201393127441,
-0.022847652435302734,
0.026720738038420677,
-0.03278029337525368,
0.03252794221043587,
0.00567807350307703,
0.06711806356906891,
-0.04125623404979706,
0.017821066081523895,
-0.026355428621172905,
-0.010973173193633556,
0.029834875836968422,
0.05692436918616295,
-0.015264960937201977,
0.0030031988862901926,
0.00957479327917099,
0.02535792998969555,
-0.018638744950294495,
0.13441400229930878,
0.026891404762864113,
-0.0007208702154457569,
0.022930419072508812,
-0.03572729974985123,
-0.01575196161866188,
-0.048569757491350174,
0.05093790218234062,
0.00007585296407341957,
0.03717120364308357,
-0.038505397737026215,
0.021563459187746048,
-0.02541758120059967,
-0.051908113062381744,
-0.02213137038052082,
0.0024044837336987257,
-0.018421880900859833,
-0.08005017042160034,
-0.06932582706212997,
-0.0967230275273323,
-0.05176359787583351,
0.026316355913877487,
-0.03193499520421028,
-0.005905339494347572,
-0.024988669902086258,
0.0625462606549263,
-0.04002699628472328,
-0.0469512902200222,
-0.025952834635972977,
-0.005492824129760265,
-0.010228998959064484,
-6.170025114724242e-33,
-0.02021094597876072,
0.05819980800151825,
-0.05497307702898979,
0.013027002103626728,
-0.020243490114808083,
-0.05654812976717949,
0.04151565954089165,
0.031342606991529465,
0.09004241973161697,
0.07622813433408737,
0.011331009678542614,
-0.042087260633707047,
0.07247785478830338,
-0.058412276208400726,
0.042341891676187515,
0.06599688529968262,
-0.01903437077999115,
0.0014410823350772262,
-0.022050919011235237,
0.06673018634319305,
-0.01020083762705326,
0.07616589218378067,
-0.00014517726958729327,
0.03929859772324562,
-0.06214720383286476,
0.05167295038700104,
0.004635701421648264,
0.010493019595742226,
-0.057612307369709015,
0.041159551590681076,
0.01320796087384224,
0.084193654358387,
-0.07249737530946732,
0.03917086124420166,
-0.08076886087656021,
0.05554347485303879,
0.0507223904132843,
-0.06234249472618103,
-0.04380076378583908,
-0.06768157333135605,
0.11975797265768051,
0.07097993046045303,
-0.05766526237130165,
-0.019299618899822235,
0.008176677860319614,
-0.000876201200298965,
0.006560257636010647,
0.06687021255493164,
-0.061438336968421936,
-0.006040843203663826,
0.04528651759028435,
-0.03731156885623932,
-0.0022966237738728523,
0.018279684707522392,
0.011012398637831211,
0.07270731776952744,
0.05167147517204285,
0.046853065490722656,
-0.012939056381583214,
-0.0725589469075203,
0.01792391762137413,
-0.13866639137268066,
-0.09537393599748611,
-0.01590169407427311,
-0.02653573825955391,
-0.007902628742158413,
-0.015313304029405117,
0.0063155279494822025,
0.0575118251144886,
-0.09090857207775116,
0.07549479603767395,
0.08942552655935287,
0.007281557656824589,
0.023110579699277878,
-0.041950780898332596,
0.1224672868847847,
-0.0911542996764183,
0.036851249635219574,
-0.03132002800703049,
0.11956976354122162,
-0.04193482920527458,
0.031228234991431236,
-0.015346325002610683,
0.06222381815314293,
-0.00855872593820095,
-0.008437949232757092,
-0.0069452873431146145,
0.08722652494907379,
0.00564231164753437,
-0.08124952763319016,
-0.0074958642944693565,
-0.05110929161310196,
-0.022954141721129417,
0.08610253036022186,
0.03175535425543785,
-5.5897647399660855e-8,
0.009231707081198692,
0.024900471791625023,
-0.04219129681587219,
-0.0383114330470562,
0.044616151601076126,
-0.04614928737282753,
-0.024279877543449402,
-0.003228594083338976,
0.028437621891498566,
0.07605715841054916,
-0.06308012455701828,
-0.034706078469753265,
-0.036404386162757874,
-0.00787084735929966,
0.009020998142659664,
0.00483633391559124,
0.021280033513903618,
0.05778020620346069,
-0.002200535498559475,
-0.08145797252655029,
0.05398276820778847,
-0.01945229433476925,
-0.030161462724208832,
0.05452047288417816,
-0.08318697661161423,
-0.024016739800572395,
0.05663090944290161,
-0.01133688259869814,
-0.14149542152881622,
-0.11859908699989319,
0.012074128724634647,
-0.03593485429883003,
-0.010954405181109905,
0.02714933082461357,
-0.08918797969818115,
0.06411220133304596,
0.03791705518960953,
-0.0350232794880867,
0.03883993625640869,
-0.01554415188729763,
-0.05787975341081619,
-0.010320414789021015,
-0.09684030711650848,
-0.007915480993688107,
-0.004423846025019884,
-0.00725803105160594,
-0.02714621089398861,
0.07179315388202667,
-0.007747058756649494,
0.005237890407443047,
0.016081316396594048,
0.018729660660028458,
-0.026421010494232178,
-0.0037346812896430492,
0.06862205266952515,
0.035583220422267914,
-0.07579856365919113,
-0.01927623525261879,
-0.08477381616830826,
0.023077448830008507,
-0.043638117611408234,
0.06831835955381393,
0.009605301544070244,
-0.12327843904495239
] | 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` Valid TLS protocol versions are `'TLSv1'`, `'TLSv1.1'`, or `'TLSv1.2'`. ### `ERR\_TLS\_INVALID\_STATE` The TLS socket must be connected and securely established. Ensure the 'secure' event is emitted before continuing. ### `ERR\_TLS\_PROTOCOL\_VERSION\_CONFLICT` Attempting to set a TLS protocol `minVersion` or `maxVersion` conflicts with an attempt to set the `secureProtocol` explicitly. Use one mechanism or the other. ### `ERR\_TLS\_PSK\_SET\_IDENTITY\_HINT\_FAILED` Failed to set PSK identity hint. Hint may be too long. ### `ERR\_TLS\_RENEGOTIATION\_DISABLED` An attempt was made to renegotiate TLS on a socket instance with renegotiation disabled. ### `ERR\_TLS\_REQUIRED\_SERVER\_NAME` While using TLS, the `server.addContext()` method was called without providing a host name in the first parameter. ### `ERR\_TLS\_SESSION\_ATTACK` An excessive amount of TLS renegotiations is detected, which is a potential vector for denial-of-service attacks. ### `ERR\_TLS\_SNI\_FROM\_SERVER` An attempt was made to issue Server Name Indication from a TLS server-side socket, which is only valid from a client. ### `ERR\_TRACE\_EVENTS\_CATEGORY\_REQUIRED` The `trace\_events.createTracing()` method requires at least one trace event category. ### `ERR\_TRACE\_EVENTS\_UNAVAILABLE` The `node:trace\_events` module could not be loaded because Node.js was compiled with the `--without-v8-platform` flag. ### `ERR\_TRAILING\_JUNK\_AFTER\_STREAM\_END` Trailing junk found after the end of the compressed stream. This error is thrown when extra, unexpected data is detected after the end of a compressed stream (for example, in zlib or gzip decompression). ### `ERR\_TRANSFORM\_ALREADY\_TRANSFORMING` A `Transform` stream finished while it was still transforming. ### `ERR\_TRANSFORM\_WITH\_LENGTH\_0` A `Transform` stream finished with data still in the write buffer. ### `ERR\_TTY\_INIT\_FAILED` The initialization of a TTY failed due to a system error. ### `ERR\_UNAVAILABLE\_DURING\_EXIT` Function was called within a [`process.on('exit')`][] handler that shouldn't be called within [`process.on('exit')`][] handler. ### `ERR\_UNCAUGHT\_EXCEPTION\_CAPTURE\_ALREADY\_SET` [`process.setUncaughtExceptionCaptureCallback()`][] was called twice, without first resetting the callback to `null`. This error is designed to prevent accidentally overwriting a callback registered from another module. ### `ERR\_UNESCAPED\_CHARACTERS` A string that contained unescaped characters was received. ### `ERR\_UNHANDLED\_ERROR` An unhandled error occurred (for instance, when an `'error'` event is emitted by an [`EventEmitter`][] but an `'error'` handler is not registered). ### `ERR\_UNKNOWN\_BUILTIN\_MODULE` Used to identify a specific kind of internal Node.js error that should not typically be triggered by user code. Instances of this error point to an internal bug within the Node.js binary itself. ### `ERR\_UNKNOWN\_CREDENTIAL` A Unix group or user identifier that does not exist was passed. ### `ERR\_UNKNOWN\_ENCODING` An invalid or unknown encoding option was passed to an API. ### `ERR\_UNKNOWN\_FILE\_EXTENSION` An attempt was made to load a module with an unknown or unsupported file extension. ### `ERR\_UNKNOWN\_MODULE\_FORMAT` An attempt was made to load a module with an unknown or unsupported format. ### `ERR\_UNKNOWN\_SIGNAL` An invalid or unknown process signal was passed to an API expecting a valid signal (such as [`subprocess.kill()`][]). ### `ERR\_UNSUPPORTED\_DIR\_IMPORT` `import` a directory URL is unsupported. Instead, [self-reference a package using its name][] and [define a custom subpath][] in the [`"exports"`][] field of the [`package.json`][] file. ```mjs import './'; // unsupported import './index.js'; // supported import 'package-name'; // supported ``` ### `ERR\_UNSUPPORTED\_ESM\_URL\_SCHEME` `import` with URL schemes other than `file` and `data` is unsupported. ### `ERR\_UNSUPPORTED\_NODE\_MODULES\_TYPE\_STRIPPING` Type stripping is not supported for files descendent of a `node\_modules` directory. ### `ERR\_UNSUPPORTED\_RESOLVE\_REQUEST` An attempt was made to 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 | 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.06570756435394287,
-0.0009923391044139862,
0.05005927011370659,
0.0223101656883955,
-0.0178784541785717,
0.0018709121504798532,
-0.005195401143282652,
-0.03170185908675194,
-0.030402617529034615,
-0.014444581232964993,
0.046912986785173416,
-0.07049308717250824,
-0.08176140487194061,
-0.029107393696904182,
0.08778413385152817,
-0.023657280951738358,
0.07390725612640381,
-0.04760344326496124,
-0.040053509175777435,
-0.11808318644762039,
-0.017904426902532578,
0.01320142112672329,
0.06256262958049774,
0.02692909725010395,
0.03296039626002312,
-0.0334891602396965,
-0.005915886256843805,
0.09009063988924026,
-0.08256848156452179,
-0.08051121979951859,
0.04012255370616913,
-0.034467097371816635,
0.00602125097066164,
-0.012829357758164406,
-0.08259442448616028,
-0.07040490210056305,
-0.07246184349060059,
-0.062359124422073364,
0.08671727776527405,
-0.009281028062105179,
-0.007301358971744776,
-0.07131347805261612,
0.015519090928137302,
-0.038201406598091125,
0.1109752431511879,
0.05292311683297157,
0.07661707699298859,
0.003475347999483347,
0.028732534497976303,
-0.07299704849720001,
-0.00538450013846159,
-0.06427528709173203,
0.01679522544145584,
0.017227349802851677,
-0.06461711972951889,
-0.01714225485920906,
0.12315884232521057,
-0.048923149704933167,
0.024216461926698685,
-0.06016678735613823,
-0.014906715601682663,
0.020346369594335556,
0.016007035970687866,
0.01684345304965973,
-0.06573060899972916,
-0.052437812089920044,
-0.06842059642076492,
0.028518375009298325,
-0.08629108965396881,
-0.04970889165997505,
0.02370477467775345,
-0.055457137525081635,
-0.004561089910566807,
-0.03915714472532272,
-0.026705753058195114,
0.05098835378885269,
0.025770727545022964,
0.010212061926722527,
0.023614225909113884,
-0.01474802941083908,
0.04006950557231903,
0.14929324388504028,
0.03228845074772835,
0.027273157611489296,
-0.025561880320310593,
-0.04598666727542877,
-0.005939238704741001,
-0.013430767692625523,
-0.07194801419973373,
0.021079177036881447,
0.003119568107649684,
-0.01494696456938982,
0.008794919587671757,
-0.017400603741407394,
-0.030053691938519478,
0.06523577123880386,
-0.012819274328649044,
-0.006780019495636225,
0.01410387922078371,
0.003878809744492173,
-0.03234385326504707,
0.009183437563478947,
0.0840601995587349,
-0.05844675377011299,
0.032449644058942795,
0.008564298041164875,
0.050720635801553726,
0.03828820958733559,
-0.056922465562820435,
-0.03519643470644951,
0.008086887188255787,
-0.01930903270840645,
-0.04455289617180824,
0.10179924219846725,
2.5168329547883528e-33,
0.030262596905231476,
-0.01690521650016308,
-0.0022968798875808716,
0.08891202509403229,
0.0478021502494812,
0.07363522797822952,
0.03433974087238312,
-0.033585935831069946,
-0.050916776061058044,
0.019986135885119438,
0.02837292104959488,
-0.07890405505895615,
-0.044675834476947784,
-0.028292786329984665,
0.043122801929712296,
0.007557145319879055,
0.08480364829301834,
0.011968168430030346,
0.09470632672309875,
0.030437540262937546,
0.005627080332487822,
-0.026861727237701416,
0.05907168239355087,
-0.03827394172549248,
0.006511756218969822,
0.06118728965520859,
-0.012378468178212643,
0.03467864170670509,
-0.0018192753195762634,
0.0027478367555886507,
0.010758831165730953,
0.020185353234410286,
0.01322514284402132,
0.007188987918198109,
0.05600540712475777,
-0.037325844168663025,
0.05269630253314972,
0.047988347709178925,
-0.039674799889326096,
-0.04560995101928711,
0.029365820810198784,
0.010148103348910809,
-0.06677689403295517,
0.07374937832355499,
0.04583767428994179,
-0.04726662114262581,
-0.0671038031578064,
0.008680343627929688,
0.035213176161050797,
0.06901669502258301,
-0.09305336326360703,
-0.02029149979352951,
-0.029036322608590126,
-0.06590528041124344,
0.003980000503361225,
-0.0367971733212471,
-0.04378921166062355,
0.056356169283390045,
-0.04376758262515068,
-0.08438658714294434,
0.013254070654511452,
0.0014101916458457708,
-0.06130577251315117,
-0.08663604408502579,
0.14649097621440887,
0.01434258185327053,
-0.07199756801128387,
0.025356823578476906,
-0.07365837693214417,
0.0017995418747887015,
-0.08618511259555817,
0.1180727481842041,
0.0792020633816719,
0.02281748503446579,
-0.00252930773422122,
-0.011566640809178352,
0.006953801028430462,
0.011200097389519215,
0.04083995148539543,
-0.009769219905138016,
-0.0028769471682608128,
0.03029201552271843,
0.019688647240400314,
-0.005346538033336401,
-0.09094515442848206,
0.08603306859731674,
-0.01526400912553072,
0.09163707494735718,
-0.05417181923985481,
0.01524765882641077,
0.009286736138164997,
0.018375949934124947,
0.0818583071231842,
0.03494126722216606,
-0.03694015368819237,
-5.565509879740603e-33,
-0.012787654995918274,
-0.032052718102931976,
-0.009677167981863022,
0.02410028874874115,
0.08579292893409729,
-0.06367794424295425,
-0.026033787056803703,
0.008786674588918686,
-0.054480236023664474,
0.000017163831216748804,
0.09106738865375519,
-0.06612849980592728,
0.07987919449806213,
-0.08133744448423386,
-0.05245319381356239,
-0.01070493459701538,
-0.09280741214752197,
0.03774769976735115,
-0.020286062732338905,
0.025209804996848106,
0.0035150228068232536,
0.06432215869426727,
-0.03744808956980705,
0.08004823327064514,
-0.05779148265719414,
0.00889122299849987,
-0.03916940838098526,
-0.011642749421298504,
-0.053332988172769547,
0.04288444668054581,
0.06093903258442879,
-0.002000827109441161,
0.05205442011356354,
0.05493522062897682,
-0.048038970679044724,
-0.015880219638347626,
-0.010231480933725834,
-0.06549166142940521,
0.08339186757802963,
-0.049276575446128845,
0.11871127039194107,
-0.02765195071697235,
0.0208443496376276,
-0.10269058495759964,
0.059999965131282806,
0.010316147468984127,
0.03594987466931343,
-0.03352264314889908,
-0.03291541710495949,
-0.016388067975640297,
-0.002786618424579501,
-0.006557696498930454,
-0.03658055141568184,
-0.010819556191563606,
0.05312097817659378,
0.01098235510289669,
-0.006734772119671106,
0.010183682665228844,
0.0025943864602595568,
-0.09422110766172409,
0.02556944265961647,
-0.02753417007625103,
-0.00763139920309186,
0.0879807248711586,
0.07842715829610825,
0.056575000286102295,
-0.11447151005268097,
0.050785358995199203,
0.11735557019710541,
0.01859298348426819,
-0.03546631708741188,
0.050497718155384064,
-0.04037002846598625,
-0.03886254131793976,
0.07256651669740677,
-0.028264353051781654,
-0.025130530819296837,
0.0004194510111119598,
0.024645978584885597,
0.07893551886081696,
-0.048138752579689026,
0.05016007274389267,
-0.1292516440153122,
0.036051709204912186,
0.01683724857866764,
0.001652316888794303,
0.003891873639076948,
0.0302013847976923,
-0.0009923831094056368,
-0.03679794818162918,
0.0013544113608077168,
-0.013327522203326225,
-0.029362577944993973,
0.09272989630699158,
0.054727762937545776,
-5.03406454299693e-8,
0.04097979888319969,
-0.021037129685282707,
-0.08951681107282639,
-0.020393505692481995,
0.0727558359503746,
0.046189356595277786,
-0.022535905241966248,
-0.09077721834182739,
-0.002945145359262824,
0.038255542516708374,
-0.0808820128440857,
0.02474016696214676,
0.0027624170761555433,
0.0024889418855309486,
-0.06830371916294098,
-0.05626334622502327,
-0.09485454857349396,
0.010178050957620144,
0.058740392327308655,
-0.12512196600437164,
0.03947766125202179,
-0.12841567397117615,
-0.020886415615677834,
0.02863640896975994,
-0.006037754938006401,
-0.016564369201660156,
0.018013911321759224,
0.06029094010591507,
-0.0672609955072403,
-0.002380327321588993,
-0.11760152131319046,
-0.11615061014890671,
-0.03370151296257973,
0.005356100387871265,
-0.055708207190036774,
0.08928750455379486,
-0.08472877740859985,
-0.004092411603778601,
-0.003110925666987896,
-0.01283563394099474,
0.048441082239151,
0.047195859253406525,
0.01982717029750347,
0.0523955337703228,
-0.015401394106447697,
0.042201828211545944,
0.01304500550031662,
0.08636588603258133,
-0.007983291521668434,
0.05179764702916145,
-0.039127886295318604,
-0.014427975751459599,
-0.012435606680810452,
0.02584574930369854,
-0.050089363008737564,
-0.007094938773661852,
-0.004720921162515879,
-0.006998063996434212,
-0.07189445197582245,
-0.017843710258603096,
0.038459744304418564,
0.042242083698511124,
-0.010248687118291855,
-0.06408747285604477
] | -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 import the package 'bare-specifier' from a `data:` URL module: await import('data:text/javascript,import "bare-specifier"'); } catch (e) { console.log(e.code); // ERR\_UNSUPPORTED\_RESOLVE\_REQUEST } ``` ### `ERR\_UNSUPPORTED\_TYPESCRIPT\_SYNTAX` The provided TypeScript syntax is unsupported. This could happen when using TypeScript syntax that requires transformation with [type-stripping][]. ### `ERR\_USE\_AFTER\_CLOSE` An attempt was made to use something that was already closed. ### `ERR\_VALID\_PERFORMANCE\_ENTRY\_TYPE` While using the Performance Timing API (`perf\_hooks`), no valid performance entry types are found. ### `ERR\_VM\_DYNAMIC\_IMPORT\_CALLBACK\_MISSING` A dynamic import callback was not specified. ### `ERR\_VM\_DYNAMIC\_IMPORT\_CALLBACK\_MISSING\_FLAG` A dynamic import callback was invoked without `--experimental-vm-modules`. ### `ERR\_VM\_MODULE\_ALREADY\_LINKED` The module attempted to be linked is not eligible for linking, because of one of the following reasons: \* It has already been linked (`linkingStatus` is `'linked'`) \* It is being linked (`linkingStatus` is `'linking'`) \* Linking has failed for this module (`linkingStatus` is `'errored'`) ### `ERR\_VM\_MODULE\_CACHED\_DATA\_REJECTED` The `cachedData` option passed to a module constructor is invalid. ### `ERR\_VM\_MODULE\_CANNOT\_CREATE\_CACHED\_DATA` Cached data cannot be created for modules which have already been evaluated. ### `ERR\_VM\_MODULE\_DIFFERENT\_CONTEXT` The module being returned from the linker function is from a different context than the parent module. Linked modules must share the same context. ### `ERR\_VM\_MODULE\_LINK\_FAILURE` The module was unable to be linked due to a failure. ### `ERR\_VM\_MODULE\_NOT\_MODULE` The fulfilled value of a linking promise is not a `vm.Module` object. ### `ERR\_VM\_MODULE\_STATUS` The current module's status does not allow for this operation. The specific meaning of the error depends on the specific function. ### `ERR\_WASI\_ALREADY\_STARTED` The WASI instance has already started. ### `ERR\_WASI\_NOT\_STARTED` The WASI instance has not been started. ### `ERR\_WEBASSEMBLY\_NOT\_SUPPORTED` A feature requiring WebAssembly was used, but WebAssembly is not supported or has been disabled in the current environment (for example, when running with `--jitless`). ### `ERR\_WEBASSEMBLY\_RESPONSE` The `Response` that has been passed to `WebAssembly.compileStreaming` or to `WebAssembly.instantiateStreaming` is not a valid WebAssembly response. ### `ERR\_WORKER\_INIT\_FAILED` The `Worker` initialization failed. ### `ERR\_WORKER\_INVALID\_EXEC\_ARGV` The `execArgv` option passed to the `Worker` constructor contains invalid flags. ### `ERR\_WORKER\_MESSAGING\_ERRORED` > Stability: 1.1 - Active development The destination thread threw an error while processing a message sent via [`postMessageToThread()`][]. ### `ERR\_WORKER\_MESSAGING\_FAILED` > Stability: 1.1 - Active development The thread requested in [`postMessageToThread()`][] is invalid or has no `workerMessage` listener. ### `ERR\_WORKER\_MESSAGING\_SAME\_THREAD` > Stability: 1.1 - Active development The thread id requested in [`postMessageToThread()`][] is the current thread id. ### `ERR\_WORKER\_MESSAGING\_TIMEOUT` > Stability: 1.1 - Active development Sending a message via [`postMessageToThread()`][] timed out. ### `ERR\_WORKER\_NOT\_RUNNING` An operation failed because the `Worker` instance is not currently running. ### `ERR\_WORKER\_OUT\_OF\_MEMORY` The `Worker` instance terminated because it reached its memory limit. ### `ERR\_WORKER\_PATH` The path for the main script of a worker is neither an absolute path nor a relative path starting with `./` or `../`. ### `ERR\_WORKER\_UNSERIALIZABLE\_ERROR` All attempts at serializing an uncaught exception from a worker thread failed. ### `ERR\_WORKER\_UNSUPPORTED\_OPERATION` The requested functionality is not supported in worker threads. ### `ERR\_ZLIB\_INITIALIZATION\_FAILED` Creation of a [`zlib`][] object failed due to incorrect configuration. ### `ERR\_ZSTD\_INVALID\_PARAM` An invalid parameter key was passed during construction of a Zstd 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 order | 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.07377271354198456,
0.05824888497591019,
0.07731901109218597,
-0.02109706401824951,
-0.044668182730674744,
-0.008594428189098835,
0.0663425549864769,
0.076275534927845,
0.01034014392644167,
0.05791360139846802,
0.008430982008576393,
-0.05019940808415413,
-0.04014577344059944,
-0.018003283068537712,
-0.040840696543455124,
0.03198351711034775,
0.009693088009953499,
-0.034742195159196854,
0.06717661023139954,
-0.17765040695667267,
-0.05317223072052002,
0.036442067474126816,
0.1530967354774475,
-0.07233405858278275,
-0.017684118822216988,
0.023956380784511566,
-0.03551911562681198,
0.08697691559791565,
0.07793167233467102,
-0.03182767704129219,
-0.06093626469373703,
0.02722221612930298,
-0.04841385781764984,
-0.016125958412885666,
-0.028603816404938698,
-0.11096198856830597,
0.0026918542571365833,
-0.13246901333332062,
0.01856924779713154,
-0.06255816668272018,
-0.050500620156526566,
0.026006242260336876,
-0.008451296016573906,
-0.04213905707001686,
0.013216809369623661,
0.012652978301048279,
0.06778594851493835,
-0.021301113069057465,
-0.05076718330383301,
0.06412962079048157,
-0.09962981194257736,
-0.011946841143071651,
0.04374260827898979,
-0.10796777904033661,
0.029374802485108376,
0.05986173450946808,
-0.0029752044938504696,
-0.04739309847354889,
-0.00221242499537766,
-0.055292170494794846,
0.08711684495210648,
-0.0184866264462471,
-0.10623633116483688,
-0.04135283827781677,
0.018722156062722206,
0.040577322244644165,
-0.008906190283596516,
-0.013184715993702412,
-0.09606729447841644,
0.00996798649430275,
0.054148610681295395,
0.05932110175490379,
0.041480518877506256,
0.014300604350864887,
0.027995802462100983,
0.047819480299949646,
0.00914883054792881,
-0.06102490797638893,
-0.10659850388765335,
-0.03601629287004471,
0.09133698791265488,
0.06036357209086418,
-0.006964711472392082,
-0.06723924726247787,
0.04782329872250557,
-0.008690726943314075,
0.012484690174460411,
0.021891165524721146,
0.01669105514883995,
0.027865976095199585,
0.01982029899954796,
0.018851110711693764,
0.029923150315880775,
0.04725075513124466,
-0.027213362976908684,
0.003626036224886775,
-0.035355664789676666,
-0.039674028754234314,
-0.030271710827946663,
0.006160113960504532,
-0.07076685130596161,
-0.04566757753491402,
-0.008347147144377232,
0.015648439526557922,
-0.02637341059744358,
0.0021994791459292173,
0.06917742639780045,
0.08015742152929306,
0.05245127156376839,
0.05500960350036621,
-0.04703013598918915,
0.11562220752239227,
0.01697562262415886,
0.07339547574520111,
1.4028444173274222e-33,
-0.04505317658185959,
0.03217774257063866,
-0.0564601756632328,
0.07563841342926025,
0.01990240067243576,
-0.06137703359127045,
0.04058300331234932,
0.026071922853589058,
-0.08883946388959885,
0.013504902832210064,
-0.008069399744272232,
0.02022092230618,
-0.07851150631904602,
-0.03792243450880051,
-0.019697044044733047,
0.027026556432247162,
0.06487099081277847,
-0.010643059387803078,
0.016343483701348305,
0.023327937349677086,
0.04525648057460785,
0.06673357635736465,
0.04014882817864418,
0.03667057305574417,
-0.027776362374424934,
0.046508532017469406,
-0.01466598454862833,
0.00804858561605215,
0.023344624787569046,
-0.015582958236336708,
0.02832759916782379,
-0.02245752327144146,
0.040689386427402496,
0.03539157286286354,
0.0735655426979065,
-0.02015187032520771,
0.019927378743886948,
-0.036325689405202866,
-0.1222805455327034,
-0.04595986753702164,
-0.07066594809293747,
0.07413643598556519,
-0.0401470772922039,
0.051428381353616714,
0.0002794446190819144,
-0.1295023411512375,
-0.0539257787168026,
0.0032058898359537125,
0.028858358040452003,
0.039368078112602234,
-0.07697038352489471,
0.019696135073900223,
0.051497071981430054,
-0.021237321197986603,
0.01473837811499834,
-0.01888478547334671,
-0.04231303930282593,
0.002362431026995182,
-0.010418263264000416,
-0.062620609998703,
0.0488213449716568,
-0.06916902959346771,
-0.04187050834298134,
0.0020922485273331404,
0.05428082123398781,
-0.053898539394140244,
-0.06560206413269043,
0.04679713770747185,
-0.04270234704017639,
0.02114463411271572,
0.03638264164328575,
0.019462712109088898,
-0.08475975692272186,
0.00988208781927824,
0.04431458190083504,
-0.033146683126688004,
-0.041278962045907974,
0.027610231190919876,
0.06694186478853226,
-0.06978525221347809,
0.0731082558631897,
-0.07575926184654236,
-0.011432837694883347,
-0.0011117658577859402,
-0.05043449625372887,
0.04252273961901665,
-0.03987128287553787,
-0.0009149819961749017,
0.1010393500328064,
-0.00763943325728178,
-0.008319477550685406,
-0.003815044416114688,
-0.1061612218618393,
-0.027037566527724266,
-0.050123389810323715,
-4.081202877381731e-33,
0.066522516310215,
0.07999516278505325,
-0.0002821979869622737,
0.10751288384199142,
-0.025899337604641914,
0.010452643036842346,
0.06047409772872925,
0.03774912655353546,
0.05039046332240105,
0.023091671988368034,
0.015926286578178406,
0.014882052317261696,
0.1389075368642807,
-0.056220147758722305,
0.025322331115603447,
0.09556002914905548,
-0.07722436636686325,
0.003551761619746685,
-0.009376322850584984,
-0.06043139472603798,
0.013571962714195251,
-0.02165060304105282,
-0.03503219410777092,
0.04384145885705948,
-0.05822932347655296,
0.08930017799139023,
-0.008027100935578346,
-0.00006825312448199838,
-0.060420773923397064,
0.020362500101327896,
0.04317052662372589,
0.040259189903736115,
-0.07101839780807495,
-0.04786652699112892,
0.025721998885273933,
0.010983696207404137,
0.021536830812692642,
0.03008369356393814,
0.011577652767300606,
-0.05900031700730324,
0.07121345400810242,
0.011660384014248848,
-0.03778556361794472,
-0.029969975352287292,
0.007776455953717232,
-0.07395297288894653,
-0.011591058224439621,
0.03260593116283417,
0.08611667156219482,
-0.12842567265033722,
-0.05565648525953293,
-0.07372304797172546,
0.02556629665195942,
-0.10236169397830963,
-0.03567425161600113,
-0.015724416822195053,
0.06914521753787994,
-0.009497820399701595,
-0.004856188781559467,
0.005324085243046284,
0.054114554077386856,
-0.05608823522925377,
-0.05255422368645668,
-0.06277874857187271,
-0.04147208854556084,
-0.011506156995892525,
-0.06011318042874336,
-0.013722401112318039,
0.07664678990840912,
-0.014595563523471355,
0.02464752271771431,
0.027507320046424866,
-0.018320441246032715,
-0.04904402419924736,
0.01147843524813652,
0.0048251645639538765,
0.0028877740260213614,
0.014384135603904724,
0.05263912305235863,
0.07471863180398941,
0.08538218587636948,
0.015410800464451313,
0.0674935057759285,
-0.05272737145423889,
0.0651731863617897,
-0.006040869280695915,
-0.05055372789502144,
0.03890097141265869,
-0.03706822544336319,
-0.016498664394021034,
0.001884148339740932,
0.0006674352916888893,
-0.035939089953899384,
-0.039335429668426514,
-0.0462765172123909,
-5.975675776426215e-8,
-0.04021754115819931,
0.0029767274390906096,
-0.1190987378358841,
-0.006106930319219828,
0.023357626050710678,
-0.04910608008503914,
-0.06254061311483383,
-0.015282891690731049,
0.04358677938580513,
0.07664941251277924,
-0.054235782474279404,
0.015409255400300026,
-0.0357978492975235,
0.03415943682193756,
-0.04611368477344513,
-0.015893612056970596,
-0.038090381771326065,
0.07965310662984848,
-0.019831493496894836,
-0.04076563939452171,
-0.05376081168651581,
-0.001504315179772675,
0.031872279942035675,
0.0040772659704089165,
0.040827199816703796,
0.008488205261528492,
0.03743702545762062,
0.04695079103112221,
0.006367011461406946,
-0.00549096055328846,
-0.06515326350927353,
0.01782798022031784,
0.04636843502521515,
-0.05197102203965187,
-0.06149689853191376,
0.050362348556518555,
0.10377071797847748,
-0.028654076159000397,
0.013378169387578964,
-0.07956980913877487,
0.02733384631574154,
0.03066936694085598,
-0.005469403695315123,
0.015215633437037468,
0.018986795097589493,
-0.030434221029281616,
0.00504569336771965,
0.008950978517532349,
-0.014714449644088745,
0.005158933345228434,
0.05807027965784073,
-0.021200979128479958,
-0.08354997634887695,
0.063591867685318,
-0.026558130979537964,
-0.0015244788955897093,
-0.06053628399968147,
-0.05539538338780403,
-0.07493707537651062,
-0.11222226172685623,
0.07634954154491425,
-0.03372015431523323,
0.023820359259843826,
-0.06685204803943634
] | 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 order to protect against malicious or malconfigured clients, if more than `maxHeaderSize` of HTTP header data is received then HTTP parsing will abort without a request or response object being created, and an `Error` with this code will be emitted. ### `HPE\_UNEXPECTED\_CONTENT\_LENGTH` Server is sending both a `Content-Length` header and `Transfer-Encoding: chunked`. `Transfer-Encoding: chunked` allows the server to maintain an HTTP persistent connection for dynamically generated content. In this case, the `Content-Length` HTTP header cannot be used. Use `Content-Length` or `Transfer-Encoding: chunked`. ### `MODULE\_NOT\_FOUND` A module file could not be resolved by the CommonJS modules loader while attempting a [`require()`][] operation or when loading the program entry point. ## Legacy Node.js error codes > Stability: 0 - Deprecated. These error codes are either inconsistent, or have > been removed. ### `ERR\_CANNOT\_TRANSFER\_OBJECT` The value passed to `postMessage()` contained an object that is not supported for transferring. ### `ERR\_CPU\_USAGE` The native call from `process.cpuUsage` could not be processed. ### `ERR\_CRYPTO\_HASH\_DIGEST\_NO\_UTF16` The UTF-16 encoding was used with [`hash.digest()`][]. While the `hash.digest()` method does allow an `encoding` argument to be passed in, causing the method to return a string rather than a `Buffer`, the UTF-16 encoding (e.g. `ucs` or `utf16le`) is not supported. ### `ERR\_CRYPTO\_SCRYPT\_INVALID\_PARAMETER` An incompatible combination of options was passed to [`crypto.scrypt()`][] or [`crypto.scryptSync()`][]. New versions of Node.js use the error code [`ERR\_INCOMPATIBLE\_OPTION\_PAIR`][] instead, which is consistent with other APIs. ### `ERR\_FS\_INVALID\_SYMLINK\_TYPE` An invalid symlink type was passed to the [`fs.symlink()`][] or [`fs.symlinkSync()`][] methods. ### `ERR\_HTTP2\_FRAME\_ERROR` Used when a failure occurs sending an individual frame on the HTTP/2 session. ### `ERR\_HTTP2\_HEADERS\_OBJECT` Used when an HTTP/2 Headers Object is expected. ### `ERR\_HTTP2\_HEADER\_REQUIRED` Used when a required header is missing in an HTTP/2 message. ### `ERR\_HTTP2\_INFO\_HEADERS\_AFTER\_RESPOND` HTTP/2 informational headers must only be sent \_prior\_ to calling the `Http2Stream.prototype.respond()` method. ### `ERR\_HTTP2\_STREAM\_CLOSED` Used when an action has been performed on an HTTP/2 Stream that has already been closed. ### `ERR\_HTTP\_INVALID\_CHAR` Used when an invalid character is found in an HTTP response status message (reason phrase). ### `ERR\_IMPORT\_ASSERTION\_TYPE\_FAILED` An import assertion has failed, preventing the specified module to be imported. ### `ERR\_IMPORT\_ASSERTION\_TYPE\_MISSING` An import assertion is missing, preventing the specified module to be imported. ### `ERR\_IMPORT\_ASSERTION\_TYPE\_UNSUPPORTED` An import attribute is not supported by this version of Node.js. ### `ERR\_INDEX\_OUT\_OF\_RANGE` A given index was out of the accepted range (e.g. negative offsets). ### `ERR\_INVALID\_OPT\_VALUE` An invalid or unexpected value was passed in an options object. ### `ERR\_INVALID\_OPT\_VALUE\_ENCODING` An invalid or unknown file encoding was passed. ### `ERR\_INVALID\_PERFORMANCE\_MARK` While using the Performance Timing API (`perf\_hooks`), a performance mark is invalid. ### `ERR\_INVALID\_TRANSFER\_OBJECT` An invalid transfer object was passed to `postMessage()`. ### `ERR\_MANIFEST\_ASSERT\_INTEGRITY` An attempt was made to load a resource, but the resource did not match the integrity defined by the policy manifest. See the documentation for policy manifests for more information. ### `ERR\_MANIFEST\_DEPENDENCY\_MISSING` An attempt was made to load a resource, but the resource was not listed as a dependency from the location that attempted to load it. See the documentation for policy manifests for more information. ### `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\_MANIFEST\_INVALID\_RESOURCE\_FIELD` A policy | 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.011926069855690002,
0.0034095635637640953,
-0.016785793006420135,
-0.0010491360444575548,
0.005159270949661732,
-0.11719677597284317,
-0.006963344756513834,
0.01654094271361828,
0.045141786336898804,
-0.04543738439679146,
0.07917822897434235,
-0.009608143009245396,
0.05588874593377113,
-0.07534026354551315,
-0.03663010895252228,
0.005949767772108316,
-0.039201050996780396,
0.11010094732046127,
-0.061008501797914505,
-0.07231439650058746,
0.03932341933250427,
0.016977058723568916,
0.09298189729452133,
0.01699184440076351,
-0.07615405321121216,
-0.031862519681453705,
-0.02821183390915394,
0.07351446151733398,
0.007828339003026485,
-0.0674726814031601,
0.06354221701622009,
-0.07706114649772644,
0.06423429399728775,
-0.04395144432783127,
-0.041984133422374725,
-0.06771644949913025,
-0.05065326392650604,
-0.09554360806941986,
0.029983937740325928,
-0.030440378934144974,
0.07945146411657333,
-0.0022953127045184374,
-0.13226638734340668,
-0.08105865120887756,
0.08204036951065063,
-0.03861623257398605,
0.08158018440008163,
-0.11442746967077255,
-0.02173941396176815,
-0.010577776469290257,
-0.012106760405004025,
-0.04573122411966324,
-0.06003944203257561,
-0.03534029424190521,
0.03775545209646225,
-0.06274368613958359,
0.06878601014614105,
-0.001745365560054779,
0.025278132408857346,
-0.1552026867866516,
0.09558083117008209,
0.028557775542140007,
-0.014759440906345844,
-0.05036928877234459,
0.005190171301364899,
-0.033438898622989655,
-0.032136451452970505,
-0.0006671582814306021,
-0.0676184669137001,
0.03616153076291084,
0.031489450484514236,
-0.032286375761032104,
0.0024916629772633314,
-0.04096435755491257,
0.06106622889637947,
-0.009043867699801922,
0.0394737608730793,
-0.053603142499923706,
0.008068490773439407,
0.0807662084698677,
0.08821938931941986,
0.03425098583102226,
0.06130838394165039,
-0.009761130437254906,
-0.04934613034129143,
0.008109165355563164,
0.01957392692565918,
-0.022334210574626923,
0.03602021187543869,
0.03829081356525421,
0.01758045144379139,
-0.02605314552783966,
-0.1141209602355957,
-0.0023749242536723614,
0.14474152028560638,
0.044776011258363724,
-0.05603257566690445,
0.009156865067780018,
-0.016548505052924156,
-0.004747895989567041,
-0.13321231305599213,
-0.008312609978020191,
0.03953374922275543,
-0.023520784452557564,
-0.0288405641913414,
-0.06001543253660202,
0.021935507655143738,
0.001830217195674777,
-0.053764935582876205,
-0.05536622181534767,
-0.0010617222869768739,
0.04887542128562927,
-0.02371988259255886,
0.08863390237092972,
2.772845706163862e-33,
-0.05484532192349434,
-0.013985385186970234,
-0.054233018308877945,
0.05575936660170555,
0.016580505296587944,
0.011192317120730877,
-0.016103437170386314,
0.03833429142832756,
-0.05239490047097206,
-0.018890585750341415,
-0.004121958743780851,
-0.09475482255220413,
0.0016068801051005721,
0.052200205624103546,
0.050033777952194214,
-0.05556312948465347,
0.06749855726957321,
0.0974222719669342,
0.006395178381353617,
0.05379476770758629,
0.035164725035429,
-0.06794866174459457,
0.013840540312230587,
-0.003636317327618599,
-0.05963335558772087,
0.021243618801236153,
-0.04863787814974785,
-0.02290632389485836,
-0.04841310530900955,
-0.004051517229527235,
-0.0007980063674040139,
0.031310416758060455,
-0.021351460367441177,
-0.021820850670337677,
0.06535284221172333,
-0.07554370164871216,
-0.0149689931422472,
-0.0052408333867788315,
-0.09873256832361221,
0.011782406829297543,
0.05957770347595215,
0.022812619805336,
-0.05585705116391182,
0.027112046256661415,
-0.03298991173505783,
-0.08641499280929565,
-0.06194060295820236,
-0.07019530236721039,
-0.05925711989402771,
0.027700897306203842,
0.015902532264590263,
0.06955831497907639,
0.10691681504249573,
0.0341140553355217,
0.012660382315516472,
0.018243936821818352,
0.033670324832201004,
0.022732341662049294,
0.05335678905248642,
-0.0030192926060408354,
0.03880692273378372,
0.010922190733253956,
0.015090431086719036,
-0.014734605327248573,
0.10496892035007477,
-0.04086018353700638,
0.018420575186610222,
0.09451909363269806,
0.01882810704410076,
0.014220604673027992,
-0.021764125674962997,
-0.019990965723991394,
0.06582717597484589,
0.035216450691223145,
-0.05989992618560791,
-0.08058581501245499,
0.00984449964016676,
-0.02725979872047901,
0.04158732295036316,
-0.031060442328453064,
0.02822686731815338,
-0.005448059644550085,
0.12459532916545868,
-0.09082178771495819,
-0.05095026642084122,
-0.006323894485831261,
-0.039644528180360794,
-0.04080578684806824,
-0.06937731057405472,
0.0566520169377327,
0.0103460056707263,
-0.020925024524331093,
0.020174380391836166,
-0.08080140501260757,
-0.017156265676021576,
-4.318951385281339e-33,
0.01645086705684662,
0.025176404044032097,
-0.10860054194927216,
0.0292054396122694,
0.05365079268813133,
-0.0032409955747425556,
0.004820008762180805,
0.16363941133022308,
0.026211606338620186,
-0.014835402369499207,
0.0200320053845644,
0.011189836077392101,
-0.0021667652763426304,
-0.0037103465292602777,
-0.06969871371984482,
0.016566425561904907,
-0.020097102969884872,
-0.10077528655529022,
0.013501942157745361,
-0.025980448350310326,
-0.05536434054374695,
-0.03862708434462547,
0.020286541432142258,
0.047907810658216476,
0.026039183139801025,
0.029008332639932632,
-0.022153975442051888,
0.02508101798593998,
0.002195262350142002,
0.031625859439373016,
0.025240696966648102,
0.041019294410943985,
-0.05551037937402725,
0.019270002841949463,
0.023501837626099586,
-0.0760304257273674,
0.08376866579055786,
0.14038246870040894,
0.031222166493535042,
0.021302348002791405,
0.10950218886137009,
0.0200542863458395,
0.01655074954032898,
0.014083771966397762,
0.06988377869129181,
-0.07590977102518082,
-0.01912301778793335,
-0.013009997084736824,
-0.005626671947538853,
0.015488656237721443,
-0.004837779328227043,
0.021725861355662346,
0.01988745667040348,
0.05254018306732178,
0.04182198643684387,
-0.01844806782901287,
0.02749287523329258,
0.05010213330388069,
-0.039467424154281616,
-0.10279911011457443,
0.004629775881767273,
-0.01802809350192547,
-0.06297378242015839,
0.013245772570371628,
0.053510360419750214,
0.02212550863623619,
-0.02741544507443905,
-0.01960756443440914,
0.02951834909617901,
-0.045031409710645676,
0.0023258740548044443,
-0.0233633853495121,
-0.006283948663622141,
0.031163303181529045,
0.03545261174440384,
-0.02536170557141304,
-0.0028570760041475296,
0.02730587311089039,
0.03438819944858551,
0.12687408924102783,
-0.054371219128370285,
0.04492799565196037,
-0.04673149436712265,
0.004303680267184973,
0.11448241770267487,
-0.07617973536252975,
-0.06316432356834412,
0.022458583116531372,
-0.08176423609256744,
-0.05560673773288727,
0.021194253116846085,
0.03114430233836174,
-0.015369140543043613,
0.05347083508968353,
0.00010859323083423078,
-4.264920505647751e-8,
-0.0035982609260827303,
-0.08931993693113327,
-0.10084251314401627,
0.022310221567749977,
0.09396607428789139,
0.031061755493283272,
-0.011515532620251179,
0.01586989127099514,
0.021219896152615547,
0.006515687797218561,
0.0064626880921423435,
-0.007898029871284962,
-0.015155090019106865,
0.01187081914395094,
-0.0011116580571979284,
-0.04956284537911415,
-0.05098259076476097,
-0.05803879350423813,
-0.028957827016711235,
-0.0445253811776638,
0.0028300608973950148,
-0.007657351903617382,
-0.02776182070374489,
-0.012547497637569904,
0.03447006642818451,
-0.02659204788506031,
0.042939893901348114,
0.11800846457481384,
-0.07111688703298569,
-0.1405036747455597,
-0.014824140816926956,
0.029021721333265305,
-0.023876171559095383,
-0.043244369328022,
0.03876641392707825,
0.0655873492360115,
0.006599236745387316,
0.019522935152053833,
-0.012720229104161263,
0.01537754200398922,
0.05382861942052841,
0.028290193527936935,
0.017825597897171974,
-0.005382636561989784,
0.07915841788053513,
0.055751506239175797,
0.02889755181968212,
0.10260577499866486,
-0.018379412591457367,
-0.0030085917096585035,
0.07869360595941544,
0.025771819055080414,
0.002587198046967387,
0.011691874824464321,
-0.01852324791252613,
-0.04041401296854019,
-0.005746505223214626,
-0.03964584320783615,
-0.022411013022065163,
-0.01644630916416645,
0.08843294531106949,
0.021983396261930466,
0.04251990094780922,
-0.0006315487553365529
] | 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\_MANIFEST\_INVALID\_RESOURCE\_FIELD` A policy manifest resource had an invalid value for one of its fields. Update the manifest entry to match in order to resolve this error. See the documentation for policy manifests for more information. ### `ERR\_MANIFEST\_INVALID\_SPECIFIER` A policy manifest resource had an invalid value for one of its dependency mappings. Update the manifest entry to match to resolve this error. See the documentation for policy manifests for more information. ### `ERR\_MANIFEST\_PARSE\_POLICY` An attempt was made to load a policy manifest, but the manifest was unable to be parsed. See the documentation for policy manifests for more information. ### `ERR\_MANIFEST\_TDZ` An attempt was made to read from a policy manifest, but the manifest initialization has not yet taken place. This is likely a bug in Node.js. ### `ERR\_MANIFEST\_UNKNOWN\_ONERROR` A policy manifest was loaded, but had an unknown value for its "onerror" behavior. See the documentation for policy manifests for more information. ### `ERR\_MISSING\_MESSAGE\_PORT\_IN\_TRANSFER\_LIST` This error code was replaced by [`ERR\_MISSING\_TRANSFERABLE\_IN\_TRANSFER\_LIST`][] in Node.js 15.0.0, because it is no longer accurate as other types of transferable objects also exist now. ### `ERR\_MISSING\_TRANSFERABLE\_IN\_TRANSFER\_LIST` An object that needs to be explicitly listed in the `transferList` argument is in the object passed to a [`postMessage()`][] call, but is not provided in the `transferList` for that call. Usually, this is a `MessagePort`. In Node.js versions prior to v15.0.0, the error code being used here was [`ERR\_MISSING\_MESSAGE\_PORT\_IN\_TRANSFER\_LIST`][]. However, the set of transferable object types has been expanded to cover more types than `MessagePort`. ### `ERR\_NAPI\_CONS\_PROTOTYPE\_OBJECT` Used by the `Node-API` when `Constructor.prototype` is not an object. ### `ERR\_NAPI\_TSFN\_START\_IDLE\_LOOP` On the main thread, values are removed from the queue associated with the thread-safe function in an idle loop. This error indicates that an error has occurred when attempting to start the loop. ### `ERR\_NAPI\_TSFN\_STOP\_IDLE\_LOOP` Once no more items are left in the queue, the idle loop must be suspended. This error indicates that the idle loop has failed to stop. ### `ERR\_NO\_LONGER\_SUPPORTED` A Node.js API was called in an unsupported manner, such as `Buffer.write(string, encoding, offset[, length])`. ### `ERR\_OUTOFMEMORY` Used generically to identify that an operation caused an out of memory condition. ### `ERR\_PARSE\_HISTORY\_DATA` The `node:repl` module was unable to parse data from the REPL history file. ### `ERR\_SOCKET\_CANNOT\_SEND` Data could not be sent on a socket. ### `ERR\_STDERR\_CLOSE` An attempt was made to close the `process.stderr` stream. By design, Node.js does not allow `stdout` or `stderr` streams to be closed by user code. ### `ERR\_STDOUT\_CLOSE` An attempt was made to close the `process.stdout` stream. By design, Node.js does not allow `stdout` or `stderr` streams to be closed by user code. ### `ERR\_STREAM\_READ\_NOT\_IMPLEMENTED` Used when an attempt is made to use a readable stream that has not implemented [`readable.\_read()`][]. ### `ERR\_TAP\_LEXER\_ERROR` An error representing a failing lexer state. ### `ERR\_TAP\_PARSER\_ERROR` An error representing a failing parser state. Additional information about the token causing the error is available via the `cause` property. ### `ERR\_TAP\_VALIDATION\_ERROR` This error represents a failed TAP validation. ### `ERR\_TLS\_RENEGOTIATION\_FAILED` Used when a TLS renegotiation request has failed in a 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 in "externalized" mode, or put existing `SharedArrayBuffer` into externalized mode. ### `ERR\_UNKNOWN\_STDIN\_TYPE` An | 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.03207812085747719,
0.07840676605701447,
0.042891547083854675,
-0.00850905291736126,
-0.019628234207630157,
-0.04470362886786461,
0.12459087371826172,
0.022792261093854904,
0.041028957813978195,
-0.06169942766427994,
0.016313059255480766,
0.01786256767809391,
0.008186591789126396,
-0.08714799582958221,
0.008211889304220676,
-0.010872379876673222,
0.022599954158067703,
0.01823567785322666,
0.001562835881486535,
-0.06839596480131149,
-0.023890197277069092,
0.09450867027044296,
0.08923634886741638,
-0.06898116320371628,
-0.0449194572865963,
-0.061751917004585266,
0.030597591772675514,
0.08686532825231552,
0.020976131781935692,
0.009754622355103493,
0.04453044757246971,
-0.048493534326553345,
-0.0696701928973198,
0.04626541584730148,
-0.04022327437996864,
-0.0037847929634153843,
-0.042706448584795,
0.0027467128820717335,
0.04513677954673767,
0.023213930428028107,
-0.049973014742136,
0.007590991444885731,
0.015092149376869202,
0.01131843589246273,
0.18460600078105927,
-0.02435438521206379,
0.02451932244002819,
0.03725401684641838,
-0.02671857550740242,
-0.02982281520962715,
-0.058696843683719635,
-0.016096651554107666,
0.05992724373936653,
-0.04338866472244263,
-0.09007734805345535,
-0.005183071829378605,
-0.029014011844992638,
-0.06317322701215744,
-0.0031344746239483356,
-0.03833933174610138,
0.007617590948939323,
0.00923082698136568,
-0.0018689362332224846,
-0.024865545332431793,
0.08233804255723953,
0.029228447005152702,
-0.19949156045913696,
-0.02871476486325264,
-0.03555380925536156,
-0.030229030176997185,
-0.004093664698302746,
0.04014851897954941,
-0.010716412216424942,
-0.07596911489963531,
-0.0185727309435606,
0.09358834475278854,
0.0884072333574295,
-0.0043154992163181305,
-0.06162107363343239,
0.04909667372703552,
0.04923243820667267,
0.02763204090297222,
0.027671009302139282,
-0.024413321167230606,
-0.021980980411171913,
-0.00029442511731758714,
0.05276240035891533,
0.013486596755683422,
-0.03345874696969986,
0.008597182109951973,
0.07707913219928741,
0.027956761419773102,
0.012294959276914597,
-0.09085329622030258,
0.023124881088733673,
-0.08144719153642654,
0.022128058597445488,
-0.006140586920082569,
0.013993363827466965,
0.047430574893951416,
-0.059679459780454636,
-0.007389681879431009,
0.055072225630283356,
-0.012397798709571362,
-0.02038235403597355,
-0.054278891533613205,
0.1001230999827385,
0.04044739529490471,
-0.06630992889404297,
0.03203893452882767,
-0.019189022481441498,
-0.02242770418524742,
-0.056350041180849075,
0.003409287426620722,
-9.118088355782743e-34,
0.006384450942277908,
-0.015452706255018711,
0.007731245364993811,
0.07938548922538757,
0.021929631009697914,
-0.007510313298553228,
-0.04051673412322998,
0.03099135495722294,
-0.027241144329309464,
-0.015616132877767086,
0.07552915066480637,
0.07587640732526779,
-0.04983879253268242,
0.013901378959417343,
0.06816017627716064,
-0.013264436274766922,
0.0007927804836072028,
0.10027791559696198,
0.0844634547829628,
-0.020381923764944077,
0.0024602077901363373,
-0.01793063059449196,
-0.02462228573858738,
-0.06328824162483215,
-0.012805940583348274,
0.0992838442325592,
-0.036783475428819656,
0.04624144732952118,
0.02826779894530773,
0.005911201238632202,
0.037938155233860016,
-0.025297032669186592,
0.07931015640497208,
0.024288037791848183,
0.03841441497206688,
-0.08261962234973907,
0.054412681609392166,
-0.015955783426761627,
-0.08609796315431595,
-0.09852346032857895,
0.035379260778427124,
0.010215025395154953,
0.017503544688224792,
0.04905866086483002,
0.09244238585233688,
-0.08230756223201752,
0.030369654297828674,
-0.0016748948255553842,
0.07405058294534683,
-0.06984804570674896,
0.04178864136338234,
0.01480743009597063,
0.029702911153435707,
-0.09385517239570618,
-0.0607694610953331,
-0.043957363814115524,
-0.12312683463096619,
0.09823372215032578,
-0.0008389953291043639,
-0.08244845271110535,
0.09508409351110458,
0.007014919072389603,
-0.04393064230680466,
0.033621788024902344,
0.0330430269241333,
-0.017711041495203972,
0.013631044887006283,
0.02835726924240589,
-0.04793862625956535,
-0.015026824548840523,
-0.028673959895968437,
-0.02517681010067463,
0.02593303844332695,
0.01679813489317894,
-0.009440220892429352,
-0.07163848727941513,
0.026643000543117523,
-0.06186439096927643,
-0.10072275251150131,
0.046946000307798386,
-0.1051882952451706,
-0.026906033977866173,
-0.03227929025888443,
-0.054601915180683136,
-0.14256449043750763,
0.020036326721310616,
-0.0030213326681405306,
0.011921010911464691,
-0.0001874667505035177,
0.009876123629510403,
-0.007257638033479452,
-0.03143741935491562,
-0.10337475687265396,
0.009058781899511814,
0.00349689950235188,
-4.015201073634967e-33,
0.008427989669144154,
-0.046250272542238235,
0.004753192886710167,
-0.04775829240679741,
-0.011720237322151661,
-0.047962792217731476,
0.008937710896134377,
0.036760661751031876,
0.00976309273391962,
-0.05610991641879082,
-0.03544807434082031,
0.00031383021268993616,
0.05644768103957176,
0.006424412596970797,
-0.043864551931619644,
0.08200744539499283,
-0.01951274648308754,
0.01419371459633112,
0.025564104318618774,
0.0661269947886467,
0.004914481658488512,
0.09430650621652603,
-0.08716507256031036,
0.1006307601928711,
-0.07923319935798645,
0.01722024194896221,
-0.037778716534376144,
-0.02501417137682438,
0.018071237951517105,
0.05898992344737053,
0.06585774570703506,
0.035911086946725845,
-0.062375932931900024,
0.06210748478770256,
-0.08840838819742203,
0.03593580424785614,
0.019767416641116142,
-0.06562712788581848,
-0.08794304728507996,
-0.05897611379623413,
0.06773856282234192,
-0.06019704043865204,
0.06533673405647278,
-0.02005406841635704,
0.010502681136131287,
-0.060964688658714294,
0.06319132447242737,
-0.031953196972608566,
-0.07105131447315216,
-0.06430187821388245,
0.04525654390454292,
-0.020745445042848587,
-0.033777154982089996,
0.015346510335803032,
0.037678640335798264,
0.05125938728451729,
0.015414333902299404,
0.015836382284760475,
-0.09025060385465622,
-0.04729340597987175,
0.05538511276245117,
0.06138567999005318,
-0.07215553522109985,
0.009233832359313965,
0.0418953001499176,
0.037019506096839905,
-0.06912145018577576,
-0.012996532954275608,
0.024980628862977028,
-0.04490732029080391,
-0.01337080541998148,
-0.012071407400071621,
-0.09581748396158218,
-0.00991829764097929,
-0.004457645583897829,
0.06378188729286194,
0.05369892343878746,
-0.021256383508443832,
-0.09452339261770248,
0.003945623524487019,
-0.04412905126810074,
0.005412719678133726,
-0.02844536118209362,
0.01666031777858734,
0.011917506344616413,
0.002513592131435871,
-0.019185254350304604,
0.03494776412844658,
-0.020665708929300308,
0.04430847615003586,
-0.04075944423675537,
-0.01678413338959217,
-0.05140269175171852,
0.05834285914897919,
-0.0735999122262001,
-4.746659598708902e-8,
-0.03380519524216652,
0.03430524840950966,
-0.10812505334615707,
-0.02907278761267662,
0.049361709505319595,
-0.009918641299009323,
-0.00232865777797997,
-0.03167418763041496,
0.0013306229375302792,
-0.020835665985941887,
-0.08274330198764801,
0.027295729145407677,
-0.0758359283208847,
-0.040517229586839676,
0.014779588207602501,
-0.07095782458782196,
-0.06100933626294136,
0.08251699060201645,
-0.01845310442149639,
-0.015914278104901314,
-0.0038742662873119116,
0.0018717084312811494,
-0.02876693196594715,
-0.10756658762693405,
-0.0036290097050368786,
0.01905278116464615,
-0.03157687187194824,
0.02630358189344406,
0.034398287534713745,
0.05907474085688591,
0.04051516577601433,
-0.023261386901140213,
0.02331697754561901,
-0.02696722000837326,
0.024640623480081558,
0.03566658869385719,
0.058749567717313766,
0.005791676230728626,
0.04623294621706009,
-0.03384614363312721,
0.10049038380384445,
0.06317642331123352,
-0.022594839334487915,
0.03496526926755905,
-0.023556353524327278,
0.03286759555339813,
-0.08186525851488113,
0.03845898061990738,
0.14626577496528625,
-0.007869788445532322,
0.0031051409896463156,
0.02175893634557724,
-0.12112147361040115,
0.043804146349430084,
0.014140130952000618,
-0.03653410077095032,
-0.052982307970523834,
-0.016405709087848663,
0.015530327335000038,
-0.026193862780928612,
0.03962727636098862,
-0.02741444855928421,
0.012098941020667553,
-0.04525201767683029
] | 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 in "externalized" mode, or put existing `SharedArrayBuffer` into externalized mode. ### `ERR\_UNKNOWN\_STDIN\_TYPE` An attempt was made to launch a Node.js process with an unknown `stdin` file type. This error is usually an indication of a bug within Node.js itself, although it is possible for user code to trigger it. ### `ERR\_UNKNOWN\_STREAM\_TYPE` An attempt was made to launch a Node.js process with an unknown `stdout` or `stderr` file type. This error is usually an indication of a bug within Node.js itself, although it is possible for user code to trigger it. ### `ERR\_V8BREAKITERATOR` The V8 `BreakIterator` API was used but the full ICU data set is not installed. ### `ERR\_VALUE\_OUT\_OF\_RANGE` Used when a given value is out of the accepted range. ### `ERR\_VM\_MODULE\_LINKING\_ERRORED` The linker function returned a module for which linking has failed. ### `ERR\_VM\_MODULE\_NOT\_LINKED` The module must be successfully linked before instantiation. ### `ERR\_WORKER\_UNSUPPORTED\_EXTENSION` The pathname used for the main script of a worker has an unknown file extension. ### `ERR\_ZLIB\_BINDING\_CLOSED` Used when an attempt is made to use a `zlib` object after it has already been closed. ## OpenSSL Error Codes ### Time Validity Errors #### `CERT\_NOT\_YET\_VALID` The certificate is not yet valid: the notBefore date is after the current time. #### `CERT\_HAS\_EXPIRED` The certificate has expired: the notAfter date is before the current time. #### `CRL\_NOT\_YET\_VALID` The certificate revocation list (CRL) has a future issue date. #### `CRL\_HAS\_EXPIRED` The certificate revocation list (CRL) has expired. #### `CERT\_REVOKED` The certificate has been revoked; it is on a certificate revocation list (CRL). ### Trust or Chain Related Errors #### `UNABLE\_TO\_GET\_ISSUER\_CERT` The issuer certificate of a looked up certificate could not be found. This normally means the list of trusted certificates is not complete. #### `UNABLE\_TO\_GET\_ISSUER\_CERT\_LOCALLY` The certificate’s issuer is not known. This is the case if the issuer is not included in the trusted certificate list. #### `DEPTH\_ZERO\_SELF\_SIGNED\_CERT` The passed certificate is self-signed and the same certificate cannot be found in the list of trusted certificates. #### `SELF\_SIGNED\_CERT\_IN\_CHAIN` The certificate’s issuer is not known. This is the case if the issuer is not included in the trusted certificate list. #### `CERT\_CHAIN\_TOO\_LONG` The certificate chain length is greater than the maximum depth. #### `UNABLE\_TO\_GET\_CRL` The CRL reference by the certificate could not be found. #### `UNABLE\_TO\_VERIFY\_LEAF\_SIGNATURE` No signatures could be verified because the chain contains only one certificate and it is not self signed. #### `CERT\_UNTRUSTED` The root certificate authority (CA) is not marked as trusted for the specified purpose. ### Basic Extension Errors #### `INVALID\_CA` A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose. #### `PATH\_LENGTH\_EXCEEDED` The basicConstraints pathlength parameter has been exceeded. ### Name Related Errors #### `HOSTNAME\_MISMATCH` Certificate does not match provided name. ### Usage and Policy Errors #### `INVALID\_PURPOSE` The supplied certificate cannot be used for the specified purpose. #### `CERT\_REJECTED` The root CA is marked to reject the specified purpose. ### Formatting Errors #### `CERT\_SIGNATURE\_FAILURE` The signature of the certificate is invalid. #### `CRL\_SIGNATURE\_FAILURE` The signature of the certificate revocation list (CRL) is invalid. #### `ERROR\_IN\_CERT\_NOT\_BEFORE\_FIELD` 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 contains an invalid time. #### `UNABLE\_TO\_DECRYPT\_CERT\_SIGNATURE` The certificate signature could not be decrypted. This means that | 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.020075306296348572,
-0.0241286288946867,
-0.028301246464252472,
-0.06985060125589371,
-0.026631051674485207,
0.007808901369571686,
0.037060316652059555,
0.005555851384997368,
-0.00533853517845273,
-0.0541878268122673,
0.019850512966513634,
-0.021826647222042084,
0.03049800731241703,
-0.038675978779792786,
-0.06968855857849121,
0.004070877097547054,
0.01748037524521351,
-0.03488290309906006,
-0.02879570610821247,
-0.08064144104719162,
-0.0012372967321425676,
-0.023850195109844208,
0.1238371878862381,
-0.03741983324289322,
-0.09831392765045166,
-0.03680265322327614,
-0.062371671199798584,
0.11272257566452026,
0.04365601763129234,
-0.10796552896499634,
0.023581422865390778,
-0.0731944665312767,
-0.04742719233036041,
-0.07657486945390701,
-0.055461350828409195,
-0.07734939455986023,
-0.041445497423410416,
-0.03149102255702019,
0.02881663478910923,
0.008791366592049599,
0.004266096744686365,
0.06659400463104248,
-0.05077506974339485,
-0.06231414154171944,
0.01471445057541132,
0.024243852123618126,
0.10191970318555832,
-0.04686891660094261,
-0.01192969735711813,
0.06054689735174179,
0.0021457995753735304,
0.04618456959724426,
0.06053023785352707,
0.06558079272508621,
0.07230611890554428,
0.03457552567124367,
0.007953470572829247,
0.013050013221800327,
0.014776199124753475,
-0.12870930135250092,
0.00030787393916398287,
-0.011917018331587315,
-0.007009738124907017,
0.03272390365600586,
0.01742471009492874,
-0.0472467876970768,
-0.012316464446485043,
-0.06436511129140854,
-0.02584298513829708,
0.004644382279366255,
0.0553237684071064,
-0.021448921412229538,
0.12345527112483978,
-0.12799851596355438,
0.02387991175055504,
0.06749739497900009,
0.015900632366538048,
-0.15809381008148193,
-0.04050065577030182,
-0.03730083629488945,
0.03846847265958786,
0.05453807860612869,
-0.038456741720438004,
0.03239482268691063,
0.03419650346040726,
0.0009293924085795879,
-0.010057522915303707,
0.036933962255716324,
0.07958753407001495,
0.09147355705499649,
0.00019562728994060308,
0.019800763577222824,
-0.016373101621866226,
0.07744108140468597,
0.030765114352107048,
-0.08316990733146667,
-0.041860587894916534,
-0.004796413239091635,
0.07507961988449097,
0.0201187152415514,
-0.059713199734687805,
-0.012906232848763466,
-0.004621746484190226,
-0.006180439610034227,
-0.07051540911197662,
0.04280476272106171,
0.09644044935703278,
0.06518883258104324,
-0.03298788145184517,
0.03351595252752304,
0.04124782606959343,
0.046137627214193344,
-0.042347297072410583,
-0.023249782621860504,
1.0703221365702482e-33,
-0.017376158386468887,
-0.062163546681404114,
0.04838891327381134,
0.05538162589073181,
0.05246872082352638,
0.007826502434909344,
-0.016667736694216728,
0.02258104272186756,
-0.05698207765817642,
-0.05281520634889603,
0.03406303748488426,
-0.020063001662492752,
0.020779956132173538,
0.06853412091732025,
0.032194335013628006,
-0.028904054313898087,
0.05228584632277489,
0.04593275859951973,
0.06500212103128433,
0.015070267952978611,
0.03838174417614937,
0.07281934469938278,
-0.05795310065150261,
0.014390068128705025,
-0.059992704540491104,
0.007871386595070362,
-0.028087623417377472,
-0.04262734577059746,
0.10002501308917999,
0.006621449254453182,
0.013179903849959373,
0.04452037811279297,
0.027063807472586632,
-0.022072842344641685,
0.04598301276564598,
-0.036807868629693985,
0.020655691623687744,
0.05256212502717972,
-0.07944600284099579,
-0.010870387777686119,
0.037631019949913025,
0.01569286920130253,
-0.07457499951124191,
0.003527966560795903,
-0.016214191913604736,
-0.13128064572811127,
-0.043927304446697235,
-0.03539896756410599,
-0.03035416081547737,
-0.04445800930261612,
-0.07400242984294891,
0.07693947851657867,
0.05607267841696739,
-0.001001634169369936,
0.036021750420331955,
-0.012976380065083504,
0.025276347994804382,
-0.03732557222247124,
-0.009205111302435398,
0.017772585153579712,
0.07515475898981094,
0.05908984690904617,
-0.01730239763855934,
0.019283954054117203,
0.0031735992524772882,
-0.0221725981682539,
-0.02542782947421074,
-0.022951487451791763,
-0.012851047329604626,
-0.035023339092731476,
-0.08090056478977203,
0.024856356903910637,
-0.014451947063207626,
-0.001881845062598586,
0.03938260301947594,
-0.006755259353667498,
-0.06088090315461159,
-0.03721543028950691,
0.004509484861046076,
-0.02809898927807808,
0.008594960905611515,
-0.11514772474765778,
0.01926775462925434,
0.033422913402318954,
-0.05435852333903313,
0.03995160758495331,
-0.0755530446767807,
-0.00019524559320416301,
0.0009167043608613312,
0.08713506162166595,
0.08939510583877563,
-0.04168761521577835,
-0.03914410248398781,
-0.0888318121433258,
-0.04994553327560425,
-5.9199265693013076e-33,
-0.039354272186756134,
0.02949037402868271,
-0.07576783746480942,
0.04835796728730202,
-0.0012809649342671037,
-0.037159498780965805,
0.03267404064536095,
0.018020683899521828,
0.0103158513084054,
-0.03399287536740303,
-0.0674763023853302,
0.07950714975595474,
0.08384021371603012,
-0.004907738417387009,
-0.10247080773115158,
0.05355902761220932,
-0.07059504836797714,
-0.015122749842703342,
0.04785575717687607,
-0.014424548484385014,
-0.001166940899565816,
-0.043038260191679,
0.15311962366104126,
0.05214978754520416,
-0.021332042291760445,
0.046358104795217514,
-0.02562820538878441,
0.0074533745646476746,
-0.10920621454715729,
-0.06487991660833359,
-0.004825570620596409,
0.027885202318429947,
-0.007918034680187702,
0.03478512912988663,
0.0020791504066437483,
-0.03815045207738876,
-0.008445494808256626,
0.022430261597037315,
0.02036837674677372,
-0.043056365102529526,
0.058493588119745255,
0.025847116485238075,
0.0006660936051048338,
-0.028477167710661888,
0.0583704337477684,
-0.021036192774772644,
-0.11071527004241943,
-0.021133264526724815,
0.007196619641035795,
-0.03234526887536049,
-0.019839482381939888,
0.008326019160449505,
-0.025347035378217697,
0.01875840127468109,
0.0015015924582257867,
-0.04582512751221657,
0.07783756405115128,
0.032874155789613724,
0.05298825353384018,
0.04228556528687477,
0.053116679191589355,
-0.08939285576343536,
-0.0971725583076477,
-0.07755576074123383,
0.016655081883072853,
-0.10427714884281158,
-0.05006953328847885,
-0.02401801571249962,
0.07365702092647552,
-0.005023053847253323,
0.05980008840560913,
-0.01064831018447876,
-0.03159154951572418,
0.04706774279475212,
-0.025468194857239723,
0.0020430944859981537,
-0.0027853234205394983,
-0.12543711066246033,
-0.048831965774297714,
0.061925340443849564,
-0.014760270714759827,
0.09444274008274078,
0.04833569377660751,
0.04946080595254898,
0.049135077744722366,
-0.0058437553234398365,
0.035308655351400375,
0.03707461804151535,
-0.08532696962356567,
-0.06349718570709229,
-0.0008904071873985231,
0.0373753197491169,
-0.16267453134059906,
-0.01327658910304308,
-0.029440028592944145,
-5.462296925884402e-8,
-0.06006544455885887,
-0.024244608357548714,
-0.10232114791870117,
0.011381059885025024,
0.04119409620761871,
-0.07834826409816742,
-0.01599556766450405,
0.0036428426392376423,
0.06741181761026382,
0.04159332066774368,
-0.037356920540332794,
-0.014820972457528114,
0.009769103489816189,
-0.006885083392262459,
0.07237977534532547,
-0.02787303552031517,
-0.000022194335542735644,
-0.009365176782011986,
-0.019555220380425453,
-0.09291967749595642,
0.03869716078042984,
0.025287093594670296,
-0.04044416546821594,
0.021351896226406097,
-0.08119025081396103,
-0.07078120857477188,
0.03980417549610138,
0.07559465616941452,
-0.00938020646572113,
-0.06498055160045624,
-0.03923220932483673,
0.05922936648130417,
0.04093094915151596,
-0.002572969999164343,
0.012207108549773693,
0.08757379651069641,
0.04389284551143646,
0.020279332995414734,
-0.013887100853025913,
-0.023927124217152596,
0.030671928077936172,
0.08681101351976395,
-0.026222001761198044,
0.028790321201086044,
0.0223536379635334,
0.016059372574090958,
-0.018939374014735222,
0.1041857972741127,
0.008036453276872635,
0.002784307114779949,
0.08871929347515106,
0.03086892142891884,
-0.03878972306847572,
0.052047114819288254,
0.0008525277371518314,
-0.06366933137178421,
-0.0875973179936409,
-0.08260401338338852,
0.02500128746032715,
0.008905290625989437,
0.09284496307373047,
0.03351249173283577,
-0.0030317313503473997,
-0.00641270587220788
] | 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 contains an invalid time. #### `UNABLE\_TO\_DECRYPT\_CERT\_SIGNATURE` The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value, this is only meaningful for RSA keys. #### `UNABLE\_TO\_DECRYPT\_CRL\_SIGNATURE` The certificate revocation list (CRL) signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. #### `UNABLE\_TO\_DECODE\_ISSUER\_PUBLIC\_KEY` The public key in the certificate SubjectPublicKeyInfo could not be read. ### Other OpenSSL Errors #### `OUT\_OF\_MEM` An error occurred trying to allocate memory. This should never happen. [ES Module]: esm.md [ICU]: intl.md#internationalization-support [JSON Web Key Elliptic Curve Registry]: https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve [JSON Web Key Types Registry]: https://www.iana.org/assignments/jose/jose.xhtml#web-key-types [Native TypeScript support]: typescript.md#type-stripping [Node.js error codes]: #nodejs-error-codes [Permission Model]: permissions.md#permission-model [RFC 7230 Section 3]: https://tools.ietf.org/html/rfc7230#section-3 [SQLite]: sqlite.md [Subresource Integrity specification]: https://www.w3.org/TR/SRI/#the-integrity-attribute [V8's stack trace API]: https://v8.dev/docs/stack-trace-api [WHATWG Supported Encodings]: util.md#whatwg-supported-encodings [WHATWG URL API]: url.md#the-whatwg-url-api [`"exports"`]: packages.md#exports [`"imports"`]: packages.md#imports [`'uncaughtException'`]: process.md#event-uncaughtexception [`--disable-proto=throw`]: cli.md#--disable-protomode [`--force-fips`]: cli.md#--force-fips [`--no-addons`]: cli.md#--no-addons [`--unhandled-rejections`]: cli.md#--unhandled-rejectionsmode [`Class: assert.AssertionError`]: assert.md#class-assertassertionerror [`ERR\_INCOMPATIBLE\_OPTION\_PAIR`]: #err\_incompatible\_option\_pair [`ERR\_INVALID\_ARG\_TYPE`]: #err\_invalid\_arg\_type [`ERR\_MISSING\_MESSAGE\_PORT\_IN\_TRANSFER\_LIST`]: #err\_missing\_message\_port\_in\_transfer\_list [`ERR\_MISSING\_TRANSFERABLE\_IN\_TRANSFER\_LIST`]: #err\_missing\_transferable\_in\_transfer\_list [`ERR\_REQUIRE\_ASYNC\_MODULE`]: #err\_require\_async\_module [`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error/isError [`EventEmitter`]: events.md#class-eventemitter [`MessagePort`]: worker\_threads.md#class-messageport [`Object.getPrototypeOf`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Object/getPrototypeOf [`Object.setPrototypeOf`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Object/setPrototypeOf [`REPL`]: repl.md [`ServerResponse`]: http.md#class-httpserverresponse [`Writable`]: stream.md#class-streamwritable [`child\_process`]: child\_process.md [`cipher.getAuthTag()`]: crypto.md#ciphergetauthtag [`crypto.getDiffieHellman()`]: crypto.md#cryptogetdiffiehellmangroupname [`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback [`crypto.scryptSync()`]: crypto.md#cryptoscryptsyncpassword-salt-keylen-options [`crypto.timingSafeEqual()`]: crypto.md#cryptotimingsafeequala-b [`dgram.connect()`]: dgram.md#socketconnectport-address-callback [`dgram.createSocket()`]: dgram.md#dgramcreatesocketoptions-callback [`dgram.disconnect()`]: dgram.md#socketdisconnect [`dgram.remoteAddress()`]: dgram.md#socketremoteaddress [`domException.name`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name [`errno`(3) man page]: https://man7.org/linux/man-pages/man3/errno.3.html [`error.code`]: #errorcode [`error.message`]: #errormessage [`fs.Dir`]: fs.md#class-fsdir [`fs.cp()`]: fs.md#fscpsrc-dest-options-callback [`fs.readFileSync`]: fs.md#fsreadfilesyncpath-options [`fs.readdir`]: fs.md#fsreaddirpath-options-callback [`fs.symlink()`]: fs.md#fssymlinktarget-path-type-callback [`fs.symlinkSync()`]: fs.md#fssymlinksynctarget-path-type [`fs.unlink`]: fs.md#fsunlinkpath-callback [`fs`]: fs.md [`hash.digest()`]: crypto.md#hashdigestencoding [`hash.update()`]: crypto.md#hashupdatedata-inputencoding [`http`]: http.md [`https`]: https.md [`libuv Error handling`]: https://docs.libuv.org/en/v1.x/errors.html [`net.Socket.write()`]: net.md#socketwritedata-encoding-callback [`net`]: net.md [`new URL(input)`]: url.md#new-urlinput-base [`new URLPattern(input)`]: url.md#new-urlpatternstring-baseurl-options [`new URLSearchParams(iterable)`]: url.md#new-urlsearchparamsiterable [`package.json`]: packages.md#nodejs-packagejson-field-definitions [`postMessage()`]: worker\_threads.md#portpostmessagevalue-transferlist [`postMessageToThread()`]: worker\_threads.md#worker\_threadspostmessagetothreadthreadid-value-transferlist-timeout [`process.on('exit')`]: process.md#event-exit [`process.send()`]: process.md#processsendmessage-sendhandle-options-callback [`process.setUncaughtExceptionCaptureCallback()`]: process.md#processsetuncaughtexceptioncapturecallbackfn [`readable.\_read()`]: stream.md#readable\_readsize [`require('node:crypto').setEngine()`]: crypto.md#cryptosetengineengine-flags [`require()`]: modules.md#requireid [`server.close()`]: net.md#serverclosecallback [`server.listen()`]: net.md#serverlisten [`sign.sign()`]: crypto.md#signsignprivatekey-outputencoding [`stream.pipe()`]: stream.md#readablepipedestination-options [`stream.push()`]: stream.md#readablepushchunk-encoding [`stream.unshift()`]: stream.md#readableunshiftchunk-encoding [`stream.write()`]: stream.md#writablewritechunk-encoding-callback [`subprocess.kill()`]: child\_process.md#subprocesskillsignal [`subprocess.send()`]: child\_process.md#subprocesssendmessage-sendhandle-options-callback [`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost [`util.getSystemErrorName(error.errno)`]: util.md#utilgetsystemerrornameerr [`util.inspect()`]: util.md#utilinspectobject-options [`util.parseArgs()`]: util.md#utilparseargsconfig [`v8.startupSnapshot.setDeserializeMainFunction()`]: v8.md#v8startupsnapshotsetdeserializemainfunctioncallback-data [`zlib`]: zlib.md [crypto digest algorithm]: crypto.md#cryptogethashes [debugger]: debugger.md [define a custom subpath]: packages.md#subpath-exports [domains]: domain.md [event emitter-based]: events.md#class-eventemitter [file descriptors]: https://en.wikipedia.org/wiki/File\_descriptor [relative URL]: https://url.spec.whatwg.org/#relative-url-string [self-reference a package using its name]: packages.md#self-referencing-a-package-using-its-name [special scheme]: https://url.spec.whatwg.org/#special-scheme [stream-based]: stream.md [syscall]: https://man7.org/linux/man-pages/man2/syscalls.2.html [try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch [type-stripping]: typescript.md#type-stripping [vm]: vm.md | 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.034808915108442307,
-0.044589024037122726,
-0.014853625558316708,
-0.101798877120018,
-0.0055157337337732315,
-0.02475498802959919,
0.011119477450847626,
0.051060114055871964,
0.02184458076953888,
-0.08757339417934418,
0.05053050071001053,
-0.014371233060956001,
-0.005256085190922022,
-0.022406820207834244,
0.07239320129156113,
-0.06322014331817627,
-0.014219481498003006,
0.0022023229394108057,
0.034890253096818924,
-0.06438668072223663,
-0.03591626137495041,
0.06482162326574326,
0.0768248587846756,
0.08633271604776382,
0.02767147682607174,
0.07270362228155136,
0.004843272268772125,
-0.01612185128033161,
-0.05330571159720421,
-0.07478230446577072,
-0.0011672228574752808,
0.027285363525152206,
-0.03438162803649902,
-0.028285417705774307,
-0.07480396330356598,
-0.08939914405345917,
-0.037340689450502396,
-0.09933672100305557,
0.02592480555176735,
-0.05105000361800194,
0.023449966683983803,
-0.036447491496801376,
0.029563529416918755,
-0.008247029967606068,
0.05383724719285965,
0.007845843210816383,
-0.04625403508543968,
0.059112548828125,
0.027900753542780876,
0.0009162571514025331,
-0.001786971464753151,
-0.026380343362689018,
-0.005258536897599697,
-0.04559708386659622,
-0.06993123143911362,
0.02575395256280899,
0.08252917230129242,
0.014514082111418247,
0.018509406596422195,
-0.08086766302585602,
-0.02175254002213478,
0.013744419440627098,
0.005936311092227697,
-0.08925444632768631,
0.012355002574622631,
-0.016968190670013428,
-0.14392541348934174,
-0.005976419430226088,
-0.07584371417760849,
-0.014997211284935474,
-0.041933633387088776,
0.0393129326403141,
-0.027601853013038635,
0.004198144655674696,
0.011150075122714043,
-0.0013092367444187403,
0.03656180948019028,
0.08656781911849976,
0.020873425528407097,
0.07918475568294525,
0.02818330191075802,
0.1197459027171135,
0.02553749643266201,
0.04510089382529259,
-0.06192779168486595,
0.0260193832218647,
-0.02733825333416462,
-0.04885749891400337,
-0.02248225547373295,
-0.07692024856805801,
-0.010451327078044415,
0.0395142026245594,
0.003902335884049535,
-0.017263108864426613,
0.020350564271211624,
-0.010969002731144428,
-0.05165479704737663,
0.013981930911540985,
0.0598594956099987,
-0.025156086310744286,
-0.09796695411205292,
-0.009894010610878468,
0.16269350051879883,
-0.041097454726696014,
0.06617137789726257,
-0.017910022288560867,
-0.0039040998090058565,
-0.004631791263818741,
-0.021045269444584846,
-0.0958058089017868,
-0.028421347960829735,
-0.00686627859249711,
0.0005887863226234913,
0.07512693852186203,
4.2951674611443576e-33,
0.01790313795208931,
0.014646586030721664,
-0.025770744308829308,
0.013555780053138733,
0.014025673270225525,
0.03312959149479866,
-0.007980626076459885,
0.0419452004134655,
0.020801329985260963,
-0.018660100176930428,
0.07257140427827835,
-0.027232302352786064,
-0.040783870965242386,
-0.08208440244197845,
0.019826307892799377,
-0.027087854221463203,
0.002819589339196682,
-0.026312725618481636,
0.012060074135661125,
0.022428685799241066,
0.11732353270053864,
-0.057506073266267776,
0.006592479534447193,
-0.0271055456250906,
-0.06118415296077728,
0.034255143254995346,
0.03682997450232506,
0.045970819890499115,
0.005508034490048885,
-0.00402231328189373,
0.051367416977882385,
0.019484350457787514,
0.05565178766846657,
0.027424640953540802,
0.10834252834320068,
-0.026785191148519516,
0.11220981180667877,
-0.03105887584388256,
-0.07630882412195206,
-0.07677212357521057,
0.029354780912399292,
0.008665804751217365,
-0.012416097335517406,
0.037017278373241425,
0.04287484660744667,
-0.0857594907283783,
0.03932780399918556,
-0.020351272076368332,
0.07227297872304916,
0.02465619146823883,
-0.014815360307693481,
0.09211407601833344,
-0.032997094094753265,
-0.07198768854141235,
0.0009342855191789567,
-0.0698341652750969,
-0.04622906818985939,
0.04097149148583412,
-0.04373516887426376,
-0.04017549008131027,
0.06775674968957901,
-0.08426529169082642,
-0.04186075180768967,
-0.07801366597414017,
-0.004832025617361069,
0.059662073850631714,
0.02473621256649494,
-0.066004678606987,
-0.04202639311552048,
-0.018292667344212532,
-0.02750014141201973,
0.03502269089221954,
0.0789097473025322,
0.022690942510962486,
-0.004312918987125158,
-0.07999042421579361,
0.04115326702594757,
0.05420762300491333,
0.049340590834617615,
-0.03230969235301018,
0.015414373949170113,
-0.00024212090647779405,
-0.015751026570796967,
-0.018754754215478897,
-0.02436135523021221,
0.037323251366615295,
0.025554781779646873,
0.0633821114897728,
-0.04928256943821907,
0.014248337596654892,
0.02208731137216091,
0.026638908311724663,
-0.0069703394547104836,
0.04905020818114281,
0.00950533151626587,
-5.1733385156833945e-33,
0.03460260108113289,
-0.07420089840888977,
0.047871723771095276,
0.07823774218559265,
0.042780693620443344,
-0.054301004856824875,
-0.06622881442308426,
0.09706317633390427,
0.08717325329780579,
-0.06115312501788139,
0.06453511863946915,
-0.05495026707649231,
0.05934318155050278,
-0.05286610871553421,
-0.03334468603134155,
-0.010313276201486588,
-0.02026757225394249,
0.011453128419816494,
-0.06419050693511963,
0.0603070929646492,
0.0563574843108654,
0.05458482727408409,
-0.050225093960762024,
0.09230276942253113,
-0.0068309735506772995,
0.0858030691742897,
-0.05907973647117615,
0.04173923283815384,
0.006719175260514021,
-0.0027811997570097446,
0.07890574634075165,
0.008370336145162582,
-0.016631707549095154,
0.05101354047656059,
-0.09799019992351532,
-0.0900881439447403,
0.011213346384465694,
-0.033468808978796005,
-0.01348352711647749,
0.05321570485830307,
0.08366842567920685,
0.027420030906796455,
0.019084148108959198,
-0.049753639847040176,
0.055700864642858505,
-0.027632324025034904,
0.05043330416083336,
0.04415148124098778,
0.06356534361839294,
0.029814517125487328,
0.056192923337221146,
-0.07466994225978851,
-0.060584649443626404,
0.0012641600333154202,
0.10393454879522324,
0.05829478055238724,
-0.01117504108697176,
0.0068497434258461,
0.039351481944322586,
-0.02017829194664955,
0.017369043081998825,
0.041388679295778275,
0.026890432462096214,
0.019280705600976944,
0.07764383405447006,
0.0774526298046112,
-0.09363991022109985,
0.03993648663163185,
0.08727866411209106,
-0.029149707406759262,
0.03616359829902649,
-0.04921506717801094,
-0.06129249185323715,
-0.07227957248687744,
0.027018364518880844,
-0.01733328588306904,
-0.05610956996679306,
0.04983154684305191,
-0.00957473460584879,
-0.014979132451117039,
-0.0028098388575017452,
0.004423520993441343,
-0.015892889350652695,
0.0837363451719284,
-0.024575162678956985,
0.024124400690197945,
-0.014576662331819534,
-0.010886571370065212,
-0.039413582533597946,
-0.007890480570495129,
0.03478821739554405,
-0.0059217591769993305,
-0.0012520714662969112,
0.09899051487445831,
0.12840300798416138,
-5.006871361956655e-8,
-0.012316458858549595,
-0.03833847865462303,
-0.08007627725601196,
-0.06672679632902145,
0.09216604381799698,
-0.07824774831533432,
0.047770168632268906,
-0.1407908946275711,
0.02027377486228943,
-0.044172149151563644,
-0.023527661338448524,
-0.06799309700727463,
-0.013364605605602264,
-0.070560522377491,
-0.08595488220453262,
0.028914522379636765,
-0.11990044265985489,
-0.04020882025361061,
0.02066163159906864,
-0.09630151838064194,
0.0439034178853035,
-0.11349955946207047,
0.015613885596394539,
0.027400976046919823,
-0.008729326538741589,
0.03967534378170967,
0.018744515255093575,
0.08979575335979462,
0.02397536300122738,
-0.016653994098305702,
-0.048867117613554,
-0.061677660793066025,
0.06223709136247635,
0.005097461398690939,
-0.08675730973482132,
0.04767235368490219,
0.013664760626852512,
-0.011626893654465675,
-0.0798698291182518,
0.0847291350364685,
0.05478506535291672,
-0.0024887837935239077,
-0.04229544848203659,
0.0602010041475296,
-0.04729296639561653,
-0.05981242656707764,
-0.050363678485155106,
0.014516240917146206,
-0.04270287603139877,
0.0007856303709559143,
-0.004693436436355114,
-0.04799436032772064,
0.02986692078411579,
-0.03438011556863785,
-0.09513924270868301,
0.006132143083959818,
0.014860881492495537,
-0.00019567807612475008,
-0.012847598642110825,
-0.011567028239369392,
0.05554187670350075,
-0.03545212373137474,
0.02451646886765957,
0.011686292476952076
] | -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 named `foo.js`: ```js const circle = require('./circle.js'); console.log(`The area of a circle of radius 4 is ${circle.area(4)}`); ``` On the first line, `foo.js` loads the module `circle.js` that is in the same directory as `foo.js`. Here are the contents of `circle.js`: ```js const { PI } = Math; exports.area = (r) => PI \* r \*\* 2; exports.circumference = (r) => 2 \* PI \* r; ``` The module `circle.js` has exported the functions `area()` and `circumference()`. Functions and objects are added to the root of a module by specifying additional properties on the special `exports` object. Variables local to the module will be private, because the module is wrapped in a function by Node.js (see [module wrapper](#the-module-wrapper)). In this example, the variable `PI` is private to `circle.js`. The `module.exports` property can be assigned a new value (such as a function or object). In the following code, `bar.js` makes use of the `square` module, which exports a Square class: ```js const Square = require('./square.js'); const mySquare = new Square(2); console.log(`The area of mySquare is ${mySquare.area()}`); ``` The `square` module is defined in `square.js`: ```js // Assigning to exports will not modify module, must use module.exports module.exports = class Square { constructor(width) { this.width = width; } area() { return this.width \*\* 2; } }; ``` The CommonJS module system is implemented in the [`module` core module][]. ## Enabling Node.js has two module systems: CommonJS modules and [ECMAScript modules][]. By default, Node.js will treat the following as CommonJS modules: \* Files with a `.cjs` extension; \* Files with a `.js` extension when the nearest parent `package.json` file contains a top-level field [`"type"`][] with a value of `"commonjs"`. \* Files with a `.js` extension or without an extension, when the nearest parent `package.json` file doesn't contain a top-level field [`"type"`][] or there is no `package.json` in any parent folder; unless the file contains syntax that errors unless it is evaluated as an ES module. Package authors should include the [`"type"`][] field, even in packages where all sources are CommonJS. Being explicit about the `type` of the package will make things easier for build tools and loaders to determine how the files in the package should be interpreted. \* Files with an extension that is not `.mjs`, `.cjs`, `.json`, `.node`, or `.js` (when the nearest parent `package.json` file contains a top-level field [`"type"`][] with a value of `"module"`, those files will be recognized as CommonJS modules only if they are being included via `require()`, not when used as the command-line entry point of the program). See [Determining module system][] for more details. Calling `require()` always use the CommonJS module loader. Calling `import()` always use the ECMAScript module loader. ## Accessing the main module When a file is run directly from Node.js, `require.main` is set to its `module`. That means that it is possible to determine whether a file has been run directly by testing `require.main === module`. For a file `foo.js`, this will be `true` if run via `node foo.js`, but `false` if 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 such as | 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.014308110810816288,
0.13023722171783447,
0.03078661859035492,
-0.04342092573642731,
0.060102932155132294,
-0.011421220377087593,
-0.028852734714746475,
0.009523587301373482,
-0.013147817924618721,
0.04592672735452652,
0.014235642738640308,
-0.020790057256817818,
0.030573097988963127,
-0.025272993370890617,
-0.005136128049343824,
0.038020942360162735,
-0.06566396355628967,
-0.026623785495758057,
0.07648999989032745,
-0.05966556817293167,
-0.027383102104067802,
-0.0861634910106659,
0.1379682868719101,
-0.0562283992767334,
-0.05666062980890274,
0.04255964607000351,
-0.07074978947639465,
0.0069206575863063335,
0.15075424313545227,
0.012977715581655502,
-0.08729642629623413,
-0.02366562932729721,
-0.012442216277122498,
-0.10723834484815598,
0.041919153183698654,
-0.06637248396873474,
0.009437917731702328,
0.03985302150249481,
-0.0692775696516037,
-0.039047908037900925,
-0.04037369042634964,
0.037644047290086746,
0.0303921140730381,
-0.014153100550174713,
0.007875418290495872,
0.03588275983929634,
0.04620594531297684,
-0.020407937467098236,
0.005333344452083111,
0.03830466419458389,
0.014823399484157562,
0.07420943677425385,
-0.016882875934243202,
-0.01626363955438137,
-0.017616214230656624,
0.002108922228217125,
0.024171866476535797,
-0.08535273373126984,
0.0766490250825882,
0.016569923609495163,
0.010422241874039173,
-0.03127598762512207,
-0.02314981073141098,
-0.03942348435521126,
0.0680803433060646,
-0.03661706671118736,
-0.00031104436493478715,
-0.04412668198347092,
-0.045810628682374954,
0.008601134642958641,
0.02270970679819584,
0.03912106901407242,
0.08809974789619446,
0.03557251766324043,
-0.03960011899471283,
0.03450511768460274,
-0.0018069498473778367,
-0.03231356665492058,
-0.07341372966766357,
0.008852999657392502,
0.052379388362169266,
-0.04773273691534996,
-0.005736038088798523,
0.0030570542439818382,
0.07994775474071503,
-0.07812146842479706,
-0.008932152763009071,
-0.00849733967334032,
0.011108080856502056,
0.11604125052690506,
-0.01421856414526701,
0.034195609390735626,
-0.03583234176039696,
0.0036697089672088623,
0.012028425931930542,
0.024018844589591026,
0.0026572810020297766,
-0.00016514754679519683,
-0.02148335613310337,
-0.019859373569488525,
-0.05306212231516838,
-0.04989533871412277,
0.01464461162686348,
0.08328084647655487,
-0.024135174229741096,
0.08629929274320602,
0.1208329051733017,
0.07474131137132645,
0.07708627730607986,
0.08399052172899246,
-0.004795299377292395,
0.06721605360507965,
-0.03122849389910698,
-0.03747403994202614,
9.065544676655949e-34,
-0.061896707862615585,
-0.07171091437339783,
-0.020389383658766747,
0.10974699258804321,
-0.03221237286925316,
-0.02956789918243885,
0.0025329459458589554,
0.007216126192361116,
-0.052731338888406754,
-0.00573421735316515,
-0.020917614921927452,
0.1320217251777649,
0.001589293358847499,
0.023606589064002037,
0.03227407485246658,
-0.009575561620295048,
0.11760467290878296,
-0.036414872854948044,
0.023767797276377678,
-0.018637411296367645,
-0.013534157536923885,
0.029051221907138824,
-0.04723864048719406,
0.08934933692216873,
0.03062107227742672,
0.07977312058210373,
0.052656497806310654,
0.018458837643265724,
-0.03400459513068199,
0.012441093102097511,
0.011839826591312885,
0.047010015696287155,
-0.005822516046464443,
0.044634636491537094,
0.07049813121557236,
0.07690314203500748,
-0.01745370402932167,
0.043372295796871185,
-0.09407160431146622,
-0.008100728504359722,
-0.0011047290172427893,
0.04542234167456627,
-0.07593744993209839,
-0.00011266001092735678,
-0.0027704350650310516,
-0.056742601096630096,
-0.032263386994600296,
0.020385047420859337,
0.025175970047712326,
-0.03688795864582062,
-0.1051018089056015,
0.0699528157711029,
0.06707543134689331,
-0.008318359032273293,
0.09800685942173004,
-0.05008695274591446,
0.003943279851227999,
-0.08202524483203888,
-0.020359588786959648,
-0.004348268266767263,
0.020780831575393677,
-0.0029751325491815805,
-0.06418248265981674,
0.034081656485795975,
-0.008978200145065784,
0.02649635449051857,
-0.07300905883312225,
-0.027244973927736282,
-0.059453804045915604,
0.041726794093847275,
-0.003328833496198058,
0.041585054248571396,
0.019001800566911697,
0.06559288501739502,
-0.006706371437758207,
-0.015181213617324829,
-0.07946743816137314,
0.03111919015645981,
-0.028578968718647957,
0.008481192402541637,
0.0038723116740584373,
-0.01275886595249176,
-0.038984909653663635,
-0.001588552026078105,
0.05712145194411278,
-0.036246638745069504,
0.023711901158094406,
0.028227195143699646,
0.03729473426938057,
-0.02240622229874134,
0.03278728574514389,
-0.028020575642585754,
0.029438460245728493,
-0.008384344168007374,
-0.07929596304893494,
-3.7152549555814444e-33,
-0.0344570018351078,
0.06809822469949722,
-0.05638402700424194,
0.10998555272817612,
-0.06509712338447571,
0.007553391624242067,
-0.05890849232673645,
-0.04573005810379982,
0.022394748404622078,
0.04228561371564865,
-0.12086834758520126,
0.012388692237436771,
0.04698091745376587,
0.045909490436315536,
0.057116929441690445,
0.09401383996009827,
-0.09230384975671768,
0.00584549643099308,
0.024418875575065613,
-0.049115896224975586,
-0.06046866998076439,
0.023826323449611664,
0.05215509608387947,
0.005971943959593773,
-0.03189040720462799,
0.03468135744333267,
-0.09759321808815002,
-0.07896939665079117,
-0.12136814743280411,
0.005559850018471479,
-0.1272430568933487,
-0.0431191511452198,
0.008771270513534546,
0.010387465357780457,
-0.03000706247985363,
-0.08925674855709076,
-0.023890402168035507,
0.010538598522543907,
0.011180788278579712,
-0.14084842801094055,
-0.008958248421549797,
-0.040104713290929794,
0.0001510271249571815,
-0.009807916358113289,
-0.015754763036966324,
-0.04179913178086281,
0.05946967378258705,
0.044723983854055405,
-0.060688555240631104,
-0.05343044176697731,
-0.08924800902605057,
-0.040843501687049866,
0.019538581371307373,
-0.03267977759242058,
-0.008365057408809662,
-0.007031071465462446,
-0.006600616965442896,
0.0896005928516388,
0.07525032013654709,
0.042010895907878876,
0.026232365518808365,
-0.10023409128189087,
-0.0037946407683193684,
-0.019928812980651855,
-0.06050465255975723,
-0.028555257245898247,
-0.08360724151134491,
-0.031987514346838,
0.09796541929244995,
0.04262397065758705,
-0.07238905131816864,
0.04805321246385574,
0.00235016830265522,
-0.012869534082710743,
-0.06341619789600372,
0.04864360764622688,
0.05855009704828262,
-0.05743446201086044,
0.0030878419056534767,
0.02076290361583233,
-0.022739963605999947,
0.054802440106868744,
-0.038375984877347946,
-0.012708899565041065,
0.007326406892389059,
-0.04695909470319748,
0.04802250862121582,
-0.004435760900378227,
-0.04469602555036545,
-0.013748690485954285,
0.003348176134750247,
0.05054567754268646,
-0.029889309778809547,
-0.005428019445389509,
-0.014720586128532887,
-4.642354056727527e-8,
-0.020030999556183815,
0.042294617742300034,
-0.11444304883480072,
-0.04602881148457527,
0.01817365176975727,
-0.027029752731323242,
0.021338632330298424,
0.064520925283432,
-0.00847071222960949,
0.0663771703839302,
-0.003311089938506484,
0.07247934490442276,
-0.01365725789219141,
-0.02110113576054573,
-0.02783137373626232,
0.047619450837373734,
-0.012523499317467213,
0.06569309532642365,
-0.023212354630231857,
0.0006969535606913269,
0.0002896692603826523,
0.011433117091655731,
0.06555277854204178,
0.05734744295477867,
-0.01148197427392006,
-0.037485700100660324,
0.08445341885089874,
0.01583455689251423,
-0.03749630227684975,
-0.0638369619846344,
-0.0742771178483963,
0.00333708175458014,
-0.023463288322091103,
-0.0009913889225572348,
-0.046131208539009094,
-0.07040060311555862,
0.014841505326330662,
-0.020042523741722107,
0.099204421043396,
0.10540559887886047,
0.02031034417450428,
0.022137435153126717,
-0.052898626774549484,
0.01979037933051586,
0.027237506583333015,
0.008276687003672123,
0.005943721160292625,
-0.036649439483881,
-0.06163199990987778,
-0.01879994384944439,
-0.03714622184634209,
-0.012856975197792053,
-0.06022430211305618,
0.05846322700381279,
0.05490124598145485,
-0.005925800651311874,
0.03870858997106552,
-0.04673207551240921,
-0.0059705269522964954,
-0.04981306567788124,
-0.06278380751609802,
0.06284549087285995,
0.1102505549788475,
-0.05308225005865097
] | 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 such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to build native packages from Node.js modules without modification. In the following, we give a suggested directory structure that could work: Let's say that we wanted to have the folder at `/usr/lib/node//` hold the contents of a specific version of a package. Packages can depend on one another. In order to install package `foo`, it may be necessary to install a specific version of package `bar`. The `bar` package may itself have dependencies, and in some cases, these may even collide or form cyclic dependencies. Because Node.js looks up the `realpath` of any modules it loads (that is, it resolves symlinks) and then [looks for their dependencies in `node\_modules` folders](#loading-from-node\_modules-folders), this situation can be resolved with the following architecture: \* `/usr/lib/node/foo/1.2.3/`: Contents of the `foo` package, version 1.2.3. \* `/usr/lib/node/bar/4.3.2/`: Contents of the `bar` package that `foo` depends on. \* `/usr/lib/node/foo/1.2.3/node\_modules/bar`: Symbolic link to `/usr/lib/node/bar/4.3.2/`. \* `/usr/lib/node/bar/4.3.2/node\_modules/\*`: Symbolic links to the packages that `bar` depends on. Thus, even if a cycle is encountered, or if there are dependency conflicts, every module will be able to get a version of its dependency that it can use. When the code in the `foo` package does `require('bar')`, it will get the version that is symlinked into `/usr/lib/node/foo/1.2.3/node\_modules/bar`. Then, when the code in the `bar` package calls `require('quux')`, it'll get the version that is symlinked into `/usr/lib/node/bar/4.3.2/node\_modules/quux`. Furthermore, to make the module lookup process even more optimal, rather than putting packages directly in `/usr/lib/node`, we could put them in `/usr/lib/node\_modules//`. Then Node.js will not bother looking for missing dependencies in `/usr/node\_modules` or `/node\_modules`. In order to make modules available to the Node.js REPL, it might be useful to also add the `/usr/lib/node\_modules` folder to the `$NODE\_PATH` environment variable. Since the module lookups using `node\_modules` folders are all relative, and based on the real path of the files making the calls to `require()`, the packages themselves can be anywhere. ## Loading ECMAScript modules using `require()` The `.mjs` extension is reserved for [ECMAScript Modules][]. See [Determining module system][] section for more info regarding which files are parsed as ECMAScript modules. `require()` only supports loading ECMAScript modules that meet the following requirements: \* The module is fully synchronous (contains no top-level `await`); and \* One of these conditions are met: 1. The file has a `.mjs` extension. 2. The file has a `.js` extension, and the closest `package.json` contains `"type": "module"` 3. The file has a `.js` extension, the closest `package.json` does not contain `"type": "commonjs"`, and the module contains ES module syntax. If the ES Module being loaded meets the requirements, `require()` can load it and return the [module namespace object][]. In this case it is similar to dynamic `import()` but is run synchronously and returns the name space object directly. With the following ES Modules: ```mjs // distance.mjs export function distance(a, b) { return Math.sqrt((b.x - a.x) \*\* 2 + (b.y - a.y) \*\* 2); } ``` ```mjs // point.mjs export default class Point { constructor(x, 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] { // default: [class Point], | 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.020126264542341232,
0.06313183158636093,
0.029827559366822243,
0.04834788665175438,
0.05441710352897644,
0.05509427934885025,
0.035949110984802246,
-0.02352594956755638,
0.031039975583553314,
0.043636005371809006,
-0.010282421484589577,
-0.049985338002443314,
-0.015392427332699299,
-0.02339545078575611,
0.019491996616125107,
0.007856782525777817,
0.004483223892748356,
0.053692858666181564,
0.07501666992902756,
-0.005927342921495438,
-0.01693441905081272,
-0.06416506320238113,
0.13009989261627197,
-0.03607495501637459,
-0.055952854454517365,
-0.022742563858628273,
-0.035200342535972595,
0.010726903565227985,
0.17173539102077484,
0.03312535583972931,
-0.03621809557080269,
-0.051481638103723526,
-0.05795086920261383,
-0.09421049803495407,
0.02181432396173477,
-0.12006016820669174,
0.002855694852769375,
0.006377886515110731,
-0.0542788989841938,
-0.021386148408055305,
-0.06840424239635468,
0.051761120557785034,
0.0911484807729721,
-0.011157374829053879,
0.023962892591953278,
-0.027968037873506546,
0.09273979812860489,
-0.008885842747986317,
0.013702680356800556,
0.027151720598340034,
-0.05744070187211037,
0.06940142810344696,
0.008506939746439457,
0.019508136436343193,
-0.023322569206357002,
0.03424699231982231,
0.047383688390254974,
0.018437761813402176,
0.019736025482416153,
-0.04843316599726677,
0.03244505822658539,
-0.08495774120092392,
-0.06332967430353165,
0.003294618334621191,
0.045728202909231186,
-0.015904981642961502,
-0.014356174506247044,
-0.02908516302704811,
0.007890964858233929,
0.04934468865394592,
0.05728910490870476,
-0.021785849705338478,
0.017779266461730003,
0.021596554666757584,
-0.010136588476598263,
0.036206215620040894,
0.02848782390356064,
-0.008361401967704296,
-0.13394972681999207,
0.005770104005932808,
0.025438671931624413,
0.0026828397531062365,
0.024452732875943184,
0.03516789525747299,
0.08159245550632477,
-0.008063067682087421,
-0.017387833446264267,
-0.011463689617812634,
-0.00012758163211401552,
0.03300385922193527,
-0.03990853950381279,
0.04620431736111641,
0.043309684842824936,
-0.0562468096613884,
-0.06785876303911209,
-0.031306784600019455,
-0.004624681547284126,
0.01863233372569084,
-0.019452199339866638,
-0.012390709482133389,
-0.08031494915485382,
-0.059428755193948746,
-0.054008688777685165,
0.10836023837327957,
-0.07587175071239471,
0.05580698698759079,
0.11367824673652649,
-0.007021395955234766,
0.06598831713199615,
0.10480044037103653,
0.005372387822717428,
0.07416091859340668,
-0.04238845035433769,
-0.03697916492819786,
-3.1267816828199275e-35,
-0.023872455582022667,
-0.02466549165546894,
0.03132735937833786,
0.09034474939107895,
0.02523641288280487,
-0.051083773374557495,
0.04579300060868263,
0.02156655304133892,
-0.0670960396528244,
-0.01314349565654993,
-0.014821268618106842,
0.08008872717618942,
-0.04697997868061066,
-0.036899253726005554,
0.045791108161211014,
-0.02858605422079563,
-0.0032530161552131176,
-0.020631691440939903,
0.032783374190330505,
-0.006537287961691618,
-0.04696767404675484,
0.006504594814032316,
-0.012708894908428192,
0.028599992394447327,
0.016082286834716797,
-0.023088810965418816,
0.09523472934961319,
0.014219528064131737,
0.02111438289284706,
-0.025970645248889923,
-0.0012244260869920254,
0.044544197618961334,
-0.01401018351316452,
0.07719187438488007,
-0.004797608125954866,
0.058084886521101,
-0.07607295364141464,
-0.003908801358193159,
-0.08194629848003387,
0.020207421854138374,
0.03950101509690285,
0.10383222997188568,
-0.06589173525571823,
0.024017926305532455,
0.019476179033517838,
-0.04557554051280022,
-0.0009872156661003828,
-0.05122119560837746,
0.017942577600479126,
-0.037316713482141495,
-0.048225317150354385,
0.016661278903484344,
0.09561794996261597,
-0.0009778133826330304,
-0.009407633915543556,
-0.03942723944783211,
0.00472094165161252,
-0.09440886974334717,
0.03433576226234436,
-0.020790113136172295,
0.051338378340005875,
-0.02439059317111969,
-0.02747090719640255,
0.08262301236391068,
-0.002384928520768881,
0.037320658564567566,
-0.06745152920484543,
-0.046561576426029205,
-0.010603709146380424,
0.06005777046084404,
-0.00022963776427786797,
0.011466423980891705,
0.006890458054840565,
-0.001570775406435132,
-0.020591767504811287,
0.03553100302815437,
-0.0454966239631176,
0.01591670513153076,
-0.02054537646472454,
-0.04022189974784851,
-0.02704709954559803,
-0.04874671623110771,
0.005905219353735447,
0.059868112206459045,
0.0774095356464386,
-0.02126557007431984,
-0.02287703938782215,
0.039461929351091385,
0.011518627405166626,
-0.04687434807419777,
0.11020682007074356,
-0.0653470829129219,
-0.05019977316260338,
-0.03842485696077347,
-0.003142743604257703,
-1.5605767492600685e-33,
0.018850136548280716,
0.05660919100046158,
0.0014838507631793618,
0.0741003081202507,
0.009935377165675163,
-0.02431943453848362,
-0.11182600259780884,
-0.11868280172348022,
0.04071297124028206,
0.03328206017613411,
-0.1377849578857422,
0.005868899170309305,
0.09479079395532608,
0.023330489173531532,
-0.024370290338993073,
0.08140823245048523,
-0.07432437688112259,
-0.029733294621109962,
-0.020584343001246452,
-0.016977054998278618,
-0.02573380619287491,
0.012900960631668568,
0.015216740779578686,
-0.011015502735972404,
-0.01174227800220251,
0.02875027246773243,
-0.09962058067321777,
-0.04389266297221184,
-0.06020711734890938,
0.0041691032238304615,
-0.06982631981372833,
-0.0008253317209891975,
-0.017946714535355568,
-0.07602757215499878,
-0.039176080375909805,
-0.015884673222899437,
-0.11978092044591904,
0.05202023312449455,
0.037326913326978683,
-0.06169406324625015,
-0.01633097231388092,
-0.01447655726224184,
-0.03598060831427574,
-0.02104736492037773,
-0.01251195464283228,
-0.04346292093396187,
0.010514825582504272,
0.004406604915857315,
-0.04395158961415291,
-0.10541932284832001,
-0.08019571006298065,
0.030168667435646057,
-0.0030150527600198984,
0.02098613977432251,
-0.04190823435783386,
0.027056127786636353,
-0.04026292264461517,
0.1274712234735489,
0.09433330595493317,
0.03576510772109032,
0.0813840702176094,
-0.009272776544094086,
-0.026257241144776344,
-0.08289267122745514,
-0.0855298563838005,
-0.06767676770687103,
-0.06449225544929504,
-0.03337576985359192,
0.06937998533248901,
0.022486673668026924,
-0.033227838575839996,
0.054217349737882614,
0.051053084433078766,
0.030457505956292152,
-0.032740332186222076,
0.010039547458291054,
0.0444832518696785,
-0.020549040287733078,
0.019347671419382095,
0.00497069489210844,
-0.05255305394530296,
0.06435757875442505,
-0.018069718033075333,
0.030841264873743057,
0.007388359867036343,
-0.019874311983585358,
0.016471853479743004,
-0.026106903329491615,
-0.00564701110124588,
0.0042909118346869946,
0.10998263210058212,
0.031125131994485855,
-0.08080825954675674,
-0.021854350343346596,
-0.023326056078076363,
-5.349833287482397e-8,
-0.016434255987405777,
0.02960355393588543,
-0.15316100418567657,
-0.033370159566402435,
0.07349031418561935,
-0.025313369929790497,
0.06251955032348633,
0.1049247682094574,
0.07045337557792664,
0.1185564249753952,
0.04035529866814613,
0.05884324014186859,
-0.02588578686118126,
-0.009058850817382336,
-0.06008818373084068,
0.06344779580831528,
0.008792721666395664,
0.05975939705967903,
-0.07199519127607346,
0.024841979146003723,
-0.019647354260087013,
0.03812035173177719,
-0.015708209946751595,
0.12726370990276337,
-0.041296377778053284,
-0.01974400319159031,
0.05379524081945419,
0.03106572851538658,
0.02099555730819702,
-0.007036975119262934,
-0.07949940115213394,
0.019941452890634537,
-0.05639790743589401,
-0.014968669973313808,
-0.02196795493364334,
0.03036045841872692,
-0.02157602272927761,
-0.040901243686676025,
0.07667987793684006,
0.06342322379350662,
-0.03215577453374863,
-0.04109729081392288,
0.012969642877578735,
0.037137072533369064,
-0.03544209524989128,
-0.04998142644762993,
-0.03783438354730606,
-0.01857174001634121,
-0.0640065148472786,
0.0011244089109823108,
0.02918354980647564,
-0.0056639849208295345,
-0.12189875543117523,
0.03482278063893318,
0.0510462261736393,
0.0505509190261364,
-0.011386910453438759,
-0.018467102199792862,
-0.03455004841089249,
-0.08140537142753601,
-0.00638433126732707,
0.023022472858428955,
0.08680855482816696,
-0.04823672026395798
] | 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] { // default: [class Point], // \_\_esModule: true, // } ``` For interoperability with existing tools that convert ES Modules into CommonJS, which could then load real ES Modules through `require()`, the returned namespace would contain a `\_\_esModule: true` property if it has a `default` export so that consuming code generated by tools can recognize the default exports in real ES Modules. If the namespace already defines `\_\_esModule`, this would not be added. This property is experimental and can change in the future. It should only be used by tools converting ES modules into CommonJS modules, following existing ecosystem conventions. Code authored directly in CommonJS should avoid depending on it. The result returned by `require()` is the [module namespace object][], which places the default export in the `.default` property, similar to the results returned by `import()`. To customize what should be returned by `require(esm)` directly, the ES Module can export the desired value using the string name `"module.exports"`. ```mjs // point.mjs export default class Point { constructor(x, y) { this.x = x; this.y = y; } } // `distance` is lost to CommonJS consumers of this module, unless it's // added to `Point` as a static property. export function distance(a, b) { return Math.sqrt((b.x - a.x) \*\* 2 + (b.y - a.y) \*\* 2); } export { Point as 'module.exports' } ``` ```cjs const Point = require('./point.mjs'); console.log(Point); // [class Point] // Named exports are lost when 'module.exports' is used const { distance } = require('./point.mjs'); console.log(distance); // undefined ``` Notice in the example above, when the `module.exports` export name is used, named exports will be lost to CommonJS consumers. To allow CommonJS consumers to continue accessing named exports, the module can make sure that the default export is an object with the named exports attached to it as properties. For example with the example above, `distance` can be attached to the default export, the `Point` class, as a static method. ```mjs export function distance(a, b) { return Math.sqrt((b.x - a.x) \*\* 2 + (b.y - a.y) \*\* 2); } export default class Point { constructor(x, y) { this.x = x; this.y = y; } static distance = distance; } export { Point as 'module.exports' } ``` ```cjs const Point = require('./point.mjs'); console.log(Point); // [class Point] const { distance } = require('./point.mjs'); console.log(distance); // [Function: distance] ``` If the module being `require()`'d contains top-level `await`, or the module graph it `import`s contains top-level `await`, [`ERR\_REQUIRE\_ASYNC\_MODULE`][] will be thrown. In this case, users should load the asynchronous module using [`import()`][]. If `--experimental-print-required-tla` is enabled, instead of throwing `ERR\_REQUIRE\_ASYNC\_MODULE` before evaluation, Node.js will evaluate the module, try to locate the top-level awaits, and print their location to help users fix them. If support for loading ES modules using `require()` results in unexpected breakage, it can be disabled using `--no-require-module`. To print where this feature is used, use [`--trace-require-module`][]. This feature can be detected by checking if [`process.features.require\_module`][] is `true`. ## All together To get the exact filename that will be loaded when `require()` is called, use the `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 | 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.04076138138771057,
0.11306022107601166,
0.052889399230480194,
0.06432535499334335,
-0.007410683669149876,
-0.027294348925352097,
0.025212496519088745,
0.1240270733833313,
-0.029794348403811455,
0.034942034631967545,
-0.015626443549990654,
-0.00794911663979292,
-0.03464183956384659,
0.050825443118810654,
0.00859566405415535,
0.010681875981390476,
-0.059223756194114685,
-0.019904939457774162,
0.031642742455005646,
-0.0768783763051033,
0.027545902878046036,
0.003127004485577345,
0.09905669093132019,
-0.001967033604159951,
-0.05987771227955818,
-0.007678910158574581,
-0.06850841641426086,
-0.027565624564886093,
0.1157674491405487,
0.00896272249519825,
-0.023526456207036972,
0.012148934416472912,
-0.03937338665127754,
-0.057366177439689636,
-0.04232316091656685,
-0.06887070834636688,
0.020292719826102257,
-0.0010784852784126997,
-0.049112334847450256,
-0.07501251995563507,
-0.028971588239073753,
0.05325549840927124,
0.05259063094854355,
-0.007427353411912918,
-0.002024951856583357,
0.04455895721912384,
0.057755813002586365,
-0.010531081818044186,
0.03737170249223709,
0.044552773237228394,
0.004996847361326218,
0.04256972670555115,
-0.0972711518406868,
-0.010393449105322361,
0.029016995802521706,
0.005088666919618845,
0.044147390872240067,
-0.07377302646636963,
0.05079467594623566,
0.05636253580451012,
0.031585607677698135,
-0.01422819122672081,
-0.08642780035734177,
-0.05316168814897537,
0.0829753428697586,
0.007466455455869436,
-0.002420914825052023,
-0.05192817002534866,
0.01338504534214735,
-0.030655154958367348,
0.01511264219880104,
0.05218587443232536,
0.08333408832550049,
-0.012158162891864777,
-0.0016499328194186091,
0.06444265693426132,
-0.0006848128978163004,
-0.038020361214876175,
-0.16330499947071075,
-0.08260281383991241,
0.1112992987036705,
0.002625431399792433,
-0.057535942643880844,
0.031421445310115814,
0.008598869666457176,
-0.02999110147356987,
0.006129722110927105,
-0.061515189707279205,
0.017557252198457718,
0.10219642519950867,
0.02847716212272644,
0.006684674881398678,
-0.017795057967305183,
-0.039637137204408646,
-0.05425771698355675,
0.01696782372891903,
0.022174179553985596,
0.03539365530014038,
-0.034063130617141724,
-0.024931712076067924,
-0.07086693495512009,
-0.04737240448594093,
-0.019446391612291336,
0.0636158287525177,
-0.07466204464435577,
0.08741975575685501,
0.060276128351688385,
0.024185920134186745,
0.031170090660452843,
0.09823142737150192,
-0.020056523382663727,
0.0553203746676445,
0.01509286928921938,
-0.004627308342605829,
7.811766993843705e-34,
-0.019594544544816017,
-0.054978013038635254,
-0.044779326766729355,
0.12602105736732483,
0.029658064246177673,
0.015181375667452812,
0.004396225791424513,
0.07685524970293045,
-0.08641157299280167,
-0.048914339393377304,
-0.01865454576909542,
0.11553911119699478,
0.00836099311709404,
0.01974872685968876,
0.05843660607933998,
0.018151434138417244,
0.10467880964279175,
-0.05051613971590996,
0.07647541910409927,
0.003045587334781885,
0.010190704837441444,
0.020256513729691505,
-0.04128624126315117,
0.0014400662621483207,
0.016605017706751823,
-0.019690003246068954,
-0.026019923388957977,
0.012653311714529991,
-0.07920481264591217,
0.011136999353766441,
-0.0021812382619827986,
0.06066231057047844,
0.03984904661774635,
0.06907245516777039,
-0.0001646706077735871,
0.027074668556451797,
0.0044952197931706905,
-0.030303310602903366,
-0.08074193447828293,
-0.033809926360845566,
0.07307390868663788,
0.08210156112909317,
-0.09335529059171677,
-0.01064093504101038,
-0.03677794337272644,
-0.13637827336788177,
0.04031020775437355,
0.0005224637570790946,
0.05145857855677605,
-0.06720074266195297,
-0.04612912982702255,
0.04976164549589157,
0.025292491540312767,
-0.033639781177043915,
0.04587073251605034,
-0.004858218599110842,
-0.017334209755063057,
-0.039918623864650726,
0.04654807597398758,
-0.03749854862689972,
-0.032733671367168427,
-0.01174087356775999,
-0.013915710151195526,
0.10441859811544418,
0.031129544600844383,
0.049029167741537094,
-0.04551766812801361,
-0.0582585446536541,
0.026203759014606476,
0.025149084627628326,
-0.03052416443824768,
-0.03994829207658768,
-0.09435495734214783,
-0.03128688037395477,
0.04716644436120987,
-0.00818309560418129,
-0.03952931612730026,
-0.007429677527397871,
-0.0016556158661842346,
-0.05930911749601364,
0.009885621257126331,
0.04285726323723793,
-0.04073730483651161,
0.044014640152454376,
0.017940105870366096,
-0.02722882851958275,
0.011973121203482151,
-0.035793107002973557,
0.043482184410095215,
0.04000060632824898,
0.02601299062371254,
-0.05715546756982803,
-0.11090365797281265,
-0.014098971150815487,
-0.06523529440164566,
-3.578599329194538e-33,
0.06112617626786232,
0.05555301159620285,
-0.019683729857206345,
0.09089604020118713,
-0.025729425251483917,
-0.01428475882858038,
0.0055427211336791515,
-0.08356914669275284,
-0.008100488223135471,
0.030369004234671593,
-0.07792772352695465,
-0.049056436866521835,
0.09246067702770233,
0.048427093774080276,
0.028202950954437256,
0.12051817029714584,
-0.08338525146245956,
-0.09576277434825897,
0.0009097388829104602,
-0.0658329576253891,
0.04445585981011391,
0.02112865447998047,
0.03617339953780174,
-0.04639696702361107,
-0.012151370756328106,
0.0245366208255291,
-0.11369501799345016,
-0.0047132219187915325,
-0.09185034036636353,
-0.03520578145980835,
-0.09386979043483734,
-0.014352096244692802,
-0.009078193455934525,
-0.05629303678870201,
-0.03961090371012688,
0.007016198709607124,
-0.0023612389340996742,
0.11224524676799774,
0.031683944165706635,
-0.034538332372903824,
0.06701252609491348,
0.058245062828063965,
-0.08543212711811066,
0.03343937546014786,
-0.05919282138347626,
-0.024605033919215202,
0.07732324302196503,
-0.03579512983560562,
0.04635333642363548,
-0.07730317860841751,
-0.04243210330605507,
-0.08740006387233734,
-0.0779813751578331,
-0.056800104677677155,
-0.06231624633073807,
-0.0035616618115454912,
-0.008483308367431164,
0.005093101412057877,
0.0074995639733970165,
0.061404790729284286,
0.0705738440155983,
-0.0840546190738678,
-0.027755731716752052,
-0.019254717975854874,
0.02018968015909195,
0.013821784406900406,
-0.03231906145811081,
0.04524574428796768,
0.10416048020124435,
-0.026636561378836632,
-0.020869988948106766,
0.04531927779316902,
0.006743086036294699,
-0.053153146058321,
-0.030810140073299408,
-0.001573045621626079,
0.058821991086006165,
-0.02596399374306202,
0.09182000905275345,
0.023220624774694443,
0.010556460358202457,
0.02034262754023075,
-0.005319161340594292,
-0.042583972215652466,
0.030662735924124718,
0.02928154729306698,
0.0020534005016088486,
0.03903857246041298,
0.0050311461091041565,
-0.005334802903234959,
0.045747723430395126,
0.03396221995353699,
-0.11077076941728592,
-0.0317251980304718,
-0.0023259816225618124,
-4.643967699280438e-8,
-0.08614786714315414,
-0.03328917548060417,
-0.03913124278187752,
-0.05478241667151451,
0.010075924918055534,
-0.050656817853450775,
0.07448019087314606,
0.03787983953952789,
0.04265104979276657,
0.038171641528606415,
0.00892476923763752,
0.0771760493516922,
0.029518380761146545,
0.06692177802324295,
-0.05610194802284241,
0.046338267624378204,
-0.0009694256586953998,
0.041899003088474274,
-0.06940053403377533,
0.02717713452875614,
-0.04682690277695656,
0.02359449863433838,
0.038280196487903595,
0.10040278732776642,
-0.010735147632658482,
-0.0534566193819046,
0.034570787101984024,
0.0441572479903698,
0.04965291544795036,
0.0235295370221138,
-0.12556196749210358,
0.05417256057262421,
-0.0012325955322012305,
-0.0003922792093362659,
-0.08671428263187408,
-0.012754283845424652,
-0.02581971511244774,
0.011795416474342346,
0.031560223549604416,
0.10539249330759048,
0.00463127763941884,
-0.023582709953188896,
-0.05414056032896042,
0.02938699722290039,
-0.0009486690978519619,
-0.0003282182733528316,
-0.05537432059645653,
-0.044876642525196075,
-0.080842986702919,
-0.035880763083696365,
-0.011673014611005783,
0.023013142868876457,
-0.07715427875518799,
0.043045174330472946,
-0.004786784294992685,
-0.006967004854232073,
-0.007343978155404329,
-0.0004972289316356182,
-0.03239983320236206,
-0.08895701169967651,
-0.01614200696349144,
-0.017837241291999817,
0.07011573016643524,
-0.04524008557200432
] | 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 '.', or X begins with './', '/' or '../' a. LOAD\_AS\_FILE(Y + X) b. LOAD\_AS\_DIRECTORY(Y + X) c. THROW "not found" 4. If X begins with '#' a. LOAD\_PACKAGE\_IMPORTS(X, dirname(Y)) 5. LOAD\_PACKAGE\_SELF(X, dirname(Y)) 6. LOAD\_NODE\_MODULES(X, dirname(Y)) 7. THROW "not found" MAYBE\_DETECT\_AND\_LOAD(X) 1. If X parses as a CommonJS module, load X as a CommonJS module. STOP. 2. Else, if the source code of X can be parsed as ECMAScript module using [DETECT\_MODULE\_SYNTAX defined in the ESM resolver](esm.md#resolver-algorithm-specification), a. Load X as an ECMAScript module. STOP. 3. THROW the SyntaxError from attempting to parse X as CommonJS in 1. STOP. LOAD\_AS\_FILE(X) 1. If X is a file, load X as its file extension format. STOP 2. If X.js is a file, a. Find the closest package scope SCOPE to X. b. If no scope was found 1. MAYBE\_DETECT\_AND\_LOAD(X.js) c. If the SCOPE/package.json contains "type" field, 1. If the "type" field is "module", load X.js as an ECMAScript module. STOP. 2. If the "type" field is "commonjs", load X.js as a CommonJS module. STOP. d. MAYBE\_DETECT\_AND\_LOAD(X.js) 3. If X.json is a file, load X.json to a JavaScript Object. STOP 4. If X.node is a file, load X.node as binary addon. STOP LOAD\_INDEX(X) 1. If X/index.js is a file a. Find the closest package scope SCOPE to X. b. If no scope was found, load X/index.js as a CommonJS module. STOP. c. If the SCOPE/package.json contains "type" field, 1. If the "type" field is "module", load X/index.js as an ECMAScript module. STOP. 2. Else, load X/index.js as a CommonJS module. STOP. 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP 3. If X/index.node is a file, load X/index.node as binary addon. STOP LOAD\_AS\_DIRECTORY(X) 1. If X/package.json is a file, a. Parse X/package.json, and look for "main" field. b. If "main" is a falsy value, GOTO 2. c. let M = X + (json main field) d. LOAD\_AS\_FILE(M) e. LOAD\_INDEX(M) f. LOAD\_INDEX(X) DEPRECATED g. THROW "not found" 2. LOAD\_INDEX(X) LOAD\_NODE\_MODULES(X, START) 1. let DIRS = NODE\_MODULES\_PATHS(START) 2. for each DIR in DIRS: a. LOAD\_PACKAGE\_EXPORTS(X, DIR) b. LOAD\_AS\_FILE(DIR/X) c. LOAD\_AS\_DIRECTORY(DIR/X) NODE\_MODULES\_PATHS(START) 1. let PARTS = path split(START) 2. let I = count of PARTS - 1 3. let DIRS = [] 4. while I >= 0, a. if PARTS[I] = "node\_modules", GOTO d. b. DIR = path join(PARTS[0 .. I] + "node\_modules") c. DIRS = DIRS + DIR d. let I = I - 1 5. return DIRS + GLOBAL\_FOLDERS LOAD\_PACKAGE\_IMPORTS(X, DIR) 1. Find the closest package scope SCOPE to DIR. 2. If no scope was found, return. 3. If the SCOPE/package.json "imports" is null or undefined, return. 4. If `--no-require-module` is not enabled a. let CONDITIONS = ["node", "require", "module-sync"] b. Else, let CONDITIONS = ["node", "require"] 5. let MATCH = PACKAGE\_IMPORTS\_RESOLVE(X, pathToFileURL(SCOPE), CONDITIONS) [defined in the ESM resolver](esm.md#resolver-algorithm-specification). 6. RESOLVE\_ESM\_MATCH(MATCH). LOAD\_PACKAGE\_EXPORTS(X, DIR) 1. Try to interpret X as a combination of NAME and SUBPATH where the name may have 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 | 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.017102979123592377,
0.07401058822870255,
0.09174142777919769,
-0.014958239160478115,
0.021990114822983742,
-0.02082965523004532,
-0.01270546205341816,
0.03819388523697853,
0.048068322241306305,
0.016794268041849136,
0.006485856603831053,
-0.03604830056428909,
-0.008691202849149704,
-0.003636034205555916,
-0.03125161677598953,
-0.0154672646895051,
0.03315342217683792,
-0.030355364084243774,
0.07694357633590698,
-0.05407986789941788,
0.05930261313915253,
0.07285251468420029,
0.14911937713623047,
-0.04215635359287262,
-0.08989111334085464,
-0.030228499323129654,
-0.05974579602479935,
0.027790211141109467,
0.06819315999746323,
0.0404527485370636,
-0.08412089198827744,
-0.03419141098856926,
-0.053056176751852036,
-0.07177772372961044,
0.07339608669281006,
-0.05798715353012085,
-0.0805763229727745,
-0.027905236929655075,
-0.05533555522561073,
-0.06516171246767044,
-0.060979973524808884,
0.03715505823493004,
0.004809386562556028,
0.0754585936665535,
-0.05979422852396965,
-0.06888119131326675,
0.06399291753768921,
-0.05056435614824295,
0.01220915000885725,
-0.0072395578026771545,
-0.03808226436376572,
-0.010130579583346844,
-0.004148712381720543,
-0.05125045403838158,
0.005566112231463194,
0.046333085745573044,
0.053011827170848846,
-0.08564841002225876,
0.03342854604125023,
-0.03497114032506943,
0.08094587177038193,
-0.019817067310214043,
-0.10434816032648087,
-0.010306880809366703,
0.010097341611981392,
-0.06697367131710052,
-0.11343667656183243,
-0.05401964858174324,
0.00502884853631258,
0.05952606722712517,
0.07219758629798889,
0.018448317423462868,
-0.0394991859793663,
0.001414033817127347,
0.02746538259088993,
0.03631003201007843,
0.027445729821920395,
-0.02925960160791874,
-0.11373104900121689,
-0.03946336731314659,
0.022186994552612305,
0.038267191499471664,
0.06699690222740173,
0.032347556203603745,
0.029820101335644722,
-0.016084495931863785,
0.026421478018164635,
-0.03820836916565895,
-0.0298466719686985,
0.03464849293231964,
-0.06381646543741226,
0.017471924424171448,
0.05364956706762314,
-0.021565396338701248,
-0.048945143818855286,
-0.017243672162294388,
-0.1171121746301651,
-0.018946757540106773,
-0.06888085603713989,
0.03332464396953583,
-0.10698677599430084,
0.03896761313080788,
-0.04871717840433121,
0.13492734730243683,
-0.00907396711409092,
-0.016087302938103676,
0.03692826256155968,
0.0454750657081604,
0.05229182168841362,
0.12837061285972595,
-0.03089803457260132,
0.05824333056807518,
-0.017335984855890274,
-0.03701448813080788,
4.333526780547566e-33,
-0.06858202069997787,
-0.049051374197006226,
-0.013599103316664696,
0.09494516998529434,
-0.028513770550489426,
-0.015213659964501858,
0.0854647308588028,
0.03021160699427128,
-0.07640250027179718,
0.04750531539320946,
-0.0034856535494327545,
0.0315086729824543,
-0.05035810545086861,
0.0016748410416767001,
0.039677783846855164,
-0.0036509342025965452,
0.06824518740177155,
-0.03396099433302879,
0.0915728509426117,
0.03168483078479767,
0.05341256782412529,
0.006736360490322113,
-0.045045603066682816,
0.057335931807756424,
-0.024655120447278023,
-0.014917321503162384,
0.04479121416807175,
-0.059591129422187805,
0.06384873390197754,
-0.020829204469919205,
-0.009174906648695469,
0.01410626620054245,
0.003225139807909727,
0.07428084313869476,
-0.008838975802063942,
0.011224540881812572,
0.02665872313082218,
-0.002402826678007841,
-0.06217818707227707,
-0.03996627777814865,
0.04424935206770897,
0.08694884926080704,
-0.03161167353391647,
0.03954233601689339,
-0.008377039805054665,
-0.09641169011592865,
-0.05409931764006615,
0.024289648979902267,
0.022117042914032936,
-0.0492134727537632,
0.031031157821416855,
0.0015296792844310403,
0.10570521652698517,
0.008444027043879032,
0.009165101684629917,
-0.016752243041992188,
-0.032212477177381516,
0.022891614586114883,
0.08369319885969162,
-0.018837688490748405,
0.06707536429166794,
-0.11340921372175217,
-0.06796920299530029,
0.09737186878919601,
0.028959352523088455,
0.06313438713550568,
0.018693218007683754,
-0.02169983647763729,
-0.01030498556792736,
0.10122346132993698,
-0.05538299307227135,
0.016335582360625267,
-0.018738223239779472,
-0.046074122190475464,
0.0786997601389885,
-0.03190084174275398,
-0.0344928503036499,
-0.07908095419406891,
-0.024310333654284477,
-0.04734478518366814,
-0.011927898973226547,
-0.02454279363155365,
0.03779575973749161,
0.042692631483078,
-0.02315670996904373,
0.008093737065792084,
-0.01816597208380699,
-0.04536972567439079,
0.01020671334117651,
-0.07629582285881042,
0.003709647571668029,
-0.08755844086408615,
-0.05391046032309532,
-0.011684427037835121,
-0.02260602079331875,
-6.443991705598639e-33,
0.08598855137825012,
0.0942721739411354,
0.011375712230801582,
0.05470959469676018,
0.04847835749387741,
-0.03290250897407532,
-0.003108648117631674,
-0.1119958832859993,
0.05556024610996246,
0.012307766824960709,
-0.05183028802275658,
-0.028835726901888847,
0.10810372978448868,
0.033384863287210464,
0.05103224143385887,
0.11227143555879593,
-0.0734402984380722,
-0.027462564408779144,
-0.054283853620290756,
0.012179647572338581,
-0.030027266591787338,
0.04147815704345703,
-0.02003219909965992,
-0.00965209398418665,
0.015776101499795914,
-0.001655465574003756,
-0.0933169424533844,
0.00791978184133768,
-0.043030720204114914,
0.04751289635896683,
-0.055775415152311325,
0.07358025014400482,
-0.02009880170226097,
-0.047745417803525925,
-0.06672755628824234,
0.0038972317706793547,
-0.05296804755926132,
0.06267688423395157,
-0.05099988356232643,
0.009320083074271679,
0.08663316071033478,
0.017347054556012154,
-0.07178782671689987,
0.018270881846547127,
-0.04000130668282509,
-0.07818081229925156,
0.012447846122086048,
0.047960299998521805,
-0.038280993700027466,
-0.05588676035404205,
-0.07453081756830215,
-0.06036766991019249,
-0.049098558723926544,
0.004254121799021959,
-0.021196631714701653,
0.03346408158540726,
0.03848676756024361,
0.06118721887469292,
0.0447101853787899,
-0.027477260679006577,
0.013677766546607018,
-0.059985529631376266,
-0.02000964619219303,
-0.0648525282740593,
-0.03302207216620445,
-0.019067639485001564,
-0.05936000123620033,
-0.009690571576356888,
0.08942888677120209,
-0.02061152644455433,
-0.02883676066994667,
0.08967854827642441,
-0.011436617001891136,
-0.04111957922577858,
-0.04608660191297531,
0.041974931955337524,
0.013908629305660725,
-0.0021283018868416548,
0.010263392701745033,
0.09053297340869904,
-0.03013450838625431,
0.021988164633512497,
-0.02251063473522663,
0.05836861953139305,
-0.02404739335179329,
-0.03597625344991684,
0.023321764543652534,
0.04572426900267601,
-0.027225103229284286,
-0.0015307078137993813,
0.07194335758686066,
0.039815597236156464,
-0.003428746946156025,
-0.02682444453239441,
-0.0389682911336422,
-5.7599539360353447e-8,
-0.02866200916469097,
-0.055015575140714645,
-0.05042429640889168,
-0.042755186557769775,
0.08311773836612701,
0.060248129069805145,
0.042218536138534546,
0.07055860012769699,
0.02474617213010788,
0.01098208874464035,
0.017529116943478584,
0.030778853222727776,
0.007982296869158745,
0.008878545835614204,
-0.13963362574577332,
0.036923062056303024,
-0.002419922035187483,
-0.0019335780525580049,
-0.08576872199773788,
-0.034774042665958405,
-0.01841830648481846,
0.014316187240183353,
0.02945490926504135,
0.10729040950536728,
-0.05238347873091698,
-0.03211010619997978,
0.04040307179093361,
-0.018884969875216484,
0.007610953878611326,
0.0006354223005473614,
-0.04542246088385582,
-0.000013667622624780051,
-0.030053818598389626,
-0.0476527139544487,
-0.006046139635145664,
0.10011003166437149,
0.05262095481157303,
-0.021051902323961258,
0.06856227666139603,
-0.0018308565486222506,
-0.024618711322546005,
0.037652548402547836,
-0.015648774802684784,
0.020044546574354172,
0.054198190569877625,
-0.10021750628948212,
-0.06472104787826538,
-0.02168031968176365,
0.004116431809961796,
0.019686460494995117,
0.0025608574505895376,
0.03842903673648834,
-0.08946356922388077,
0.09647152572870255,
0.020841380581259727,
0.022324923425912857,
-0.001981711247935891,
-0.0013871544506400824,
-0.054198794066905975,
-0.04836572706699371,
-0.02051123045384884,
0.04541092365980148,
0.11181807518005371,
-0.06303185224533081
] | 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 = ["node", "require", "module-sync"] b. Else, let CONDITIONS = ["node", "require"] 6. let MATCH = PACKAGE\_EXPORTS\_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, `package.json` "exports", CONDITIONS) [defined in the ESM resolver](esm.md#resolver-algorithm-specification). 7. RESOLVE\_ESM\_MATCH(MATCH) LOAD\_PACKAGE\_SELF(X, DIR) 1. Find the closest package scope SCOPE to DIR. 2. If no scope was found, return. 3. If the SCOPE/package.json "exports" is null or undefined, return. 4. If the SCOPE/package.json "name" is not the first segment of X, return. 5. let MATCH = PACKAGE\_EXPORTS\_RESOLVE(pathToFileURL(SCOPE), "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) [defined in the ESM resolver](esm.md#resolver-algorithm-specification). 6. RESOLVE\_ESM\_MATCH(MATCH) RESOLVE\_ESM\_MATCH(MATCH) 1. let RESOLVED\_PATH = fileURLToPath(MATCH) 2. If the file at RESOLVED\_PATH exists, load RESOLVED\_PATH as its extension format. STOP 3. THROW "not found" ``` ## Caching Modules are cached after the first time they are loaded. This means (among other things) that every call to `require('foo')` will get exactly the same object returned, if it would resolve to the same file. Provided `require.cache` is not modified, multiple calls to `require('foo')` will not cause the module code to be executed multiple times. This is an important feature. With it, "partially done" objects can be returned, thus allowing transitive dependencies to be loaded even when they would cause cycles. To have a module execute code multiple times, export a function, and call that function. ### Module caching caveats Modules are cached based on their resolved filename. Since modules may resolve to a different filename based on the location of the calling module (loading from `node\_modules` folders), it is not a \_guarantee\_ that `require('foo')` will always return the exact same object, if it would resolve to different files. Additionally, on case-insensitive file systems or operating systems, different resolved filenames can point to the same file, but the cache will still treat them as different modules and will reload the file multiple times. For example, `require('./foo')` and `require('./FOO')` return two different objects, irrespective of whether or not `./foo` and `./FOO` are the same file. ## Built-in modules Node.js has several modules compiled into the binary. These modules are described in greater detail elsewhere in this documentation. The built-in modules are defined within the Node.js source and are located in the `lib/` folder. Built-in modules can be identified using the `node:` prefix, in which case it bypasses the `require` cache. For instance, `require('node:http')` will always return the built in HTTP module, even if there is `require.cache` entry by that name. Some built-in modules are always preferentially loaded if their identifier is passed to `require()`. For instance, `require('http')` will always return the built-in HTTP module, even if there is a file by that name. The list of all the built-in modules can be retrieved from [`module.builtinModules`][]. The modules being all listed without the `node:` prefix, except those that mandate such prefix (as explained in the next section). ### Built-in modules with mandatory `node:` prefix When being loaded by `require()`, some built-in modules must be requested with the `node:` prefix. This requirement exists to prevent newly introduced built-in modules from having a conflict with user land 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 circular `require()` calls, a module might not have | 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.021891683340072632,
0.09350553900003433,
0.06967486441135406,
0.007189495489001274,
-0.010625597089529037,
-0.03479013219475746,
-0.06683669984340668,
0.06892934441566467,
0.08746065199375153,
0.020162155851721764,
-0.022690512239933014,
-0.03176648169755936,
-0.018164729699492455,
-0.04578522965312004,
-0.03995460271835327,
-0.025511035695672035,
0.002538335742428899,
-0.0031462551560252905,
0.07616601884365082,
-0.059510957449674606,
0.034019578248262405,
0.14026033878326416,
0.1325245052576065,
-0.006127199158072472,
-0.08493983000516891,
0.04142909497022629,
-0.07247383147478104,
0.06410322338342667,
0.0867297500371933,
0.06597509235143661,
-0.09926262497901917,
0.025883212685585022,
-0.07824886590242386,
-0.03730214387178421,
0.019298013299703598,
-0.07789579778909683,
-0.008098240941762924,
-0.012121889740228653,
-0.038549453020095825,
-0.15190331637859344,
-0.034766603261232376,
0.09801515936851501,
0.06015453487634659,
-0.004467825870960951,
0.03352095186710358,
-0.04961689934134483,
0.09844083338975906,
0.04276244342327118,
-0.062078677117824554,
-0.014041334390640259,
-0.06008923426270485,
-0.021691622212529182,
-0.0027736977208405733,
-0.002797614550217986,
-0.02420170046389103,
-0.008962144143879414,
0.005564187653362751,
-0.04058066010475159,
0.013791420497000217,
-0.0031636012718081474,
0.023337408900260925,
-0.04482046514749527,
-0.05299212783575058,
0.04930699244141579,
0.03995608538389206,
-0.024391796439886093,
-0.05042722448706627,
-0.035789504647254944,
-0.01231843139976263,
0.007482106797397137,
0.07039577513933182,
-0.011912235990166664,
-0.0392589308321476,
-0.00456059817224741,
-0.033347152173519135,
0.05282849073410034,
0.017667291685938835,
-0.025427499786019325,
-0.19889642298221588,
-0.045607052743434906,
0.004346734844148159,
0.008627905510365963,
0.06701058149337769,
-0.016696972772479057,
0.08139859884977341,
-0.038429245352745056,
0.02274913154542446,
-0.05807466432452202,
-0.03539002314209938,
0.07034047693014145,
-0.015701500698924065,
0.014460676349699497,
0.043101966381073,
0.002863775473088026,
-0.040571779012680054,
-0.0595814548432827,
0.026250923052430153,
0.009417944587767124,
0.02890557423233986,
0.03077818639576435,
-0.0670582503080368,
-0.015374809503555298,
-0.03259469196200371,
0.042065080255270004,
0.006730988621711731,
-0.007915188558399677,
0.08804072439670563,
0.06719624996185303,
0.049693819135427475,
0.15426155924797058,
-0.04557890072464943,
0.04834584519267082,
0.008831484243273735,
0.041910283267498016,
1.0883366793320959e-33,
-0.003790691029280424,
-0.03305510804057121,
-0.0015862471191212535,
-0.007592168636620045,
0.02634304203093052,
-0.02374042570590973,
0.07475531846284866,
0.015012855641543865,
-0.036202412098646164,
0.020049842074513435,
-0.02633519470691681,
0.08227084577083588,
-0.07353046536445618,
-0.038560330867767334,
-0.01166955940425396,
-0.04777764901518822,
0.06197604537010193,
-0.036002375185489655,
0.042520828545093536,
0.025371400639414787,
0.02200416289269924,
-0.06198405101895332,
-0.040322158485651016,
0.03753582388162613,
0.014893732033669949,
-0.075962595641613,
0.05022262781858444,
-0.005384491290897131,
0.03291253745555878,
-0.008164907805621624,
0.026441946625709534,
0.020979564636945724,
0.030251216143369675,
0.024877358227968216,
0.02854083850979805,
-0.0018906764453276992,
-0.011246543377637863,
0.005306130275130272,
-0.09045515209436417,
0.02078191004693508,
-0.0015682147350162268,
0.07609070092439651,
-0.08454915881156921,
0.06293044239282608,
-0.04636843129992485,
-0.11659175902605057,
-0.0023642918094992638,
-0.09087052196264267,
0.12290950864553452,
-0.05177244544029236,
-0.03952457010746002,
0.005126552656292915,
0.058740656822919846,
-0.11244578659534454,
0.0761912614107132,
-0.029001006856560707,
0.011193067766726017,
-0.002943872008472681,
0.01666530780494213,
-0.05488065630197525,
0.014582650735974312,
-0.08739850670099258,
-0.05271045118570328,
0.025720486417412758,
0.05212179198861122,
0.0260405782610178,
-0.06531459093093872,
-0.05344371870160103,
-0.047070927917957306,
0.023812534287571907,
0.03464486449956894,
0.019425664097070694,
0.015073656104505062,
-0.06640184670686722,
0.08747446537017822,
-0.03893289715051651,
-0.027844564989209175,
0.04443122074007988,
-0.046435143798589706,
-0.1061912477016449,
-0.0774536281824112,
-0.004462887533009052,
-0.0627816766500473,
0.10687423497438431,
0.019500689581036568,
0.04474032297730446,
-0.05571257323026657,
0.02437753602862358,
0.027475344017148018,
-0.02519363723695278,
0.012176431715488434,
-0.025970496237277985,
-0.05700431764125824,
-0.05769648775458336,
0.013095739297568798,
-1.6463343886113315e-33,
0.11671796441078186,
0.013808696530759335,
0.04488615691661835,
0.023427264764904976,
-0.010676665231585503,
-0.04453040286898613,
0.023727284744381905,
-0.022906064987182617,
0.05978992208838463,
0.060781024396419525,
-0.01725972630083561,
0.022419042885303497,
0.05135306715965271,
-0.0291383508592844,
-0.011221962049603462,
0.10359460860490799,
-0.05407246947288513,
-0.09174391627311707,
0.011947114951908588,
-0.004029381554573774,
0.035784076899290085,
0.06628433614969254,
0.034422941505908966,
-0.004179472103714943,
-0.04661069065332413,
0.003593986388295889,
-0.025892550125718117,
-0.04004142805933952,
-0.08314595371484756,
0.008757101371884346,
-0.021984079852700233,
-0.016806606203317642,
-0.03221224620938301,
-0.010912047699093819,
-0.08760767430067062,
-0.0035130949690937996,
-0.010024904273450375,
0.05491434037685394,
-0.020493505522608757,
-0.03455887362360954,
0.06613021343946457,
0.0130553487688303,
-0.0748099684715271,
0.031071042641997337,
-0.023046331480145454,
-0.06734981387853622,
0.10002611577510834,
0.0865640863776207,
0.020954979583621025,
-0.05066201463341713,
-0.003261430421844125,
-0.0347929410636425,
-0.03723025321960449,
-0.03814815357327461,
-0.0353672057390213,
0.04762142524123192,
0.017364168539643288,
-0.04925062507390976,
-0.005509332753717899,
-0.0030441731214523315,
0.06561695784330368,
-0.04703294113278389,
-0.02098090760409832,
-0.06263750791549683,
0.004631343763321638,
0.02027874067425728,
-0.1014886274933815,
0.03198202699422836,
0.08503871411085129,
0.03484922647476196,
-0.0373506173491478,
-0.016439061611890793,
0.018342070281505585,
-0.015129300765693188,
0.03205670416355133,
0.04065518081188202,
-0.0174631979316473,
-0.023057661950588226,
0.06250590085983276,
0.05858640372753143,
-0.008900611661374569,
0.08689112216234207,
-0.11092972010374069,
0.048065122216939926,
0.04730433598160744,
0.002574267564341426,
-0.00426001800224185,
0.038512833416461945,
0.01573210582137108,
0.02970772422850132,
0.04918878525495529,
-0.024152126163244247,
-0.014016270637512207,
-0.0680873766541481,
-0.028430834412574768,
-5.00967765049154e-8,
-0.08365239948034286,
-0.02655707858502865,
-0.10287624597549438,
-0.036211058497428894,
0.09007816761732101,
0.025050926953554153,
0.09115152806043625,
0.041393425315618515,
0.12080251425504684,
0.04628245159983635,
0.005933365784585476,
0.08260401338338852,
-0.10390619933605194,
0.05013919249176979,
-0.029780512675642967,
-0.02168157696723938,
0.04905712977051735,
0.07376211881637573,
-0.06961502879858017,
-0.015039795078337193,
-0.005991696380078793,
-0.013576645404100418,
0.030129261314868927,
0.036576882004737854,
0.008950380608439445,
0.00500418059527874,
0.0487486869096756,
-0.03330453857779503,
0.006944345310330391,
0.002009795978665352,
-0.07016041874885559,
0.010944352485239506,
-0.010170471854507923,
-0.0466640405356884,
-0.05281330645084381,
-0.011555240489542484,
0.10809285938739777,
0.01622036285698414,
0.05169089511036873,
0.049553032964468,
0.018776381388306618,
0.07318630814552307,
0.017656411975622177,
0.04536903649568558,
-0.020686166360974312,
-0.052782170474529266,
0.014803464524447918,
-0.0010839651804417372,
0.021859724074602127,
0.012388716451823711,
-0.011911727488040924,
-0.04099944233894348,
-0.03765321895480156,
0.08786292374134064,
-0.08087766915559769,
-0.00980857852846384,
-0.005514590069651604,
-0.02175525575876236,
-0.04398736730217934,
-0.011504030786454678,
0.05749053135514259,
0.007415750063955784,
0.04531317576766014,
-0.03824097290635109
] | 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 circular `require()` calls, a module might not have finished executing when it is returned. Consider this situation: `a.js`: ```js console.log('a starting'); exports.done = false; const b = require('./b.js'); console.log('in a, b.done = %j', b.done); exports.done = true; console.log('a done'); ``` `b.js`: ```js console.log('b starting'); exports.done = false; const a = require('./a.js'); console.log('in b, a.done = %j', a.done); exports.done = true; console.log('b done'); ``` `main.js`: ```js console.log('main starting'); const a = require('./a.js'); const b = require('./b.js'); console.log('in main, a.done = %j, b.done = %j', a.done, b.done); ``` When `main.js` loads `a.js`, then `a.js` in turn loads `b.js`. At that point, `b.js` tries to load `a.js`. In order to prevent an infinite loop, an \*\*unfinished copy\*\* of the `a.js` exports object is returned to the `b.js` module. `b.js` then finishes loading, and its `exports` object is provided to the `a.js` module. By the time `main.js` has loaded both modules, they're both finished. The output of this program would thus be: ```console $ node main.js main starting a starting b starting in b, a.done = false b done in a, b.done = true a done in main, a.done = true, b.done = true ``` Careful planning is required to allow cyclic module dependencies to work correctly within an application. ## File modules If the exact filename is not found, then Node.js will attempt to load the required filename with the added extensions: `.js`, `.json`, and finally `.node`. When loading a file that has a different extension (e.g. `.cjs`), its full name must be passed to `require()`, including its file extension (e.g. `require('./file.cjs')`). `.json` files are parsed as JSON text files, `.node` files are interpreted as compiled addon modules loaded with `process.dlopen()`. Files using any other extension (or no extension at all) are parsed as JavaScript text files. Refer to the [Determining module system][] section to understand what parse goal will be used. A required module prefixed with `'/'` is an absolute path to the file. For example, `require('/home/marco/foo.js')` will load the file at `/home/marco/foo.js`. A required module prefixed with `'./'` is relative to the file calling `require()`. That is, `circle.js` must be in the same directory as `foo.js` for `require('./circle')` to find it. Without a leading `'/'`, `'./'`, or `'../'` to indicate a file, the module must either be a core module or is loaded from a `node\_modules` folder. If the given path does not exist, `require()` will throw a [`MODULE\_NOT\_FOUND`][] error. ## Folders as modules > Stability: 3 - Legacy: Use [subpath exports][] or [subpath imports][] instead. There are three ways in which a folder may be passed to `require()` as an argument. The first is to create a [`package.json`][] file in the root of the folder, which specifies a `main` module. An example [`package.json`][] file might look like this: ```json { "name" : "some-library", "main" : "./lib/some-library.js" } ``` If this was in a folder at `./some-library`, then `require('./some-library')` would attempt to load `./some-library/lib/some-library.js`. If there is no [`package.json`][] file present in the directory, or if the [`"main"`][] entry is missing or cannot be resolved, then Node.js will attempt 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 module as missing with the default error: | 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.002430085791274905,
0.09775540977716446,
0.03366832435131073,
-0.014582850970327854,
0.002597308252006769,
0.016330143436789513,
-0.03379066288471222,
0.024095425382256508,
0.03686866536736488,
0.01461554504930973,
0.010113749653100967,
-0.044330839067697525,
0.013898833654820919,
-0.020711420103907585,
-0.032729584723711014,
0.06347094476222992,
-0.013825261034071445,
-0.03733740374445915,
0.06285896897315979,
-0.07629108428955078,
0.04415595531463623,
0.016876978799700737,
0.128631591796875,
-0.046249113976955414,
-0.06724895536899567,
-0.027919558808207512,
-0.09711528569459915,
0.07750571519136429,
0.07341980934143066,
-0.051679227501153946,
0.012934783473610878,
-0.004856026731431484,
-0.1048683226108551,
-0.119499072432518,
-0.025842860341072083,
-0.0957990363240242,
-0.004774635657668114,
0.009916769340634346,
-0.06675253063440323,
-0.04771925136446953,
-0.044520437717437744,
0.03098296746611595,
0.06732932478189468,
0.012044643051922321,
0.0011233092518523335,
0.015604334883391857,
0.08839410543441772,
-0.050700731575489044,
-0.02132379822432995,
-0.01854407787322998,
-0.012022783048450947,
0.060318879783153534,
0.011960682459175587,
0.026404941454529762,
-0.03227035701274872,
0.07053811848163605,
0.06249596178531647,
-0.006744845304638147,
0.013727259822189808,
-0.02265644259750843,
0.016543995589017868,
-0.06665131449699402,
-0.027384022250771523,
-0.010130045935511589,
0.0315636582672596,
-0.07065814733505249,
-0.04927825927734375,
-0.09198778122663498,
-0.07132109254598618,
-0.014182768762111664,
0.060868922621011734,
0.027507055550813675,
0.035509154200553894,
0.04536530375480652,
-0.024580854922533035,
0.06064135581254959,
0.012916959822177887,
-0.08872314542531967,
-0.11873968690633774,
-0.019539689645171165,
0.08413669466972351,
-0.043846629559993744,
0.02478911355137825,
0.06711623072624207,
0.05458055064082146,
-0.03543035313487053,
0.02704828418791294,
-0.05151819437742233,
-0.008113336749374866,
0.03046974539756775,
-0.01557844877243042,
0.014792450703680515,
-0.015775421634316444,
-0.027197429910302162,
-0.10030344873666763,
-0.014611094258725643,
-0.020113114267587662,
-0.01867530308663845,
0.03935378044843674,
0.0616864338517189,
-0.05613427609205246,
-0.04169118404388428,
-0.012512934394180775,
0.07003304362297058,
-0.046433933079242706,
0.10006649047136307,
0.11224114894866943,
0.1366083174943924,
0.10245852172374725,
0.10798163712024689,
0.003938079811632633,
0.05449928343296051,
0.004671221133321524,
0.012386375106871128,
-1.7803290987162157e-35,
-0.010886981151998043,
-0.05041240528225899,
-0.006060160230845213,
0.07035467773675919,
0.005003649741411209,
0.022188885137438774,
0.06921721249818802,
0.04755181446671486,
-0.0556902214884758,
-0.011613467708230019,
-0.030609512701630592,
0.09632579237222672,
-0.05367854982614517,
0.005538526922464371,
0.06006017327308655,
-0.005550482776015997,
0.11898838728666306,
-0.027103567495942116,
0.03326566517353058,
0.012330352328717709,
-0.018718332052230835,
0.03486534208059311,
-0.03681809455156326,
0.09768473356962204,
0.0526123046875,
-0.04061628878116608,
0.030520891770720482,
0.007491427473723888,
-0.022196030244231224,
0.03591678664088249,
0.03753000870347023,
0.03679851070046425,
-0.041869744658470154,
0.07164204865694046,
0.02315564639866352,
0.08917070925235748,
-0.02587638795375824,
0.013288578949868679,
-0.10595478862524033,
-0.03338690474629402,
0.010430549271404743,
0.042791180312633514,
-0.1540476232767105,
0.022963685914874077,
-0.02735287696123123,
-0.13305199146270752,
-0.03849360719323158,
-0.0203279759734869,
0.0707438513636589,
-0.07248660176992416,
-0.019793329760432243,
0.05805999040603638,
0.0641808956861496,
-0.031065886840224266,
0.03330794721841812,
-0.003251706250011921,
0.06328528374433517,
-0.02273331955075264,
-0.0021950139198452234,
0.0006428055930882692,
-0.011058839969336987,
-0.05232300981879234,
-0.0846986323595047,
0.1051889955997467,
-0.03428249806165695,
0.08225220441818237,
-0.05369344726204872,
-0.06065703183412552,
0.02057800441980362,
0.013912077061831951,
-0.029342712834477425,
0.0369928777217865,
-0.012617413885891438,
0.009342323988676071,
0.04300442337989807,
0.01725604571402073,
-0.10995005816221237,
-0.039618656039237976,
-0.06970755755901337,
-0.038181111216545105,
0.04635000228881836,
-0.007475591264665127,
-0.06792610138654709,
0.05514875054359436,
0.022627150639891624,
-0.003858658019453287,
-0.04108797758817673,
-0.009370291605591774,
-0.015282987616956234,
-0.014341996051371098,
0.02390061505138874,
0.0034753086511045694,
0.026013575494289398,
-0.03982488438487053,
-0.040996525436639786,
-2.1222209705852494e-33,
0.010273848660290241,
0.05301612615585327,
-0.04735470563173294,
0.10687028616666794,
-0.006549505516886711,
-0.06993801891803741,
-0.03352534770965576,
-0.06922801584005356,
0.004338584374636412,
0.030215799808502197,
-0.05800431966781616,
0.007745956536382437,
0.05539444461464882,
0.035018954426050186,
0.014985079877078533,
0.10862234979867935,
-0.04574025794863701,
-0.037421245127916336,
0.0496949702501297,
-0.011315916664898396,
-0.009118979796767235,
0.0566001757979393,
0.05301426723599434,
-0.017006274312734604,
-0.0005365529796108603,
0.015276513993740082,
-0.06810779124498367,
-0.005236652679741383,
-0.02587204985320568,
-0.03589501976966858,
-0.06856713443994522,
0.02491758018732071,
-0.02542870119214058,
-0.0075407493859529495,
-0.018043262884020805,
0.011006483808159828,
-0.018725287169218063,
0.09182486683130264,
0.012768132612109184,
-0.008327869698405266,
0.03706797957420349,
-0.027267498895525932,
-0.05126819387078285,
0.02953433245420456,
-0.04975374415516853,
-0.09012984484434128,
0.05986374244093895,
0.03207011893391609,
-0.0015449888305738568,
-0.06657298654317856,
-0.051921214908361435,
-0.003940203692764044,
-0.025458110496401787,
-0.0017779483459889889,
-0.001613859785720706,
-0.05098990723490715,
0.00808521918952465,
0.022702855989336967,
0.07131589949131012,
0.018225781619548798,
0.05216975882649422,
-0.05846675857901573,
0.034427449107170105,
-0.047377876937389374,
-0.04539687559008598,
-0.05199604853987694,
-0.08924292027950287,
0.004647047724574804,
0.11151901632547379,
-0.002501074690371752,
-0.003928567282855511,
0.08382625877857208,
-0.017761731520295143,
0.012904873117804527,
-0.01930111087858677,
0.034726355224847794,
-0.04135827347636223,
-0.08138148486614227,
-0.00024269857385661453,
0.023472445085644722,
-0.07323259115219116,
0.04971152916550636,
-0.05791911855340004,
-0.009491300210356712,
-0.002792560961097479,
-0.06286182999610901,
0.02897539734840393,
0.009248574264347553,
-0.030031884089112282,
0.032725345343351364,
0.07335920631885529,
0.0014127548784017563,
-0.051461704075336456,
0.033579785376787186,
-0.025461159646511078,
-5.6582891261314217e-8,
-0.018090585246682167,
-0.04063327610492706,
-0.11127311736345291,
-0.040199123322963715,
0.10765883326530457,
-0.060701511800289154,
0.04906095191836357,
0.07792636007070541,
0.022294238209724426,
-0.007626907899975777,
0.015280980616807938,
0.05810533091425896,
0.0569264218211174,
0.05033154413104057,
-0.014227056875824928,
0.03362402692437172,
0.037477172911167145,
0.010826735757291317,
-0.08713406324386597,
0.012439555488526821,
-0.05245945230126381,
0.02896847575902939,
-0.016496865078806877,
0.09325800836086273,
-0.06927534937858582,
-0.03776885196566582,
0.04528006911277771,
0.011827235110104084,
0.016358254477381706,
0.006929301656782627,
-0.0865931361913681,
0.03966519236564636,
-0.0035036068875342607,
-0.029797613620758057,
-0.07437430322170258,
0.029167035594582558,
0.026961995288729668,
-0.03140781819820404,
0.09516137093305588,
0.07334572821855545,
-0.011917953379452229,
-0.016111472621560097,
-0.05241188406944275,
0.0773148164153099,
-0.007086046505719423,
-0.05464564636349678,
-0.07326111197471619,
-0.002092478098347783,
-0.022994043305516243,
-0.05357015132904053,
0.010185949504375458,
-0.04945611208677292,
-0.060060713440179825,
0.040039241313934326,
0.016921477392315865,
0.042113047093153,
0.04440601170063019,
-0.06498956680297852,
0.01781044714152813,
-0.023547573015093803,
-0.052324552088975906,
-0.029941130429506302,
0.13527894020080566,
-0.03678533062338829
] | 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 module as missing with the default error: ```console Error: Cannot find module 'some-library' ``` In all three above cases, an `import('./some-library')` call would result in a [`ERR\_UNSUPPORTED\_DIR\_IMPORT`][] error. Using package [subpath exports][] or [subpath imports][] can provide the same containment organization benefits as folders as modules, and work for both `require` and `import`. ## Loading from `node\_modules` folders If the module identifier passed to `require()` is not a [built-in](#built-in-modules) module, and does not begin with `'/'`, `'../'`, or `'./'`, then Node.js starts at the directory of the current module, and adds `/node\_modules`, and attempts to load the module from that location. Node.js will not append `node\_modules` to a path already ending in `node\_modules`. If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached. For example, if the file at `'/home/ry/projects/foo.js'` called `require('bar.js')`, then Node.js would look in the following locations, in this order: \* `/home/ry/projects/node\_modules/bar.js` \* `/home/ry/node\_modules/bar.js` \* `/home/node\_modules/bar.js` \* `/node\_modules/bar.js` This allows programs to localize their dependencies, so that they do not clash. It is possible to require specific files or sub modules distributed with a module by including a path suffix after the module name. For instance `require('example-module/path/to/file')` would resolve `path/to/file` relative to where `example-module` is located. The suffixed path follows the same module resolution semantics. ## Loading from the global folders If the `NODE\_PATH` environment variable is set to a colon-delimited list of absolute paths, then Node.js will search those paths for modules if they are not found elsewhere. On Windows, `NODE\_PATH` is delimited by semicolons (`;`) instead of colons. `NODE\_PATH` was originally created to support loading modules from varying paths before the current [module resolution][] algorithm was defined. `NODE\_PATH` is still supported, but is less necessary now that the Node.js ecosystem has settled on a convention for locating dependent modules. Sometimes deployments that rely on `NODE\_PATH` show surprising behavior when people are unaware that `NODE\_PATH` must be set. Sometimes a module's dependencies change, causing a different version (or even a different module) to be loaded as the `NODE\_PATH` is searched. Additionally, Node.js will search in the following list of GLOBAL\\_FOLDERS: \* 1: `$HOME/.node\_modules` \* 2: `$HOME/.node\_libraries` \* 3: `$PREFIX/lib/node` Where `$HOME` is the user's home directory, and `$PREFIX` is the Node.js configured `node\_prefix`. These are mostly for historic reasons. It is strongly encouraged to place dependencies in the local `node\_modules` folder. These will be loaded faster, and more reliably. ## The module wrapper Before a module's code is executed, Node.js will wrap it with a function wrapper that looks like the following: ```js (function(exports, require, module, \_\_filename, \_\_dirname) { // Module code actually lives in here }); ``` By doing this, Node.js achieves a few things: \* It keeps top-level variables (defined with `var`, `const`, or `let`) scoped to the module rather than the global object. \* It helps to provide some global-looking variables that are actually specific to the module, such as: \* The `module` and `exports` objects that the implementor can use to export values from 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: running `node example.js` from `/Users/mjr` ```js | 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.05328279361128807,
0.10021330416202545,
0.048218801617622375,
-0.0011144543532282114,
0.028368884697556496,
0.0035350581165403128,
0.023915203288197517,
0.020971117541193962,
0.04582233354449272,
-0.0036067357286810875,
-0.033622559159994125,
-0.05894574895501137,
0.01022881269454956,
-0.03838296979665756,
-0.047626882791519165,
0.0031251609325408936,
0.05366603657603264,
-0.0460701622068882,
0.04452570155262947,
-0.07262230664491653,
0.009507260285317898,
0.004887118935585022,
0.13949047029018402,
-0.03423242270946503,
-0.10202620178461075,
-0.025834809988737106,
-0.04994102194905281,
0.0505114421248436,
0.12600083649158478,
-0.02345057763159275,
-0.05244135111570358,
-0.06854286789894104,
-0.09668430685997009,
-0.06009560450911522,
-0.0033975772093981504,
-0.07356421649456024,
-0.024533424526453018,
-0.04240370914340019,
-0.036759600043296814,
-0.00519227609038353,
-0.055177994072437286,
0.0185311920940876,
0.05833693966269493,
-0.0240730419754982,
0.0004004022921435535,
0.024428298696875572,
0.11220944672822952,
0.021871211007237434,
0.03163183107972145,
0.028691062703728676,
-0.04621971771121025,
0.0020706597715616226,
-0.025711724534630775,
-0.046286169439554214,
-0.0010760193690657616,
0.022670645266771317,
0.04684239253401756,
-0.021765761077404022,
0.0002793869352899492,
-0.07977758347988129,
0.06227599084377289,
-0.025007596239447594,
-0.1027996689081192,
0.03748634457588196,
0.016614826396107674,
-0.00006445652252295986,
-0.017707154154777527,
-0.07784262299537659,
-0.04040071740746498,
0.03624343127012253,
0.04180499538779259,
-0.0026444231625646353,
0.01246348861604929,
-0.01018174272030592,
-0.024862423539161682,
0.030413413420319557,
0.02733404003083706,
-0.02542114071547985,
-0.1553194671869278,
-0.05199246108531952,
0.059685394167900085,
0.029645118862390518,
0.024618644267320633,
0.0124624352902174,
0.09978648275136948,
-0.055950965732336044,
0.0032177630346268415,
-0.06016622856259346,
-0.02202533185482025,
0.05692650377750397,
0.007957099936902523,
0.009239893406629562,
0.018030105158686638,
-0.03943382203578949,
-0.07241129130125046,
-0.04758705571293831,
-0.010396038182079792,
0.007658574730157852,
-0.0006798835820518434,
0.052578117698431015,
-0.06996015459299088,
0.015949144959449768,
-0.02687729522585869,
0.0558529868721962,
-0.02078094892203808,
-0.007398390676826239,
0.15593209862709045,
0.010168722830712795,
0.007232983130961657,
0.12217102199792862,
0.01936802826821804,
0.10146086663007736,
-0.020253028720617294,
-0.03328530490398407,
2.408947001624845e-34,
-0.015219377353787422,
-0.045691363513469696,
0.02035442367196083,
0.10287753492593765,
0.01859770528972149,
-0.05099594220519066,
0.0804087221622467,
0.01612509973347187,
-0.07278161495923996,
0.018115578219294548,
-0.040091678500175476,
0.10223250091075897,
-0.06766152381896973,
0.021296581253409386,
0.012115326710045338,
-0.001661533722653985,
0.08710900694131851,
-0.036067359149456024,
0.07292337715625763,
0.01770550198853016,
-0.0075846887193620205,
-0.03297009319067001,
0.021621860563755035,
0.0878031924366951,
-0.003989689983427525,
0.03052384778857231,
0.07607544213533401,
-0.0698605477809906,
0.08496081829071045,
-0.0004836775187868625,
0.03171971067786217,
0.004264609422534704,
0.02208070270717144,
0.008621331304311752,
0.02901925891637802,
0.044958386570215225,
0.005911156069487333,
0.021894505247473717,
-0.14753848314285278,
-0.0012638947227969766,
-0.022808073088526726,
0.1283118575811386,
-0.058813806623220444,
0.004241493064910173,
-0.010613666847348213,
-0.04064903408288956,
0.021337848156690598,
-0.011171278543770313,
0.021700704470276833,
-0.0019090075511485338,
-0.08639713376760483,
0.018715498968958855,
0.07187767326831818,
-0.01787695661187172,
0.030969984829425812,
-0.016340509057044983,
0.007189659401774406,
-0.012369777075946331,
0.05134032666683197,
-0.06922054290771484,
0.08053821325302124,
-0.06033384054899216,
-0.03641620650887489,
0.07195910811424255,
0.07990001142024994,
0.02290438488125801,
-0.08442715555429459,
0.019076524302363396,
-0.05375879630446434,
0.09187478572130203,
-0.021851586177945137,
-0.00015675931354053319,
0.0005074550281278789,
0.002342976164072752,
0.037579115480184555,
-0.00989679154008627,
-0.041000064462423325,
-0.02526067942380905,
-0.0005716822925023735,
-0.042658839374780655,
-0.01232281792908907,
-0.04829584062099457,
0.03155016899108887,
-0.02687392570078373,
0.014998120255768299,
-0.014304033480584621,
-0.03104211576282978,
0.011112661100924015,
0.0316455103456974,
-0.06606234610080719,
0.07516106218099594,
-0.029042720794677734,
-0.06791214644908905,
-0.05050485208630562,
-0.07149724662303925,
-3.2934578278056525e-33,
0.07447159290313721,
0.016269590705633163,
-0.008517691865563393,
0.013807637616991997,
0.011822463013231754,
-0.03898004814982414,
-0.02051137387752533,
-0.06865999847650528,
0.08267147094011307,
0.03501149266958237,
-0.09766767174005508,
0.007793123833835125,
0.11083296686410904,
0.026527078822255135,
0.01728144660592079,
0.11724768579006195,
-0.10578642040491104,
-0.04154032841324806,
0.004053390119224787,
-0.03713057562708855,
-0.03610704466700554,
0.03447465971112251,
0.04471670836210251,
0.036639489233493805,
-0.05739354342222214,
0.00128771155141294,
-0.06062513589859009,
-0.038577642291784286,
-0.07793450355529785,
0.025729618966579437,
-0.0360427051782608,
0.038623590022325516,
0.0076689585112035275,
-0.017073441296815872,
-0.07248380035161972,
0.030765607953071594,
-0.044231317937374115,
0.02348872646689415,
0.0035410223063081503,
-0.09031103551387787,
0.03916013613343239,
0.03757694363594055,
-0.021053757518529892,
-0.01512826606631279,
-0.03789375349879265,
-0.08851886540651321,
-0.014956262893974781,
0.07240890711545944,
-0.02671128697693348,
-0.09442886710166931,
-0.046707380563020706,
-0.0364382229745388,
0.0044316742569208145,
-0.004080538637936115,
-0.028722289949655533,
0.01811840385198593,
-0.00030557147692888975,
0.08825643360614777,
0.05436193197965622,
-0.016032062470912933,
-0.005940576083958149,
-0.034140270203351974,
-0.108403280377388,
-0.08132272958755493,
-0.10672196000814438,
-0.041699640452861786,
-0.07477761059999466,
-0.03409961238503456,
0.10295900702476501,
-0.037446871399879456,
-0.054122839123010635,
0.03930247947573662,
0.04112758859992027,
-0.0003442776796873659,
-0.033427249640226364,
0.026055505499243736,
0.0072227781638503075,
0.01943095400929451,
0.025223318487405777,
0.04953838884830475,
-0.039748355746269226,
0.036484912037849426,
-0.035328302532434464,
0.011696001514792442,
0.053844302892684937,
0.01589057222008705,
0.040916673839092255,
0.03967846557497978,
-0.05216614902019501,
-0.013594591058790684,
0.08853814005851746,
0.0006128769600763917,
0.004154542461037636,
-0.025831757113337517,
0.01888704113662243,
-5.1443471704715193e-8,
-0.03281525894999504,
0.025712069123983383,
-0.09896377474069595,
-0.06630032509565353,
0.06032070517539978,
-0.028035741299390793,
0.06893498450517654,
0.07452908903360367,
0.035340677946805954,
0.07078864425420761,
-0.006295609287917614,
0.06531696021556854,
-0.04600859060883522,
0.024617373943328857,
-0.08195105940103531,
0.04305079206824303,
-0.009168555028736591,
0.08326341211795807,
-0.03453672677278519,
0.01994585618376732,
-0.013204400427639484,
0.015548605471849442,
0.034604210406541824,
0.07789453864097595,
-0.02539079636335373,
-0.0014396505430340767,
0.021841377019882202,
-0.030220551416277885,
-0.02681667171418667,
-0.051341667771339417,
-0.10964614897966385,
0.01869805157184601,
-0.012935318984091282,
-0.058253828436136246,
-0.011969373561441898,
0.004376646596938372,
0.03351994976401329,
-0.06448458135128021,
0.04140608012676239,
0.01279731560498476,
-0.025803014636039734,
0.00039356827619485557,
0.020807530730962753,
-0.007658049464225769,
-0.03676946833729744,
-0.05277235805988312,
-0.07802563905715942,
0.04071665555238724,
0.009677319787442684,
-0.004237333778291941,
0.035503238439559937,
-0.03429782763123512,
-0.1124073714017868,
0.04573303461074829,
0.04098876565694809,
0.06303941458463669,
-0.021195514127612114,
-0.019317500293254852,
-0.06887218356132507,
-0.0926608219742775,
0.05667819455265999,
0.020314721390604973,
0.06368515640497208,
-0.08190835267305374
] | 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: running `node example.js` from `/Users/mjr` ```js console.log(\_\_dirname); // Prints: /Users/mjr console.log(path.dirname(\_\_filename)); // Prints: /Users/mjr ``` ### `\_\_filename` \* Type: {string} The file name of the current module. This is the current module file's absolute path with symlinks resolved. For a main program this is not necessarily the same as the file name used in the command line. See [`\_\_dirname`][] for the directory name of the current module. Examples: Running `node example.js` from `/Users/mjr` ```js console.log(\_\_filename); // Prints: /Users/mjr/example.js console.log(\_\_dirname); // Prints: /Users/mjr ``` Given two modules: `a` and `b`, where `b` is a dependency of `a` and there is a directory structure of: \* `/Users/mjr/app/a.js` \* `/Users/mjr/app/node\_modules/b/b.js` References to `\_\_filename` within `b.js` will return `/Users/mjr/app/node\_modules/b/b.js` while references to `\_\_filename` within `a.js` will return `/Users/mjr/app/a.js`. ### `exports` \* Type: {Object} A reference to the `module.exports` that is shorter to type. See the section about the [exports shortcut][] for details on when to use `exports` and when to use `module.exports`. ### `module` \* Type: {module} A reference to the current module, see the section about the [`module` object][]. In particular, `module.exports` is used for defining what a module exports and makes available through `require()`. ### `require(id)` \* `id` {string} module name or path \* Returns: {any} exported module content Used to import modules, `JSON`, and local files. Modules can be imported from `node\_modules`. Local modules and JSON files can be imported using a relative path (e.g. `./`, `./foo`, `./bar/baz`, `../foo`) that will be resolved against the directory named by [`\_\_dirname`][] (if defined) or the current working directory. The relative paths of POSIX style are resolved in an OS independent fashion, meaning that the examples above will work on Windows in the same way they would on Unix systems. ```js // Importing a local module with a path relative to the `\_\_dirname` or current // working directory. (On Windows, this would resolve to .\path\myLocalModule.) const myLocalModule = require('./path/myLocalModule'); // Importing a JSON file: const jsonData = require('./path/filename.json'); // Importing a module from node\_modules or Node.js built-in module: const crypto = require('node:crypto'); ``` #### `require.cache` \* Type: {Object} Modules are cached in this object when they are required. By deleting a key value from this object, the next `require` will reload the module. This does not apply to [native addons][], for which reloading will result in an error. Adding or replacing entries is also possible. This cache is checked before built-in modules and if a name matching a built-in module is added to the cache, only `node:`-prefixed require calls are going to receive the built-in module. Use with care! ```js const assert = require('node:assert'); const realFs = require('node:fs'); const fakeFs = {}; require.cache.fs = { exports: fakeFs }; assert.strictEqual(require('fs'), fakeFs); assert.strictEqual(require('node:fs'), realFs); ``` #### `require.extensions` > Stability: 0 - Deprecated \* Type: {Object} Instruct `require` on how to handle certain file extensions. Process files with the extension `.sjs` as `.js`: ```js require.extensions['.sjs'] = require.extensions['.js']; ``` \*\*Deprecated.\*\* In the past, this list has been used to load non-JavaScript modules into Node.js by compiling them on-demand. However, in practice, there are much 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 `Module` object | 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.014876465313136578,
0.016694840043783188,
0.07751909643411636,
-0.009359308518469334,
0.05244956910610199,
0.0026889806613326073,
0.011648914776742458,
0.030394690111279488,
0.043426189571619034,
0.052568469196558,
-0.03605514019727707,
0.06405375897884369,
-0.00766703300178051,
0.02258378267288208,
0.04162215813994408,
0.018191246315836906,
-0.020336776971817017,
0.03383839875459671,
0.04690166562795639,
-0.04889770597219467,
-0.006769119296222925,
0.008654722012579441,
0.13412341475486755,
-0.024942370131611824,
-0.08869867771863937,
-0.009439466521143913,
-0.07615739852190018,
0.054922301322221756,
0.09324758499860764,
-0.007580890320241451,
-0.08063024282455444,
-0.05593607947230339,
-0.028008418157696724,
-0.05423622205853462,
-0.021643666550517082,
-0.11826261878013611,
0.026149893179535866,
-0.05173177644610405,
-0.05540888011455536,
-0.013896000571548939,
-0.06459777802228928,
0.0005392645252868533,
0.027569042518734932,
-0.03684501722455025,
0.032497722655534744,
0.031387388706207275,
0.15937821567058563,
-0.013118712231516838,
0.010791809298098087,
-0.011041705496609211,
-0.06167391315102577,
0.02668001502752304,
-0.062003519386053085,
0.014670084230601788,
0.0026518700178712606,
0.03456205874681473,
-0.04108400642871857,
-0.007966777309775352,
0.022263528779149055,
-0.028603559359908104,
-0.023461122065782547,
-0.0755181759595871,
-0.09789500385522842,
0.002939509227871895,
0.1313602179288864,
-0.00947135966271162,
-0.052793800830841064,
0.029221266508102417,
-0.04031805321574211,
0.05818917974829674,
0.010885181836783886,
-0.02592540718615055,
0.0799468606710434,
-0.0034565343521535397,
0.03183760121464729,
0.07282674312591553,
0.025030037388205528,
-0.05956057459115982,
-0.14531679451465607,
-0.05541270598769188,
0.03659653663635254,
0.023192325606942177,
0.03903135284781456,
0.017470059916377068,
0.16737517714500427,
0.02526019886136055,
-0.03339853510260582,
0.022862564772367477,
0.009325727820396423,
0.052559416741132736,
0.03238225728273392,
0.09179124236106873,
0.002470813924446702,
0.014450625516474247,
0.000004755062036565505,
0.024771971628069878,
-0.06064869835972786,
-0.013523804023861885,
-0.007241209503263235,
-0.011805051937699318,
-0.03759012371301651,
-0.009818878024816513,
-0.06638465821743011,
0.02972348779439926,
0.04967028647661209,
0.06492463499307632,
0.1269066333770752,
0.0762164518237114,
-0.005786762572824955,
0.05904379487037659,
-0.035240914672613144,
0.03472774848341942,
-0.009173108264803886,
-0.0059004430659115314,
-1.4324218755750264e-33,
-0.012945661321282387,
-0.04799840971827507,
0.04237860068678856,
0.05343760922551155,
0.05137701705098152,
-0.04716484993696213,
-0.0023435414768755436,
0.061832819133996964,
-0.0356946736574173,
0.03282608464360237,
-0.05515376478433609,
0.009873297065496445,
0.013028563000261784,
-0.027317550033330917,
-0.030736900866031647,
-0.019246064126491547,
0.00045836676144972444,
-0.07331626862287521,
-0.003174206241965294,
-0.03238377720117569,
0.00094281614292413,
0.1253541260957718,
-0.02052103355526924,
0.05226178467273712,
-0.029611637815833092,
0.01165321096777916,
0.05426457151770592,
0.008239044807851315,
0.007674804888665676,
-0.013277390040457249,
0.037241656333208084,
0.017479119822382927,
0.001794961397536099,
0.04386233165860176,
0.06110930070281029,
0.07158882915973663,
-0.0331924669444561,
-0.005601353012025356,
-0.09369838982820511,
-0.010886485688388348,
0.03093501552939415,
0.06713718175888062,
-0.07961209118366241,
0.010166226886212826,
-0.06584509462118149,
-0.06231849268078804,
-0.10081086307764053,
-0.03324270248413086,
-0.041309207677841187,
0.0062898132018744946,
-0.07607585936784744,
0.06907794624567032,
0.09864906966686249,
0.0054706973023712635,
0.010233532637357712,
-0.015359316021203995,
0.0014226529747247696,
-0.039478421211242676,
-0.06180586293339729,
-0.005858813412487507,
-0.03090430237352848,
0.014206984080374241,
-0.018339643254876137,
0.05804412439465523,
-0.034390438348054886,
0.0060213725082576275,
-0.0024562696926295757,
-0.013332294300198555,
0.04646798223257065,
0.10859855264425278,
-0.022409608587622643,
0.04957819730043411,
0.03392550349235535,
-0.01087508350610733,
0.04829448089003563,
-0.0038776106666773558,
-0.11066527664661407,
0.004563292488455772,
-0.05331561714410782,
-0.043384894728660583,
-0.07279009371995926,
0.006561615038663149,
-0.045548196882009506,
0.021598409861326218,
0.00577519740909338,
-0.020189570263028145,
-0.0805043876171112,
-0.05298339203000069,
0.09964142739772797,
-0.05753275007009506,
0.11018683016300201,
-0.04672421142458916,
-0.0808829739689827,
0.02728758007287979,
-0.09116409718990326,
-1.996679275943383e-33,
0.06827947497367859,
0.07023442536592484,
-0.030588122084736824,
0.03225191310048103,
-0.07594314962625504,
-0.04102752357721329,
0.019107593223452568,
-0.02645769901573658,
-0.024575725197792053,
0.001806273590773344,
-0.053761765360832214,
0.08436354994773865,
0.012078139930963516,
0.021265694871544838,
0.06613419950008392,
0.07154153287410736,
-0.057043079286813736,
-0.057018037885427475,
-0.03406938537955284,
-0.0525091178715229,
-0.01866123452782631,
0.05253225937485695,
0.04094189032912254,
0.019743196666240692,
0.010463929735124111,
-0.03733798488974571,
-0.03612808883190155,
-0.006604256574064493,
-0.04135788977146149,
-0.007947918027639389,
0.009114736691117287,
0.010479898191988468,
-0.05673929303884506,
-0.06496298313140869,
-0.02584986202418804,
-0.06764707714319229,
-0.03930215165019035,
0.04033363237977028,
0.06880424916744232,
-0.0657394751906395,
0.058671366423368454,
0.021272186189889908,
-0.02518315613269806,
0.05988482013344765,
0.011636314913630486,
0.017088012769818306,
0.006999173667281866,
-0.02190011367201805,
0.022867051884531975,
-0.08357352763414383,
-0.04692381992936134,
-0.10063397139310837,
0.026980657130479813,
-0.005603061523288488,
0.049231354147195816,
-0.031815528869628906,
-0.039483632892370224,
0.014549050480127335,
-0.030406871810555458,
0.07661143690347672,
0.07241930067539215,
-0.09867525845766068,
-0.06649021804332733,
-0.031170133501291275,
-0.0973077043890953,
-0.027847591787576675,
-0.0702921450138092,
-0.05109855532646179,
0.08320099115371704,
-0.06759130954742432,
-0.01127707865089178,
-0.010951821692287922,
-0.035752441734075546,
0.06732980906963348,
-0.028238289058208466,
0.04490526020526886,
0.03309433162212372,
-0.03988124802708626,
-0.036155808717012405,
0.00032916219788603485,
0.011257614009082317,
0.03403697535395622,
-0.11300952732563019,
0.002594650024548173,
0.0050566354766488075,
-0.0738174244761467,
-0.021530993282794952,
0.05300293117761612,
-0.022610370069742203,
-0.08026806265115738,
0.06615482270717621,
0.09093357622623444,
-0.032151103019714355,
0.007318157237023115,
-0.0708637610077858,
-4.9104031063507136e-8,
-0.03748885542154312,
-0.028262464329600334,
-0.09606707096099854,
-0.06128237769007683,
0.05011243000626564,
0.003801953047513962,
0.014701608568429947,
0.08997561782598495,
0.06528406590223312,
0.12218686193227768,
0.06987947225570679,
-0.006547595374286175,
-0.0720134824514389,
-0.02748553454875946,
-0.0505484901368618,
0.02230362594127655,
0.008314925245940685,
0.07283362746238708,
-0.01065103244036436,
0.034154072403907776,
-0.013112989254295826,
-0.008390495553612709,
-0.008058281615376472,
0.09467597305774689,
-0.028038430958986282,
-0.04825878515839577,
0.030985329300165176,
0.07185767590999603,
-0.06646628677845001,
-0.029555093497037888,
-0.06667641550302505,
0.06822863221168518,
0.051679980009794235,
0.014921861700713634,
-0.09129098802804947,
0.06894479691982269,
0.034779977053403854,
-0.023631948977708817,
0.06668371707201004,
0.06813361495733261,
-0.0011057750089094043,
-0.011798473075032234,
0.00593158695846796,
0.026837091892957687,
-0.03141622990369797,
-0.03499922528862953,
0.012918664142489433,
0.025662170723080635,
-0.0714782327413559,
-0.06244302913546562,
-0.0009397811954841018,
0.012378763407468796,
-0.023188309744000435,
0.02209634706377983,
0.008239182643592358,
0.007734413258731365,
0.004507150966674089,
-0.020421897992491722,
-0.005208777729421854,
-0.027684614062309265,
0.0062162745743989944,
0.030386723577976227,
0.008948439732193947,
-0.03983280062675476
] | 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 `Module` object representing the entry script loaded when the Node.js process launched, or `undefined` if the entry point of the program is not a CommonJS module. See ["Accessing the main module"](#accessing-the-main-module). In `entry.js` script: ```js console.log(require.main); ``` ```bash node entry.js ``` ```js Module { id: '.', path: '/absolute/path/to', exports: {}, filename: '/absolute/path/to/entry.js', loaded: false, children: [], paths: [ '/absolute/path/to/node\_modules', '/absolute/path/node\_modules', '/absolute/node\_modules', '/node\_modules' ] } ``` #### `require.resolve(request[, options])` \* `request` {string} The module path to resolve. \* `options` {Object} \* `paths` {string\[]} Paths to resolve module location from. If present, these paths are used instead of the default resolution paths, with the exception of [GLOBAL\\_FOLDERS][GLOBAL\_FOLDERS] like `$HOME/.node\_modules`, which are always included. Each of these paths is used as a starting point for the module resolution algorithm, meaning that the `node\_modules` hierarchy is checked from this location. \* Returns: {string} Use the internal `require()` machinery to look up the location of a module, but rather than loading the module, just return the resolved filename. If the module can not be found, a `MODULE\_NOT\_FOUND` error is thrown. ##### `require.resolve.paths(request)` \* `request` {string} The module path whose lookup paths are being retrieved. \* Returns: {string\[]|null} Returns an array containing the paths searched during resolution of `request` or `null` if the `request` string references a core module, for example `http` or `fs`. ## The `module` object \* Type: {Object} In each module, the `module` free variable is a reference to the object representing the current module. For convenience, `module.exports` is also accessible via the `exports` module-global. `module` is not actually a global but rather local to each module. ### `module.children` \* Type: {module\[]} The module objects required for the first time by this one. ### `module.exports` \* Type: {Object} The `module.exports` object is created by the `Module` system. Sometimes this is not acceptable; many want their module to be an instance of some class. To do this, assign the desired export object to `module.exports`. Assigning the desired object to `exports` will simply rebind the local `exports` variable, which is probably not what is desired. For example, suppose we were making a module called `a.js`: ```js const EventEmitter = require('node:events'); module.exports = new EventEmitter(); // Do some work, and after some time emit // the 'ready' event from the module itself. setTimeout(() => { module.exports.emit('ready'); }, 1000); ``` Then in another file we could do: ```js const a = require('./a'); a.on('ready', () => { console.log('module "a" is ready'); }); ``` Assignment to `module.exports` must be done immediately. It cannot be done in any callbacks. This does not work: `x.js`: ```js setTimeout(() => { module.exports = { a: 'hello' }; }, 0); ``` `y.js`: ```js const x = require('./x'); console.log(x.a); ``` #### `exports` shortcut The `exports` variable is available within a module's file-level scope, and is assigned the value of `module.exports` before the module is evaluated. It allows a shortcut, so that `module.exports.f = ...` can be written more succinctly as `exports.f = ...`. However, be aware that like any variable, if a new value is assigned to `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 | 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.0069404891692101955,
0.07583069801330566,
0.02380051463842392,
0.002289233263581991,
0.02029697597026825,
0.032215580344200134,
-0.012997067533433437,
-0.017528727650642395,
-0.03555299714207649,
0.0176105760037899,
-0.008162587881088257,
-0.011731622740626335,
-0.009015625342726707,
0.004369925241917372,
0.012195123359560966,
0.03171059489250183,
0.01625363901257515,
0.011919939890503883,
0.017979254946112633,
-0.020225360989570618,
-0.033010467886924744,
-0.015653418377041817,
0.12627030909061432,
-0.0661095604300499,
-0.07571478933095932,
-0.01752377860248089,
-0.06272263824939728,
0.05274306982755661,
0.13999813795089722,
-0.022464843466877937,
-0.05493173748254776,
0.023254552856087685,
-0.07073847949504852,
-0.09717980027198792,
-0.019407661631703377,
-0.06536959111690521,
-0.004419201519340277,
0.06619708240032196,
-0.03482738509774208,
-0.01892346888780594,
-0.07418587803840637,
-0.08818993717432022,
0.04034271463751793,
-0.03356272727251053,
0.0044455998577177525,
0.059858739376068115,
0.10116776823997498,
-0.07761816680431366,
0.010752414353191853,
0.04188879206776619,
-0.057164717465639114,
-0.015378935262560844,
0.07417824864387512,
-0.017564663663506508,
0.01154045108705759,
0.006468627136200666,
0.07580079138278961,
0.04555791616439819,
0.05667129531502724,
-0.06410031765699387,
-0.015478239394724369,
-0.09926524758338928,
-0.15362435579299927,
-0.020468059927225113,
-0.013054854236543179,
-0.021924041211605072,
-0.0021891258656978607,
-0.07528269290924072,
-0.05200691521167755,
-0.01069941371679306,
0.04550587013363838,
-0.022445248439908028,
0.06918486952781677,
-0.02539266087114811,
0.002692683134227991,
0.02898150123655796,
0.025773072615265846,
-0.047570522874593735,
-0.1325788050889969,
-0.04115942120552063,
0.038026005029678345,
0.009976841509342194,
0.02372538298368454,
-0.027497943490743637,
0.06428268551826477,
-0.01061579305678606,
-0.02147831954061985,
0.008882757276296616,
0.029603468254208565,
0.029190225526690483,
0.050071436911821365,
0.09646689891815186,
-0.018301647156476974,
0.01473819836974144,
0.0037735060323029757,
-0.013398912735283375,
-0.007346087601035833,
-0.004034020006656647,
0.016792910173535347,
0.04305332899093628,
-0.047205738723278046,
-0.03191516920924187,
0.023234384134411812,
0.11922135949134827,
-0.03787064552307129,
0.04910745099186897,
0.15730683505535126,
0.1387210190296173,
0.04892101138830185,
0.08872229605913162,
0.0057133822701871395,
0.09663093090057373,
-0.08075806498527527,
-0.0022830164525657892,
3.853514764415239e-33,
-0.04561115428805351,
-0.07459691911935806,
0.02989165671169758,
0.12213663756847382,
-0.06105884537100792,
-0.006506599951535463,
0.047306157648563385,
-0.010218256153166294,
-0.11972424387931824,
0.0005881497054360807,
-0.018849024549126625,
0.13104569911956787,
-0.0006978478049859405,
0.004974339623004198,
-0.002833680948242545,
-0.006629475858062506,
0.08179766684770584,
-0.025158975273370743,
0.06808823347091675,
0.0378027968108654,
-0.0025297943502664566,
-0.018620967864990234,
0.01076679490506649,
0.09849179536104202,
0.07422832399606705,
0.005849835462868214,
-0.009414250031113625,
0.019024837762117386,
-0.020758232101798058,
-0.008436186239123344,
0.04566487297415733,
0.0016799216391518712,
-0.0840747281908989,
-0.003907743375748396,
0.019086873158812523,
-0.011841262690722942,
0.025476813316345215,
0.06257506459951401,
-0.09538824111223221,
0.02260741963982582,
0.025706632062792778,
0.03211599588394165,
-0.07286358624696732,
-0.035194870084524155,
-0.05599924549460411,
-0.04926387965679169,
-0.05382462963461876,
0.03215140849351883,
0.032354746013879776,
-0.020507561042904854,
-0.04556989669799805,
0.045240700244903564,
0.05142555758357048,
-0.008565254509449005,
0.012203608639538288,
-0.015356660820543766,
-0.018942678347229958,
-0.07454781979322433,
0.00658401008695364,
-0.029114803299307823,
0.0035338758025318384,
-0.09122565388679504,
-0.08760947734117508,
0.09841929376125336,
0.008968277834355831,
0.0020465999841690063,
-0.04991655796766281,
0.039916545152664185,
-0.014186917804181576,
0.01748986542224884,
-0.02742999978363514,
-0.030029267072677612,
0.01573093608021736,
-0.030622411519289017,
0.09039794653654099,
-0.022914668545126915,
-0.05377529561519623,
0.0035301807802170515,
-0.05283640697598457,
0.04030783101916313,
0.05041118711233139,
0.01101206336170435,
0.014156891964375973,
-0.014035829342901707,
0.11125162243843079,
-0.010629412718117237,
-0.06688346713781357,
-0.009993085637688637,
0.015780068933963776,
0.025308819487690926,
0.06436573714017868,
-0.019971095025539398,
-0.014143555425107479,
-0.04173239320516586,
-0.06170862540602684,
-5.7327518691359055e-33,
0.03490118309855461,
0.03382599353790283,
-0.018767910078167915,
0.03753650188446045,
0.007728166412562132,
-0.023864971473813057,
-0.08528079092502594,
-0.037424638867378235,
0.02750992402434349,
0.019896412268280983,
-0.08899404108524323,
0.02225382998585701,
0.04887644946575165,
0.0377112440764904,
-0.005412237718701363,
0.13019226491451263,
-0.07624881714582443,
0.0178969856351614,
0.054673630744218826,
-0.04598279669880867,
-0.05518551915884018,
0.01020383182913065,
0.09306630492210388,
-0.03621455281972885,
-0.01365501619875431,
-0.008564156480133533,
-0.0821952223777771,
0.03262355923652649,
-0.055269334465265274,
-0.0361739806830883,
-0.1161779910326004,
0.05951395630836487,
0.027396680787205696,
0.029913010075688362,
0.011632204987108707,
0.001515437732450664,
-0.010847335681319237,
0.07957786321640015,
0.034773483872413635,
-0.10431686788797379,
0.03821556642651558,
-0.00746133690699935,
-0.020388329401612282,
0.0010987662244588137,
-0.014399031177163124,
-0.057326652109622955,
-0.016384035348892212,
0.023180227726697922,
-0.05805317685008049,
-0.019294416531920433,
-0.10641845315694809,
-0.029138190671801567,
0.0038980627432465553,
0.02806725539267063,
0.012323464266955853,
-0.068730928003788,
0.00014191577793098986,
0.017607884481549263,
0.07145543396472931,
0.01251875702291727,
0.05520325154066086,
-0.10335523635149002,
-0.04970976710319519,
-0.04211343824863434,
-0.048057567328214645,
-0.09960480034351349,
-0.042081255465745926,
0.004025381989777088,
0.08488982170820236,
-0.03145477548241615,
-0.0774119421839714,
-0.010967723093926907,
0.03758017718791962,
0.03126968815922737,
-0.06984920054674149,
0.01911783032119274,
0.040218789130449295,
-0.035665202885866165,
0.022859593853354454,
0.019017325714230537,
-0.00003374022708158009,
0.03878697380423546,
-0.0470200851559639,
-0.09726126492023468,
-0.008613944984972477,
0.021629497408866882,
-0.017277352511882782,
0.06489072740077972,
-0.029390644282102585,
0.023140177130699158,
0.04737727716565132,
-0.006647939793765545,
-0.01570093259215355,
-0.04138222709298134,
-0.052351657301187515,
-6.230920490679637e-8,
-0.022833747789263725,
0.017910132184624672,
-0.11372167617082596,
-0.019128404557704926,
0.08435161411762238,
-0.031214607879519463,
0.02125379629433155,
0.13415931165218353,
0.011743073351681232,
0.05700933188199997,
0.04061213880777359,
0.023927804082632065,
0.047105006873607635,
-0.0005766540416516364,
-0.025858692824840546,
0.08642084151506424,
0.015802646055817604,
0.025439998134970665,
-0.010740378871560097,
0.0009231665171682835,
-0.00026059773517772555,
0.05588817596435547,
0.019260570406913757,
0.08684220910072327,
-0.053469449281692505,
-0.045378249138593674,
0.0049696629866957664,
-0.022498156875371933,
0.002725328551605344,
-0.02072956971824169,
-0.1603500097990036,
0.04287637770175934,
-0.020882336422801018,
-0.02226082794368267,
-0.060596220195293427,
-0.009162960574030876,
0.053706057369709015,
-0.03753281757235527,
0.024518415331840515,
0.036252595484256744,
0.04116208106279373,
0.006765257101505995,
-0.007898405194282532,
-0.013749446719884872,
-0.07101162523031235,
-0.024163493886590004,
0.01829272136092186,
0.03585373982787132,
0.03546757623553276,
0.012609035708010197,
0.03855244070291519,
-0.030826307833194733,
-0.06945709884166718,
-0.024819916114211082,
-0.004277868662029505,
0.05956585705280304,
0.015418379567563534,
-0.07352113723754883,
-0.002281748689711094,
-0.02805907651782036,
-0.03020298108458519,
-0.0370509959757328,
0.053679004311561584,
-0.03930440917611122
] | -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 `exports`: ```js module.exports = exports = function Constructor() { // ... etc. }; ``` To illustrate the behavior, imagine this hypothetical implementation of `require()`, which is quite similar to what is actually done by `require()`: ```js function require(/\* ... \*/) { const module = { exports: {} }; ((module, exports) => { // Module code here. In this example, define a function. function someFunc() {} exports = someFunc; // At this point, exports is no longer a shortcut to module.exports, and // this module will still export an empty default object. module.exports = someFunc; // At this point, the module will now export someFunc, instead of the // default object. })(module, module.exports); return module.exports; } ``` ### `module.filename` \* Type: {string} The fully resolved filename of the module. ### `module.id` \* Type: {string} The identifier for the module. Typically this is the fully resolved filename. ### `module.isPreloading` \* Type: {boolean} `true` if the module is running during the Node.js preload phase. ### `module.loaded` \* Type: {boolean} Whether or not the module is done loading, or is in the process of loading. ### `module.parent` > Stability: 0 - Deprecated: Please use [`require.main`][] and > [`module.children`][] instead. \* Type: {module | null | undefined} The module that first required this one, or `null` if the current module is the entry point of the current process, or `undefined` if the module was loaded by something that is not a CommonJS module (E.G.: REPL or `import`). ### `module.path` \* Type: {string} The directory name of the module. This is usually the same as the [`path.dirname()`][] of the [`module.id`][]. ### `module.paths` \* Type: {string\[]} The search paths for the module. ### `module.require(id)` \* `id` {string} \* Returns: {any} exported module content The `module.require()` method provides a way to load a module as if `require()` was called from the original module. In order to do this, it is necessary to get a reference to the `module` object. Since `require()` returns the `module.exports`, and the `module` is typically \_only\_ available within a specific module's code, it must be explicitly exported in order to be used. ## The `Module` object This section was moved to [Modules: `module` core module](module.md#the-module-object). \* [`module.builtinModules`](module.html#modulebuiltinmodules) \* [`module.createRequire(filename)`](module.html#modulecreaterequirefilename) \* [`module.syncBuiltinESMExports()`](module.html#modulesyncbuiltinesmexports) ## Source map v3 support This section was moved to [Modules: `module` core module](module.md#source-map-support). \* [`module.findSourceMap(path)`](module.html#modulefindsourcemappath) \* [Class: `module.SourceMap`](module.html#class-modulesourcemap) \* [`new SourceMap(payload)`](module.html#new-sourcemappayload--linelengths-) \* [`sourceMap.payload`](module.html#sourcemappayload) \* [`sourceMap.findEntry(lineNumber, columnNumber)`](module.html#sourcemapfindentrylineoffset-columnoffset) [Determining module system]: packages.md#determining-module-system [ECMAScript Modules]: esm.md [GLOBAL\_FOLDERS]: #loading-from-the-global-folders [`"main"`]: packages.md#main [`"type"`]: packages.md#type [`--trace-require-module`]: cli.md#--trace-require-modulemode [`ERR\_REQUIRE\_ASYNC\_MODULE`]: errors.md#err\_require\_async\_module [`ERR\_UNSUPPORTED\_DIR\_IMPORT`]: errors.md#err\_unsupported\_dir\_import [`MODULE\_NOT\_FOUND`]: errors.md#module\_not\_found [`\_\_dirname`]: #\_\_dirname [`\_\_filename`]: #\_\_filename [`import()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import [`module.builtinModules`]: module.md#modulebuiltinmodules [`module.children`]: #modulechildren [`module.id`]: #moduleid [`module` core module]: module.md [`module` object]: #the-module-object [`node:sea`]: single-executable-applications.md#single-executable-application-api [`node:sqlite`]: sqlite.md [`node:test/reporters`]: test.md#test-reporters [`node:test`]: test.md [`package.json`]: packages.md#nodejs-packagejson-field-definitions [`path.dirname()`]: path.md#pathdirnamepath [`process.features.require\_module`]: process.md#processfeaturesrequire\_module [`require.main`]: #requiremain [exports shortcut]: #exports-shortcut [module namespace object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#module\_namespace\_object [module resolution]: #all-together [native addons]: addons.md [subpath exports]: packages.md#subpath-exports [subpath imports]: packages.md#subpath-imports | 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.01078095007687807,
0.08938851952552795,
0.022702831774950027,
0.04917285591363907,
-0.00802750326693058,
-0.09732364863157272,
0.0475584976375103,
0.012782261706888676,
-0.02223890833556652,
-0.0010314142564311624,
-0.03002205491065979,
0.003683609189465642,
-0.04656468704342842,
-0.02333724871277809,
-0.05056624114513397,
0.05898197367787361,
0.006314979866147041,
-0.06339175999164581,
0.06771016865968704,
-0.06291420012712479,
0.033060409128665924,
-0.061360958963632584,
0.1231980174779892,
0.00027690298156812787,
-0.042550817131996155,
0.01118688564747572,
-0.07460891455411911,
0.0038147333543747663,
0.09952477365732193,
-0.06320145726203918,
-0.013259733095765114,
-0.004470369312912226,
0.003631463274359703,
-0.008928850293159485,
-0.022783663123846054,
-0.08875168114900589,
0.009429899044334888,
-0.002794097177684307,
0.010223363526165485,
-0.040448591113090515,
-0.030369363725185394,
0.037689801305532455,
0.029729925096035004,
-0.0015505831688642502,
-0.03141358122229576,
0.019793404266238213,
0.09702128171920776,
-0.03713401407003403,
0.04638436809182167,
-0.002840765519067645,
0.007937803864479065,
0.08078644424676895,
-0.06321612745523453,
-0.03867267072200775,
0.026600783690810204,
0.006633317098021507,
0.09936782717704773,
-0.05393066629767418,
0.03477228432893753,
-0.011628980748355389,
0.03586101904511452,
-0.026199335232377052,
-0.11989395320415497,
-0.015754425898194313,
0.07618318498134613,
0.006543381605297327,
-0.01826220564544201,
-0.03793392702937126,
-0.020769605413079262,
-0.02250565215945244,
0.020176975056529045,
0.027012407779693604,
0.031255047768354416,
0.005470871459692717,
-0.03000558353960514,
0.05561806261539459,
0.03985104337334633,
-0.07403356581926346,
-0.1570102572441101,
-0.013879867270588875,
0.11879629641771317,
-0.028116919100284576,
-0.07119112461805344,
0.03973666578531265,
0.10226666927337646,
-0.03347020968794823,
-0.022886687889695168,
-0.02805054560303688,
0.03901292756199837,
0.10849665850400925,
-0.032615114003419876,
0.018819238990545273,
-0.019436849281191826,
-0.07582509517669678,
-0.005916213151067495,
0.009349633008241653,
0.026823628693819046,
0.029945893213152885,
0.011500082910060883,
0.04151934012770653,
-0.10590005666017532,
-0.06722824275493622,
0.0171880591660738,
-0.009179930202662945,
-0.04588458687067032,
0.04180113226175308,
0.14074024558067322,
0.027925727888941765,
0.018119413405656815,
0.16650934517383575,
0.0008597989217378199,
0.05004144459962845,
0.04549642279744148,
-0.04255383461713791,
-2.5322903381596813e-33,
-0.04093827307224274,
-0.06563261151313782,
-0.08358237147331238,
0.09307499974966049,
-0.021076519042253494,
0.016245758160948753,
0.03552026301622391,
0.010597492568194866,
-0.0683760866522789,
0.005353499669581652,
0.018543755635619164,
0.11637326329946518,
-0.04422790929675102,
0.08152374625205994,
0.03744739294052124,
-0.005024419166147709,
0.11106698960065842,
-0.05937866121530533,
0.07778160274028778,
0.04456054046750069,
-0.02377733215689659,
0.031199954450130463,
-0.004815509542822838,
0.027630653232336044,
0.033464465290308,
0.026782775297760963,
0.021088920533657074,
0.0053159031085669994,
-0.03805137425661087,
0.009407478384673595,
0.0109770018607378,
0.054759953171014786,
0.019937586039304733,
0.005648063030093908,
-0.0015932249370962381,
0.05531361326575279,
-0.0038140281103551388,
-0.05182162672281265,
-0.09727630019187927,
-0.014065053313970566,
0.0055015734396874905,
0.0684388056397438,
-0.09454665333032608,
0.016923105344176292,
0.010696332901716232,
-0.1086312085390091,
0.017647286877036095,
0.0361117459833622,
0.05731437727808952,
-0.058634769171476364,
-0.061078011989593506,
0.06157490983605385,
0.09185561537742615,
-0.0253232941031456,
0.040813859552145004,
-0.04096989333629608,
0.03302500396966934,
-0.08777304738759995,
-0.02665073610842228,
-0.019393261522054672,
-0.0016683907015249133,
-0.007919822819530964,
-0.07026632875204086,
0.12757760286331177,
-0.022936644032597542,
0.0818176195025444,
-0.05065636709332466,
-0.02008996345102787,
-0.02185230143368244,
0.015211726538836956,
-0.027636684477329254,
0.017641887068748474,
-0.11365200579166412,
-0.02165267802774906,
0.0491219162940979,
0.03141375258564949,
-0.019748972728848457,
-0.01508884783834219,
0.042749468237161636,
-0.0643436461687088,
0.028815455734729767,
0.03850545361638069,
-0.007325091399252415,
0.03829541429877281,
-0.025123165920376778,
-0.048603713512420654,
-0.03606418892741203,
-0.011816399171948433,
0.04490606486797333,
0.021329574286937714,
0.046563901007175446,
-0.03712838515639305,
-0.07306338846683502,
-0.013978797942399979,
-0.02635248191654682,
-4.465944566128766e-34,
0.04886132478713989,
0.035837721079587936,
-0.0832209587097168,
0.08824615925550461,
-0.012707778252661228,
-0.02196701057255268,
-0.038916219025850296,
-0.054332222789525986,
-0.016426656395196915,
-0.025529205799102783,
-0.0685279443860054,
-0.03751222789287567,
0.054931022226810455,
0.04286796227097511,
-0.028028950095176697,
0.07272303104400635,
-0.07769852131605148,
-0.05425744876265526,
0.0054029859602451324,
-0.09255626052618027,
0.01994379609823227,
0.037060774862766266,
0.06863772869110107,
0.02067178301513195,
-0.033425506204366684,
0.04229673370718956,
-0.11348874866962433,
0.03697576746344566,
-0.04754931479692459,
-0.003697763429954648,
-0.021213790401816368,
0.012044963426887989,
0.00086065917275846,
-0.05075281113386154,
-0.03911035135388374,
-0.038771215826272964,
-0.07092529535293579,
0.09841800481081009,
0.03520718216896057,
-0.0654553771018982,
0.050439994782209396,
0.005194618832319975,
-0.004302219022065401,
0.042581234127283096,
-0.04833023250102997,
-0.01750185526907444,
0.011766050010919571,
0.0018060655565932393,
0.048704639077186584,
-0.042236585170030594,
0.008517082780599594,
-0.046610958874225616,
-0.005170257296413183,
-0.031347814947366714,
-0.046890247613191605,
-0.0426880307495594,
-0.02017398364841938,
-0.0009242368978448212,
0.059986554086208344,
0.04991437494754791,
0.07335489243268967,
-0.04690375179052353,
0.004353634547442198,
-0.01707543060183525,
-0.06981290876865387,
0.014405051246285439,
0.018498988822102547,
0.04563870653510094,
0.1293146163225174,
0.024858292192220688,
-0.026267491281032562,
0.00959200132638216,
-0.045731447637081146,
-0.03545304015278816,
-0.03969065845012665,
0.06668784469366074,
-0.016729867085814476,
-0.04799331724643707,
0.07848460227251053,
-0.0023550698533654213,
-0.020160958170890808,
-0.01975797861814499,
-0.025266939774155617,
-0.03949413821101189,
0.03303152695298195,
-0.05878915637731552,
-0.006028099916875362,
0.0068561965599656105,
0.00004872894351137802,
0.041625652462244034,
0.0567048154771328,
-0.017940007150173187,
-0.1123073622584343,
-0.06737817823886871,
-0.09999629855155945,
-4.320625279774504e-8,
-0.028162792325019836,
-0.022009311243891716,
-0.09546870738267899,
-0.06661321967840195,
0.021541541442275047,
-0.06594675034284592,
0.09487158060073853,
0.05656551197171211,
0.0009831603383645415,
0.06755288690328598,
0.005941052921116352,
0.06494815647602081,
0.05337642878293991,
-0.024366991594433784,
-0.048770345747470856,
0.058982349932193756,
0.05210810527205467,
-0.032699160277843475,
-0.06408929079771042,
-0.03496271371841431,
-0.04167778044939041,
0.03219163417816162,
-0.0030901578720659018,
0.08357938379049301,
-0.029179614037275314,
-0.04363664612174034,
0.038747116923332214,
0.086636483669281,
0.056707583367824554,
-0.02435561642050743,
-0.10438733547925949,
0.06489655375480652,
0.010442331433296204,
0.015449296683073044,
-0.0716741755604744,
0.01348086353391409,
-0.04137164726853371,
-0.04802347719669342,
0.03886079788208008,
0.08178402483463287,
-0.014225861057639122,
-0.025076214224100113,
-0.016002856194972992,
0.029883842915296555,
-0.07961651682853699,
-0.026386715471744537,
-0.021613342687487602,
0.006772476714104414,
-0.04401655122637749,
-0.011532030068337917,
0.029789552092552185,
0.009037686511874199,
-0.06593336910009384,
0.038290366530418396,
0.02596765197813511,
0.027825888246297836,
0.004810088314116001,
0.015335789881646633,
0.001492026261985302,
-0.07101865857839584,
-0.007556241936981678,
0.021939925849437714,
0.0818738266825676,
-0.05665193870663643
] | 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 {URLSearchParams} when performance is not critical or when compatibility with browser code is desirable. ## `querystring.decode()` The `querystring.decode()` function is an alias for `querystring.parse()`. ## `querystring.encode()` The `querystring.encode()` function is an alias for `querystring.stringify()`. ## `querystring.escape(str)` \* `str` {string} The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL query strings. The `querystring.escape()` method is used by `querystring.stringify()` and is generally not expected to be used directly. It is exported primarily to allow application code to provide a replacement percent-encoding implementation if necessary by assigning `querystring.escape` to an alternative function. ## `querystring.parse(str[, sep[, eq[, options]]])` \* `str` {string} The URL query string to parse \* `sep` {string} The substring used to delimit key and value pairs in the query string. \*\*Default:\*\* `'&'`. \* `eq` {string}. The substring used to delimit keys and values in the query string. \*\*Default:\*\* `'='`. \* `options` {Object} \* `decodeURIComponent` {Function} The function to use when decoding percent-encoded characters in the query string. \*\*Default:\*\* `querystring.unescape()`. \* `maxKeys` {number} Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. \*\*Default:\*\* `1000`. The `querystring.parse()` method parses a URL query string (`str`) into a collection of key and value pairs. For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: ```json { "foo": "bar", "abc": ["xyz", "123"] } ``` The object returned by the `querystring.parse()` method \_does not\_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others are not defined and \_will not work\_. By default, percent-encoded characters within the query string will be assumed to use UTF-8 encoding. If an alternative character encoding is used, then an alternative `decodeURIComponent` option will need to be specified: ```js // Assuming gbkDecodeURIComponent function already exists... querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, { decodeURIComponent: gbkDecodeURIComponent }); ``` ## `querystring.stringify(obj[, sep[, eq[, options]]])` \* `obj` {Object} The object to serialize into a URL query string \* `sep` {string} The substring used to delimit key and value pairs in the query string. \*\*Default:\*\* `'&'`. \* `eq` {string}. The substring used to delimit keys and values in the query string. \*\*Default:\*\* `'='`. \* `options` \* `encodeURIComponent` {Function} The function to use when converting URL-unsafe characters to percent-encoding in the query string. \*\*Default:\*\* `querystring.escape()`. The `querystring.stringify()` method produces a URL query string from a given `obj` by iterating through the object's "own properties". It serializes the following types of values passed in `obj`: {string|number|bigint|boolean|string\[]|number\[]|bigint\[]|boolean\[]} The numeric values must be finite. Any other input values will be coerced to empty strings. ```js querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); // Returns 'foo=bar&baz=qux&baz=quux&corge=' querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); // Returns 'foo:bar;baz:qux' ``` By default, characters requiring percent-encoding within the query string will be encoded as UTF-8. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: ```js // Assuming gbkEncodeURIComponent function already exists, querystring.stringify({ w: '中文', foo: 'bar' }, null, null, { encodeURIComponent: gbkEncodeURIComponent }); ``` ## `querystring.unescape(str)` \* `str` {string} 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 implementation if necessary by assigning `querystring.unescape` to an | 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.050577905029058456,
-0.005727498326450586,
0.03335961326956749,
0.0016485111555084586,
0.07131315022706985,
-0.01649530790746212,
-0.04990333691239357,
0.08368659019470215,
0.028216993436217308,
0.007582475431263447,
-0.03627980500459671,
0.04295966401696205,
-0.04744471237063408,
-0.028566615656018257,
-0.03941134363412857,
0.0671115592122078,
0.029728811234235764,
0.06222030892968178,
-0.041301898658275604,
-0.05861559882760048,
0.05510977655649185,
-0.05502954497933388,
0.06647656857967377,
-0.023096587508916855,
-0.11915571987628937,
-0.001099413842894137,
-0.07206221669912338,
-0.010576881468296051,
0.10837957262992859,
-0.0884614884853363,
-0.051110848784446716,
0.010853584855794907,
0.033511169254779816,
-0.07371342182159424,
0.03337876871228218,
-0.0993962213397026,
-0.021230291575193405,
-0.020117638632655144,
-0.03285227343440056,
-0.07223986089229584,
-0.014998105354607105,
0.018413323909044266,
0.028156649321317673,
-0.12817202508449554,
0.019897181540727615,
0.02200785093009472,
0.047851454466581345,
-0.018944205716252327,
-0.056637562811374664,
0.04994664713740349,
0.030012832954525948,
-0.009309745393693447,
-0.011220922693610191,
0.050028812140226364,
-0.017449824139475822,
0.06636721640825272,
-0.06561591476202011,
-0.0698876827955246,
-0.0021563726477324963,
-0.03797752037644386,
0.04484633728861809,
-0.047898679971694946,
0.031631965190172195,
-0.00876482855528593,
-0.014944657683372498,
-0.04456392303109169,
0.049948420375585556,
0.07828588038682938,
-0.09488815814256668,
0.00018852335051633418,
0.11685587465763092,
0.07652042806148529,
0.043926872313022614,
-0.014204456470906734,
-0.04835290461778641,
0.059622205793857574,
0.028796667233109474,
-0.05286533385515213,
-0.07704560458660126,
-0.018349813297390938,
-0.001147892908193171,
0.017654385417699814,
0.04695815220475197,
-0.011495859362185001,
0.05127468705177307,
-0.02099103480577469,
-0.01056300476193428,
0.03234102949500084,
-0.00425212737172842,
0.05080175772309303,
-0.12083800137042999,
-0.03941776603460312,
0.0036405620630830526,
0.06534786522388458,
0.049189142882823944,
0.07217755913734436,
0.04266978055238724,
-0.02701069600880146,
0.04641295224428177,
-0.007094636559486389,
-0.06297135353088379,
-0.08174601197242737,
0.011416038498282433,
0.07692401111125946,
-0.07302479445934296,
0.10582734644412994,
0.10155616700649261,
0.07424228638410568,
0.04695925861597061,
-0.08921483159065247,
-0.08752662688493729,
0.0039190491661429405,
-0.014394646510481834,
0.06471624225378036,
4.92818549539956e-33,
0.01064970437437296,
0.026615317910909653,
0.012662342749536037,
-0.060104236006736755,
-0.06444119662046432,
0.06497401744127274,
0.007906610146164894,
0.05985165014863014,
-0.05108865723013878,
-0.02293357253074646,
-0.0638735219836235,
-0.03887435793876648,
0.01920398883521557,
-0.07052423059940338,
0.006282455287873745,
-0.010370190255343914,
0.019894568249583244,
-0.0043158452026546,
0.009628534317016602,
0.039533693343400955,
-0.03845702111721039,
0.04600539058446884,
0.02107846923172474,
0.029123878106474876,
0.02140541933476925,
0.006314183585345745,
0.027466805651783943,
-0.01745895855128765,
-0.04035203531384468,
-0.015776442363858223,
-0.034173693507909775,
-0.034960661083459854,
-0.0870267003774643,
0.01391062792390585,
0.059244025498628616,
0.008752221241593361,
0.028923528268933296,
0.04772196710109711,
-0.11578823626041412,
-0.027470633387565613,
-0.07857814431190491,
0.0023312540724873543,
0.021782539784908295,
-0.006035263650119305,
-0.03444438427686691,
-0.09090286493301392,
-0.11909166723489761,
-0.05205675587058067,
0.018142828717827797,
-0.006255052052438259,
-0.04953370243310928,
0.05037868022918701,
0.037724949419498444,
0.0082324780523777,
0.08526679128408432,
-0.03590117394924164,
0.07075584679841995,
-0.025368986651301384,
-0.051354438066482544,
0.07642325758934021,
-0.028077641502022743,
-0.02298017218708992,
0.05331921949982643,
-0.07650811225175858,
0.02462649904191494,
0.03162933886051178,
0.012183616869151592,
0.04270203784108162,
-0.041505929082632065,
0.06011282652616501,
-0.008977326564490795,
-0.013137081637978554,
-0.0060404702089726925,
-0.044602323323488235,
-0.006531138904392719,
-0.051640838384628296,
-0.08950848877429962,
0.011983098462224007,
0.01890677772462368,
-0.0038981433026492596,
-0.029735691845417023,
-0.10966052114963531,
0.000023045800844556652,
0.13338862359523773,
-0.013204210437834263,
0.0035346937365829945,
-0.01728801243007183,
-0.0024372583720833063,
0.06971897929906845,
0.02573343925178051,
0.0841682106256485,
-0.005874550901353359,
-0.0749097391963005,
-0.013225574046373367,
-0.019538594409823418,
-5.568364494303178e-33,
0.01318941917270422,
-0.004994923248887062,
-0.07853075861930847,
0.1284143328666687,
-0.03569359704852104,
-0.08887078613042831,
0.014208606444299221,
0.018927408382296562,
-0.01507637184113264,
-0.015242408961057663,
-0.011895116418600082,
0.04946966841816902,
0.02677910588681698,
-0.0632997676730156,
0.04439593851566315,
0.09968613088130951,
-0.04303840175271034,
-0.045485228300094604,
0.033571530133485794,
-0.006557832937687635,
-0.03927556425333023,
0.03952215984463692,
-0.038685571402311325,
-0.01091386191546917,
-0.0521346852183342,
0.03293876722455025,
0.03746804594993591,
-0.03531183302402496,
0.008364008739590645,
-0.004877464845776558,
0.014614788815379143,
-0.00290647498331964,
-0.00227670231834054,
0.02191215381026268,
-0.061922959983348846,
0.002072463743388653,
-0.0138632170855999,
0.03902002051472664,
0.027224300429224968,
-0.04885336011648178,
0.043289896100759506,
0.0011317523894831538,
0.011887310072779655,
0.08328387886285782,
0.062495406717061996,
-0.018858609721064568,
-0.059259265661239624,
0.06777309626340866,
0.013851767405867577,
0.0070075299590826035,
0.058632742613554,
-0.005242509301751852,
-0.0071668000891804695,
0.0147549482062459,
0.000059715512179536745,
-0.07536128908395767,
-0.13661901652812958,
0.032647982239723206,
-0.07376120984554291,
0.019978486001491547,
-0.004234286956489086,
-0.022460827603936195,
0.007222272921353579,
-0.00156966014765203,
-0.002056179801002145,
-0.02053282968699932,
-0.10354536026716232,
-0.0113217206671834,
0.022876808419823647,
-0.043287716805934906,
-0.00020103176939301193,
-0.07169081270694733,
0.04266637563705444,
0.06655505299568176,
0.02586955577135086,
-0.020746368914842606,
0.007239013910293579,
0.03171905502676964,
0.0327565036714077,
0.06166163831949234,
-0.004937256686389446,
0.08143419027328491,
0.005915334448218346,
0.01929357461631298,
0.015496824868023396,
-0.020919015631079674,
-0.07798001170158386,
0.10314053297042847,
-0.062196843326091766,
-0.04137298837304115,
0.04678520932793617,
0.03757910802960396,
-0.13276855647563934,
0.0013589266454800963,
-0.006468358915299177,
-4.839958123170618e-8,
-0.05070151016116142,
0.04466709494590759,
-0.12032518535852432,
-0.004165023565292358,
-0.005244815722107887,
0.024183381348848343,
0.011953435838222504,
0.0976201593875885,
0.009801621548831463,
0.07112274318933487,
0.06310253590345383,
0.003197653917595744,
-0.023235872387886047,
-0.03814610093832016,
0.004201310221105814,
0.022940633818507195,
-0.007703475188463926,
0.037078648805618286,
-0.038105640560388565,
-0.03617775812745094,
-0.04164538159966469,
-0.007744011003524065,
-0.09227617084980011,
0.007387170102447271,
0.05744003504514694,
-0.0038447401020675898,
-0.0032385208178311586,
0.05749090015888214,
-0.010657199658453465,
0.003694157348945737,
-0.05789105221629143,
0.05629204213619232,
-0.014292438514530659,
-0.05687442794442177,
-0.03434911370277405,
0.08451759070158005,
-0.04395945370197296,
-0.06622308492660522,
0.048707008361816406,
0.054741181433200836,
0.11048819869756699,
0.05803268030285835,
-0.009489202871918678,
0.06340139359235764,
-0.10526382178068161,
-0.016945984214544296,
0.14564426243305206,
0.02154630981385708,
0.06856448203325272,
0.026403935626149178,
0.052982885390520096,
-0.07837194204330444,
-0.05805071070790291,
-0.039513640105724335,
-0.033754896372556686,
-0.012253837659955025,
-0.06198782101273537,
-0.07250535488128662,
0.0011389831779524684,
0.05445728451013565,
0.0496395118534565,
-0.007072601933032274,
0.05436815321445465,
0.046668797731399536
] | 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 implementation if necessary by assigning `querystring.unescape` to an alternative function. By default, the `querystring.unescape()` method will attempt to use the JavaScript built-in `decodeURIComponent()` method to decode. If that fails, a safer equivalent that does not throw on malformed URLs will be used. | 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.020033756271004677,
-0.007601671852171421,
-0.007172838319092989,
-0.04017878696322441,
0.03240969777107239,
-0.05800718814134598,
-0.025198515504598618,
0.071444071829319,
-0.0014970761258155107,
-0.0030721186194568872,
-0.00190252426546067,
0.09944362938404083,
-0.047016896307468414,
-0.024564577266573906,
-0.006512699648737907,
0.07340827584266663,
-0.006287949625402689,
0.07484804838895798,
-0.05929747223854065,
-0.01651632972061634,
-0.010542419739067554,
0.0027586023788899183,
0.06433961540460587,
-0.04334055632352829,
-0.1224183589220047,
0.0047926162369549274,
-0.027603624388575554,
-0.010998459532856941,
0.06613495200872421,
-0.08402690291404724,
0.0047432901337742805,
-0.015348912216722965,
0.058365583419799805,
-0.09793834388256073,
0.03838017210364342,
-0.0625440701842308,
-0.014419267885386944,
0.007314017042517662,
0.034976646304130554,
-0.052398305386304855,
0.00420477706938982,
-0.009597541764378548,
-0.05012420192360878,
-0.1340426355600357,
-0.0019570384174585342,
0.002244909293949604,
0.0017260483000427485,
-0.03961987793445587,
-0.02070004679262638,
0.054640740156173706,
0.02842465043067932,
-0.041843246668577194,
-0.017530184239149094,
0.04005550593137741,
-0.020061848685145378,
0.005266853608191013,
-0.04692026227712631,
-0.0658324584364891,
-0.06278324127197266,
-0.04784384369850159,
0.07298894971609116,
0.004916125908493996,
0.052382681518793106,
-0.07423575222492218,
-0.01885875314474106,
-0.002739381045103073,
0.07670673727989197,
0.10193990916013718,
-0.11691035330295563,
0.046746477484703064,
0.12161809206008911,
0.09831158071756363,
0.04390930011868477,
-0.00558333657681942,
-0.02339116856455803,
0.0871320366859436,
0.03753738850355148,
-0.08224786818027496,
-0.01591978408396244,
0.023486297577619553,
0.07569707930088043,
-0.0021382479462772608,
-0.0008223761687986553,
0.0077170999720692635,
0.03951086103916168,
-0.0643206387758255,
0.003708635224029422,
0.05455021187663078,
-0.007399207446724176,
0.05477409437298775,
-0.10260695219039917,
-0.06895918399095535,
-0.013403612188994884,
0.07354264706373215,
0.07989569008350372,
0.13127131760120392,
0.02260509319603443,
-0.023643163964152336,
0.04824823513627052,
-0.01582101359963417,
-0.08539481461048126,
-0.06739236414432526,
-0.018172942101955414,
0.0934523493051529,
-0.08261881023645401,
0.06755602359771729,
0.05225023999810219,
0.01608177274465561,
0.00463851960375905,
-0.06713603436946869,
-0.04615267366170883,
0.009418677538633347,
-0.05511004850268364,
0.05083375796675682,
1.0272884822480943e-33,
-0.046382591128349304,
0.04544446989893913,
0.00596917187795043,
-0.06952262669801712,
-0.06864017993211746,
0.06522440910339355,
-0.0577310286462307,
0.06394456326961517,
-0.005309981759637594,
-0.023020435124635696,
-0.10209867358207703,
-0.05090608075261116,
0.028771858662366867,
-0.041896969079971313,
0.03736737370491028,
0.015381965786218643,
-0.00821114145219326,
0.010983126237988472,
0.0331563875079155,
0.0036787628196179867,
-0.010978403501212597,
0.102617546916008,
0.015459321439266205,
-0.00227463711053133,
-0.039608001708984375,
0.04094349965453148,
-0.0096367709338665,
-0.04466930776834488,
-0.06594967097043991,
-0.002008293755352497,
-0.04286453127861023,
-0.045972537249326706,
-0.08919680118560791,
0.0033962896559387445,
0.08098616451025009,
0.03969278931617737,
0.04717009514570236,
0.0356927253305912,
-0.09459187835454941,
0.04672801122069359,
-0.028331246227025986,
-0.026143310591578484,
0.023351579904556274,
0.009777131490409374,
0.0007181920227594674,
-0.06552336364984512,
-0.01722371019423008,
-0.06537910550832748,
-0.013130422681570053,
0.016755880787968636,
-0.06468340754508972,
0.05963800475001335,
0.021863684058189392,
0.00906653143465519,
0.04663863033056259,
-0.04647694155573845,
0.06089058518409729,
-0.056864723563194275,
-0.029308047145605087,
0.011120394803583622,
0.009288795292377472,
0.02866603434085846,
0.05585969239473343,
-0.05626074969768524,
0.010411188937723637,
-0.03946366161108017,
0.005070087965577841,
0.03192545846104622,
-0.10346921533346176,
-0.0028705899603664875,
0.012992189265787601,
-0.018308447673916817,
0.04893123731017113,
-0.03907785937190056,
-0.032491233199834824,
-0.02601870335638523,
-0.08438330888748169,
0.05145670101046562,
0.06129885092377663,
-0.010436125099658966,
0.016206607222557068,
-0.08213841915130615,
-0.006919629406183958,
0.05194077268242836,
-0.05227059870958328,
0.0699121281504631,
0.03243853151798248,
-0.04601737856864929,
0.06923473626375198,
0.06259835511445999,
0.12508459389209747,
-0.05850281938910484,
-0.12003082782030106,
-0.018269097432494164,
0.004883452784270048,
-2.8438707278794754e-33,
-0.006928716786205769,
0.0031273667700588703,
-0.05353514850139618,
0.09752733260393143,
-0.06495019793510437,
-0.07603206485509872,
0.044758737087249756,
0.10195377469062805,
0.03827763348817825,
-0.015095403417944908,
0.00535759050399065,
0.02781660482287407,
-0.024703077971935272,
-0.07247627526521683,
0.0638376772403717,
0.0572320893406868,
-0.015783976763486862,
0.02182867005467415,
-0.00688043562695384,
0.012139512225985527,
0.012220948003232479,
0.025260239839553833,
-0.08178263157606125,
0.059189680963754654,
-0.003427931573241949,
0.044449128210544586,
0.0682368054986,
-0.041102804243564606,
0.03569268435239792,
-0.00566454790532589,
0.007796693593263626,
0.02721594087779522,
0.016660641878843307,
-0.02187212184071541,
-0.09416323155164719,
-0.009348390623927116,
-0.021118534728884697,
0.08137509226799011,
0.02221538871526718,
-0.055914394557476044,
0.02437179908156395,
-0.013236945495009422,
-0.03228393569588661,
0.08865420520305634,
0.06411256641149521,
-0.05348406359553337,
-0.05258788540959358,
0.03468066081404686,
0.050364017486572266,
0.01468163263052702,
0.09491059184074402,
0.019077029079198837,
0.008506781421601772,
0.006524887401610613,
-0.01627461425960064,
-0.02870718576014042,
-0.13148517906665802,
-0.012830900028347969,
-0.07839550077915192,
0.031531527638435364,
0.011635797098279,
-0.00701179401949048,
-0.017445413395762444,
-0.03871750831604004,
-0.010011219419538975,
-0.02224464900791645,
-0.07064741849899292,
0.03754088282585144,
0.02530653215944767,
-0.06482695043087006,
0.027496028691530228,
-0.0804508626461029,
0.03825436532497406,
-0.0049073053523898125,
0.0470355823636055,
-0.027956465259194374,
-0.008578079752624035,
0.05722590908408165,
0.029341399669647217,
0.03673353046178818,
-0.006507140584290028,
0.0066698892042040825,
0.05376527085900307,
0.03017548657953739,
0.05095694214105606,
-0.07414916157722473,
-0.07269287109375,
0.006333477329462767,
-0.09331472963094711,
-0.05160176753997803,
0.030063383281230927,
0.05821990966796875,
-0.06819181889295578,
0.06761930137872696,
0.022919319570064545,
-4.1231640324213004e-8,
-0.052074581384658813,
0.061069030314683914,
-0.14060229063034058,
-0.034134987741708755,
-0.02752704732120037,
0.010358251631259918,
-0.040615685284137726,
0.039944782853126526,
0.007576354779303074,
0.06954497843980789,
0.061755478382110596,
-0.001016475958749652,
-0.05003556236624718,
-0.030679944902658463,
-0.014820678159594536,
0.04247238114476204,
0.014604209922254086,
0.07015219330787659,
0.00860636867582798,
-0.02703746035695076,
-0.04625881463289261,
0.0044375229626894,
-0.07217742502689362,
-0.03186381608247757,
0.06089026480913162,
0.02461361698806286,
-0.01742900162935257,
0.059989579021930695,
0.014051895588636398,
-0.014200123958289623,
-0.04629547894001007,
0.05911237373948097,
-0.00016126639093272388,
-0.016488375142216682,
-0.06457972526550293,
0.08686980605125427,
-0.018824925646185875,
-0.06693937629461288,
0.0047948285937309265,
0.0016933714505285025,
0.10078079998493195,
-0.004994677845388651,
-0.014411316253244877,
0.02713129110634327,
-0.0656111016869545,
-0.0027516926638782024,
0.09836891293525696,
0.009090605191886425,
0.061320263892412186,
-0.03929446265101433,
0.0868551954627037,
-0.042748093605041504,
-0.08466634899377823,
-0.005346100311726332,
0.023245280608534813,
-0.0718785896897316,
-0.011076989583671093,
-0.030910814180970192,
-0.044749852269887924,
0.10121430456638336,
0.0719107985496521,
0.02763107419013977,
0.019452769309282303,
0.0408439002931118
] | 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 timers API provided by Web Browsers but use a different internal implementation that is built around the Node.js [Event Loop][]. ## Class: `Immediate` This object is created internally and is returned from [`setImmediate()`][]. It can be passed to [`clearImmediate()`][] in order to cancel the scheduled actions. By default, when an immediate is scheduled, the Node.js event loop will continue running as long as the immediate is active. The `Immediate` object returned by [`setImmediate()`][] exports both `immediate.ref()` and `immediate.unref()` functions that can be used to control this default behavior. ### `immediate.hasRef()` \* Returns: {boolean} If true, the `Immediate` object will keep the Node.js event loop active. ### `immediate.ref()` \* Returns: {Immediate} a reference to `immediate` When called, requests that the Node.js event loop \_not\_ exit so long as the `Immediate` is active. Calling `immediate.ref()` multiple times will have no effect. By default, all `Immediate` objects are "ref'ed", making it normally unnecessary to call `immediate.ref()` unless `immediate.unref()` had been called previously. ### `immediate.unref()` \* Returns: {Immediate} a reference to `immediate` When called, the active `Immediate` object will not require the Node.js event loop to remain active. If there is no other activity keeping the event loop running, the process may exit before the `Immediate` object's callback is invoked. Calling `immediate.unref()` multiple times will have no effect. ### `immediate[Symbol.dispose]()` Cancels the immediate. This is similar to calling `clearImmediate()`. ## Class: `Timeout` This object is created internally and is returned from [`setTimeout()`][] and [`setInterval()`][]. It can be passed to either [`clearTimeout()`][] or [`clearInterval()`][] in order to cancel the scheduled actions. By default, when a timer is scheduled using either [`setTimeout()`][] or [`setInterval()`][], the Node.js event loop will continue running as long as the timer is active. Each of the `Timeout` objects returned by these functions export both `timeout.ref()` and `timeout.unref()` functions that can be used to control this default behavior. ### `timeout.close()` > Stability: 3 - Legacy: Use [`clearTimeout()`][] instead. \* Returns: {Timeout} a reference to `timeout` Cancels the timeout. ### `timeout.hasRef()` \* Returns: {boolean} If true, the `Timeout` object will keep the Node.js event loop active. ### `timeout.ref()` \* Returns: {Timeout} a reference to `timeout` When called, requests that the Node.js event loop \_not\_ exit so long as the `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. By default, all `Timeout` objects are "ref'ed", making it normally unnecessary to call `timeout.ref()` unless `timeout.unref()` had been called previously. ### `timeout.refresh()` \* Returns: {Timeout} a reference to `timeout` Sets the timer's start time to the current time, and reschedules the timer to call its callback at the previously specified duration adjusted to the current time. This is useful for refreshing a timer without allocating a new JavaScript object. Using this on a timer that has already called its callback will reactivate the timer. ### `timeout.unref()` \* Returns: {Timeout} a reference to `timeout` When called, the active `Timeout` object will not require the Node.js event loop to remain active. If there is no other activity keeping the event loop 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 clear the `Timeout`. | 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.017112543806433678,
-0.011684443801641464,
-0.014635936357080936,
-0.013046041131019592,
0.010012867860496044,
0.00918651558458805,
-0.04058333858847618,
0.08041996508836746,
-0.009371780790388584,
0.045908909291028976,
0.018150731921195984,
-0.10228783637285233,
-0.05421261489391327,
-0.026334848254919052,
-0.041592787951231,
0.08708631247282028,
0.00969869364053011,
0.0031698942184448242,
-0.03746292367577553,
-0.055426668375730515,
-0.024790123105049133,
-0.07819033414125443,
0.14963959157466888,
-0.029916252940893173,
-0.07878304272890091,
-0.03624338284134865,
-0.024428410455584526,
0.09323194622993469,
0.031239785254001617,
-0.07627749443054199,
-0.07260016351938248,
0.02116214483976364,
0.00504406588152051,
-0.10376108437776566,
-0.009114151820540428,
-0.11835938692092896,
0.042029790580272675,
0.029638463631272316,
-0.05305875092744827,
-0.01654871180653572,
-0.06668443232774734,
0.049648117274045944,
0.09060492366552353,
0.02846544235944748,
0.012224406935274601,
0.004762635100632906,
0.04064542055130005,
-0.03215348720550537,
-0.07710589468479156,
0.014187224209308624,
-0.007382367271929979,
0.051268935203552246,
0.10465435683727264,
-0.03643963113427162,
-0.028254292905330658,
0.0653766319155693,
0.0077083176001906395,
0.03882231563329697,
0.044235486537218094,
-0.009876950643956661,
0.02881160005927086,
-0.07401697337627411,
-0.08172038197517395,
-0.029958831146359444,
0.011369726620614529,
-0.062497202306985855,
0.07076243311166763,
0.002809711266309023,
-0.12444743514060974,
0.0038806037046015263,
-0.002535887761041522,
-0.02724386937916279,
0.027506398037075996,
0.017306186258792877,
0.04723187908530235,
0.05877760052680969,
0.010974735021591187,
-0.058725498616695404,
-0.0008136562537401915,
-0.02072335034608841,
0.02812066115438938,
-0.05690368264913559,
0.03957865387201309,
0.035513848066329956,
0.048051103949546814,
-0.0679592564702034,
-0.025647729635238647,
0.030205370858311653,
-0.023771975189447403,
-0.05126795545220375,
-0.01007087156176567,
0.02578623965382576,
-0.02399510145187378,
-0.042207662016153336,
0.02963194064795971,
-0.036481309682130814,
0.033765509724617004,
0.004136187955737114,
0.013041078113019466,
0.024571260437369347,
-0.007868056185543537,
-0.03796004503965378,
0.10171335190534592,
0.04259079694747925,
0.005562243517488241,
0.105863057076931,
0.0824122205376625,
0.12086436152458191,
0.10752908140420914,
0.017928961664438248,
-0.06500033289194107,
0.04875403642654419,
-0.025876423344016075,
0.057134341448545456,
3.0388982813213474e-33,
-0.09359868615865707,
-0.08012338727712631,
-0.06402578204870224,
0.0055909790098667145,
0.08740201592445374,
0.01050698570907116,
0.029169196262955666,
-0.0015299660153687,
-0.03170933201909065,
-0.03595968335866928,
0.0427672378718853,
0.010815232060849667,
-0.011490954086184502,
0.008469333872199059,
-0.00950690358877182,
-0.05205854773521423,
0.14205478131771088,
-0.03076598420739174,
0.13113939762115479,
-0.03413345664739609,
0.0448327362537384,
-0.037231042981147766,
-0.037967316806316376,
0.04836956411600113,
0.017996301874518394,
-0.0276393573731184,
-0.013080655597150326,
0.034803036600351334,
0.0030549902003258467,
0.0018331155879423022,
-0.013896709308028221,
0.07253926992416382,
-0.08321386575698853,
0.08471345156431198,
-0.003271377645432949,
-0.01396296638995409,
-0.05392668768763542,
0.026226796209812164,
-0.06393270939588547,
-0.01218198798596859,
0.0010451881680637598,
0.09290247410535812,
-0.10072767734527588,
0.010692398995161057,
-0.01215220708400011,
-0.15588805079460144,
-0.009438248351216316,
0.026342594996094704,
0.04399218410253525,
0.04810922592878342,
0.031751953065395355,
0.05629502236843109,
0.031137682497501373,
-0.09070900827646255,
-0.014689547941088676,
0.028729811310768127,
0.0556657500565052,
-0.05946848541498184,
-0.1182645857334137,
0.020890768617391586,
0.11739768087863922,
-0.0600605309009552,
-0.03597857430577278,
-0.008377687074244022,
-0.05297105014324188,
0.07070618867874146,
-0.017238952219486237,
0.01134090218693018,
-0.016380401328206062,
-0.0031030362006276846,
-0.00023832026636227965,
0.08559252321720123,
0.04564439132809639,
0.016765417531132698,
-0.045273635536432266,
0.016032129526138306,
-0.003600980853661895,
-0.036946337670087814,
-0.07540132105350494,
0.05753505602478981,
0.1391877681016922,
-0.022100575268268585,
-0.03917314112186432,
0.07834340631961823,
0.047828786075115204,
-0.03874881565570831,
-0.013959823176264763,
0.03557819500565529,
0.019639426842331886,
0.049224916845560074,
0.01687701977789402,
-0.023857947438955307,
0.017607908695936203,
0.015542249195277691,
-0.08808570355176926,
-4.614064384843059e-33,
0.06311537325382233,
-0.016282906755805016,
-0.08368542045354843,
0.10636231303215027,
0.01900753565132618,
-0.02632220648229122,
-0.04505147784948349,
0.012809766456484795,
-0.005571624264121056,
-0.0012495537521317601,
0.004948042333126068,
0.04926631599664688,
-0.02294047363102436,
-0.010173691436648369,
-0.03627055510878563,
0.05205143988132477,
-0.0078688720241189,
-0.04732216149568558,
-0.024697784334421158,
0.0008862639078870416,
0.006153351627290249,
-0.006431018002331257,
-0.018385032191872597,
-0.03932752087712288,
-0.02465798519551754,
0.01260402426123619,
-0.06250477582216263,
-0.009364527650177479,
-0.02913895808160305,
0.022702613845467567,
-0.05334335193037987,
-0.04395483806729317,
0.029309634119272232,
-0.002331637777388096,
0.06952264159917831,
-0.04509127140045166,
-0.03250862658023834,
0.05242621898651123,
0.03929027169942856,
-0.0350768119096756,
0.1400834172964096,
-0.00675760256126523,
-0.05162367969751358,
-0.05026258900761604,
-0.021748466417193413,
0.063635915517807,
-0.028849763795733452,
0.019881008192896843,
-0.07662703096866608,
0.0009560954058542848,
-0.09541181474924088,
-0.07977982610464096,
0.05064902454614639,
0.056848786771297455,
0.0029200485441833735,
-0.09849631786346436,
0.012231218628585339,
-0.025636201724410057,
0.06464455276727676,
0.03537382557988167,
0.06004032865166664,
-0.08487313240766525,
-0.027483375743031502,
0.038631562143564224,
-0.004728114698082209,
-0.0043548354879021645,
-0.06739804893732071,
-0.02279912307858467,
0.05723901838064194,
-0.0020060138776898384,
0.05705684795975685,
0.05223251134157181,
-0.05114171281456947,
-0.009493429213762283,
-0.06946783512830734,
0.04249931871891022,
-0.017940443009138107,
-0.07078351825475693,
-0.024532834067940712,
0.0014537262031808496,
-0.06638497114181519,
0.06691547483205795,
-0.02878962643444538,
0.0022525344975292683,
-0.04534565284848213,
0.050786565989255905,
-0.02887001261115074,
0.04710545763373375,
0.018434058874845505,
0.05034845694899559,
0.020940637215971947,
0.0013875680742785335,
-0.06652920693159103,
0.010569611564278603,
-0.04621915519237518,
-5.3496282959031305e-8,
-0.03168552368879318,
0.03742758557200432,
-0.04206216707825661,
-0.0293478611856699,
0.011152593418955803,
-0.07095637172460556,
0.03819317743182182,
0.032014623284339905,
0.06676864624023438,
0.06521663814783096,
0.04982127249240875,
-0.0060614049434661865,
0.10495994240045547,
-0.0706055536866188,
-0.013824724592268467,
0.03752647712826729,
0.040033210068941116,
0.007225832436233759,
0.018737830221652985,
-0.017568744719028473,
-0.014688455499708652,
-0.03320892155170441,
0.03316201642155647,
-0.023938415572047234,
-0.0277525894343853,
-0.012172450311481953,
0.02573925256729126,
0.07127480208873749,
0.02106644958257675,
-0.0195571668446064,
-0.1223374530673027,
0.010233882814645767,
-0.03827328979969025,
0.04152962565422058,
-0.05755268409848213,
-0.039639826864004135,
-0.09023868292570114,
-0.05437697470188141,
0.0313674621284008,
0.08085212856531143,
0.050286341458559036,
-0.019669290632009506,
-0.08228437602519989,
0.016755210235714912,
0.008684694766998291,
-0.021275373175740242,
0.0004384360508993268,
-0.0169796384871006,
0.006565490737557411,
0.06173523887991905,
-0.025232866406440735,
-0.02043895609676838,
-0.06950778514146805,
0.03365619480609894,
0.020801175385713577,
-0.001945575000718236,
0.055526431649923325,
-0.08691760152578354,
-0.040647249668836594,
0.007425074931234121,
0.03183247521519661,
0.06101665645837784,
0.009133987128734589,
-0.053039103746414185
] | 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 clear the `Timeout`. The primitive can only be used in the same thread where the timeout was created. Therefore, to use it across [`worker\_threads`][] it must first be passed to the correct thread. This allows enhanced compatibility with browser `setTimeout()` and `setInterval()` implementations. ### `timeout[Symbol.dispose]()` Cancels the timeout. ## Scheduling timers A timer in Node.js is an internal construct that calls a given function after a certain period of time. When a timer's function is called varies depending on which method was used to create the timer and what other work the Node.js event loop is doing. ### `setImmediate(callback[, ...args])` \* `callback` {Function} The function to call at the end of this turn of the Node.js [Event Loop][] \* `...args` {any} Optional arguments to pass when the `callback` is called. \* Returns: {Immediate} for use with [`clearImmediate()`][] Schedules the "immediate" execution of the `callback` after I/O events' callbacks. When multiple calls to `setImmediate()` are made, the `callback` functions are queued for execution in the order in which they are created. The entire callback queue is processed every event loop iteration. If an immediate timer is queued from inside an executing callback, that timer will not be triggered until the next event loop iteration. If `callback` is not a function, a [`TypeError`][] will be thrown. This method has a custom variant for promises that is available using [`timersPromises.setImmediate()`][]. ### `setInterval(callback[, delay[, ...args]])` \* `callback` {Function} The function to call when the timer elapses. \* `delay` {number} The number of milliseconds to wait before calling the `callback`. \*\*Default:\*\* `1`. \* `...args` {any} Optional arguments to pass when the `callback` is called. \* Returns: {Timeout} for use with [`clearInterval()`][] Schedules repeated execution of `callback` every `delay` milliseconds. When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer. If `callback` is not a function, a [`TypeError`][] will be thrown. This method has a custom variant for promises that is available using [`timersPromises.setInterval()`][]. ### `setTimeout(callback[, delay[, ...args]])` \* `callback` {Function} The function to call when the timer elapses. \* `delay` {number} The number of milliseconds to wait before calling the `callback`. \*\*Default:\*\* `1`. \* `...args` {any} Optional arguments to pass when the `callback` is called. \* Returns: {Timeout} for use with [`clearTimeout()`][] Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds. Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified. When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer. If `callback` is not a function, a [`TypeError`][] will be thrown. This method has a custom variant for promises that is available using [`timersPromises.setTimeout()`][]. ## Cancelling timers The [`setImmediate()`][], [`setInterval()`][], and [`setTimeout()`][] methods each return objects that represent the scheduled timers. These can be 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 as setImmediatePromise } from 'node:timers/promises'; const | 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.07437445223331451,
-0.006983260158449411,
-0.011965326964855194,
-0.05325676500797272,
-0.01044099684804678,
-0.04068689048290253,
-0.058629587292671204,
0.05231659486889839,
-0.023379694670438766,
-0.01296510361135006,
0.0281047560274601,
-0.07821675390005112,
-0.07562281936407089,
-0.04630555212497711,
-0.05950792133808136,
0.07634838670492172,
0.055831488221883774,
0.005936800967901945,
-0.06105104833841324,
-0.0961112231016159,
-0.02560107782483101,
-0.07348936051130295,
0.14211104810237885,
-0.000982580822892487,
-0.03492768108844757,
-0.09829260408878326,
0.024297676980495453,
0.012235545553267002,
0.044565774500370026,
-0.07424252480268478,
-0.0542469322681427,
0.03329762816429138,
0.03226940333843231,
-0.10612084716558456,
-0.04057401791214943,
-0.04763181135058403,
0.02767389453947544,
0.01745656132698059,
0.030369224026799202,
-0.02948436513543129,
0.00011971694038948044,
0.0354977622628212,
0.07260644435882568,
0.06760378926992416,
-0.019581058993935585,
-0.01540076732635498,
0.0625150129199028,
-0.01637355610728264,
-0.06567446142435074,
0.004027325194329023,
0.0033331739250570536,
0.0805479884147644,
0.025899747386574745,
-0.0058259847573935986,
-0.07906433939933777,
0.030592642724514008,
0.029521485790610313,
0.006406628526747227,
0.04213437810540199,
-0.05411043390631676,
0.036733370274305344,
-0.03731079399585724,
-0.03398112207651138,
0.007637045346200466,
-0.026903817430138588,
-0.037320613861083984,
0.05101679638028145,
0.02787621319293976,
-0.03989100083708763,
0.025406911969184875,
-0.007063018158078194,
-0.044232554733753204,
0.004563755821436644,
0.05349992588162422,
0.04473520442843437,
0.056512411683797836,
-0.008950116112828255,
-0.11870364099740982,
0.02264847606420517,
-0.03679554536938667,
0.046983614563941956,
0.008143030107021332,
-0.01922418549656868,
0.07263609766960144,
0.08411680161952972,
-0.09075784683227539,
-0.021479768678545952,
0.025284036993980408,
-0.02388051711022854,
-0.01682940311729908,
-0.06496521830558777,
-0.008847680874168873,
0.0059352763928473,
-0.02233579009771347,
0.016160396859049797,
0.005183950066566467,
-0.01167608518153429,
0.041950710117816925,
0.05226963758468628,
0.023038843646645546,
0.03639492020010948,
0.0015613645082339644,
0.06595552712678909,
0.058138567954301834,
-0.014983645640313625,
0.09137158840894699,
0.13735714554786682,
0.10801499336957932,
0.08922170847654343,
-0.03594272583723068,
-0.10835098475217819,
0.005067065358161926,
-0.027305256575345993,
0.05776284262537956,
1.6017945403166904e-33,
-0.06510183960199356,
-0.06855015456676483,
-0.03360588848590851,
0.018273621797561646,
0.1182987317442894,
-0.028976382687687874,
-0.03180760145187378,
-0.032557133585214615,
-0.0020857241470366716,
0.00130763731431216,
0.011434611864387989,
-0.07665202021598816,
-0.017534775659441948,
-0.004614411387592554,
0.0036916115786880255,
-0.025386732071638107,
0.1748506873846054,
-0.004635616205632687,
0.12253076583147049,
-0.006955004762858152,
0.06762658059597015,
-0.021632088348269463,
-0.07122039794921875,
0.0845247358083725,
0.006431960500776768,
-0.0099500035867095,
-0.05619014427065849,
-0.02408440411090851,
-0.011622358113527298,
0.004960354883223772,
0.009383835829794407,
0.06629740446805954,
-0.1393471360206604,
0.03698331117630005,
0.035315342247486115,
-0.08222571015357971,
0.0013775269035249949,
0.018987279385328293,
-0.039708368480205536,
-0.06363897025585175,
-0.03987113758921623,
0.05012190714478493,
-0.05605228245258331,
0.02699245885014534,
-0.006861438509076834,
-0.15610067546367645,
0.02073892205953598,
-0.027727577835321426,
0.050213199108839035,
0.04705154895782471,
0.026814600452780724,
0.03164065629243851,
0.09179293364286423,
-0.0473296195268631,
-0.009529774077236652,
0.023921675980091095,
0.06608466058969498,
-0.05081719160079956,
-0.11783632636070251,
0.039173174649477005,
0.08409085124731064,
-0.007728527765721083,
-0.03189469873905182,
-0.0026088659651577473,
-0.00883305724710226,
0.01979934796690941,
-0.015158617869019508,
-0.0016598307993263006,
-0.02633705921471119,
0.036128658801317215,
-0.04300704970955849,
0.09465887397527695,
0.01709877699613571,
0.0452403798699379,
-0.07227773219347,
0.004191587213426828,
-0.01684858836233616,
-0.012478805147111416,
-0.05802791193127632,
0.01044622901827097,
0.06110388785600662,
0.011838488280773163,
-0.04709356650710106,
-0.028070246800780296,
0.03722739592194557,
-0.016775472089648247,
-0.005807983223348856,
-0.02015380747616291,
0.06242895871400833,
0.015874017030000687,
0.05538015812635422,
0.020164819434285164,
0.008438811637461185,
-0.07607657462358475,
-0.10127194225788116,
-4.726517317230504e-33,
-0.02893911674618721,
-0.03271331638097763,
-0.07047268748283386,
0.08610805124044418,
0.02345861680805683,
0.007133057340979576,
-0.0851670429110527,
0.03122776187956333,
-0.004534813109785318,
-0.007046799175441265,
-0.009090033359825611,
0.029177483171224594,
-0.027736760675907135,
-0.022816017270088196,
-0.041489481925964355,
-0.0006236503249965608,
0.0005711738485842943,
-0.020138852298259735,
-0.02921692281961441,
-0.014164358377456665,
0.0392581932246685,
-0.04002563655376434,
0.01185279618948698,
-0.050439801067113876,
-0.02683413028717041,
0.00853283517062664,
-0.04515993967652321,
-0.03408575430512428,
0.008289252407848835,
-0.038109585642814636,
-0.05798361077904701,
-0.0016259703552350402,
0.037604786455631256,
0.039207424968481064,
0.05929391458630562,
-0.0758986547589302,
-0.06425368785858154,
0.058853670954704285,
0.0686543807387352,
-0.03228841349482536,
0.08079399168491364,
0.05458425357937813,
0.009055719710886478,
-0.01397516205906868,
-0.014553742483258247,
0.06079360470175743,
-0.027568351477384567,
-0.04019223526120186,
-0.006471326109021902,
-0.0033233945723623037,
-0.03504614531993866,
-0.09010495990514755,
0.06741856783628464,
0.08692394942045212,
-0.03417624533176422,
-0.09110027551651001,
0.029751531779766083,
-0.0668049082159996,
0.032890960574150085,
0.060228120535612106,
0.07998217642307281,
-0.050801828503608704,
0.009394712746143341,
0.06978397816419601,
0.017898887395858765,
0.0031741478014737368,
-0.09027446806430817,
-0.00039038335671648383,
0.04753869026899338,
-0.019298285245895386,
0.018159326165914536,
0.07497741281986237,
-0.01981351710855961,
-0.029573684558272362,
-0.08018621802330017,
0.061171725392341614,
-0.060376401990652084,
-0.09355829656124115,
-0.04381057247519493,
0.030802961438894272,
-0.02260143682360649,
0.07423273473978043,
-0.04107998311519623,
0.0006919543375261128,
0.015350387431681156,
0.010727012529969215,
0.027281366288661957,
0.05424796789884567,
-0.020184209570288658,
-0.0315554179251194,
0.05565259978175163,
0.04358130320906639,
-0.090399369597435,
0.025200773030519485,
-0.03538445010781288,
-5.430621996538321e-8,
0.010304953902959824,
0.05877309665083885,
-0.04912631958723068,
-0.07490870356559753,
-0.024740183725953102,
-0.07299529016017914,
0.018889939412474632,
-0.008587121032178402,
0.039879944175481796,
0.07948659360408783,
0.029440762475132942,
-0.037474583834409714,
0.10490627586841583,
-0.009890254586935043,
0.02045477367937565,
0.02323675900697708,
0.04231065511703491,
-0.006918169092386961,
0.018733736127614975,
0.015209758654236794,
-0.02381783537566662,
-0.08891358226537704,
-0.04586756229400635,
0.03727877512574196,
-0.044720981270074844,
-0.004048496019095182,
0.04416634514927864,
0.086325503885746,
-0.026447534561157227,
-0.021625075489282608,
-0.12643882632255554,
0.06497520208358765,
-0.07833460718393326,
0.04520503431558609,
-0.049318332225084305,
-0.009625962004065514,
-0.03860107436776161,
-0.06833425909280777,
0.046839579939842224,
0.054975200444459915,
0.03467673063278198,
0.0015161497285589576,
-0.06608834862709045,
0.03292999044060707,
0.02993660233914852,
-0.021110376343131065,
-0.01447735819965601,
0.08179978281259537,
-0.06544189900159836,
0.049630939960479736,
-0.013739140704274178,
0.012125998735427856,
-0.0433468334376812,
-0.03259118273854256,
0.07677485793828964,
-0.0041957758367061615,
0.05830435827374458,
-0.07759587466716766,
-0.02039625495672226,
0.0024534708354622126,
0.018295513466000557,
0.03372984752058983,
-0.003962146118283272,
-0.01917329616844654
] | 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 as setImmediatePromise } from 'node:timers/promises'; const ac = new AbortController(); const signal = ac.signal; // We do not `await` the promise so `ac.abort()` is called concurrently. setImmediatePromise('foobar', { signal }) .then(console.log) .catch((err) => { if (err.name === 'AbortError') console.error('The immediate was aborted'); }); ac.abort(); ``` ```cjs const { setImmediate: setImmediatePromise } = require('node:timers/promises'); const ac = new AbortController(); const signal = ac.signal; setImmediatePromise('foobar', { signal }) .then(console.log) .catch((err) => { if (err.name === 'AbortError') console.error('The immediate was aborted'); }); ac.abort(); ``` For `setTimeout()`: ```mjs import { setTimeout as setTimeoutPromise } from 'node:timers/promises'; const ac = new AbortController(); const signal = ac.signal; // We do not `await` the promise so `ac.abort()` is called concurrently. setTimeoutPromise(1000, 'foobar', { signal }) .then(console.log) .catch((err) => { if (err.name === 'AbortError') console.error('The timeout was aborted'); }); ac.abort(); ``` ```cjs const { setTimeout: setTimeoutPromise } = require('node:timers/promises'); const ac = new AbortController(); const signal = ac.signal; setTimeoutPromise(1000, 'foobar', { signal }) .then(console.log) .catch((err) => { if (err.name === 'AbortError') console.error('The timeout was aborted'); }); ac.abort(); ``` ### `clearImmediate(immediate)` \* `immediate` {Immediate} An `Immediate` object as returned by [`setImmediate()`][]. Cancels an `Immediate` object created by [`setImmediate()`][]. ### `clearInterval(timeout)` \* `timeout` {Timeout|string|number} A `Timeout` object as returned by [`setInterval()`][] or the [primitive][] of the `Timeout` object as a string or a number. Cancels a `Timeout` object created by [`setInterval()`][]. ### `clearTimeout(timeout)` \* `timeout` {Timeout|string|number} A `Timeout` object as returned by [`setTimeout()`][] or the [primitive][] of the `Timeout` object as a string or a number. Cancels a `Timeout` object created by [`setTimeout()`][]. ## Timers Promises API The `timers/promises` API provides an alternative set of timer functions that return `Promise` objects. The API is accessible via `require('node:timers/promises')`. ```mjs import { setTimeout, setImmediate, setInterval, } from 'node:timers/promises'; ``` ```cjs const { setTimeout, setImmediate, setInterval, } = require('node:timers/promises'); ``` ### `timersPromises.setTimeout([delay[, value[, options]]])` \* `delay` {number} The number of milliseconds to wait before fulfilling the promise. \*\*Default:\*\* `1`. \* `value` {any} A value with which the promise is fulfilled. \* `options` {Object} \* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active. \*\*Default:\*\* `true`. \* `signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`. ```mjs import { setTimeout, } from 'node:timers/promises'; const res = await setTimeout(100, 'result'); console.log(res); // Prints 'result' ``` ```cjs const { setTimeout, } = require('node:timers/promises'); setTimeout(100, 'result').then((res) => { console.log(res); // Prints 'result' }); ``` ### `timersPromises.setImmediate([value[, options]])` \* `value` {any} A value with which the promise is fulfilled. \* `options` {Object} \* `ref` {boolean} Set to `false` to indicate that the scheduled `Immediate` should not require the Node.js event loop to remain active. \*\*Default:\*\* `true`. \* `signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Immediate`. ```mjs import { setImmediate, } from 'node:timers/promises'; const res = await setImmediate('result'); console.log(res); // Prints 'result' ``` ```cjs const { setImmediate, } = require('node:timers/promises'); setImmediate('result').then((res) => { console.log(res); // Prints 'result' }); ``` ### `timersPromises.setInterval([delay[, value[, options]]])` Returns an async iterator that generates values in an 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` | 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.03904419764876366,
-0.03095557726919651,
-0.01808755472302437,
-0.05535011738538742,
0.003694261657074094,
0.014539556577801704,
-0.05432356894016266,
0.05128795653581619,
0.011113575659692287,
0.08195805549621582,
0.04453561455011368,
-0.07515809684991837,
-0.07277020066976547,
-0.01726287603378296,
-0.05387607216835022,
0.03927513211965561,
0.015442559495568275,
0.011316031217575073,
-0.047618478536605835,
-0.078883595764637,
-0.0079189483076334,
-0.10704350471496582,
0.06573312729597092,
-0.05277010798454285,
-0.04017100855708122,
0.04214391112327576,
-0.021728403866291046,
0.08221336454153061,
0.07332006841897964,
-0.06455641984939575,
-0.022355422377586365,
0.0384819433093071,
-0.03230215981602669,
-0.07459339499473572,
0.0017640080768615007,
-0.0917944386601448,
0.04879439249634743,
0.017632823437452316,
0.012500188313424587,
-0.0591626912355423,
-0.019615577533841133,
0.043852124363183975,
0.016340553760528564,
-0.005862939637154341,
0.0499383881688118,
0.017852194607257843,
-0.00698967557400465,
-0.03187192976474762,
-0.07453782856464386,
-0.012613882310688496,
0.002316137542948127,
0.0697530061006546,
0.046889349818229675,
0.01609879732131958,
-0.004710363689810038,
0.10363077372312546,
0.040170446038246155,
0.05951143801212311,
-0.061464983969926834,
0.018729140982031822,
0.028162002563476562,
-0.044156625866889954,
-0.01788434013724327,
-0.005023544654250145,
-0.015205370262265205,
-0.06161108985543251,
0.07195712625980377,
-0.02433968335390091,
-0.08092794567346573,
0.0014300602488219738,
-0.04416385293006897,
-0.06420330703258514,
0.034622177481651306,
0.015760129317641258,
0.004548612050712109,
0.014201627112925053,
-0.07653332501649857,
-0.07988335937261581,
-0.05056590586900711,
-0.0735124945640564,
0.06231464818120003,
-0.0344417504966259,
-0.011951833963394165,
0.023012477904558182,
-0.01888161711394787,
-0.04525474086403847,
-0.012620512396097183,
0.06129525974392891,
-0.017717894166707993,
-0.04908864200115204,
-0.047756679356098175,
-0.01709579862654209,
-0.02073696441948414,
-0.035420164465904236,
0.004836438689380884,
-0.024239936843514442,
0.005337227135896683,
0.00039480641135014594,
0.019994812086224556,
0.03653884306550026,
0.008189216256141663,
0.030899113044142723,
0.13321882486343384,
0.04810229316353798,
0.034935567528009415,
0.054373759776353836,
0.0015435699606314301,
0.017222413793206215,
0.05520403012633324,
0.040534090250730515,
-0.06589745730161667,
0.03957074508070946,
-0.012461579404771328,
0.0379737950861454,
1.928245300916371e-33,
-0.04590470716357231,
-0.07100335508584976,
-0.07850785553455353,
0.0045637525618076324,
0.12598536908626556,
0.04946494847536087,
0.0379086472094059,
0.051295846700668335,
-0.027678726240992546,
0.03442294895648956,
0.010064538568258286,
-0.09171747416257858,
-0.035857271403074265,
-0.02673185057938099,
-0.011275123804807663,
-0.03686267137527466,
0.11783857643604279,
-0.04473154619336128,
0.07915905117988586,
0.012002742849290371,
0.08084508031606674,
-0.05649517849087715,
-0.0004476528847590089,
0.011124254204332829,
0.018167423084378242,
-0.0007582994294352829,
-0.062197230756282806,
0.056480538100004196,
0.03808983415365219,
-0.018948517739772797,
0.021682623773813248,
0.10722994804382324,
-0.04916898161172867,
0.03053840808570385,
0.05429864674806595,
-0.0879812240600586,
-0.032090868800878525,
0.015506662428379059,
-0.06805615872144699,
-0.06370612978935242,
-0.03971245139837265,
0.03822558373212814,
-0.09315438568592072,
0.026766303926706314,
0.03644030541181564,
-0.17410597205162048,
-0.010697961784899235,
-0.029691409319639206,
0.09562213718891144,
0.027766669169068336,
0.07263870537281036,
0.07634193450212479,
0.05615191161632538,
-0.0821528211236,
0.04004911705851555,
0.05478940159082413,
-0.004525350406765938,
-0.028319885954260826,
-0.04863743484020233,
-0.02650882862508297,
0.10230997204780579,
-0.11168939620256424,
-0.04213530942797661,
-0.03736788034439087,
-0.07420014590024948,
0.07044925540685654,
-0.04727332666516304,
-0.02766111120581627,
-0.0436890609562397,
0.019652754068374634,
-0.013616284355521202,
0.02696588821709156,
0.020417094230651855,
0.016864120960235596,
-0.02467546984553337,
0.03668326139450073,
-0.05577349662780762,
0.00009156292071565986,
0.017083337530493736,
-0.02336961403489113,
0.10028313100337982,
-0.020902445539832115,
-0.07818339765071869,
0.07181082665920258,
0.04053312540054321,
0.010701720602810383,
0.003928991500288248,
-0.027967026457190514,
0.04081672057509422,
0.03209593519568443,
-0.03599438816308975,
0.04100270941853523,
0.04351212456822395,
-0.0011584488674998283,
-0.06377214938402176,
-4.114917524731253e-33,
0.07597941905260086,
-0.012207666411995888,
-0.06710624694824219,
0.030750403180718422,
0.039533451199531555,
-0.041661106050014496,
0.002157987095415592,
0.015927255153656006,
-0.03510182350873947,
-0.052293311804533005,
0.061700768768787384,
0.04719478264451027,
0.06391928344964981,
0.03866712376475334,
-0.0826416164636612,
0.010552394203841686,
0.07623299211263657,
0.0006771417101845145,
-0.005044092424213886,
-0.023142239078879356,
0.038129813969135284,
-0.07667331397533417,
-0.03037327714264393,
-0.052783071994781494,
-0.04280863702297211,
0.04570623114705086,
-0.057244669646024704,
-0.010719923302531242,
-0.003292171750217676,
-0.010103562846779823,
0.004640253260731697,
-0.020823733881115913,
-0.011745050549507141,
-0.01784074679017067,
0.08156397938728333,
-0.02882518246769905,
0.023610930889844894,
0.09657669812440872,
-0.12015968561172485,
-0.02713198959827423,
0.12635749578475952,
0.017849590629339218,
-0.05930276960134506,
-0.03142644837498665,
0.022600829601287842,
0.006574795115739107,
0.050122495740652084,
-0.050356701016426086,
0.010126259177923203,
-0.003799787722527981,
-0.060465529561042786,
-0.08656104654073715,
0.05073407664895058,
0.06853280961513519,
0.01998680830001831,
-0.07080178707838058,
0.0776718482375145,
-0.07240722328424454,
0.06857340782880783,
0.0158174280077219,
-0.016645025461912155,
-0.07659497857093811,
0.01749962568283081,
0.04186054319143295,
0.05432457849383354,
0.04689621180295944,
-0.08324308693408966,
0.026754720136523247,
0.11768610775470734,
0.028868701308965683,
0.05468901991844177,
0.0909871757030487,
-0.0641615241765976,
-0.018162798136472702,
-0.05961975082755089,
-0.006715309806168079,
-0.06218893826007843,
-0.11449497193098068,
-0.0019793712999671698,
0.019030239433050156,
0.02501409873366356,
0.00048752810107544065,
0.01177466381341219,
0.06723415106534958,
-0.030208082869648933,
0.0728904977440834,
-0.044828251004219055,
-0.010729108937084675,
-0.029641903936862946,
0.05965306609869003,
-0.040189728140830994,
0.0037994736339896917,
0.0023727111984044313,
0.029184920713305473,
-0.028651617467403412,
-4.977505696501794e-8,
-0.06262456625699997,
0.053659021854400635,
-0.03379060700535774,
-0.039350733160972595,
0.006291197147220373,
-0.0570211261510849,
-0.05431372672319412,
-0.06628452241420746,
-0.015380725264549255,
-0.017359761521220207,
-0.012666406109929085,
-0.0016091682482510805,
0.1043863445520401,
0.0460457019507885,
0.003999999258667231,
-0.04598156735301018,
-0.004744719248265028,
0.019616207107901573,
0.043363623321056366,
-0.039878539741039276,
-0.05374123528599739,
-0.030857030302286148,
0.028643162921071053,
-0.029915546998381615,
-0.017439693212509155,
-0.001623475574888289,
0.07515358924865723,
0.0966176986694336,
-0.027229830622673035,
-0.006968915928155184,
-0.1439361572265625,
0.0031460945028811693,
0.0332108736038208,
0.0646931603550911,
-0.07168009132146835,
-0.012456665746867657,
-0.008214143104851246,
-0.031187603250145912,
0.020626135170459747,
0.05650220438838005,
0.05515557900071144,
0.0062813060358166695,
-0.04463214799761772,
0.04247317463159561,
0.05272066220641136,
-0.030188722535967827,
0.057052191346883774,
0.0039739664644002914,
-0.015839802101254463,
0.07263325899839401,
-0.026493260636925697,
-0.010604245588183403,
-0.06582130491733551,
0.02600415050983429,
0.06748831272125244,
-0.06913617253303528,
-0.008396380580961704,
-0.11422716826200485,
-0.06908029317855835,
-0.005148685537278652,
0.013411103747785091,
-0.013815701007843018,
-0.004750736523419619,
-0.09049095213413239
] | 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} \* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` between iterations should not require the Node.js event loop to remain active. \*\*Default:\*\* `true`. \* `signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Timeout` between operations. ```mjs import { setInterval, } from 'node:timers/promises'; const interval = 100; for await (const startTime of setInterval(interval, Date.now())) { const now = Date.now(); console.log(now); if ((now - startTime) > 1000) break; } console.log(Date.now()); ``` ```cjs const { setInterval, } = require('node:timers/promises'); const interval = 100; (async function() { for await (const startTime of setInterval(interval, Date.now())) { const now = Date.now(); console.log(now); if ((now - startTime) > 1000) break; } console.log(Date.now()); })(); ``` ### `timersPromises.scheduler.wait(delay[, options])` > Stability: 1 - Experimental \* `delay` {number} The number of milliseconds to wait before resolving the promise. \* `options` {Object} \* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active. \*\*Default:\*\* `true`. \* `signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel waiting. \* Returns: {Promise} An experimental API defined by the [Scheduling APIs][] draft specification being developed as a standard Web Platform API. Calling `timersPromises.scheduler.wait(delay, options)` is equivalent to calling `timersPromises.setTimeout(delay, undefined, options)`. ```mjs import { scheduler } from 'node:timers/promises'; await scheduler.wait(1000); // Wait one second before continuing ``` ### `timersPromises.scheduler.yield()` > Stability: 1 - Experimental \* Returns: {Promise} An experimental API defined by the [Scheduling APIs][] draft specification being developed as a standard Web Platform API. Calling `timersPromises.scheduler.yield()` is equivalent to calling `timersPromises.setImmediate()` with no arguments. [Event Loop]: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout [Scheduling APIs]: https://github.com/WICG/scheduling-apis [`AbortController`]: globals.md#class-abortcontroller [`TypeError`]: errors.md#class-typeerror [`clearImmediate()`]: #clearimmediateimmediate [`clearInterval()`]: #clearintervaltimeout [`clearTimeout()`]: #cleartimeouttimeout [`setImmediate()`]: #setimmediatecallback-args [`setInterval()`]: #setintervalcallback-delay-args [`setTimeout()`]: #settimeoutcallback-delay-args [`timersPromises.setImmediate()`]: #timerspromisessetimmediatevalue-options [`timersPromises.setInterval()`]: #timerspromisessetintervaldelay-value-options [`timersPromises.setTimeout()`]: #timerspromisessettimeoutdelay-value-options [`worker\_threads`]: worker\_threads.md [primitive]: #timeoutsymboltoprimitive | 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.03761204332113266,
-0.028633248060941696,
-0.02029777131974697,
-0.06937827169895172,
0.0005772740696556866,
0.02343568578362465,
-0.06698628515005112,
0.047649867832660675,
0.0028482715133577585,
0.04347502812743187,
0.03020610101521015,
-0.03752223402261734,
-0.05736071988940239,
-0.04965894669294357,
-0.046713244169950485,
0.07180534303188324,
0.051932185888290405,
0.034270916134119034,
-0.05841163918375969,
-0.06741224229335785,
-0.022403689101338387,
-0.007859541103243828,
0.07147729396820068,
-0.034341856837272644,
-0.03051764704287052,
-0.012330904603004456,
-0.014849749393761158,
0.10098753869533539,
0.050674937665462494,
-0.050743989646434784,
-0.08721963316202164,
0.11741756647825241,
0.009699827060103416,
-0.09115060418844223,
0.010884404182434082,
-0.038889527320861816,
0.05803808942437172,
-0.02747199870646,
0.012692676857113838,
-0.07164087146520615,
-0.038981273770332336,
0.04944129288196564,
0.07211187481880188,
0.09941935539245605,
0.013757923617959023,
0.057153988629579544,
-0.02789309062063694,
0.03352966904640198,
-0.08210157603025436,
0.00906119029968977,
-0.035064294934272766,
0.015361777506768703,
0.03468042612075806,
-0.025204932317137718,
-0.01678597554564476,
0.056516051292419434,
0.058631423860788345,
0.04264198988676071,
0.03488096967339516,
-0.02024873159825802,
0.06024062633514404,
-0.03381803631782532,
-0.03762597590684891,
0.0035717058926820755,
0.0023130024783313274,
-0.04021831974387169,
0.0470350943505764,
-0.02648226171731949,
-0.09252588450908661,
0.02398918755352497,
-0.052769001573324203,
-0.053417954593896866,
-0.01815146952867508,
0.03339499607682228,
0.05192317068576813,
-0.005850867368280888,
-0.030110249295830727,
-0.05028258636593819,
0.00198698160238564,
-0.0692722350358963,
0.010080349631607533,
0.02577192708849907,
0.057122617959976196,
0.02913975715637207,
0.06641161441802979,
-0.00492889853194356,
-0.06718196719884872,
0.012653066776692867,
-0.01996586099267006,
-0.08365119993686676,
-0.042467184364795685,
0.03695470839738846,
-0.00005850138040841557,
-0.012908322736620903,
-0.04746779799461365,
-0.05717288330197334,
0.009935388341546059,
0.027919786050915718,
0.02732248045504093,
0.03223341703414917,
0.026945238932967186,
0.01297107245773077,
0.07481008768081665,
0.06185493990778923,
-0.025560269132256508,
0.11121214926242828,
0.05039508640766144,
0.11020177602767944,
0.09294731914997101,
0.019261782988905907,
-0.06286939233541489,
0.04532445967197418,
-0.011802888475358486,
0.058417364954948425,
2.4808569501814367e-33,
-0.09269947558641434,
-0.11700963973999023,
-0.028479933738708496,
-0.02140468917787075,
0.027591053396463394,
0.03086870349943638,
0.0473933182656765,
-0.03159631788730621,
-0.062169209122657776,
-0.02416297234594822,
-0.04062160849571228,
-0.04182516410946846,
-0.05399139225482941,
-0.05840673670172691,
-0.024665074422955513,
-0.078487828373909,
0.1891033947467804,
-0.10699652880430222,
0.060680072754621506,
-0.03830824792385101,
0.05314240604639053,
-0.11138547956943512,
-0.030927011743187904,
0.05562358722090721,
-0.013710297644138336,
-0.06540587544441223,
-0.03357711806893349,
0.03790741786360741,
0.014895662665367126,
-0.02372809872031212,
0.009064778685569763,
0.10880618542432785,
-0.07924036681652069,
0.00013819332525599748,
0.01610856130719185,
-0.03309354931116104,
0.005741785746067762,
0.01109001412987709,
-0.05319031700491905,
-0.062171570956707,
-0.14198248088359833,
0.04175598546862602,
-0.061828676611185074,
0.02039153315126896,
-0.028685158118605614,
-0.09973498433828354,
0.016659734770655632,
0.018916158005595207,
0.03845934197306633,
0.06625771522521973,
0.03112344816327095,
0.035379692912101746,
-0.017722254619002342,
-0.09696795791387558,
0.018110841512680054,
0.025882696732878685,
0.06783483177423477,
0.01460536289960146,
-0.06411385536193848,
0.03391754999756813,
0.09622137248516083,
-0.09195032715797424,
-0.01637473702430725,
0.03927578032016754,
-0.01994289644062519,
0.05109124258160591,
-0.034684501588344574,
0.011379169300198555,
-0.015201177448034286,
0.053859200328588486,
0.0016218234086409211,
0.0567781962454319,
0.01826762594282627,
-0.026610272005200386,
-0.05904665216803551,
-0.013793480582535267,
-0.024380778893828392,
-0.030938075855374336,
-0.12672658264636993,
-0.011374923400580883,
0.08959297835826874,
0.023255635052919388,
-0.08107714354991913,
0.05137912929058075,
0.09268572181463242,
-0.013385827653110027,
-0.027270575985312462,
0.025242894887924194,
0.0564822182059288,
0.009616839699447155,
-0.018604014068841934,
-0.008581385016441345,
0.06315253674983978,
0.009415185078978539,
-0.10867501050233841,
-5.231971439218441e-33,
0.05274978652596474,
-0.0021822848357260227,
0.020148832350969315,
0.06971360743045807,
0.07184107601642609,
-0.0412500724196434,
-0.008984233252704144,
0.04710891842842102,
-0.011822840198874474,
-0.022187458351254463,
-0.02063695341348648,
0.019595352932810783,
0.019659630954265594,
0.015829069539904594,
-0.02691774256527424,
0.027546366676688194,
0.08227626234292984,
-0.03959738090634346,
0.03618151322007179,
0.01526185218244791,
0.027655262500047684,
-0.031873539090156555,
-0.03269878029823303,
-0.00982404313981533,
-0.08593975752592087,
-0.001553855137899518,
-0.029179364442825317,
-0.023038698360323906,
-0.02687973715364933,
-0.05009440705180168,
-0.05306665971875191,
-0.062286265194416046,
0.03563586622476578,
0.052757371217012405,
0.06875840574502945,
-0.03739982843399048,
0.040347542613744736,
0.006499636452645063,
0.04998047649860382,
-0.0009278858778998256,
0.12945415079593658,
-0.04032598063349724,
-0.026712944731116295,
-0.04839024692773819,
0.00028772829682566226,
0.02717619203031063,
-0.0440099760890007,
0.04909917712211609,
-0.05649372562766075,
0.013125120662152767,
-0.055370524525642395,
-0.09911201894283295,
0.0142349973320961,
0.06604612618684769,
0.0004000490589533001,
-0.06073371320962906,
-0.025229331105947495,
-0.07072386890649796,
0.11114007979631424,
0.06448275595903397,
0.0026079651433974504,
-0.06831665337085724,
0.05102157220244408,
0.03564026579260826,
0.03201129287481308,
0.034172173589468,
-0.09749466925859451,
-0.023632241412997246,
0.028770197182893753,
0.03926866501569748,
0.07929601520299911,
0.07894613593816757,
-0.104933962225914,
-0.019155636429786682,
-0.0985393077135086,
-0.04009316861629486,
-0.08941356837749481,
-0.07030162215232849,
0.05526699870824814,
0.017662333324551582,
-0.018462900072336197,
0.0825275257229805,
-0.015696505084633827,
0.017776818946003914,
-0.029732508584856987,
0.06735023111104965,
0.026895612478256226,
0.05956070125102997,
0.011326873674988747,
0.003463160712271929,
0.015045255422592163,
-0.01253510918468237,
-0.023324966430664062,
0.010027186945080757,
-0.007628984283655882,
-5.3291142165790006e-8,
-0.04618620499968529,
0.012648249045014381,
-0.035714663565158844,
0.028934255242347717,
0.010890208184719086,
-0.05808374285697937,
-0.0060601308941841125,
-0.07342638075351715,
0.04284634441137314,
-0.004566781222820282,
0.061249349266290665,
-0.09232747554779053,
0.10798121243715286,
-0.023584408685564995,
0.011980371549725533,
-0.02253524214029312,
-0.015094333328306675,
-0.05536698177456856,
0.06467849761247635,
0.008453251793980598,
0.022654222324490547,
-0.05176496133208275,
0.04126375913619995,
-0.027251042425632477,
-0.019588667899370193,
-0.025562260299921036,
0.030594445765018463,
0.06501175463199615,
0.028133362531661987,
-0.04025041311979294,
-0.10739362239837646,
-0.026074854657053947,
-0.00839264877140522,
0.05606813356280327,
-0.07379689812660217,
-0.07916583865880966,
0.0035823876969516277,
-0.00914095714688301,
0.08474840223789215,
0.041559796780347824,
0.05133463442325592,
-0.013728288002312183,
-0.030086087062954903,
0.01762467622756958,
-0.029246026650071144,
-0.05426399037241936,
0.006134998984634876,
0.03230706974864006,
0.013973955996334553,
0.06882341206073761,
-0.012728657573461533,
-0.029945023357868195,
-0.02218060940504074,
-0.007363553624600172,
0.05963796377182007,
-0.03915845975279808,
0.03126513957977295,
-0.0637790709733963,
-0.02993188612163067,
0.043279245495796204,
-0.003204142674803734,
-0.04447609558701515,
-0.06772182136774063,
-0.035615045577287674
] | 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 = require('node:diagnostics\_channel'); ``` It is intended that a module writer wanting to report diagnostics messages will create one or many top-level channels to report messages through. Channels may also be acquired at runtime but it is not encouraged due to the additional overhead of doing so. Channels may be exported for convenience, but as long as the name is known it can be acquired anywhere. If you intend for your module to produce diagnostics data for others to consume it is recommended that you include documentation of what named channels are used along with the shape of the message data. Channel names should generally include the module name to avoid collisions with data from other modules. ## Public API ### Overview Following is a simple overview of the public API. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; // Get a reusable channel object const channel = diagnostics\_channel.channel('my-channel'); function onMessage(message, name) { // Received data } // Subscribe to the channel diagnostics\_channel.subscribe('my-channel', onMessage); // Check if the channel has an active subscriber if (channel.hasSubscribers) { // Publish data to the channel channel.publish({ some: 'data', }); } // Unsubscribe from the channel diagnostics\_channel.unsubscribe('my-channel', onMessage); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); // Get a reusable channel object const channel = diagnostics\_channel.channel('my-channel'); function onMessage(message, name) { // Received data } // Subscribe to the channel diagnostics\_channel.subscribe('my-channel', onMessage); // Check if the channel has an active subscriber if (channel.hasSubscribers) { // Publish data to the channel channel.publish({ some: 'data', }); } // Unsubscribe from the channel diagnostics\_channel.unsubscribe('my-channel', onMessage); ``` #### `diagnostics\_channel.hasSubscribers(name)` \* `name` {string|symbol} The channel name \* Returns: {boolean} If there are active subscribers Check if there are active subscribers to the named channel. This is helpful if the message you want to send might be expensive to prepare. This API is optional but helpful when trying to publish messages from very performance-sensitive code. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; if (diagnostics\_channel.hasSubscribers('my-channel')) { // There are subscribers, prepare and publish message } ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); if (diagnostics\_channel.hasSubscribers('my-channel')) { // There are subscribers, prepare and publish message } ``` #### `diagnostics\_channel.channel(name)` \* `name` {string|symbol} The channel name \* Returns: {Channel} The named channel object This is the primary entry-point for anyone wanting to publish to a named channel. It produces a channel object which is optimized to reduce overhead at publish time as much as possible. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channel = diagnostics\_channel.channel('my-channel'); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); ``` #### `diagnostics\_channel.subscribe(name, onMessage)` \* `name` {string|symbol} The channel name \* `onMessage` {Function} The handler to receive channel messages \* `message` {any} The message data \* `name` {string|symbol} The name of the channel Register a message handler to subscribe to this channel. This message handler will be run synchronously whenever a message is published to the channel. Any errors thrown in the message handler will trigger an [`'uncaughtException'`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; diagnostics\_channel.subscribe('my-channel', (message, name) => { // Received data }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); diagnostics\_channel.subscribe('my-channel', (message, name) => { // Received data }); ``` #### `diagnostics\_channel.unsubscribe(name, 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)`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; function onMessage(message, name) { // Received | 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.04355940222740173,
-0.0012142491759732366,
-0.0011609499342739582,
0.05939984694123268,
0.024215614423155785,
-0.007582406047731638,
-0.04551897943019867,
0.03172203153371811,
0.12280957400798798,
-0.020158551633358,
0.016736755147576332,
-0.05489182472229004,
-0.09360460191965103,
-0.022650592029094696,
0.03180728852748871,
0.015761086717247963,
-0.04665346443653107,
0.0069612483493983746,
0.02369513548910618,
-0.0537504144012928,
0.10516378283500671,
0.027075229212641716,
0.10149329155683517,
0.019621537998318672,
-0.10981547087430954,
-0.03370387479662895,
-0.03435568884015083,
0.07706291973590851,
0.019869182258844376,
-0.06254091113805771,
-0.04500206559896469,
-0.02017936296761036,
-0.06950434297323227,
-0.03036881983280182,
0.033484041690826416,
-0.04218483716249466,
-0.0019613723270595074,
-0.028894973918795586,
-0.04647566378116608,
0.007904025726020336,
0.08990156650543213,
0.013141896575689316,
-0.004992334637790918,
-0.10135652869939804,
-0.07221715152263641,
-0.03278670832514763,
0.055201590061187744,
-0.04781064763665199,
0.04352238401770592,
0.04960298538208008,
-0.01627465896308422,
0.05065831542015076,
0.05598884075880051,
-0.018749957904219627,
0.07263052463531494,
0.09004736691713333,
0.022638272494077682,
-0.0923939123749733,
-0.007264931220561266,
-0.021782036870718002,
0.0541168674826622,
-0.02466912567615509,
-0.041625868529081345,
0.023850470781326294,
0.003291575238108635,
-0.03336818143725395,
-0.03664529323577881,
-0.04515664279460907,
0.009073394350707531,
-0.016296537593007088,
0.0035631719511002302,
-0.00006189285340951756,
0.10130824893712997,
0.007938207127153873,
0.0608939453959465,
-0.015000123530626297,
-0.013706093654036522,
-0.09266352653503418,
-0.1063767820596695,
-0.024055978283286095,
0.08674884587526321,
-0.02409222535789013,
0.00657891808077693,
0.030368292704224586,
-0.021630773320794106,
0.044360075145959854,
0.007890081964433193,
0.0007005381048657,
-0.020661549642682076,
0.06785616278648376,
0.005636916495859623,
-0.050649579614400864,
-0.06509703397750854,
-0.021580658853054047,
-0.02412714809179306,
-0.022770050913095474,
0.010301454924046993,
-0.0325537845492363,
0.11172715574502945,
-0.004793999250978231,
-0.07970045506954193,
0.09145049750804901,
0.03729191794991493,
0.0003751152544282377,
0.009450550191104412,
0.03661336749792099,
0.06786090135574341,
0.0899059846997261,
-0.08706792443990707,
0.043540213257074356,
0.020276611670851707,
0.0980486050248146,
0.02250145748257637,
0.0031254475470632315,
1.26139350867313e-33,
-0.0260397270321846,
0.005803870968520641,
-0.039910294115543365,
0.06990930438041687,
0.0155216995626688,
0.0767839178442955,
-0.010163298808038235,
-0.040551748126745224,
-0.04347590357065201,
0.006579827517271042,
-0.06841982156038284,
0.0889885425567627,
-0.01654026284813881,
-0.058891039341688156,
-0.004943246021866798,
0.034462135285139084,
-0.009297306649386883,
0.02200864814221859,
0.01861763745546341,
0.03953435271978378,
0.018769025802612305,
-0.02825717069208622,
0.007203944027423859,
0.0239306278526783,
0.09646663069725037,
-0.024889357388019562,
0.011507964693009853,
-0.01661398634314537,
0.015327476896345615,
0.0042269667610526085,
-0.007251042407006025,
0.016406096518039703,
0.07310966402292252,
0.055905502289533615,
0.05982079729437828,
-0.008143099024891853,
-0.04081159457564354,
0.0032262448221445084,
-0.0841967836022377,
-0.019257934764027596,
0.05599092319607735,
0.030962364748120308,
-0.08797228336334229,
-0.0037673059850931168,
0.024719424545764923,
-0.08348190784454346,
-0.10025433450937271,
-0.032467104494571686,
0.04878734052181244,
-0.12786102294921875,
0.01547686941921711,
0.05531597137451172,
0.036835867911577225,
-0.03414685279130936,
0.07618240267038345,
-0.013460338115692139,
0.04150770232081413,
-0.050875142216682434,
-0.009596338495612144,
0.002852789591997862,
-0.028000857681035995,
-0.047782789915800095,
-0.018089119344949722,
-0.0018347336445003748,
0.02467483840882778,
0.03326266258955002,
-0.0510278083384037,
0.03896695747971535,
-0.008601966314017773,
-0.04837173968553543,
-0.06807977706193924,
0.004734255373477936,
-0.08883444964885712,
-0.028882618993520737,
0.012747470289468765,
-0.0029228583443909883,
-0.053202759474515915,
-0.03469313308596611,
0.00019577292550820857,
0.014881840907037258,
0.008769643492996693,
-0.02144971303641796,
-0.04203629121184349,
0.106441430747509,
0.07077942788600922,
0.006563378032296896,
-0.04869376868009567,
-0.028852200135588646,
-0.03295474499464035,
0.017881108447909355,
-0.0024122053291648626,
0.08154366165399551,
-0.006211617961525917,
-0.002704240381717682,
-0.03707378730177879,
-3.679425153084412e-33,
-0.06923966854810715,
0.06723649799823761,
-0.06633520871400833,
0.04455218091607094,
-0.12694291770458221,
-0.08531603217124939,
-0.009927568957209587,
-0.014216485433280468,
-0.00401325523853302,
0.017130011692643166,
-0.042564839124679565,
-0.04948528856039047,
-0.0611567497253418,
-0.015984665602445602,
0.025923816487193108,
0.03744390979409218,
-0.10679763555526733,
-0.06183558329939842,
0.04674458131194115,
-0.01587848924100399,
-0.07459725439548492,
0.07220712304115295,
-0.033077042549848557,
-0.03472328186035156,
-0.10923291742801666,
0.03671813756227493,
0.029162239283323288,
0.038968827575445175,
0.006192929111421108,
-0.06899362057447433,
-0.01303291879594326,
0.044288959354162216,
0.024495145305991173,
0.013833722099661827,
-0.008069643750786781,
-0.0391070693731308,
0.07393892854452133,
-0.006286936346441507,
0.05642348527908325,
-0.027679219841957092,
0.10228164494037628,
0.1339968740940094,
-0.10973983258008957,
-0.04945113882422447,
-0.0570451095700264,
0.026773065328598022,
0.007710164412856102,
0.005262557417154312,
-0.013816753402352333,
-0.01447052787989378,
0.010953540913760662,
-0.06629770994186401,
0.014511861838400364,
-0.03242801874876022,
-0.07901518046855927,
0.00023750669788569212,
0.016560113057494164,
0.04126885160803795,
0.03585850074887276,
-0.028498345986008644,
-0.020570950582623482,
-0.08917289227247238,
-0.020304599776864052,
-0.008979209698736668,
-0.01312649343162775,
-0.04608968645334244,
0.009078988805413246,
-0.031189028173685074,
0.09175343066453934,
-0.014310561120510101,
0.007847062312066555,
0.009640568867325783,
-0.08355400711297989,
0.02355501987040043,
0.046869877725839615,
0.08548185229301453,
-0.0927378311753273,
-0.057218119502067566,
-0.03420383855700493,
0.064239501953125,
-0.1019255667924881,
0.05755987390875816,
-0.02139364741742611,
0.05017796903848648,
0.05089881643652916,
-0.03252744302153587,
0.07124239951372147,
0.08269739151000977,
0.043549325317144394,
-0.04533763602375984,
0.06909963488578796,
0.0663142129778862,
-0.0990581288933754,
-0.030577896162867546,
-0.00921645201742649,
-4.6937280728798214e-8,
-0.0837441235780716,
-0.06720928102731705,
-0.08816083520650864,
-0.045238856226205826,
-0.029989462345838547,
-0.0030936081893742085,
0.05721786245703697,
0.0032921370584517717,
0.08822719752788544,
0.05512695759534836,
-0.011689048260450363,
-0.01092189084738493,
-0.035152532160282135,
-0.05845417454838753,
0.028702277690172195,
0.0011820215731859207,
-0.03958737850189209,
0.03790587931871414,
-0.04919249191880226,
-0.04855703189969063,
0.059265702962875366,
0.0407160185277462,
0.026617832481861115,
0.12484107166528702,
-0.02071903832256794,
-0.09955710172653198,
0.10046649724245071,
0.08482827991247177,
-0.05841638892889023,
-0.0787217915058136,
-0.08098125457763672,
0.05092047154903412,
0.04751202464103699,
0.051157981157302856,
-0.0323965921998024,
0.03957454487681389,
-0.005929593462496996,
0.009440327063202858,
0.0695173591375351,
0.11681905388832092,
0.01935798116028309,
-0.020784467458724976,
-0.031339965760707855,
0.02941913530230522,
-0.0012111954856663942,
-0.03983239084482193,
-0.0540367066860199,
-0.0003985162475146353,
0.05303341895341873,
-0.03328021988272667,
-0.018338492140173912,
0.0054777213372290134,
-0.019703255966305733,
0.033726856112480164,
-0.02918110601603985,
0.010281999595463276,
-0.04352642595767975,
-0.034169118851423264,
-0.02105097472667694,
-0.014707744121551514,
-0.05618233233690262,
0.019440745934844017,
0.03277578949928284,
-0.0845615342259407
] | 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)`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; function onMessage(message, name) { // Received data } diagnostics\_channel.subscribe('my-channel', onMessage); diagnostics\_channel.unsubscribe('my-channel', onMessage); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); function onMessage(message, name) { // Received data } diagnostics\_channel.subscribe('my-channel', onMessage); diagnostics\_channel.unsubscribe('my-channel', onMessage); ``` #### `diagnostics\_channel.tracingChannel(nameOrChannels)` > Stability: 1 - Experimental \* `nameOrChannels` {string|TracingChannel} Channel name or object containing all the [TracingChannel Channels][] \* Returns: {TracingChannel} Collection of channels to trace with Creates a [`TracingChannel`][] wrapper for the given [TracingChannel Channels][]. If a name is given, the corresponding tracing channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of [TracingChannel Channels][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channelsByName = diagnostics\_channel.tracingChannel('my-channel'); // or... const channelsByCollection = diagnostics\_channel.tracingChannel({ start: diagnostics\_channel.channel('tracing:my-channel:start'), end: diagnostics\_channel.channel('tracing:my-channel:end'), asyncStart: diagnostics\_channel.channel('tracing:my-channel:asyncStart'), asyncEnd: diagnostics\_channel.channel('tracing:my-channel:asyncEnd'), error: diagnostics\_channel.channel('tracing:my-channel:error'), }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channelsByName = diagnostics\_channel.tracingChannel('my-channel'); // or... const channelsByCollection = diagnostics\_channel.tracingChannel({ start: diagnostics\_channel.channel('tracing:my-channel:start'), end: diagnostics\_channel.channel('tracing:my-channel:end'), asyncStart: diagnostics\_channel.channel('tracing:my-channel:asyncStart'), asyncEnd: diagnostics\_channel.channel('tracing:my-channel:asyncEnd'), error: diagnostics\_channel.channel('tracing:my-channel:error'), }); ``` ### Class: `Channel` The class `Channel` represents an individual named channel within the data pipeline. It is used to track subscribers and to publish messages when there are subscribers present. It exists as a separate object to avoid channel lookups at publish time, enabling very fast publish speeds and allowing for heavy use while incurring very minimal cost. Channels are created with [`diagnostics\_channel.channel(name)`][], constructing a channel directly with `new Channel(name)` is not supported. #### `channel.hasSubscribers` \* Returns: {boolean} If there are active subscribers Check if there are active subscribers to this channel. This is helpful if the message you want to send might be expensive to prepare. This API is optional but helpful when trying to publish messages from very performance-sensitive code. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channel = diagnostics\_channel.channel('my-channel'); if (channel.hasSubscribers) { // There are subscribers, prepare and publish message } ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); if (channel.hasSubscribers) { // There are subscribers, prepare and publish message } ``` #### `channel.publish(message)` \* `message` {any} The message to send to the channel subscribers Publish a message to any subscribers to the channel. This will trigger message handlers synchronously so they will execute within the same context. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channel = diagnostics\_channel.channel('my-channel'); channel.publish({ some: 'message', }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); channel.publish({ some: 'message', }); ``` #### `channel.subscribe(onMessage)` \* `onMessage` {Function} The handler to receive channel messages \* `message` {any} The message data \* `name` {string|symbol} The name of the channel Register a message handler to subscribe to this channel. This message handler will be run synchronously whenever a message is published to the channel. Any errors thrown in the message handler will trigger an [`'uncaughtException'`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channel = diagnostics\_channel.channel('my-channel'); channel.subscribe((message, name) => { // Received data }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); channel.subscribe((message, name) => { // Received data }); ``` #### `channel.unsubscribe(onMessage)` \* `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 [`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 = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); function onMessage(message, name) { // Received data } channel.subscribe(onMessage); channel.unsubscribe(onMessage); ``` #### `channel.bindStore(store[, transform])` > Stability: 1 - Experimental \* | 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.05353178456425667,
-0.0333658829331398,
-0.0034455934073776007,
-0.007154614664614201,
-0.047938477247953415,
-0.05196627229452133,
-0.06415290385484695,
0.012686185538768768,
0.09614814817905426,
-0.02012951485812664,
0.01725878193974495,
0.034034937620162964,
-0.07527850568294525,
-0.012336188927292824,
-0.04751938581466675,
-0.01031598448753357,
-0.04229461029171944,
0.05846955627202988,
-0.03610739856958389,
-0.023144014179706573,
0.0060338471084833145,
0.004897224251180887,
0.0632275715470314,
-0.03990142047405243,
-0.06207997351884842,
0.009431845508515835,
0.03066331148147583,
0.04899190366268158,
-0.022626113146543503,
-0.09327835589647293,
-0.054959364235401154,
0.024407655000686646,
-0.012190754525363445,
-0.07222822308540344,
0.03286946192383766,
-0.024984290823340416,
0.027527332305908203,
0.0039183893240988255,
-0.012079586274921894,
-0.04941185563802719,
0.08248843997716904,
0.04551776498556137,
0.04398515447974205,
-0.045255839824676514,
-0.02283523418009281,
0.04587366804480553,
-0.039916977286338806,
-0.021167540922760963,
-0.008106419816613197,
0.03507857769727707,
-0.002246108604595065,
-0.03952748328447342,
0.03245183080434799,
-0.045330606400966644,
0.04384424909949303,
0.06053001806139946,
0.1062496230006218,
-0.027759576216340065,
0.04815628007054329,
-0.020573923364281654,
0.05202913656830788,
0.062241267412900925,
-0.06396444886922836,
-0.033261194825172424,
-0.013691707514226437,
-0.06073548272252083,
0.020434968173503876,
-0.01747395284473896,
-0.07830414175987244,
-0.00458089355379343,
0.005880219396203756,
0.030357355251908302,
0.07803087681531906,
-0.04558891803026199,
-0.006837500259280205,
0.00729035772383213,
-0.0549289844930172,
-0.05696353316307068,
-0.03636317327618599,
-0.0267462320625782,
0.11883951723575592,
-0.0600571371614933,
0.0026909285224974155,
-0.08277767151594162,
0.080812007188797,
0.0016907081007957458,
0.057252462953329086,
0.0234716534614563,
0.00964319333434105,
0.02569982036948204,
0.05065717175602913,
-0.012554599903523922,
-0.03952343761920929,
-0.06513091176748276,
-0.046049561351537704,
-0.03178982064127922,
0.034222256392240524,
-0.03021884150803089,
0.04169299826025963,
-0.010461187921464443,
0.017125532031059265,
0.004880910273641348,
0.0988377034664154,
0.10693584382534027,
0.10137024521827698,
-0.0560838021337986,
0.07457651942968369,
0.10848183184862137,
-0.12576211988925934,
0.018913231790065765,
0.022119594737887383,
0.021308718249201775,
0.009281126782298088,
0.019763225689530373,
2.631400674981324e-33,
-0.03297337889671326,
0.010299096815288067,
-0.09159708023071289,
-0.0032396006863564253,
0.055073902010917664,
0.015960080549120903,
-0.012543715536594391,
0.01270955242216587,
-0.010097021237015724,
0.055376868695020676,
0.0017270612297579646,
0.07104426622390747,
-0.0002245506620965898,
-0.06756515800952911,
-0.016578596085309982,
-0.034801237285137177,
0.046987783163785934,
-0.027236666530370712,
0.01763252168893814,
-0.014014890417456627,
0.04827958345413208,
0.023385656997561455,
-0.024269375950098038,
0.032389651983976364,
0.01126000378280878,
-0.03360823541879654,
0.02899879217147827,
-0.006730604451149702,
0.010370932519435883,
-0.025205275043845177,
0.034424591809511185,
0.03210051357746124,
0.018915103748440742,
0.0796203687787056,
0.04450303316116333,
-0.03975660353899002,
-0.04059993475675583,
-0.0047212643548846245,
-0.08902360498905182,
-0.060141369700431824,
0.05359511822462082,
0.016846315935254097,
-0.13235874474048615,
-0.04467619210481644,
-0.009031456895172596,
-0.08283420652151108,
-0.02837679535150528,
-0.06552442908287048,
0.08726590126752853,
-0.15417470037937164,
0.04995422065258026,
0.06762388348579407,
0.07223597913980484,
-0.07019378244876862,
0.030741361901164055,
0.018186092376708984,
-0.008086247369647026,
-0.011721163988113403,
-0.04819423332810402,
-0.0361783504486084,
-0.003292171284556389,
-0.04157926142215729,
0.06293561309576035,
-0.01982215978205204,
-0.01650206930935383,
0.010195254348218441,
-0.07536298036575317,
0.013581426814198494,
-0.037846025079488754,
-0.08927647769451141,
-0.03674815595149994,
0.0034722043201327324,
0.00030399957904592156,
-0.001089959405362606,
-0.05086609348654747,
-0.011270074173808098,
-0.06572358310222626,
0.03865143656730652,
-0.00628541549667716,
0.004081379156559706,
0.07236262410879135,
-0.04768102616071701,
-0.031338825821876526,
0.09997478872537613,
0.10890165716409683,
-0.020473826676607132,
-0.024797173216938972,
-0.05232739448547363,
-0.00007728493073955178,
0.10026029497385025,
-0.02761959284543991,
0.03842122107744217,
-0.05578137934207916,
-0.018983472138643265,
-0.044685788452625275,
-5.256669677555171e-33,
-0.046787139028310776,
0.10116207599639893,
-0.07805687189102173,
0.014410005882382393,
-0.08178985863924026,
-0.05260529741644859,
0.05306973308324814,
0.0808815136551857,
-0.01775868609547615,
-0.04197274520993233,
0.004017557017505169,
-0.037810031324625015,
0.022861769422888756,
0.009942847304046154,
-0.008006898686289787,
0.12049316614866257,
-0.0675530955195427,
-0.019674479961395264,
-0.08545268326997757,
-0.03650445491075516,
-0.011178744956851006,
0.0732392966747284,
-0.020590508356690407,
-0.010408306494355202,
-0.1343967616558075,
0.017138171941041946,
0.0633106678724289,
0.06325136125087738,
-0.011439790949225426,
-0.0382939837872982,
-0.01443735882639885,
0.08486003428697586,
0.008729428984224796,
0.023604122921824455,
0.0007768627256155014,
-0.06903402507305145,
0.02463214099407196,
0.09911015629768372,
0.017869235947728157,
-0.0045186313800513744,
0.11046715825796127,
0.09092602133750916,
-0.09642426669597626,
-0.03588520362973213,
-0.02063826471567154,
0.05132627859711647,
0.01264280267059803,
0.019159765914082527,
0.03801976144313812,
-0.014109089970588684,
-0.053656354546546936,
-0.08483248203992844,
0.07222872972488403,
-0.013479618355631828,
-0.05350854992866516,
0.05955398827791214,
0.050939563661813736,
-0.010707010515034199,
0.07179735600948334,
-0.037894703447818756,
0.011812523007392883,
-0.11459918320178986,
-0.06023067235946655,
0.0014953238423913717,
0.04779539629817009,
-0.05032675713300705,
-0.01540743000805378,
0.041700925678014755,
0.09162340313196182,
-0.048388004302978516,
-0.03826050087809563,
0.018446531146764755,
-0.0727873295545578,
-0.04058067500591278,
0.0687456801533699,
0.08060438930988312,
-0.07857968658208847,
-0.09061183780431747,
-0.06429845839738846,
0.07390736043453217,
-0.04208153858780861,
0.010774368420243263,
-0.041815273463726044,
0.0020966175943613052,
-0.0023938848171383142,
-0.03125077113509178,
-0.002576919272542,
0.06786155700683594,
-0.011610119603574276,
-0.03068428300321102,
0.0378451868891716,
0.03869444504380226,
-0.02407829463481903,
-0.03114156424999237,
-0.034893300384283066,
-4.24504520424307e-8,
-0.05136393755674362,
-0.11710000038146973,
0.014377114363014698,
-0.026524031534790993,
0.06014258414506912,
-0.01575283333659172,
-0.011703332886099815,
-0.0018610345432534814,
-0.010609578341245651,
-0.04169661924242973,
-0.04782940447330475,
0.033870041370391846,
-0.01623234897851944,
-0.03367779403924942,
0.023323161527514458,
-0.0830283984541893,
-0.07186532765626907,
0.02238309197127819,
-0.004278955049812794,
-0.02823399007320404,
0.06103162840008736,
0.015287971124053001,
0.021825268864631653,
0.1009221076965332,
0.016935762017965317,
-0.05499204993247986,
0.05707358941435814,
0.041208792477846146,
-0.0538380965590477,
-0.04468124732375145,
-0.06740790605545044,
0.024333439767360687,
0.06926362216472626,
-0.024950584396719933,
-0.08628196269273758,
0.06121702119708061,
0.03929368034005165,
-0.05157485231757164,
0.024899758398532867,
0.08690276741981506,
0.10333560407161713,
0.048687830567359924,
-0.009213101118803024,
0.03989829868078232,
-0.05943839251995087,
-0.02635142393410206,
-0.015893710777163506,
-0.007037040777504444,
0.1247265636920929,
0.013936277478933334,
-0.021708251908421516,
0.015848245471715927,
-0.033991117030382156,
-0.00873233936727047,
-0.035394832491874695,
-0.056619204580783844,
0.007758804131299257,
0.002987475832924247,
-0.04650938883423805,
0.019201574847102165,
0.031170401722192764,
0.0002984552120324224,
-0.024142669513821602,
-0.11624868959188461
] | 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 = require('node:diagnostics\_channel'); const channel = diagnostics\_channel.channel('my-channel'); function onMessage(message, name) { // Received data } channel.subscribe(onMessage); channel.unsubscribe(onMessage); ``` #### `channel.bindStore(store[, transform])` > Stability: 1 - Experimental \* `store` {AsyncLocalStorage} The store to which to bind the context data \* `transform` {Function} Transform context data before setting the store context When [`channel.runStores(context, ...)`][] is called, the given context data will be applied to any store bound to the channel. If the store has already been bound the previous `transform` function will be replaced with the new one. The `transform` function may be omitted to set the given context data as the context directly. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; import { AsyncLocalStorage } from 'node:async\_hooks'; const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store, (data) => { return { data }; }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const { AsyncLocalStorage } = require('node:async\_hooks'); const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store, (data) => { return { data }; }); ``` #### `channel.unbindStore(store)` > Stability: 1 - Experimental \* `store` {AsyncLocalStorage} The store to unbind from the channel. \* Returns: {boolean} `true` if the store was found, `false` otherwise. Remove a message handler previously registered to this channel with [`channel.bindStore(store)`][]. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; import { AsyncLocalStorage } from 'node:async\_hooks'; const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store); channel.unbindStore(store); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const { AsyncLocalStorage } = require('node:async\_hooks'); const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store); channel.unbindStore(store); ``` #### `channel.runStores(context, fn[, thisArg[, ...args]])` > Stability: 1 - Experimental \* `context` {any} Message to send to subscribers and bind to stores \* `fn` {Function} Handler to run within the entered storage context \* `thisArg` {any} The receiver to be used for the function call. \* `...args` {any} Optional arguments to pass to the function. Applies the given data to any AsyncLocalStorage instances bound to the channel for the duration of the given function, then publishes to the channel within the scope of that data is applied to the stores. If a transform function was given to [`channel.bindStore(store)`][] it will be applied to transform the message data before it becomes the context value for the store. The prior storage context is accessible from within the transform function in cases where context linking is required. The context applied to the store should be accessible in any async code which continues from execution which began during the given function, however there are some situations in which [context loss][] may occur. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; import { AsyncLocalStorage } from 'node:async\_hooks'; const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store, (message) => { const parent = store.getStore(); return new Span(message, parent); }); channel.runStores({ some: 'message' }, () => { store.getStore(); // Span({ some: 'message' }) }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const { AsyncLocalStorage } = require('node:async\_hooks'); const store = new AsyncLocalStorage(); const channel = diagnostics\_channel.channel('my-channel'); channel.bindStore(store, (message) => { const parent = store.getStore(); return new Span(message, parent); }); channel.runStores({ some: 'message' }, () => { store.getStore(); // Span({ some: 'message' }) }); ``` ### Class: `TracingChannel` > Stability: 1 - Experimental The class `TracingChannel` is a collection of [TracingChannel 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 `TracingChannel` at the top-level of the file | 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.019086036831140518,
0.016719646751880646,
0.012901214882731438,
0.023627150803804398,
-0.018052835017442703,
-0.08249519765377045,
-0.06521270424127579,
0.03502534329891205,
0.049678392708301544,
0.012222187593579292,
-0.0002617642458062619,
0.014701584354043007,
-0.0606035552918911,
-0.04035542905330658,
-0.03774917870759964,
0.01564904674887657,
-0.01712052896618843,
0.07425931096076965,
-0.015056470409035683,
-0.04210842400789261,
0.026507016271352768,
0.0005098379915580153,
0.08866969496011734,
-0.07914891093969345,
-0.06513288617134094,
-0.024788249284029007,
0.013364155776798725,
0.04973595216870308,
0.025721454992890358,
-0.07473719120025635,
-0.012470290996134281,
0.024937914684414864,
-0.035750772804021835,
-0.04928360879421234,
0.055317118763923645,
-0.029124898836016655,
0.03689879551529884,
-0.002923791529610753,
0.0036106000188738108,
-0.06078704819083214,
0.08191822469234467,
0.01278367917984724,
0.13090087473392487,
-0.013740714639425278,
0.045311544090509415,
0.05678094923496246,
-0.010238475166261196,
-0.0008179713040590286,
-0.007355470675975084,
0.015593252144753933,
-0.014684636145830154,
-0.024367202073335648,
0.059610020369291306,
-0.028596900403499603,
0.060881201177835464,
0.013520968146622181,
0.08282095938920975,
-0.02572418376803398,
0.014557613991200924,
-0.022400515154004097,
0.052430301904678345,
0.056254997849464417,
-0.05408160015940666,
-0.04372334107756615,
-0.028661059215664864,
-0.05460856482386589,
0.02389857918024063,
0.03206793963909149,
-0.03623078018426895,
-0.012012739665806293,
-0.01103940512984991,
0.029014145955443382,
0.07202263921499252,
-0.017592912539839745,
0.0046433620154857635,
0.010140693746507168,
-0.03145073726773262,
-0.0669073760509491,
-0.0437840111553669,
-0.025688238441944122,
0.09704355150461197,
-0.05220220983028412,
0.00025191609165631235,
-0.03860656917095184,
0.08177684247493744,
0.010122939012944698,
0.03461744263768196,
0.028785336762666702,
0.006078563164919615,
0.02683245576918125,
0.07241564989089966,
-0.030385473743081093,
-0.07622145861387253,
-0.03607597574591637,
0.0036396102514117956,
-0.05677703022956848,
0.04579734802246094,
-0.03376486524939537,
0.10508843511343002,
-0.02070511318743229,
0.026347262784838676,
0.045945096760988235,
0.07516166567802429,
0.08656011521816254,
0.025666898116469383,
-0.0012107634684070945,
0.09379247575998306,
0.11309630423784256,
-0.10123330354690552,
-0.012745819985866547,
-0.019158881157636642,
0.006653704680502415,
0.029842257499694824,
0.045594919472932816,
3.670118543903761e-33,
-0.03444128483533859,
-0.03381219878792763,
-0.04916878789663315,
0.03478095680475235,
0.046648524701595306,
0.025429492816329002,
0.03309803456068039,
-0.025060290470719337,
-0.061724089086055756,
0.0037976193707436323,
0.005310822743922472,
0.08736833184957504,
-0.03866960480809212,
-0.10773760080337524,
-0.0236530601978302,
-0.059843115508556366,
0.029119890183210373,
-0.004478393122553825,
0.09708946943283081,
-0.010252760723233223,
0.030271295458078384,
0.03762362152338028,
-0.02398315630853176,
-0.029899844899773598,
0.03372467681765556,
-0.0551605299115181,
0.011590900830924511,
-0.005365876480937004,
-0.02709239535033703,
-0.009799538180232048,
0.0049887122586369514,
0.06064335256814957,
0.011493507772684097,
0.06580083072185516,
0.04049687460064888,
-0.06190212443470955,
-0.05022279545664787,
-0.00003937531801057048,
-0.10698004812002182,
-0.08678864687681198,
0.06603962182998657,
0.020921966060996056,
-0.09532342106103897,
-0.009051239117980003,
-0.037466030567884445,
-0.09812162071466446,
-0.037944480776786804,
-0.049321722239255905,
0.06200743466615677,
-0.10680393129587173,
0.006953229196369648,
0.06219007819890976,
-0.0011767869582399726,
-0.06927148997783661,
0.03503446653485298,
0.00664529437199235,
-0.0073028504848480225,
-0.05928178131580353,
-0.04432787746191025,
-0.01832916960120201,
-0.03870471566915512,
-0.0528128556907177,
0.057291194796562195,
-0.01603732444345951,
0.03213188797235489,
0.006101205945014954,
-0.11121497303247452,
-0.02915315143764019,
-0.045517321676015854,
-0.10711251944303513,
-0.03831223398447037,
-0.014800437726080418,
-0.006376456003636122,
0.017817649990320206,
-0.06786344945430756,
0.011424385011196136,
-0.0990222692489624,
0.07896418124437332,
-0.09812600165605545,
-0.0358315110206604,
0.09848427027463913,
-0.014962544664740562,
-0.058339670300483704,
0.14716900885105133,
0.09746915102005005,
-0.005659610498696566,
-0.0281684547662735,
-0.049543630331754684,
-0.014135405421257019,
0.08216582983732224,
-0.026768960058689117,
0.005206234287470579,
0.03686746582388878,
-0.034376610070466995,
-0.03183921054005623,
-5.377702616677665e-33,
-0.027650484815239906,
0.02670198492705822,
-0.0791509747505188,
0.04001495987176895,
-0.05144315958023071,
-0.05361182987689972,
0.05621758848428726,
0.04574033245444298,
-0.04161527752876282,
-0.011246854439377785,
-0.02579135075211525,
-0.030330685898661613,
-0.002746298210695386,
0.023402318358421326,
-0.01997375674545765,
0.07419480383396149,
-0.0030078680720180273,
-0.022771622985601425,
-0.025729484856128693,
-0.018540238961577415,
-0.004281535744667053,
0.05646789073944092,
-0.060951266437768936,
0.031573645770549774,
-0.1255675107240677,
0.001548852538689971,
0.008938883431255817,
0.04317814111709595,
-0.008450079709291458,
-0.05138033628463745,
-0.028541747480630875,
0.05190495774149895,
-0.02440868318080902,
0.04771513491868973,
-0.010771598666906357,
-0.07742281258106232,
-0.004509845282882452,
0.07686782628297806,
0.0016550365835428238,
-0.002344059059396386,
0.106874480843544,
0.10598985105752945,
-0.12122635543346405,
-0.0433969646692276,
0.025643059983849525,
0.0685940757393837,
0.026393061503767967,
0.005673243664205074,
0.017051788046956062,
-0.0006340898107737303,
-0.052148882299661636,
-0.07305586338043213,
0.05151466652750969,
-0.022465093061327934,
-0.05908255651593208,
0.05628342926502228,
0.09308785945177078,
-0.03875759616494179,
0.11046174168586731,
-0.04194734990596771,
0.01919497922062874,
-0.13564804196357727,
-0.01387934759259224,
-0.05214407667517662,
0.06372404098510742,
-0.03364889323711395,
-0.0038238081615418196,
0.03609278053045273,
0.09770484268665314,
-0.04055535048246384,
-0.04133208841085434,
-0.011746775358915329,
-0.019247595220804214,
-0.02744881995022297,
0.090218685567379,
0.010829794220626354,
-0.05844283103942871,
-0.1156308725476265,
-0.017200598493218422,
0.05746782198548317,
-0.08723419904708862,
0.036252155900001526,
-0.042301248759031296,
0.031391728669404984,
0.008320641703903675,
-0.003013020846992731,
0.01230537984520197,
0.06982036679983139,
0.014572300016880035,
-0.07317033410072327,
0.010080890730023384,
0.03040691465139389,
-0.09335584193468094,
-0.023868737742304802,
0.01728484220802784,
-4.782168971928513e-8,
-0.1102382093667984,
-0.09392302483320236,
0.0014706210931763053,
0.022064007818698883,
0.0521344318985939,
-0.02478618733584881,
0.02540004625916481,
-0.01579335704445839,
0.05739836022257805,
-0.021349282935261726,
-0.057264894247055054,
-0.00006199730705702677,
0.0044775172136723995,
-0.042123403400182724,
-0.025301989167928696,
-0.04699060693383217,
-0.02012002095580101,
0.022663384675979614,
0.010715062730014324,
-0.020738134160637856,
0.066385917365551,
0.022860370576381683,
0.0379900261759758,
0.09942968934774399,
0.04278535395860672,
-0.07843483239412308,
0.08631688356399536,
0.06448884308338165,
-0.013186483643949032,
-0.015375449322164059,
-0.06897278130054474,
0.0021651973947882652,
0.08250126242637634,
-0.013682075776159763,
-0.11193212866783142,
0.022892454639077187,
0.07236636430025101,
-0.03489101678133011,
0.060389962047338486,
0.045318443328142166,
0.09871820360422134,
0.03155231103301048,
-0.011446492746472359,
0.05941985175013542,
-0.036666691303253174,
0.0022045052610337734,
0.01606816053390503,
0.015810951590538025,
0.12398771196603775,
0.024438265711069107,
-0.029068509116768837,
-0.029217999428510666,
-0.004945298656821251,
-0.011771060526371002,
0.021500032395124435,
-0.09170600771903992,
-0.006516831927001476,
-0.01178919617086649,
-0.014961164444684982,
0.03560163080692291,
0.0009893112583085895,
0.020664867013692856,
-0.06629325449466705,
-0.10090740025043488
] | 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 `TracingChannel` at the top-level of the file rather than creating them dynamically. #### `tracingChannel.subscribe(subscribers)` \* `subscribers` {Object} Set of [TracingChannel Channels][] subscribers \* `start` {Function} The [`start` event][] subscriber \* `end` {Function} The [`end` event][] subscriber \* `asyncStart` {Function} The [`asyncStart` event][] subscriber \* `asyncEnd` {Function} The [`asyncEnd` event][] subscriber \* `error` {Function} The [`error` event][] subscriber Helper to subscribe a collection of functions to the corresponding channels. This is the same as calling [`channel.subscribe(onMessage)`][] on each channel individually. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.subscribe({ start(message) { // Handle start message }, end(message) { // Handle end message }, asyncStart(message) { // Handle asyncStart message }, asyncEnd(message) { // Handle asyncEnd message }, error(message) { // Handle error message }, }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.subscribe({ start(message) { // Handle start message }, end(message) { // Handle end message }, asyncStart(message) { // Handle asyncStart message }, asyncEnd(message) { // Handle asyncEnd message }, error(message) { // Handle error message }, }); ``` #### `tracingChannel.unsubscribe(subscribers)` \* `subscribers` {Object} Set of [TracingChannel Channels][] subscribers \* `start` {Function} The [`start` event][] subscriber \* `end` {Function} The [`end` event][] subscriber \* `asyncStart` {Function} The [`asyncStart` event][] subscriber \* `asyncEnd` {Function} The [`asyncEnd` event][] subscriber \* `error` {Function} The [`error` event][] subscriber \* Returns: {boolean} `true` if all handlers were successfully unsubscribed, and `false` otherwise. Helper to unsubscribe a collection of functions from the corresponding channels. This is the same as calling [`channel.unsubscribe(onMessage)`][] on each channel individually. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.unsubscribe({ start(message) { // Handle start message }, end(message) { // Handle end message }, asyncStart(message) { // Handle asyncStart message }, asyncEnd(message) { // Handle asyncEnd message }, error(message) { // Handle error message }, }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.unsubscribe({ start(message) { // Handle start message }, end(message) { // Handle end message }, asyncStart(message) { // Handle asyncStart message }, asyncEnd(message) { // Handle asyncEnd message }, error(message) { // Handle error message }, }); ``` #### `tracingChannel.traceSync(fn[, context[, thisArg[, ...args]]])` \* `fn` {Function} Function to wrap a trace around \* `context` {Object} Shared object to correlate events through \* `thisArg` {any} The receiver to be used for the function call \* `...args` {any} Optional arguments to pass to the function \* Returns: {any} The return value of the given function Trace a synchronous function call. This will always produce a [`start` event][] and [`end` event][] around the execution and may produce an [`error` event][] if the given function throws an error. This will run the given function using [`channel.runStores(context, ...)`][] on the `start` channel which ensures all events should have any bound stores set to match this trace context. To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions which are added after the trace begins will not receive future events from that trace, only future traces will be seen. ```mjs import 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('my-channel'); channels.traceSync(() => { // Do something }, { some: 'thing', }); ``` #### `tracingChannel.tracePromise(fn[, context[, thisArg[, ...args]]])` \* `fn` {Function} Promise-returning function | 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.028416162356734276,
-0.021400239318609238,
-0.03399965912103653,
-0.032447319477796555,
-0.026048844680190086,
-0.08166622370481491,
-0.08949645608663559,
0.04174644127488136,
0.03537674993276596,
-0.04526931792497635,
0.01858636364340782,
-0.031988177448511124,
-0.07659666240215302,
-0.03232654556632042,
-0.0476827472448349,
0.04401735961437225,
-0.05476830527186394,
0.10367833822965622,
-0.005559779237955809,
-0.03925144299864769,
0.009302395395934582,
-0.025842484086751938,
0.048028457909822464,
0.03384296968579292,
-0.07594755291938782,
-0.028152167797088623,
0.0061380937695503235,
0.10585497319698334,
-0.029083844274282455,
-0.06603950262069702,
0.006449982989579439,
-0.05314115434885025,
-0.10699315369129181,
-0.00566474674269557,
-0.045480240136384964,
-0.07327761501073837,
0.034376952797174454,
0.015119895339012146,
0.0060948594473302364,
-0.038208942860364914,
0.08877307176589966,
0.0685989111661911,
0.027451632544398308,
-0.05029579624533653,
-0.0478878952562809,
-0.006601728033274412,
-0.04405790939927101,
-0.022929809987545013,
-0.017330555245280266,
0.011943253688514233,
0.03190678358078003,
0.029252100735902786,
0.042354948818683624,
-0.028309548273682594,
0.06305515021085739,
0.11065463721752167,
0.05687708407640457,
-0.12699511647224426,
0.02979247272014618,
-0.05122700706124306,
0.033455803990364075,
0.05399342626333237,
-0.07064395397901535,
-0.016178147867321968,
-0.03363766148686409,
-0.04707195609807968,
-0.06408236920833588,
0.027285197749733925,
-0.0378701351583004,
0.030159827321767807,
0.010987923480570316,
0.04067340865731239,
0.11610541492700577,
-0.024849165230989456,
-0.004274947103112936,
0.02970375306904316,
0.008391320705413818,
-0.08557995408773422,
0.013039461337029934,
0.05406533554196358,
0.042941126972436905,
-0.01443209033459425,
0.04269018396735191,
0.007977818138897419,
-0.0047212569043040276,
0.05070958659052849,
0.016133172437548637,
-0.038493841886520386,
0.018924275413155556,
0.07064715772867203,
0.048090506345033646,
-0.005771160125732422,
-0.09060335159301758,
-0.06262103468179703,
-0.004393832758069038,
-0.03048410452902317,
-0.002763984492048621,
-0.054171204566955566,
0.010983827523887157,
-0.01584528386592865,
-0.0035784479696303606,
0.08143296092748642,
0.10487890988588333,
0.03305999934673309,
0.051712945103645325,
-0.010705307126045227,
0.1151857078075409,
0.11585579812526703,
-0.01652449183166027,
0.032260116189718246,
-0.012056862935423851,
0.08632668107748032,
-0.0430334210395813,
0.010709812864661217,
3.940959789172909e-33,
0.020673783496022224,
0.0013247501337900758,
-0.09657159447669983,
0.017239682376384735,
0.06109960749745369,
0.014296087436378002,
0.04225221648812294,
-0.018670704215765,
-0.040042534470558167,
0.05998682603240013,
-0.03932517021894455,
0.09427109360694885,
-0.05149329453706741,
0.012038689106702805,
0.006836899556219578,
-0.031142519786953926,
-0.014597303234040737,
0.045625898987054825,
-0.05515359714627266,
-0.017301224172115326,
-0.017896359786391258,
0.03472989425063133,
-0.03615156188607216,
-0.002291169948875904,
0.056971631944179535,
0.0014974229270592332,
0.009139308705925941,
0.07074826210737228,
0.01018246728926897,
-0.007161153946071863,
0.03188518434762955,
-0.0170589592307806,
-0.016601594164967537,
0.035048604011535645,
0.05175924673676491,
-0.060464125126600266,
-0.04434354230761528,
-0.04396527260541916,
-0.09106197208166122,
-0.037972740828990936,
-0.0187645573168993,
-0.010546175763010979,
-0.12104232609272003,
-0.023405756801366806,
-0.06348792463541031,
-0.059150129556655884,
-0.06393499672412872,
0.010309749282896519,
0.10828143358230591,
-0.034746624529361725,
0.04268653690814972,
0.06500566005706787,
0.059486549347639084,
-0.0721883773803711,
0.1353563666343689,
-0.014937241561710835,
-0.04535100609064102,
0.0031761950813233852,
0.011639001779258251,
-0.0012992874253541231,
0.0749683603644371,
-0.05209149792790413,
-0.03838937729597092,
0.00773219857364893,
0.012441852129995823,
0.027990510687232018,
-0.0076530491933226585,
0.011456453241407871,
0.06676164269447327,
-0.04818786680698395,
-0.0854569748044014,
0.05437774956226349,
-0.03628932312130928,
0.009464805945754051,
0.011937649920582771,
0.010050434619188309,
-0.06831695139408112,
-0.02825494296848774,
-0.04103834182024002,
-0.023702993988990784,
-0.06723222136497498,
-0.04609933868050575,
-0.04734250530600548,
0.0707727000117302,
0.039946548640728,
0.024915898218750954,
0.00047639402328059077,
-0.07096779346466064,
-0.06561670452356339,
0.0025157511699944735,
-0.043084289878606796,
0.06108570098876953,
0.027096474543213844,
-0.0525711253285408,
-0.013173534534871578,
-5.6509811760148455e-33,
0.0016767466440796852,
0.03866134583950043,
-0.06472569704055786,
0.057803139090538025,
-0.0747896060347557,
-0.06090792641043663,
0.02473466843366623,
-0.020268922671675682,
0.04749879986047745,
0.005458008963614702,
-0.06174207851290703,
0.004683067090809345,
-0.06688325107097626,
-0.005707449745386839,
0.05056699737906456,
0.006146231200546026,
-0.03205075114965439,
-0.09357091039419174,
-0.000619137252215296,
-0.06336656957864761,
-0.01693156734108925,
0.04816630482673645,
-0.02086855098605156,
0.010896090418100357,
-0.06750830262899399,
-0.016680506989359856,
0.1240101009607315,
0.0013306787004694343,
-0.016499202698469162,
-0.032743901014328,
-0.03487972170114517,
0.03172750025987625,
0.00009496022539678961,
0.00367371435277164,
0.011602523736655712,
-0.024359621107578278,
0.07070210576057434,
0.0757334753870964,
-0.009016846306622028,
-0.1282222867012024,
0.12261359393596649,
0.04644802212715149,
-0.0008710125111974776,
-0.07315722852945328,
-0.046046286821365356,
0.043746694922447205,
-0.00005120775676914491,
0.06650274991989136,
-0.0576079823076725,
-0.053195491433143616,
0.020673682913184166,
-0.07219786942005157,
0.027498282492160797,
0.03153069689869881,
-0.00666243489831686,
0.12402115762233734,
0.13256071507930756,
-0.033578936010599136,
0.09050412476062775,
-0.060312796384096146,
-0.022511892020702362,
-0.07276425510644913,
0.00515943206846714,
-0.017704566940665245,
0.00623884005472064,
-0.026173004880547523,
-0.010685878805816174,
-0.07268200069665909,
0.017105530947446823,
0.0261217150837183,
0.002815915271639824,
-0.04661182686686516,
-0.09349516779184341,
0.004639587830752134,
0.03256354480981827,
0.010094554163515568,
-0.07091107219457626,
-0.10679729282855988,
-0.03084552474319935,
0.03650564327836037,
-0.09372047334909439,
0.041121382266283035,
0.013599502854049206,
0.0448736809194088,
0.02294839359819889,
-0.012457153759896755,
0.013856315985321999,
0.04678664356470108,
0.038470566272735596,
-0.03722676262259483,
0.021198393777012825,
0.06927396357059479,
-0.04857592657208443,
0.037094004452228546,
-0.055094294250011444,
-5.649173928645723e-8,
-0.11800526082515717,
-0.039608512073755264,
-0.06507040560245514,
-0.022046245634555817,
0.020952316001057625,
0.03130047023296356,
0.04021286964416504,
-0.011939655989408493,
0.030487138777971268,
-0.00933623407036066,
-0.0109780952334404,
0.003947248682379723,
0.03833632916212082,
-0.007687507197260857,
0.06935012340545654,
-0.03326142206788063,
-0.013799880631268024,
0.05609903857111931,
-0.06516288220882416,
-0.017452796921133995,
0.0442509800195694,
0.020623911172151566,
-0.017520003020763397,
0.03184923902153969,
-0.016783619299530983,
0.013475092127919197,
0.07628130912780762,
0.12658414244651794,
-0.00577879510819912,
-0.059891268610954285,
0.01339581049978733,
0.06127876415848732,
0.08363131433725357,
0.041112594306468964,
-0.10543512552976608,
0.06318117678165436,
0.022463878616690636,
-0.052216190844774246,
-0.024111241102218628,
0.10489621013402939,
0.09242070466279984,
-0.06548202037811279,
0.02908853255212307,
0.04693395644426346,
0.007448481395840645,
-0.03059956431388855,
-0.07624585926532745,
-0.003484673798084259,
0.06256049126386642,
0.008606672286987305,
-0.029479624703526497,
-0.013767216354608536,
-0.007884437218308449,
0.07102948427200317,
-0.013558978214859962,
-0.019659578800201416,
0.023263562470674515,
-0.06954441964626312,
-0.014199960045516491,
0.054328106343746185,
0.003308345330879092,
0.10967570543289185,
0.039764754474163055,
-0.02939954586327076
] | 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('my-channel'); channels.traceSync(() => { // Do something }, { some: 'thing', }); ``` #### `tracingChannel.tracePromise(fn[, context[, thisArg[, ...args]]])` \* `fn` {Function} Promise-returning function to wrap a trace around \* `context` {Object} Shared object to correlate trace events through \* `thisArg` {any} The receiver to be used for the function call \* `...args` {any} Optional arguments to pass to the function \* Returns: {Promise} Chained from promise returned by the given function Trace a promise-returning function call. This will always produce a [`start` event][] and [`end` event][] around the synchronous portion of the function execution, and will produce an [`asyncStart` event][] and [`asyncEnd` event][] when a promise continuation is reached. It may also produce an [`error` event][] if the given function throws an error or the returned promise rejects. This will run the given function using [`channel.runStores(context, ...)`][] on the `start` channel which ensures all events should have any bound stores set to match this trace context. To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions which are added after the trace begins will not receive future events from that trace, only future traces will be seen. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.tracePromise(async () => { // Do something }, { some: 'thing', }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.tracePromise(async () => { // Do something }, { some: 'thing', }); ``` #### `tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])` \* `fn` {Function} callback using function to wrap a trace around \* `position` {number} Zero-indexed argument position of expected callback (defaults to last argument if `undefined` is passed) \* `context` {Object} Shared object to correlate trace events through (defaults to `{}` if `undefined` is passed) \* `thisArg` {any} The receiver to be used for the function call \* `...args` {any} arguments to pass to the function (must include the callback) \* Returns: {any} The return value of the given function Trace a callback-receiving function call. The callback is expected to follow the error as first arg convention typically used. This will always produce a [`start` event][] and [`end` event][] around the synchronous portion of the function execution, and will produce a [`asyncStart` event][] and [`asyncEnd` event][] around the callback execution. It may also produce an [`error` event][] if the given function throws or the first argument passed to the callback is set. This will run the given function using [`channel.runStores(context, ...)`][] on the `start` channel which ensures all events should have any bound stores set to match this trace context. To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions which are added after the trace begins will not receive future events from that trace, only future traces will be seen. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.traceCallback((arg1, callback) => { // Do something callback(null, 'result'); }, 1, { some: 'thing', }, thisArg, arg1, callback); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel('my-channel'); channels.traceCallback((arg1, callback) => { // Do something callback(null, 'result'); }, 1, { 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 = diagnostics\_channel.tracingChannel('my-channel'); const myStore = new AsyncLocalStorage(); // The start channel sets the | 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.048735328018665314,
0.027925586327910423,
-0.029208488762378693,
-0.04248405620455742,
0.02761380560696125,
-0.06748397648334503,
-0.05039317533373833,
0.0024140533059835434,
0.022837238386273384,
-0.03040790557861328,
-0.024374430999159813,
-0.05194064974784851,
-0.09948686510324478,
-0.021670298650860786,
-0.034100014716386795,
0.028040247038006783,
-0.025128230452537537,
0.048774201422929764,
-0.008090129122138023,
-0.1224101334810257,
0.04555860161781311,
-0.030085748061537743,
0.12394149601459503,
-0.014504668302834034,
-0.08669102936983109,
0.0038315344136208296,
-0.028696591034531593,
0.07168257981538773,
0.08181688189506531,
-0.08138719946146011,
-0.028976276516914368,
0.05226917937397957,
-0.06879279762506485,
0.040084075182676315,
0.02662067301571369,
-0.07494615018367767,
0.003026121063157916,
-0.030752861872315407,
0.005399477202445269,
-0.0466509573161602,
0.04748911410570145,
0.0017595492536202073,
0.016783103346824646,
0.009976635687053204,
-0.07412051409482956,
0.01915125548839569,
-0.004214699380099773,
-0.05070192739367485,
-0.04785587638616562,
0.059536371380090714,
0.017140556126832962,
0.06020554155111313,
0.0017696733120828867,
0.004023754969239235,
0.07854779064655304,
0.06774384528398514,
0.1268763393163681,
-0.060900162905454636,
0.031091662123799324,
0.003744090674445033,
0.06379768997430801,
0.03380855172872543,
-0.019022656604647636,
-0.021131517365574837,
0.023526521399617195,
-0.03146524727344513,
-0.014838616363704205,
-0.02193332090973854,
-0.01501118391752243,
0.0202036090195179,
-0.008563081733882427,
0.009019608609378338,
0.14776869118213654,
-0.049606457352638245,
-0.021968534216284752,
-0.016185594722628593,
-0.028032591566443443,
-0.07194875180721283,
-0.054977115243673325,
-0.07918055355548859,
0.0626663938164711,
-0.02027815394103527,
-0.029888825491070747,
0.013910556212067604,
-0.010377543978393078,
0.010581904090940952,
0.035678260028362274,
-0.03511414676904678,
0.001700818189419806,
0.11150451004505157,
-0.04049079492688179,
-0.06541290879249573,
0.03770109638571739,
-0.07086721807718277,
-0.0446380078792572,
-0.039927732199430466,
0.000673607864882797,
-0.024640897288918495,
0.09256432205438614,
-0.017577363178133965,
-0.0015448833582922816,
0.07879330962896347,
0.05415135994553566,
0.042804088443517685,
-0.012066809460520744,
0.0651446133852005,
0.1141006126999855,
0.1041005328297615,
-0.012651659548282623,
0.04134770855307579,
0.032343532890081406,
0.03304898738861084,
0.009722623974084854,
0.006618160288780928,
2.307497614716058e-33,
0.04385294020175934,
-0.006467378232628107,
-0.06902171671390533,
0.0019746744073927402,
0.040297962725162506,
0.03727247193455696,
0.00754242530092597,
-0.033790867775678635,
-0.07939755916595459,
0.08873359858989716,
-0.04151858016848564,
0.05821705237030983,
-0.047622859477996826,
-0.07815340161323547,
0.02717994898557663,
0.020647885277867317,
0.016209948807954788,
-0.008522086776793003,
0.009014220908284187,
0.03703201934695244,
0.010496615432202816,
-0.031074410304427147,
-0.045901861041784286,
-0.02349480800330639,
0.04220408946275711,
-0.04553389176726341,
0.005298861302435398,
0.049264974892139435,
0.006477124523371458,
-0.018658101558685303,
0.028031136840581894,
0.042915359139442444,
0.02929387055337429,
0.07605833560228348,
0.017930209636688232,
-0.018604399636387825,
-0.020428985357284546,
-0.00594828836619854,
-0.10187945514917374,
-0.05293179675936699,
0.0676002949476242,
0.022030077874660492,
-0.07529483735561371,
-0.006300556007772684,
0.003558447817340493,
-0.11091618984937668,
-0.07870873808860779,
-0.01587190106511116,
0.06717827171087265,
-0.044914137572050095,
-0.004296484868973494,
0.07702215760946274,
0.01910383626818657,
-0.09298526495695114,
0.11027512699365616,
-0.0034820802975445986,
0.011379499919712543,
0.0024507776834070683,
0.03193351998925209,
0.005813082680106163,
0.05269907787442207,
-0.04179077968001366,
-0.053313031792640686,
0.002325799548998475,
-0.02586636319756508,
0.022492533549666405,
-0.06693492084741592,
0.03483269363641739,
0.030609576031565666,
-0.03495808318257332,
-0.09224988520145416,
0.0518425814807415,
-0.0553424097597599,
-0.007197768893092871,
0.04611620306968689,
-0.01141547691076994,
-0.11705923080444336,
-0.045504339039325714,
-0.010022454895079136,
-0.07498454302549362,
-0.011354770511388779,
-0.02045973390340805,
-0.043973930180072784,
0.14221368730068207,
0.046661995351314545,
0.01596231758594513,
-0.0688416138291359,
-0.041175391525030136,
-0.03508630022406578,
0.031310390681028366,
-0.008306045085191727,
0.04928089678287506,
-0.010575502179563046,
-0.034705959260463715,
-0.06845179945230484,
-5.615608346946695e-33,
-0.031648166477680206,
0.062034573405981064,
-0.02153518609702587,
0.10185456275939941,
-0.03557639941573143,
-0.06397795677185059,
0.039929259568452835,
-0.06282221525907516,
-0.004352719988673925,
0.011106757447123528,
-0.039710450917482376,
-0.023291146382689476,
-0.008800715208053589,
0.035003356635570526,
0.03688157722353935,
0.03687223419547081,
-0.08698459714651108,
-0.0589384101331234,
0.05104990303516388,
-0.044627849012613297,
0.0020211345981806517,
0.04156586527824402,
-0.004628454335033894,
0.007049085572361946,
-0.11925940215587616,
0.022310100495815277,
0.07284779846668243,
0.020195910707116127,
0.00839317124336958,
-0.010120252147316933,
-0.04880479350686073,
0.03105071932077408,
0.0014137823600322008,
0.02979257144033909,
0.031944673508405685,
-0.06562606245279312,
0.0718231201171875,
0.060329537838697433,
-0.008816949091851711,
-0.10027787834405899,
0.09833436459302902,
0.0360284298658371,
-0.06413917988538742,
-0.08166803419589996,
-0.06443747133016586,
0.013321801088750362,
0.027255954220891,
-0.009132681414484978,
-0.027754977345466614,
-0.039093103259801865,
0.013925600796937943,
-0.03552292287349701,
-0.0204992163926363,
-0.006409022957086563,
-0.07464540749788284,
0.05492616817355156,
0.08743645995855331,
-0.07975699752569199,
0.09265948832035065,
0.00938779953867197,
-0.02632220834493637,
-0.07654691487550735,
-0.014335778541862965,
-0.02130495011806488,
0.053004443645477295,
-0.029330329969525337,
-0.03793046623468399,
-0.039213117212057114,
0.10763779282569885,
0.0666339099407196,
-0.028681881725788116,
0.05073510855436325,
-0.06097908318042755,
0.0008592772646807134,
0.05177582800388336,
0.05218378081917763,
-0.07620745897293091,
-0.14754407107830048,
0.0320877879858017,
0.10204871743917465,
-0.02269906923174858,
-0.01473347470164299,
0.01370343379676342,
0.02212325483560562,
0.06721760332584381,
-0.0011251199757680297,
-0.001452615368179977,
0.07231461256742477,
-0.020583737641572952,
-0.03700895607471466,
0.06993931531906128,
0.03607457876205444,
-0.09719599038362503,
-0.06455416232347488,
-0.015139015391469002,
-5.0185342104214214e-8,
-0.08845283836126328,
-0.0349297821521759,
-0.07524251192808151,
-0.027866916730999947,
-0.010964062064886093,
-0.03857291489839554,
0.06740330159664154,
-0.016728142276406288,
-0.00631148274987936,
-0.02175862342119217,
-0.05648055300116539,
0.021152842789888382,
0.08129283785820007,
-0.014849354512989521,
0.03315405175089836,
-0.05188676342368126,
-0.08177215605974197,
0.013874120078980923,
-0.062103793025016785,
-0.025320785120129585,
0.0067851669155061245,
0.019564997404813766,
-0.03230923041701317,
0.06755506247282028,
-0.011963608674705029,
-0.053210195153951645,
0.06824932992458344,
0.14782744646072388,
-0.0008713304996490479,
-0.01925327070057392,
-0.07061754912137985,
0.045900050550699234,
0.04549294337630272,
0.04608866944909096,
-0.08150718361139297,
0.00463617779314518,
0.004237627610564232,
-0.009729559533298016,
0.03792062774300575,
0.10690919309854507,
0.04142991825938225,
0.0008597112610004842,
0.015072230249643326,
0.04288363456726074,
-0.0019153790781274438,
-0.0676487535238266,
-0.01566440239548683,
0.015438550151884556,
0.05851735174655914,
0.005675834137946367,
-0.010182281956076622,
-0.01790967397391796,
-0.034329839050769806,
0.038738515228033066,
0.006317208055406809,
-0.027124106884002686,
-0.01851034164428711,
-0.030203213915228844,
-0.0812097042798996,
0.017740366980433464,
0.010006015188992023,
0.012630020268261433,
0.002650601789355278,
-0.07141623646020889
] | 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 = diagnostics\_channel.tracingChannel('my-channel'); const myStore = new AsyncLocalStorage(); // The start channel sets the initial store data to something // and stores that store data value on the trace context object channels.start.bindStore(myStore, (data) => { const span = new Span(data); data.span = span; return span; }); // Then asyncStart can restore from that data it stored previously channels.asyncStart.bindStore(myStore, (data) => { return data.span; }); ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const { AsyncLocalStorage } = require('node:async\_hooks'); const channels = diagnostics\_channel.tracingChannel('my-channel'); const myStore = new AsyncLocalStorage(); // The start channel sets the initial store data to something // and stores that store data value on the trace context object channels.start.bindStore(myStore, (data) => { const span = new Span(data); data.span = span; return span; }); // Then asyncStart can restore from that data it stored previously channels.asyncStart.bindStore(myStore, (data) => { return data.span; }); ``` #### `tracingChannel.hasSubscribers` \* Returns: {boolean} `true` if any of the individual channels has a subscriber, `false` if not. This is a helper method available on a [`TracingChannel`][] instance to check if any of the [TracingChannel Channels][] have subscribers. A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise. ```mjs import diagnostics\_channel from 'node:diagnostics\_channel'; const channels = diagnostics\_channel.tracingChannel('my-channel'); if (channels.hasSubscribers) { // Do something } ``` ```cjs const diagnostics\_channel = require('node:diagnostics\_channel'); const channels = diagnostics\_channel.tracingChannel('my-channel'); if (channels.hasSubscribers) { // Do something } ``` ### TracingChannel Channels A TracingChannel is a collection of several diagnostics\\_channels representing specific points in the execution lifecycle of a single traceable action. The behavior is split into five diagnostics\\_channels consisting of `start`, `end`, `asyncStart`, `asyncEnd`, and `error`. A single traceable action will share the same event object between all events, this can be helpful for managing correlation through a weakmap. These event objects will be extended with `result` or `error` values when the task "completes". In the case of a synchronous task the `result` will be the return value and the `error` will be anything thrown from the function. With callback-based async functions the `result` will be the second argument of the callback while the `error` will either be a thrown error visible in the `end` event or the first callback argument in either of the `asyncStart` or `asyncEnd` events. To ensure only correct trace graphs are formed, events should only be published if subscribers are present prior to starting the trace. Subscriptions which are added after the trace begins should not receive future events from that trace, only future traces will be seen. Tracing channels should follow a naming pattern of: \* `tracing:module.class.method:start` or `tracing:module.function:start` \* `tracing:module.class.method:end` or `tracing:module.function:end` \* `tracing:module.class.method:asyncStart` or `tracing:module.function:asyncStart` \* `tracing:module.class.method:asyncEnd` or `tracing:module.function:asyncEnd` \* `tracing:module.class.method:error` or `tracing:module.function:error` #### `start(event)` \* Name: `tracing:${name}:start` The `start` event represents the point at which a function is called. At this point the event data may contain function arguments or anything else available at the very start of the execution of the function. #### `end(event)` \* Name: `tracing:${name}:end` The `end` event represents the point at which a function call returns a value. In the case of an async function this is 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 | 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.0501277819275856,
-0.00534867076203227,
-0.01270055677741766,
0.02195226214826107,
0.08900749683380127,
-0.07822772860527039,
-0.01401763129979372,
-0.021339604631066322,
0.011244603432714939,
0.030568478628993034,
-0.033655911684036255,
0.0062429956160485744,
-0.037087246775627136,
-0.025355806574225426,
-0.04544313997030258,
0.07001606374979019,
-0.04317232221364975,
0.025633225217461586,
-0.024347223341464996,
-0.0646708756685257,
0.03727012872695923,
-0.007240799721330404,
0.13639295101165771,
-0.034222912043333054,
-0.04821809008717537,
-0.10653606802225113,
-0.006595538463443518,
0.10133936256170273,
0.06901884824037552,
-0.1263238936662674,
0.022771133109927177,
-0.019942807033658028,
-0.06858853250741959,
-0.022160708904266357,
0.027768896892666817,
-0.015203163959085941,
-0.00470118410885334,
0.04358481243252754,
0.05796445161104202,
-0.058666881173849106,
0.09551221877336502,
-0.02844625897705555,
0.09404905140399933,
0.04182055592536926,
0.002790122525766492,
-0.046154528856277466,
0.06679929792881012,
0.04560457170009613,
-0.034207526594400406,
-0.01055203564465046,
-0.03179167956113815,
0.03587893024086952,
0.060123469680547714,
0.04767067730426788,
0.04591920226812363,
0.04881216213107109,
-0.01793639548122883,
-0.045298658311367035,
-0.04947587102651596,
-0.015281337313354015,
0.057817909866571426,
0.0021850361954420805,
0.016294153407216072,
0.0132991848513484,
0.022076647728681564,
-0.06366076320409775,
0.02036803402006626,
0.016281794756650925,
-0.04888872057199478,
-0.014800991863012314,
-0.015238245017826557,
-0.020143656060099602,
0.08226743340492249,
-0.04664495214819908,
-0.004441358614712954,
0.0055184015072882175,
0.04681047052145004,
-0.08310510963201523,
-0.012847132049500942,
-0.022955724969506264,
0.01937945745885372,
-0.00257486361078918,
0.01298987865447998,
0.032328542321920395,
0.0412760004401207,
0.03941166773438454,
-0.022326165810227394,
0.04430929571390152,
-0.0033946807961910963,
0.020056573674082756,
0.05763515084981918,
-0.030669942498207092,
-0.07158555835485458,
-0.018003413453698158,
-0.03960733115673065,
-0.056681618094444275,
0.026587514206767082,
-0.04145070165395737,
0.10992617905139923,
0.024712638929486275,
0.07586555927991867,
0.09680577367544174,
0.06512948870658875,
0.040191732347011566,
-0.021681685000658035,
0.01315380074083805,
0.07653859257698059,
0.035209883004426956,
-0.046113207936286926,
0.07106611132621765,
-0.04939286783337593,
-0.012890094891190529,
0.047253116965293884,
0.005148021038621664,
3.323042449221957e-33,
-0.028208846226334572,
-0.018334122374653816,
-0.04766235873103142,
-0.006871814373880625,
-0.021978262811899185,
0.021615758538246155,
0.03264481946825981,
-0.05077942833304405,
-0.03308486565947533,
0.006447433028370142,
-0.014624928124248981,
0.028844410553574562,
-0.05564133822917938,
-0.048576418310403824,
-0.03551149740815163,
-0.057849686592817307,
0.018824489787220955,
-0.03275435417890549,
0.07265108823776245,
-0.017966022714972496,
-0.034856561571359634,
0.043269794434309006,
-0.018349315971136093,
-0.06839881837368011,
0.06786500662565231,
-0.059171658009290695,
0.0012032201047986746,
0.027963316068053246,
-0.0005020196549594402,
0.0037413074169307947,
-0.011268693953752518,
0.040007688105106354,
-0.027641532942652702,
0.028345294296741486,
-0.008692937903106213,
-0.023708369582891464,
-0.0042844596318900585,
-0.009147470816969872,
-0.08523191511631012,
-0.10113531351089478,
-0.0015440259594470263,
0.0248601995408535,
-0.0590987354516983,
-0.006781978532671928,
-0.09340490400791168,
-0.14254602789878845,
-0.03385036066174507,
0.008284720592200756,
0.03166908398270607,
-0.04564671218395233,
0.04153003916144371,
0.029970474541187286,
-0.049411591142416,
-0.08206036686897278,
0.024889301508665085,
0.0017357830656692386,
-0.01813741773366928,
-0.040356483310461044,
0.0257576834410429,
0.06364632397890091,
0.02697398141026497,
-0.05865495279431343,
-0.009925557300448418,
0.02469451352953911,
0.058867111802101135,
0.03686358779668808,
-0.06991435587406158,
-0.02614906057715416,
-0.05455603078007698,
-0.06518107652664185,
-0.07626868784427643,
-0.009891720488667488,
0.013332769274711609,
-0.02153327688574791,
0.036893580108881,
0.040369465947151184,
-0.08547954261302948,
0.056538935750722885,
-0.07918372750282288,
-0.10682271420955658,
0.050059832632541656,
-0.002594053279608488,
-0.029454568400979042,
0.11139821261167526,
0.026037737727165222,
0.01096914429217577,
0.028462186455726624,
-0.11315896362066269,
0.03861261531710625,
0.0034445365890860558,
0.009336888790130615,
-0.03088982030749321,
0.05745807662606239,
-0.03171604126691818,
-0.03074508346617222,
-4.800173058569059e-33,
-0.0007695952081121504,
-0.019338494166731834,
-0.05787204951047897,
0.06878816336393356,
-0.044280823320150375,
-0.06084771454334259,
-0.0048261298798024654,
0.04354885220527649,
-0.09599937498569489,
-0.02954460121691227,
-0.04799143597483635,
-0.0201623123139143,
-0.0003509313683025539,
0.03673670068383217,
0.02096385322511196,
0.004257014021277428,
0.03443389758467674,
-0.07737727463245392,
0.05779748037457466,
-0.05010621249675751,
0.051957033574581146,
-0.01830792799592018,
-0.025761142373085022,
0.04658336564898491,
-0.1285167932510376,
-0.029972001910209656,
0.00831519439816475,
0.03975876420736313,
-0.02228577993810177,
-0.06805837154388428,
0.020379114896059036,
-0.005615574307739735,
0.03412584960460663,
0.021365288645029068,
-0.009002321399748325,
-0.0467275008559227,
0.03276287764310837,
0.0291687473654747,
-0.04718621075153351,
-0.06341925263404846,
0.11904887109994888,
0.06430289149284363,
-0.06358213722705841,
-0.08394856750965118,
0.009542432613670826,
0.03518233820796013,
-0.019654786214232445,
0.041460830718278885,
-0.011350401677191257,
-0.016442738473415375,
0.04416824132204056,
-0.03701416403055191,
0.007501167245209217,
-0.009530443698167801,
-0.011995142325758934,
0.0838439092040062,
0.17799371480941772,
-0.025603529065847397,
0.10885142534971237,
-0.050448834896087646,
0.018858229741454124,
-0.0981908068060875,
0.010896584950387478,
-0.039011768996715546,
0.04229003190994263,
-0.013328226283192635,
0.04741663113236427,
-0.05217535421252251,
-0.007590289227664471,
0.022092457860708237,
0.004124844446778297,
0.055304545909166336,
-0.021783890202641487,
0.025930453091859818,
0.10781009495258331,
0.008584325201809406,
-0.08988672494888306,
-0.10124297440052032,
0.003847582032904029,
0.01309868972748518,
-0.05426006764173508,
0.01927136816084385,
-0.01921260915696621,
0.01219585444778204,
0.08735909312963486,
0.03203592076897621,
-0.01273568719625473,
0.0649876520037651,
0.03903014585375786,
-0.08276088535785675,
-0.013087762519717216,
0.025191931053996086,
-0.16774801909923553,
0.003992671612650156,
0.044761091470718384,
-4.850979351544993e-8,
-0.09913013130426407,
-0.006887472700327635,
-0.07883187383413315,
0.08686638623476028,
0.0013543481472879648,
-0.08476705104112625,
0.023061102256178856,
0.02995012141764164,
0.08431938290596008,
-0.020170044153928757,
-0.043838709592819214,
0.0024276003241539,
0.01578107476234436,
-0.0291158314794302,
-0.020445534959435463,
0.0051113604567945,
0.033800702542066574,
-0.01646069623529911,
0.03059816174209118,
0.04164246842265129,
0.027416277676820755,
0.012923524715006351,
0.01749454438686371,
0.10618004947900772,
0.04404976963996887,
-0.020655086264014244,
0.127975732088089,
0.161431223154068,
0.05055534094572067,
-0.027337897568941116,
-0.025278544053435326,
-0.007217671722173691,
0.08461567014455795,
0.020587794482707977,
-0.10885776579380035,
0.03258334472775459,
0.022188663482666016,
-0.011249012313783169,
0.08303652703762054,
0.11048707365989685,
0.04823429882526398,
-0.038716092705726624,
0.03180160000920296,
0.0355544313788414,
-0.01705109514296055,
0.012960020452737808,
-0.013992049731314182,
0.048658549785614014,
0.0374777689576149,
0.008778829127550125,
-0.0061911288648843765,
-0.06267950683832169,
0.0003466098860371858,
-0.010185838676989079,
0.018438348546624184,
-0.09160427749156952,
-0.022258995100855827,
-0.020225945860147476,
-0.00355880637653172,
0.03151197358965874,
-0.04591325297951698,
-0.0031453375704586506,
-0.02790168859064579,
-0.07622775435447693
] | 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 listen specifically to the `error` event to track errors as it may be possible for a traceable action to produce multiple errors. For example, an async task which fails may be started internally before the sync part of the task then throws an error. #### `asyncStart(event)` \* Name: `tracing:${name}:asyncStart` The `asyncStart` event represents the callback or continuation of a traceable function being reached. At this point things like callback arguments may be available, or anything else expressing the "result" of the action. For callbacks-based functions, the first argument of the callback will be assigned to the `error` field, if not `undefined` or `null`, and the second argument will be assigned to the `result` field. For promises, the argument to the `resolve` path will be assigned to `result` or the argument to the `reject` path will be assign to `error`. It is recommended to listen specifically to the `error` event to track errors as it may be possible for a traceable action to produce multiple errors. For example, an async task which fails may be started internally before the sync part of the task then throws an error. #### `asyncEnd(event)` \* Name: `tracing:${name}:asyncEnd` The `asyncEnd` event represents the callback of an asynchronous function returning. It's not likely event data will change after the `asyncStart` event, however it may be useful to see the point where the callback completes. #### `error(event)` \* Name: `tracing:${name}:error` The `error` event represents any error produced by the traceable function either synchronously or asynchronously. If an error is thrown in the synchronous portion of the traced function the error will be assigned to the `error` field of the event and the `error` event will be triggered. If an error is received asynchronously through a callback or promise rejection it will also be assigned to the `error` field of the event and trigger the `error` event. It is possible for a single traceable function call to produce errors multiple times so this should be considered when consuming this event. For example, if another async task is triggered internally which fails and then the sync part of the function then throws and error two `error` events will be emitted, one for the sync error and one for the async error. ### Built-in Channels #### Console > Stability: 1 - Experimental ##### Event: `'console.log'` \* `args` {any\[]} Emitted when `console.log()` is called. Receives and array of the arguments passed to `console.log()`. ##### Event: `'console.info'` \* `args` {any\[]} Emitted when `console.info()` is called. Receives and array of the arguments passed to `console.info()`. ##### Event: `'console.debug'` \* `args` {any\[]} Emitted when `console.debug()` is called. Receives and array of the arguments passed to `console.debug()`. ##### Event: `'console.warn'` \* `args` {any\[]} Emitted when `console.warn()` is called. Receives and array of the arguments passed to `console.warn()`. ##### Event: `'console.error'` \* `args` {any\[]} Emitted when `console.error()` is called. Receives and array of the arguments passed to `console.error()`. #### HTTP > Stability: 1 - Experimental ##### Event: `'http.client.request.created'` \* `request` {http.ClientRequest} Emitted when client creates 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} Emitted when an error occurs during a client request. ##### Event: `'http.client.response.finish'` \* `request` | 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.07343356311321259,
-0.05978879705071449,
-0.055827707052230835,
-0.0069234720431268215,
-0.03313923999667168,
-0.07523257285356522,
-0.07592789828777313,
0.04781511798501015,
-0.059086259454488754,
0.006778921466320753,
0.006165351253002882,
-0.06296348571777344,
0.00004976516720489599,
-0.10504785925149918,
-0.08536555618047714,
-0.008507615886628628,
-0.03209763765335083,
-0.00353608257137239,
-0.05492163449525833,
-0.07738400995731354,
0.0019441202748566866,
-0.05979577451944351,
0.08141729235649109,
0.014563259668648243,
-0.051358237862586975,
-0.009237031452357769,
-0.04254145547747612,
0.06927400082349777,
0.009380841627717018,
-0.055258769541978836,
0.026438448578119278,
0.03324032202363014,
-0.07573245465755463,
0.030303655192255974,
-0.010756614618003368,
-0.09562038630247116,
0.0339595191180706,
0.02988753467798233,
0.10459364950656891,
-0.052095066756010056,
0.037051886320114136,
0.011275085620582104,
0.05451737716794014,
0.057636190205812454,
0.026497606188058853,
-0.048864711076021194,
0.009952688589692116,
0.030991405248641968,
-0.09612185508012772,
-0.03257014974951744,
-0.014326668344438076,
0.09839826822280884,
-0.04566684365272522,
0.009224539622664452,
-0.04756791517138481,
0.017456836998462677,
0.03286178782582283,
0.005986000876873732,
-0.03494422882795334,
-0.023396410048007965,
0.04495473951101303,
0.030355412513017654,
0.038176849484443665,
-0.025165898725390434,
0.030995003879070282,
-0.049668945372104645,
-0.03162300959229469,
0.029329393059015274,
0.0023866856936365366,
-0.026672787964344025,
-0.02199644409120083,
0.040167633444070816,
0.05905481055378914,
-0.06431764364242554,
0.006359264720231295,
0.08232445269823074,
0.031597547233104706,
-0.027013828977942467,
-0.05943824350833893,
-0.08386878669261932,
0.04204922541975975,
0.05445336550474167,
0.0013335077092051506,
0.057067107409238815,
0.038175422698259354,
0.026419447734951973,
-0.05772598460316658,
0.023481566458940506,
0.014588179998099804,
0.044400013983249664,
0.0005474650533869863,
0.03669307380914688,
-0.012002343311905861,
-0.07891961187124252,
-0.1116330623626709,
-0.05452033132314682,
-0.03079083189368248,
-0.004072654992341995,
-0.03199256584048271,
0.015085567720234394,
0.0657758042216301,
0.11961173266172409,
0.024583393707871437,
0.027068976312875748,
0.010412415489554405,
0.0005537478136830032,
-0.010805664584040642,
0.07410472631454468,
0.07729608565568924,
0.10364240407943726,
-0.03470899164676666,
-0.002465412486344576,
-0.02107979543507099,
-0.024481656029820442,
1.7777744935004334e-33,
0.011431887745857239,
0.014362814836204052,
-0.0010100329527631402,
-0.056424204260110855,
0.03336973115801811,
0.019007667899131775,
0.019817346706986427,
-0.051718778908252716,
0.021608617156744003,
0.04424044117331505,
0.047109395265579224,
-0.030518818646669388,
-0.02185206301510334,
-0.02928346022963524,
-0.0010890266858041286,
0.03527616709470749,
0.07006773352622986,
-0.05188107118010521,
-0.05985052138566971,
0.06812385469675064,
-0.010060411877930164,
-0.0010760761797428131,
-0.04036019369959831,
-0.007021690718829632,
0.053449783474206924,
-0.06650112569332123,
-0.026272712275385857,
0.09154093265533447,
-0.0600714273750782,
-0.020713038742542267,
0.00029362543136812747,
0.0038826761301606894,
-0.017295340076088905,
-0.016045494005084038,
0.06844016164541245,
-0.007430893834680319,
-0.04582161456346512,
-0.07128787040710449,
-0.08966004103422165,
-0.006516864988952875,
-0.035115815699100494,
0.0053877863101661205,
-0.06884381175041199,
0.04227345064282417,
-0.021948853507637978,
-0.10122271627187729,
-0.03749961778521538,
0.021431753411889076,
0.10905469208955765,
-0.027655120939016342,
0.020286258310079575,
0.06760161370038986,
0.053097981959581375,
-0.09050054848194122,
0.09557320177555084,
0.04480763524770737,
0.019839156419038773,
-0.027922483161091805,
-0.036628615111112595,
0.02335895225405693,
0.14772674441337585,
-0.21748629212379456,
-0.08619377017021179,
-0.020305374637246132,
-0.020262926816940308,
0.04444987699389458,
-0.005146155133843422,
0.018946915864944458,
-0.017550785094499588,
-0.0017822760855779052,
-0.000019062938008573838,
0.02658723294734955,
0.018556242808699608,
0.06843831390142441,
0.09279528260231018,
0.029732683673501015,
-0.0803833082318306,
-0.017268221825361252,
-0.016181789338588715,
-0.0756678432226181,
-0.035359565168619156,
-0.002180694602429867,
-0.05138910934329033,
0.09492786228656769,
-0.04600593075156212,
0.08981321007013321,
-0.00424333568662405,
-0.059656210243701935,
-0.060396090149879456,
0.003298056311905384,
0.010015544481575489,
-0.0006394220399670303,
0.006753363646566868,
0.01376226544380188,
-0.066075399518013,
-5.221987451418129e-33,
0.01723412424325943,
0.01914311945438385,
-0.022360939532518387,
0.0421447679400444,
-0.03209114447236061,
-0.003929241094738245,
0.046640560030937195,
0.01638956181704998,
0.0018934999825432897,
0.018021471798419952,
-0.024573946371674538,
-0.017807871103286743,
-0.04941608011722565,
0.0958113744854927,
0.03461392968893051,
0.02953517623245716,
0.030986065044999123,
-0.05397137627005577,
0.05507731810212135,
-0.0033998123835772276,
0.07259079068899155,
-0.036103419959545135,
0.03267945349216461,
0.04043932631611824,
-0.08844717592000961,
-0.04473372548818588,
0.052224453538656235,
-0.08314061909914017,
-0.03383679687976837,
-0.04502405598759651,
0.05977027118206024,
-0.010282499715685844,
-0.03357131406664848,
0.046756450086832047,
0.07413094490766525,
-0.03933456540107727,
0.01748240366578102,
-0.0586220882833004,
-0.07415073364973068,
-0.07460837066173553,
0.0835530236363411,
0.02918834611773491,
0.017717065289616585,
-0.023784609511494637,
0.017734602093696594,
-0.07592310756444931,
-0.04534272104501724,
0.04773048684000969,
-0.019975172355771065,
-0.048407137393951416,
0.05357298627495766,
0.020265482366085052,
-0.009284358471632004,
0.0904143750667572,
-0.009159881621599197,
0.059357352554798126,
0.06230705603957176,
-0.05607060343027115,
0.06841183453798294,
0.002899890299886465,
-0.07851722091436386,
0.011307590641081333,
0.00824041198939085,
0.010533280670642853,
-0.02651550993323326,
0.005166484508663416,
0.010419655591249466,
-0.07271096110343933,
0.11257370561361313,
0.0873701199889183,
0.03426249697804451,
-0.02079128287732601,
-0.050886210054159164,
0.008039530366659164,
-0.030078165233135223,
-0.013546865433454514,
-0.0763704851269722,
-0.14351610839366913,
0.03924655541777611,
0.06809994578361511,
-0.02093755640089512,
-0.03246631845831871,
0.06973326951265335,
0.050211887806653976,
0.007779283449053764,
-0.0023993400391191244,
0.019917771220207214,
0.049633607268333435,
-0.01406179927289486,
0.028363535180687904,
0.07853887230157852,
-0.04621101915836334,
-0.08985801786184311,
0.049919579178094864,
-0.0022802974563091993,
-5.192883278937188e-8,
-0.0752534419298172,
0.010401923209428787,
-0.03912428021430969,
-0.022174740210175514,
-0.00484278192743659,
0.00039153057150542736,
0.03594155237078667,
-0.07225430756807327,
0.023636631667613983,
-0.019405782222747803,
-0.03207975998520851,
-0.06314007937908173,
0.04119226709008217,
-0.02600223384797573,
0.02797059901058674,
0.011126900091767311,
0.02908315137028694,
0.03105880133807659,
0.015273177064955235,
-0.0343363955616951,
-0.015268247574567795,
0.023336026817560196,
-0.09314638376235962,
-0.0005785727989859879,
-0.02787388488650322,
0.014075232669711113,
0.03866942599415779,
0.20384638011455536,
-0.026947012171149254,
-0.00770160835236311,
0.0381915457546711,
0.013766440562903881,
0.07315938174724579,
0.026217864826321602,
-0.05984700098633766,
0.02289675921201706,
0.08014709502458572,
-0.03804050385951996,
0.10341037809848785,
0.07801541686058044,
0.036725398153066635,
0.03556171432137489,
0.07377985864877701,
0.03337790444493294,
0.0038112890906631947,
-0.01555800810456276,
-0.05046391114592552,
-0.01972767896950245,
-0.03190429136157036,
-0.030298523604869843,
-0.023918457329273224,
-0.034426767379045486,
-0.05781656876206398,
0.05633733421564102,
0.02731679379940033,
-0.03314260020852089,
0.004624348133802414,
-0.07059960067272186,
-0.0413392037153244,
0.034672435373067856,
0.032722074538469315,
0.0024456281680613756,
0.05509274825453758,
-0.009245499037206173
] | 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} Emitted when an error occurs during a client request. ##### Event: `'http.client.response.finish'` \* `request` {http.ClientRequest} \* `response` {http.IncomingMessage} Emitted when client receives a response. ##### Event: `'http.server.request.start'` \* `request` {http.IncomingMessage} \* `response` {http.ServerResponse} \* `socket` {net.Socket} \* `server` {http.Server} Emitted when server receives a request. ##### Event: `'http.server.response.created'` \* `request` {http.IncomingMessage} \* `response` {http.ServerResponse} Emitted when server creates a response. The event is emitted before the response is sent. ##### Event: `'http.server.response.finish'` \* `request` {http.IncomingMessage} \* `response` {http.ServerResponse} \* `socket` {net.Socket} \* `server` {http.Server} Emitted when server sends a response. #### HTTP/2 > Stability: 1 - Experimental ##### Event: `'http2.client.stream.created'` \* `stream` {ClientHttp2Stream} \* `headers` {HTTP/2 Headers Object} Emitted when a stream is created on the client. ##### Event: `'http2.client.stream.start'` \* `stream` {ClientHttp2Stream} \* `headers` {HTTP/2 Headers Object} Emitted when a stream is started on the client. ##### Event: `'http2.client.stream.error'` \* `stream` {ClientHttp2Stream} \* `error` {Error} Emitted when an error occurs during the processing of a stream on the client. ##### Event: `'http2.client.stream.finish'` \* `stream` {ClientHttp2Stream} \* `headers` {HTTP/2 Headers Object} \* `flags` {number} Emitted when a stream is received on the client. ##### Event: `'http2.client.stream.bodyChunkSent'` \* `stream` {ClientHttp2Stream} \* `writev` {boolean} \* `data` {Buffer | string | Buffer\[] | Object\[]} \* `chunk` {Buffer|string} \* `encoding` {string} \* `encoding` {string} Emitted when a chunk of the client stream body is being sent. ##### Event: `'http2.client.stream.bodySent'` \* `stream` {ClientHttp2Stream} Emitted after the client stream body has been fully sent. ##### Event: `'http2.client.stream.close'` \* `stream` {ClientHttp2Stream} Emitted when a stream is closed on the client. The HTTP/2 error code used when closing the stream can be retrieved using the `stream.rstCode` property. ##### Event: `'http2.server.stream.created'` \* `stream` {ServerHttp2Stream} \* `headers` {HTTP/2 Headers Object} Emitted when a stream is created on the server. ##### Event: `'http2.server.stream.start'` \* `stream` {ServerHttp2Stream} \* `headers` {HTTP/2 Headers Object} Emitted when a stream is started on the server. ##### Event: `'http2.server.stream.error'` \* `stream` {ServerHttp2Stream} \* `error` {Error} Emitted when an error occurs during the processing of a stream on the server. ##### Event: `'http2.server.stream.finish'` \* `stream` {ServerHttp2Stream} \* `headers` {HTTP/2 Headers Object} \* `flags` {number} Emitted when a stream is sent on the server. ##### Event: `'http2.server.stream.close'` \* `stream` {ServerHttp2Stream} Emitted when a stream is closed on the server. The HTTP/2 error code used when closing the stream can be retrieved using the `stream.rstCode` property. #### Modules > Stability: 1 - Experimental ##### Event: `'module.require.start'` \* `event` {Object} containing the following properties \* `id` Argument passed to `require()`. Module name. \* `parentFilename` Name of the module that attempted to require(id). Emitted when `require()` is executed. See [`start` event][]. ##### Event: `'module.require.end'` \* `event` {Object} containing the following properties \* `id` Argument passed to `require()`. Module name. \* `parentFilename` Name of the module that attempted to require(id). Emitted when a `require()` call returns. See [`end` event][]. ##### Event: `'module.require.error'` \* `event` {Object} containing the following properties \* `id` Argument passed to `require()`. Module name. \* `parentFilename` Name of the module that attempted to require(id). \* `error` {Error} Emitted when a `require()` throws an error. See [`error` event][]. ##### Event: `'module.import.asyncStart'` \* `event` {Object} containing 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` Argument passed to `import()`. Module name. \* `parentURL` | 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.01786814257502556,
0.05238547548651695,
0.007073635701090097,
0.050134044140577316,
-0.0415925607085228,
0.03544073924422264,
-0.005833244416862726,
-0.014054758474230766,
0.04005378484725952,
-0.004417534451931715,
-0.017777619883418083,
-0.0030163524206727743,
-0.009013879112899303,
0.007365727331489325,
-0.055973924696445465,
0.021337667480111122,
0.08601335436105728,
0.017271099612116814,
-0.08753424137830734,
-0.12981119751930237,
0.018492791801691055,
-0.0473998598754406,
0.03201139345765114,
0.05157088860869408,
-0.029712839052081108,
-0.047926612198352814,
0.039482321590185165,
0.039838969707489014,
0.017873909324407578,
-0.008045671507716179,
-0.0009407808538526297,
-0.014802149496972561,
0.02681434340775013,
-0.053690046072006226,
-0.002101927762851119,
-0.07579690963029861,
-0.015668032690882683,
0.00556188216432929,
0.023320883512496948,
-0.0533786304295063,
0.08223076909780502,
0.03183198347687721,
-0.06765733659267426,
-0.034292545169591904,
-0.003777126781642437,
-0.0059891012497246265,
-0.028117358684539795,
-0.053723666816949844,
-0.0331091433763504,
0.029520466923713684,
0.024163899943232536,
-0.05839791148900986,
0.003931016195565462,
-0.032749321311712265,
-0.01425969135016203,
0.043113745748996735,
0.017957203090190887,
-0.03071342222392559,
0.0476129949092865,
-0.16707466542720795,
0.011900100857019424,
0.00497093889862299,
-0.04648236557841301,
0.013607191853225231,
0.011218241415917873,
-0.0654791072010994,
0.027611713856458664,
0.012515096925199032,
-0.06293962150812149,
-0.03609104081988335,
0.08701113611459732,
0.01864461600780487,
-0.018492788076400757,
0.009966345503926277,
0.015224088914692402,
-0.011987385340034962,
0.03118698112666607,
-0.052735306322574615,
0.010075520724058151,
-0.022181008011102676,
0.09002429246902466,
-0.020495381206274033,
0.10032622516155243,
0.03363736346364021,
-0.030442647635936737,
-0.008747460320591927,
-0.00441062543541193,
0.053970564156770706,
-0.07957513630390167,
-0.010706042870879173,
-0.03568423166871071,
0.0830584242939949,
-0.029208477586507797,
-0.07052485644817352,
0.03922897204756737,
0.06966973096132278,
0.01416709739714861,
-0.052912697196006775,
-0.03204135596752167,
-0.02709878236055374,
-0.03594125434756279,
-0.01459948718547821,
0.03159162774682045,
0.03332103416323662,
0.04597267881035805,
-0.058802276849746704,
0.051012035459280014,
0.054975658655166626,
-0.01852441020309925,
0.03311895951628685,
-0.042936958372592926,
0.07440432161092758,
-0.08193392306566238,
0.05439280346035957,
5.2948023469538614e-33,
-0.017068276181817055,
-0.01593085564672947,
-0.07458542287349701,
0.047257937490940094,
0.04866163060069084,
0.052074261009693146,
0.0414607897400856,
0.013521650806069374,
-0.028549527749419212,
-0.054835446178913116,
-0.04643748328089714,
0.0007663595606572926,
0.05754175782203674,
-0.06359417736530304,
0.052789632230997086,
-0.028649024665355682,
0.04217194393277168,
0.0374150425195694,
0.05801573768258095,
0.015591063536703587,
-0.052479807287454605,
-0.04377919062972069,
0.05668981745839119,
0.07378888875246048,
-0.04285610839724541,
0.005496885161846876,
-0.04820884391665459,
0.019963504746556282,
-0.1043744906783104,
-0.018843084573745728,
0.023783929646015167,
-0.01786987856030464,
-0.023238513618707657,
0.00021377108350861818,
0.00887963268905878,
-0.07822088152170181,
0.040472980588674545,
-0.044117894023656845,
-0.06765792518854141,
-0.08424385637044907,
-0.04410865157842636,
0.010869545862078667,
-0.1507350206375122,
0.011668096296489239,
-0.0467539019882679,
-0.10083267837762833,
-0.07370924949645996,
-0.04280990734696388,
0.08430026471614838,
-0.006564619019627571,
-0.050351545214653015,
0.045245636254549026,
0.20983357727527618,
0.021542521193623543,
-0.02115253172814846,
0.05225852131843567,
0.003558266209438443,
0.043454788625240326,
-0.03885003924369812,
-0.06802234798669815,
0.09802724421024323,
-0.06752452254295349,
-0.004085864406079054,
-0.10091711580753326,
0.07670284807682037,
-0.058950379490852356,
0.0035341638140380383,
0.061893999576568604,
-0.04208001121878624,
-0.0009658221388235688,
0.015841836109757423,
-0.0016080959467217326,
0.008192037232220173,
-0.016746850684285164,
-0.06336159259080887,
0.012305756099522114,
-0.0078011672012507915,
0.06336033344268799,
0.015225566923618317,
-0.019030839204788208,
-0.03532828390598297,
-0.014389654621481895,
-0.0006122147315181792,
-0.0047025540843605995,
-0.04764680936932564,
0.09056556969881058,
0.029135769233107567,
-0.018517693504691124,
0.014118034392595291,
0.02039348892867565,
0.0007453358848579228,
-0.01695619709789753,
0.009377817623317242,
0.01787264458835125,
-0.042873673141002655,
-7.606145664907032e-33,
0.010899224318563938,
0.004195120185613632,
-0.09521184116601944,
0.028472574427723885,
-0.01698123849928379,
-0.04628802463412285,
-0.005170220043510199,
0.03643898665904999,
-0.022807639092206955,
0.011953598819673061,
0.0494878925383091,
-0.04169096052646637,
0.020365547388792038,
0.006992742419242859,
-0.07791722565889359,
0.03938865661621094,
-0.028142955154180527,
-0.0333431251347065,
0.014773514121770859,
-0.07671812176704407,
-0.05407115817070007,
-0.016673827543854713,
0.0006928743678145111,
-0.08330122381448746,
-0.11381208151578903,
0.005169079639017582,
0.006144809070974588,
-0.04497991502285004,
-0.08874468505382538,
-0.03556542098522186,
0.017084594815969467,
0.08028924465179443,
0.0022994684986770153,
0.05296240374445915,
0.038717322051525116,
-0.0192466638982296,
0.06559436023235321,
0.008741362020373344,
0.0285357553511858,
-0.023818613961338997,
0.1598622053861618,
0.0018705653492361307,
0.022477328777313232,
0.033731650561094284,
0.03603309020400047,
-0.022632353007793427,
-0.0408766008913517,
0.09068716317415237,
-0.0389430858194828,
-0.013384630903601646,
-0.01550406776368618,
0.0076219188049435616,
0.0237001683562994,
0.04452452436089516,
-0.03136701136827469,
0.020162789151072502,
0.057207174599170685,
0.006182392127811909,
0.054919663816690445,
-0.020955584943294525,
0.00683799060061574,
-0.06375010311603546,
-0.05659375339746475,
0.058029528707265854,
-0.007466297131031752,
0.08263930678367615,
-0.04640694335103035,
-0.0011525616282597184,
0.08260855078697205,
-0.09358249604701996,
-0.01154495868831873,
-0.034171465784311295,
-0.07710940390825272,
0.005018969066441059,
0.03717448562383652,
-0.00372469425201416,
-0.0008742022910155356,
-0.029896903783082962,
0.007555829361081123,
0.046646848320961,
-0.0866888016462326,
0.021650247275829315,
-0.06995552778244019,
0.049059197306632996,
-0.025517160072922707,
-0.06404388695955276,
-0.05439223721623421,
0.0841437578201294,
-0.06433878093957901,
-0.06388922780752182,
0.010690166614949703,
0.03348542004823685,
-0.018832912668585777,
0.04978941008448601,
0.03331200033426285,
-4.839229461595096e-8,
-0.09557649493217468,
0.0431203618645668,
0.02663063071668148,
-0.006562432739883661,
0.03364007547497749,
0.09123478084802628,
0.0077216834761202335,
-0.03934745863080025,
0.06114177778363228,
-0.0034075158182531595,
-0.08855125308036804,
-0.014612679369747639,
0.04489389806985855,
-0.021444955840706825,
0.042618706822395325,
0.05019829049706459,
-0.02109258808195591,
0.006560116074979305,
0.007561064325273037,
-0.03482307121157646,
0.06991755962371826,
-0.03400162607431412,
0.013626662082970142,
-0.00864367838948965,
0.0026176192332059145,
-0.006014037877321243,
0.07207903265953064,
0.09777624160051346,
-0.1145562157034874,
-0.10061891376972198,
-0.1390005350112915,
0.04648054391145706,
0.06367094069719315,
-0.0035627679899334908,
0.004432584159076214,
0.1488802284002304,
-0.038337476551532745,
-0.02886090986430645,
-0.01406554039567709,
0.013419952243566513,
0.07118801027536392,
0.028119608759880066,
-0.032423753291368484,
0.003732380224391818,
0.015488069504499435,
0.054717618972063065,
0.01241299044340849,
0.07389843463897705,
0.042490992695093155,
-0.026166683062911034,
-0.0458078533411026,
-0.014017407782375813,
-0.0374203585088253,
-0.024263868108391762,
-0.05920296534895897,
0.04256433621048927,
-0.03650908172130585,
-0.11223400384187698,
-0.0021969848312437534,
-0.0367819219827652,
0.14873971045017242,
0.09352432936429977,
-0.05157814547419548,
-0.019071271643042564
] | 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` Argument passed to `import()`. Module name. \* `parentURL` URL object of the module that attempted to import(id). Emitted when `import()` has completed. See [`asyncEnd` event][]. ##### Event: `'module.import.error'` \* `event` {Object} containing the following properties \* `id` Argument passed to `import()`. Module name. \* `parentURL` URL object of the module that attempted to import(id). \* `error` {Error} Emitted when a `import()` throws an error. See [`error` event][]. #### NET > Stability: 1 - Experimental ##### Event: `'net.client.socket'` \* `socket` {net.Socket|tls.TLSSocket} Emitted when a new TCP or pipe client socket connection is created. ##### Event: `'net.server.socket'` \* `socket` {net.Socket} Emitted when a new TCP or pipe connection is received. ##### Event: `'tracing:net.server.listen:asyncStart'` \* `server` {net.Server} \* `options` {Object} Emitted when [`net.Server.listen()`][] is invoked, before the port or pipe is actually setup. ##### Event: `'tracing:net.server.listen:asyncEnd'` \* `server` {net.Server} Emitted when [`net.Server.listen()`][] has completed and thus the server is ready to accept connection. ##### Event: `'tracing:net.server.listen:error'` \* `server` {net.Server} \* `error` {Error} Emitted when [`net.Server.listen()`][] is returning an error. #### UDP > Stability: 1 - Experimental ##### Event: `'udp.socket'` \* `socket` {dgram.Socket} Emitted when a new UDP socket is created. #### Process > Stability: 1 - Experimental ##### Event: `'child\_process'` \* `process` {ChildProcess} Emitted when a new process is created. ##### Event: `'execve'` \* `execPath` {string} \* `args` {string\[]} \* `env` {string\[]} Emitted when [`process.execve()`][] is invoked. #### Worker Thread > Stability: 1 - Experimental ##### Event: `'worker\_threads'` \* `worker` {Worker} Emitted when a new thread is created. [TracingChannel Channels]: #tracingchannel-channels [`'uncaughtException'`]: process.md#event-uncaughtexception [`TracingChannel`]: #class-tracingchannel [`asyncEnd` event]: #asyncendevent [`asyncStart` event]: #asyncstartevent [`channel.bindStore(store)`]: #channelbindstorestore-transform [`channel.runStores(context, ...)`]: #channelrunstorescontext-fn-thisarg-args [`channel.subscribe(onMessage)`]: #channelsubscribeonmessage [`channel.unsubscribe(onMessage)`]: #channelunsubscribeonmessage [`diagnostics\_channel.channel(name)`]: #diagnostics\_channelchannelname [`diagnostics\_channel.subscribe(name, onMessage)`]: #diagnostics\_channelsubscribename-onmessage [`diagnostics\_channel.tracingChannel()`]: #diagnostics\_channeltracingchannelnameorchannels [`end` event]: #endevent [`error` event]: #errorevent [`net.Server.listen()`]: net.md#serverlisten [`process.execve()`]: process.md#processexecvefile-args-env [`start` event]: #startevent [context loss]: async\_context.md#troubleshooting-context-loss | 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.04309643805027008,
0.027276672422885895,
0.08802281320095062,
-0.05221674591302872,
-0.008712118491530418,
-0.11866144090890884,
-0.008427600376307964,
0.0036671776324510574,
0.03891881927847862,
0.011532660573720932,
0.004646433517336845,
-0.06934573501348495,
-0.03126481547951698,
-0.03147173672914505,
-0.07780490070581436,
0.01590736396610737,
-0.03540453687310219,
-0.0022567622363567352,
-0.006472658831626177,
-0.14619538187980652,
-0.0194742139428854,
0.09382376819849014,
0.14092373847961426,
0.0061979410238564014,
-0.072696253657341,
0.010358569212257862,
-0.051941726356744766,
0.1822812855243683,
0.0275129284709692,
-0.02938297763466835,
-0.06302580237388611,
-0.04620591178536415,
-0.02594713866710663,
-0.033187273889780045,
-0.03863497078418732,
-0.09053004533052444,
-0.02870645374059677,
-0.0695718377828598,
0.0434873029589653,
-0.05902542918920517,
-0.03448475897312164,
0.02662033401429653,
0.06151668354868889,
0.030049247667193413,
0.038774821907281876,
0.03771025687456131,
-0.011859498918056488,
0.017139488831162453,
-0.018877685070037842,
0.018360354006290436,
-0.02219807170331478,
-0.025912852957844734,
-0.016979334875941277,
-0.05160708352923393,
-0.027680417522788048,
0.04727013036608696,
0.028140217065811157,
-0.034941427409648895,
0.052062779664993286,
-0.09736229479312897,
0.08320923149585724,
0.05323416367173195,
-0.04917563125491142,
-0.01675271987915039,
0.04796995595097542,
-0.051600947976112366,
-0.1510200798511505,
-0.0019397272262722254,
-0.08528520911931992,
-0.022031236439943314,
-0.006917113903909922,
0.0871109738945961,
0.058986205607652664,
-0.021825192496180534,
0.011227971874177456,
0.04516991600394249,
0.10032150149345398,
-0.03481491282582283,
-0.10082247108221054,
0.028465723618865013,
0.12501421570777893,
0.08850464969873428,
0.04402686282992363,
0.03356393799185753,
0.02755158022046089,
-0.010747265070676804,
0.002181405434384942,
-0.02899138815701008,
0.02679026685655117,
0.0031077908352017403,
0.07697229087352753,
0.050153948366642,
-0.05057991296052933,
-0.03626067563891411,
-0.046001628041267395,
-0.02750290371477604,
-0.029346583411097527,
-0.016901345923542976,
-0.04125313088297844,
0.04676983132958412,
-0.021081745624542236,
0.0015645603416487575,
0.03204365447163582,
0.028254102915525436,
0.044339220970869064,
-0.06982803344726562,
0.034551817923784256,
0.1427750289440155,
0.0033298872876912355,
0.09020295739173889,
-0.03731048107147217,
0.036531221121549606,
-0.02198190614581108,
0.03354266658425331,
1.1350764469372017e-33,
-0.01731092855334282,
-0.028784554451704025,
-0.10421664267778397,
0.07764986902475357,
0.04771141707897186,
0.01081511378288269,
0.07999593764543533,
0.01912805810570717,
-0.07085682451725006,
-0.01091671735048294,
-0.10401780158281326,
0.02023235708475113,
-0.0603448711335659,
-0.042083002626895905,
0.017289016395807266,
0.02432376891374588,
0.05594919994473457,
0.08240178972482681,
0.015018625184893608,
0.015722140669822693,
0.02494053915143013,
0.02585301548242569,
-0.024851614609360695,
-0.005795015022158623,
0.05708025023341179,
0.04214916378259659,
-0.00464477576315403,
0.008022290654480457,
-0.01485980860888958,
0.021394934505224228,
0.07519800961017609,
0.00760617945343256,
-0.052859313786029816,
0.029791899025440216,
0.009427662007510662,
-0.018676193431019783,
-0.006944307126104832,
-0.07547874748706818,
-0.16474369168281555,
-0.025174040347337723,
-0.0714871883392334,
0.005988378077745438,
-0.125062495470047,
0.028986554592847824,
-0.060431212186813354,
-0.13055817782878876,
-0.03658468648791313,
0.002131628105416894,
0.020684020593762398,
-0.019132498651742935,
-0.06072944402694702,
0.0472126230597496,
0.09711138159036636,
-0.09179916977882385,
0.018688414245843887,
-0.011098344810307026,
-0.026447497308254242,
0.00018075769185088575,
0.01313932053744793,
-0.0256546251475811,
0.042729225009679794,
-0.03617246448993683,
-0.061228059232234955,
0.04897194728255272,
0.047132208943367004,
0.01672540046274662,
0.0011072835186496377,
0.011112318374216557,
0.00783894769847393,
-0.011435874737799168,
0.002080619102343917,
-0.00027980751474387944,
-0.10026354342699051,
-0.02458506077528,
0.02074994333088398,
-0.03765145316720009,
-0.051312461495399475,
-0.028809329494833946,
-0.008641541935503483,
-0.03228715807199478,
-0.005684958770871162,
-0.04679049551486969,
-0.02141944319009781,
-0.0028562508523464203,
-0.03885652869939804,
0.02694164216518402,
-0.05396686866879463,
0.014216496609151363,
-0.00797327235341072,
0.005615953356027603,
0.05655250698328018,
-0.04759266600012779,
-0.02415415644645691,
-0.037674371153116226,
-0.051494162529706955,
-4.379505140054026e-33,
0.058781467378139496,
-0.019639339298009872,
0.02092069946229458,
0.06779299676418304,
-0.00359900644980371,
-0.06397917866706848,
0.005210647359490395,
0.012911835685372353,
0.0065945968963205814,
0.002652162918820977,
0.016479726880788803,
0.019275980070233345,
0.05343741923570633,
-0.024050790816545486,
0.028856130316853523,
0.09507225453853607,
-0.03977089747786522,
-0.06009288504719734,
0.03982849791646004,
-0.023897161707282066,
-0.0020320501644164324,
0.060036689043045044,
-0.013292346149682999,
0.022177165374159813,
-0.0976027101278305,
0.015095571056008339,
0.01629452593624592,
-0.05677301436662674,
0.005512384232133627,
0.015616673044860363,
0.050906069576740265,
0.08357774466276169,
-0.07726149260997772,
0.06998533755540848,
-0.032850466668605804,
0.024607591331005096,
0.059924401342868805,
0.029630597680807114,
-0.0763680636882782,
-0.061239566653966904,
0.13839371502399445,
0.05578479543328285,
-0.03820140287280083,
0.022160252556204796,
0.0011208716314285994,
-0.06801110506057739,
0.008223962970077991,
0.0684313029050827,
0.024036776274442673,
0.01785150170326233,
0.014397774823009968,
-0.04404904693365097,
0.07207466661930084,
0.01806841604411602,
-0.013585872948169708,
0.038005392998456955,
0.11283382773399353,
0.02876327745616436,
-0.029422180727124214,
-0.01598903350532055,
0.04271833226084709,
-0.04552408307790756,
-0.06532391905784607,
-0.001173385069705546,
-0.07513464987277985,
-0.03186766803264618,
-0.044986698776483536,
0.016088347882032394,
0.057265132665634155,
-0.08754704892635345,
0.059152740985155106,
0.005215285811573267,
-0.06058606877923012,
-0.037996355444192886,
0.0028438607696443796,
-0.04117001220583916,
0.02652052603662014,
0.02627338096499443,
0.08166762441396713,
0.04368169233202934,
-0.027798479422926903,
0.007175215519964695,
0.06557507067918777,
-0.011083051562309265,
-0.01521633006632328,
-0.08967564254999161,
0.020934099331498146,
0.12196429818868637,
0.011272486299276352,
-0.02874860167503357,
-0.03217151388525963,
-0.029223043471574783,
-0.054894380271434784,
0.030277447775006294,
-0.002757149748504162,
-4.8944613695312e-8,
-0.1027328372001648,
0.05798167735338211,
-0.04705739766359329,
-0.020775990560650826,
0.06968460977077484,
-0.026491407305002213,
0.008121618069708347,
0.02602582797408104,
0.02684079110622406,
-0.011826436035335064,
-0.09300990402698517,
0.056850314140319824,
0.04309828579425812,
0.01901904121041298,
-0.05904892086982727,
-0.026076819747686386,
-0.06596960127353668,
0.05466117709875107,
-0.02549905702471733,
-0.03687737509608269,
0.010554798878729343,
-0.012727942317724228,
-0.0046831173822283745,
0.04285883903503418,
0.014849960803985596,
-0.03722667694091797,
0.04640066996216774,
0.04781188443303108,
0.004318870138376951,
-0.05602631717920303,
-0.09570172429084778,
0.008879379369318485,
0.038653966039419174,
-0.015660416334867477,
-0.060517292469739914,
0.056846968829631805,
0.07813801616430283,
-0.03137313947081566,
0.04080716893076897,
-0.01614355482161045,
0.03878355398774147,
-0.037998512387275696,
-0.005242940504103899,
0.01718405820429325,
-0.009419811889529228,
-0.026928160339593887,
-0.08157142996788025,
0.024310991168022156,
0.016768459230661392,
0.045361775904893875,
0.00373817328363657,
-0.0874163806438446,
-0.01676257885992527,
0.004009767901152372,
-0.0025939668994396925,
0.04258735850453377,
-0.023096667602658272,
-0.06807313859462738,
0.0008616934064775705,
-0.01018813531845808,
0.10426013171672821,
-0.007752279285341501,
0.06666480749845505,
-0.044204842299222946
] | 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 text terminal ("TTY") attached, [`process.stdin`][] will, by default, be initialized as an instance of `tty.ReadStream` and both [`process.stdout`][] and [`process.stderr`][] will, by default, be instances of `tty.WriteStream`. The preferred method of determining whether Node.js is being run within a TTY context is to check that the value of the `process.stdout.isTTY` property is `true`: ```console $ node -p -e "Boolean(process.stdout.isTTY)" true $ node -p -e "Boolean(process.stdout.isTTY)" | cat false ``` In most cases, there should be little to no reason for an application to manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes. ## Class: `tty.ReadStream` \* Extends: {net.Socket} Represents the readable side of a TTY. In normal circumstances [`process.stdin`][] will be the only `tty.ReadStream` instance in a Node.js process and there should be no reason to create additional instances. ### `readStream.isRaw` A `boolean` that is `true` if the TTY is currently configured to operate as a raw device. This flag is always `false` when a process starts, even if the terminal is operating in raw mode. Its value will change with subsequent calls to `setRawMode`. ### `readStream.isTTY` A `boolean` that is always `true` for `tty.ReadStream` instances. ### `readStream.setRawMode(mode)` \* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` property will be set to the resulting mode. \* Returns: {this} The read stream instance. Allows configuration of `tty.ReadStream` so that it operates as a raw device. When in raw mode, input is always available character-by-character, not including modifiers. Additionally, all special processing of characters by the terminal is disabled, including echoing input characters. `Ctrl`+`C` will no longer cause a `SIGINT` when in this mode. ## Class: `tty.WriteStream` \* Extends: {net.Socket} Represents the writable side of a TTY. In normal circumstances, [`process.stdout`][] and [`process.stderr`][] will be the only `tty.WriteStream` instances created for a Node.js process and there should be no reason to create additional instances. ### `new tty.ReadStream(fd[, options])` \* `fd` {number} A file descriptor associated with a TTY. \* `options` {Object} Options passed to parent `net.Socket`, see `options` of [`net.Socket` constructor][]. \* Returns: {tty.ReadStream} Creates a `ReadStream` for `fd` associated with a TTY. ### `new tty.WriteStream(fd)` \* `fd` {number} A file descriptor associated with a TTY. \* Returns: {tty.WriteStream} Creates a `WriteStream` for `fd` associated with a TTY. ### Event: `'resize'` The `'resize'` event is emitted whenever either of the `writeStream.columns` or `writeStream.rows` properties have changed. No arguments are passed to the listener callback when called. ```js process.stdout.on('resize', () => { console.log('screen size has changed!'); console.log(`${process.stdout.columns}x${process.stdout.rows}`); }); ``` ### `writeStream.clearLine(dir[, callback])` \* `dir` {number} \* `-1`: to the left from cursor \* `1`: to the right from cursor \* `0`: the entire line \* `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`. `writeStream.clearLine()` clears the current line of this `WriteStream` in a direction 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`. `writeStream.clearScreenDown()` clears this `WriteStream` from the current cursor | 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.03170594573020935,
0.009643707424402237,
-0.08862889558076859,
0.013873456977307796,
0.022006316110491753,
0.031632792204618454,
-0.08412012457847595,
0.045064739882946014,
0.011916960589587688,
0.04935590922832489,
-0.01928059011697769,
-0.09312739223241806,
0.022986412048339844,
-0.0007432447746396065,
-0.020640242844820023,
0.06019078195095062,
-0.03482891246676445,
-0.11087999492883682,
0.009629746899008751,
-0.07857683300971985,
-0.002319540362805128,
-0.007040285039693117,
0.136819988489151,
0.08337035775184631,
-0.10200304538011551,
-0.05791561305522919,
0.0050210184417665005,
0.08269403874874115,
0.02451450005173683,
-0.08072560280561447,
-0.04421491175889969,
-0.003604403929784894,
-0.0010978305945172906,
-0.1378161907196045,
0.016208184882998466,
-0.11631360650062561,
-0.043725721538066864,
0.042028363794088364,
-0.008569910190999508,
0.025804856792092323,
0.011763899587094784,
-0.07302066683769226,
0.018551213666796684,
0.03001708723604679,
0.018995044752955437,
0.034117359668016434,
0.015838416293263435,
-0.05505647510290146,
0.05479492247104645,
-0.013936447910964489,
-0.00939473882317543,
0.05793199688196182,
0.07329202443361282,
0.0028268450405448675,
0.04060063138604164,
0.0762474462389946,
0.020025281235575676,
-0.026537518948316574,
-0.04112501069903374,
-0.06940542161464691,
-0.01472262293100357,
-0.12251202017068863,
-0.09059512615203857,
0.06260383129119873,
0.004681781399995089,
-0.07583262771368027,
0.056810162961483,
-0.021010421216487885,
-0.040947090834379196,
0.02699742279946804,
-0.02295108325779438,
-0.03684661537408829,
0.14935477077960968,
-0.05433526635169983,
0.028524676337838173,
0.025213303044438362,
0.08713573962450027,
-0.08484961837530136,
-0.029484648257493973,
0.01718931458890438,
0.023683972656726837,
0.015988575294613838,
0.07671826332807541,
0.02203155867755413,
0.04158145561814308,
-0.006412019021809101,
-0.004530205391347408,
0.018350349739193916,
0.043999142944812775,
0.019916387274861336,
0.023097699508070946,
0.07779578119516373,
0.0010105022229254246,
0.016590289771556854,
-0.059199992567300797,
0.0489669106900692,
-0.029431484639644623,
0.03924142196774483,
0.03491850942373276,
0.020089859142899513,
0.03918163850903511,
0.0031770248897373676,
-0.02560809627175331,
0.007845901884138584,
0.03547310829162598,
0.09247371554374695,
0.15957754850387573,
0.11513274163007736,
0.024904584512114525,
-0.007749270182102919,
0.03467601537704468,
0.07167031615972519,
-0.11536950618028641,
0.04170645773410797,
1.2390376265014056e-33,
-0.00992211140692234,
-0.04971605911850929,
0.03773939236998558,
0.03948106989264488,
0.04959443211555481,
0.04294741153717041,
0.0035927393473684788,
0.002296153921633959,
-0.04560558497905731,
0.0015776616055518389,
-0.0478937067091465,
0.017245018854737282,
-0.03345537930727005,
-0.004977983422577381,
0.029106684029102325,
-0.013400204479694366,
0.01848175749182701,
-0.021530553698539734,
0.027041547000408173,
0.02948327176272869,
0.06635253131389618,
0.005133394617587328,
-0.00030167895602062345,
0.022251302376389503,
0.0025542904622852802,
-0.028816252946853638,
-0.05940290540456772,
-0.020182287320494652,
-0.04545719176530838,
0.01314001064747572,
-0.01921892538666725,
0.0064949337393045425,
-0.02230890467762947,
-0.0015192030696198344,
0.008773848414421082,
-0.09441791474819183,
-0.015141676180064678,
0.0542844720184803,
-0.10179992020130157,
-0.041511550545692444,
-0.019640078768134117,
0.026348020881414413,
-0.02684571035206318,
0.014119536615908146,
-0.037865642458200455,
-0.11950557678937912,
-0.08063073456287384,
-0.01713543012738228,
-0.025798995047807693,
-0.02666717953979969,
0.0068799336440861225,
0.04311187565326691,
0.024472195655107498,
-0.015166533179581165,
0.03993901610374451,
-0.04206643998622894,
0.0763624757528305,
-0.04967013746500015,
-0.005846916697919369,
0.07080168277025223,
0.04690525308251381,
0.026986809447407722,
0.02757684886455536,
0.0060437810607254505,
0.02393801510334015,
0.05248292163014412,
-0.0817931592464447,
-0.05158505588769913,
0.04627913236618042,
0.01490663830190897,
-0.10607967525720596,
0.01953880302608013,
-0.001016750349663198,
0.0317230299115181,
0.039714932441711426,
0.03089875355362892,
-0.021898524835705757,
-0.023105794563889503,
-0.029766956344246864,
0.027573203667998314,
0.05109531804919243,
-0.0457504503428936,
-0.03389950096607208,
0.06957314908504486,
0.046268340200185776,
-0.00010245782323181629,
-0.025483544915914536,
-0.0015868654008954763,
0.03559286147356033,
0.0464547798037529,
0.009351490065455437,
-0.018817996606230736,
0.03039756417274475,
-0.0307474248111248,
-0.038848910480737686,
-4.986765889030804e-33,
-0.010158437304198742,
0.06805320829153061,
-0.10884788632392883,
0.08499518036842346,
-0.09970808774232864,
-0.07338190823793411,
-0.056702870875597,
-0.053349610418081284,
-0.007015116512775421,
-0.023179203271865845,
-0.025102799758315086,
0.06114477664232254,
0.003095738822594285,
0.0997963547706604,
0.002883977023884654,
0.07174495607614517,
-0.05831153318285942,
-0.03788559138774872,
0.0504186674952507,
-0.04330429062247276,
-0.027377597987651825,
-0.054130975157022476,
0.04871528223156929,
0.023357784375548363,
0.01215982437133789,
-0.034025371074676514,
-0.018627174198627472,
-0.022723840549588203,
-0.07495345920324326,
-0.047582026571035385,
0.012415806762874126,
0.009781798347830772,
-0.003682718612253666,
0.06683746725320816,
0.009843564592301846,
-0.048559144139289856,
-0.0004987249849364161,
0.046696074306964874,
0.07146872580051422,
0.009760258719325066,
0.1489463746547699,
0.07542931288480759,
-0.03622577339410782,
0.006169361528009176,
-0.010742704384028912,
0.020256223157048225,
-0.0330653116106987,
0.014331676997244358,
0.026304593309760094,
-0.027608413249254227,
-0.010164741426706314,
-0.02633390948176384,
0.0384538508951664,
0.0752275288105011,
-0.023370031267404556,
-0.04964979365468025,
0.006207903381437063,
0.031015612185001373,
-0.053944073617458344,
0.035743795335292816,
0.04359107464551926,
-0.040348973125219345,
-0.06221843883395195,
-0.04886356368660927,
0.0012612794525921345,
-0.12104829400777817,
-0.04119601473212242,
0.00935486238449812,
0.07124888151884079,
-0.006889165844768286,
0.033258356153964996,
-0.010290691629052162,
-0.011902314610779285,
0.05526816099882126,
-0.0633106604218483,
0.009351306594908237,
0.004024746362119913,
-0.14226432144641876,
-0.044734030961990356,
0.045905351638793945,
-0.0539841465651989,
0.0914645567536354,
-0.10781125724315643,
-0.016115378588438034,
0.007315709721297026,
0.032394010573625565,
0.05848317965865135,
0.03903690725564957,
0.021435489878058434,
-0.0071160560473799706,
0.07459823042154312,
0.0971834659576416,
-0.16168427467346191,
-0.06427591294050217,
-0.0289843138307333,
-5.0725020628306083e-8,
-0.023191027343273163,
-0.08717446029186249,
-0.09515563398599625,
0.022471828386187553,
0.01688561961054802,
0.00773500045761466,
0.03466270864009857,
-0.04170789569616318,
0.049073196947574615,
-0.0031777950935065746,
-0.03525332361459732,
-0.05736033618450165,
0.019727390259504318,
-0.09365548938512802,
0.03265201300382614,
0.09076331555843353,
-0.01762418821454048,
0.023226778954267502,
-0.015239420346915722,
-0.06731898337602615,
0.03614694997668266,
-0.01606665551662445,
-0.03258870169520378,
0.08965481072664261,
-0.11664748936891556,
-0.05324849113821983,
0.09742613136768341,
0.03271462395787239,
-0.08296633511781693,
-0.06670156121253967,
-0.005864894017577171,
0.050784897059202194,
-0.010066074319183826,
-0.023166287690401077,
0.008384949527680874,
0.048588644713163376,
-0.012128203175961971,
-0.0021332690957933664,
0.05783749744296074,
0.03904213756322861,
0.008922574110329151,
0.03922576084733009,
-0.07844262570142746,
0.02471344731748104,
-0.01900191232562065,
0.01338200829923153,
0.07669991999864578,
0.0019708583131432533,
0.026218272745609283,
-0.024772990494966507,
-0.01612960547208786,
0.03448743000626564,
-0.05897035077214241,
0.03526392951607704,
0.007660672999918461,
0.017184536904096603,
-0.017225630581378937,
-0.0684952512383461,
-0.02911342680454254,
-0.028708966448903084,
0.01019790954887867,
-0.015842720866203308,
0.0913519412279129,
-0.06953980773687363
] | 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`. `writeStream.clearScreenDown()` clears this `WriteStream` from the current cursor down. ### `writeStream.columns` A `number` specifying the number of columns the TTY currently has. This property is updated whenever the `'resize'` event is emitted. ### `writeStream.cursorTo(x[, y][, callback])` \* `x` {number} \* `y` {number} \* `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`. `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified position. ### `writeStream.getColorDepth([env])` \* `env` {Object} An object containing the environment variables to check. This enables simulating the usage of a specific terminal. \*\*Default:\*\* `process.env`. \* Returns: {number} Returns: \* `1` for 2, \* `4` for 16, \* `8` for 256, \* `24` for 16,777,216 colors supported. Use this to determine what colors the terminal supports. Due to the nature of colors in terminals it is possible to either have false positives or false negatives. It depends on process information and the environment variables that may lie about what terminal is used. It is possible to pass in an `env` object to simulate the usage of a specific terminal. This can be useful to check how specific environment settings behave. To enforce a specific color support, use one of the below environment settings. \* 2 colors: `FORCE\_COLOR = 0` (Disables colors) \* 16 colors: `FORCE\_COLOR = 1` \* 256 colors: `FORCE\_COLOR = 2` \* 16,777,216 colors: `FORCE\_COLOR = 3` Disabling color support is also possible by using the `NO\_COLOR` and `NODE\_DISABLE\_COLORS` environment variables. ### `writeStream.getWindowSize()` \* Returns: {number\[]} `writeStream.getWindowSize()` returns the size of the TTY corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number of columns and rows in the corresponding TTY. ### `writeStream.hasColors([count][, env])` \* `count` {integer} The number of colors that are requested (minimum 2). \*\*Default:\*\* 16. \* `env` {Object} An object containing the environment variables to check. This enables simulating the usage of a specific terminal. \*\*Default:\*\* `process.env`. \* Returns: {boolean} Returns `true` if the `writeStream` supports at least as many colors as provided in `count`. Minimum support is 2 (black and white). This has the same false positives and negatives as described in [`writeStream.getColorDepth()`][]. ```js process.stdout.hasColors(); // Returns true or false depending on if `stdout` supports at least 16 colors. process.stdout.hasColors(256); // Returns true or false depending on if `stdout` supports at least 256 colors. process.stdout.hasColors({ TMUX: '1' }); // Returns true. process.stdout.hasColors(2 \*\* 24, { TMUX: '1' }); // Returns false (the environment setting pretends to support 2 \*\* 8 colors). ``` ### `writeStream.isTTY` A `boolean` that is always `true`. ### `writeStream.moveCursor(dx, dy[, callback])` \* `dx` {number} \* `dy` {number} \* `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`. `writeStream.moveCursor()` moves this `WriteStream`'s cursor \_relative\_ to its current position. ### `writeStream.rows` A `number` specifying the number of rows 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 | 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.03154201805591583,
-0.08930566906929016,
-0.03799068555235863,
-0.07165031135082245,
-0.009111066348850727,
-0.044124435633420944,
-0.07812873274087906,
0.07155435532331467,
-0.05609675124287605,
0.010384568013250828,
0.015132622793316841,
0.04670156538486481,
-0.00863624643534422,
0.009385885670781136,
-0.00040378503035753965,
0.02429204247891903,
-0.07121405750513077,
-0.0908224955201149,
0.06814749538898468,
-0.05673283711075783,
-0.021700091660022736,
-0.008616508916020393,
0.04458116739988327,
-0.01756724901497364,
-0.016467895358800888,
-0.09361868351697922,
0.020244065672159195,
0.07674596458673477,
-0.052025552839040756,
-0.05799231678247452,
0.011063234880566597,
-0.05265289917588234,
-0.02130003087222576,
-0.10304524749517441,
-0.006456985604017973,
-0.0447220653295517,
0.01773103140294552,
0.01270767580717802,
0.10835151374340057,
-0.056283749639987946,
0.05019618570804596,
0.054272186011075974,
-0.013190061785280704,
0.07181134074926376,
-0.04232703149318695,
0.02177441120147705,
0.048688750714063644,
-0.047669872641563416,
-0.01109967939555645,
-0.045574624091386795,
0.02490694634616375,
0.07665242999792099,
0.00339010963216424,
-0.010784434154629707,
-0.00033346275449730456,
0.01750139892101288,
0.05351404473185539,
-0.0007916964241303504,
0.053719911724328995,
-0.02557390183210373,
-0.025301411747932434,
-0.08953484147787094,
-0.03291532024741173,
0.033412594348192215,
0.02360628917813301,
-0.025162827223539352,
-0.009958184324204922,
0.02614104561507702,
-0.005907720886170864,
-0.014012465253472328,
0.01366045605391264,
0.029784396290779114,
0.026029055938124657,
-0.005426580552011728,
-0.005801936611533165,
0.02723478339612484,
0.062190182507038116,
-0.01656980998814106,
0.019078420475125313,
-0.030871478840708733,
0.023206837475299835,
-0.09688147902488708,
0.007589141372591257,
0.054578423500061035,
-0.053417403250932693,
-0.03498546779155731,
-0.012353288009762764,
0.022608047351241112,
0.03844335675239563,
0.05390743538737297,
0.04815700277686119,
0.029502585530281067,
0.002135674236342311,
0.02768322080373764,
-0.024490036070346832,
-0.057283587753772736,
0.01761806011199951,
0.01725677214562893,
0.006471140775829554,
0.01016537006944418,
0.030945949256420135,
-0.03663397952914238,
0.07802825421094894,
-0.016258662566542625,
0.012680776417255402,
0.03412705287337303,
0.010765188373625278,
0.13595791161060333,
0.07202409952878952,
-0.0740167647600174,
-0.03089200146496296,
0.007956759072840214,
0.02159830927848816,
0.0813583955168724,
2.4464689649740846e-33,
-0.027401108294725418,
-0.09055256843566895,
-0.03585517406463623,
0.05014472082257271,
0.08648504316806793,
0.06508924067020416,
-0.008593235164880753,
0.06367936730384827,
-0.06396812945604324,
0.017020635306835175,
-0.00017912982730194926,
0.010338637977838516,
-0.07149133831262589,
0.017996905371546745,
0.008372432552278042,
-0.04428686574101448,
0.10994362831115723,
0.08675704896450043,
-0.07489737123250961,
0.01539571676403284,
0.11176935583353043,
0.054607778787612915,
-0.05183185264468193,
-0.007906384766101837,
-0.022720778360962868,
0.0002608021313790232,
-0.12859775125980377,
0.008029830642044544,
-0.10570375621318817,
0.029340321198105812,
-0.09737759828567505,
0.041149530559778214,
-0.025510238483548164,
-0.0053977202624082565,
0.03028135746717453,
-0.05861238017678261,
-0.04164851829409599,
-0.04094937816262245,
0.027731575071811676,
-0.020418386906385422,
-0.04900894686579704,
0.01749529130756855,
-0.09132277965545654,
-0.07493672519922256,
-0.09938839077949524,
-0.1273409128189087,
0.0006996570155024529,
0.032809529453516006,
-0.004690281115472317,
-0.05224491283297539,
0.0466749332845211,
0.05445874482393265,
0.0342959389090538,
-0.029808316379785538,
0.06124800443649292,
-0.03901982307434082,
0.06013977900147438,
-0.0506393201649189,
0.020020438358187675,
0.017396075651049614,
-0.013359423726797104,
0.06738495826721191,
-0.05752282962203026,
-0.0038717228453606367,
-0.057896990329027176,
0.027740608900785446,
0.024652549996972084,
0.006927924230694771,
0.03277963772416115,
-0.03363789618015289,
-0.03938698768615723,
0.08091440051794052,
0.020487500354647636,
0.014336480759084225,
0.0369175486266613,
0.03381538391113281,
-0.03283648192882538,
-0.08153849095106125,
-0.07251419872045517,
-0.027440063655376434,
0.07223673164844513,
0.014626401476562023,
-0.020695442333817482,
0.005077754147350788,
0.07100612670183182,
-0.056818194687366486,
-0.016681015491485596,
-0.02295125462114811,
-0.06482869386672974,
-0.006790013983845711,
-0.04354146867990494,
-0.08503475785255432,
0.07696083188056946,
-0.08757342398166656,
-0.0799257680773735,
-5.527797449572332e-33,
0.00543951615691185,
0.02754826471209526,
-0.024216923862695694,
0.05161164700984955,
-0.057138584554195404,
-0.01501860935240984,
0.030809657648205757,
0.059593603014945984,
0.005349277053028345,
-0.08887653797864914,
-0.07121065258979797,
0.06862816959619522,
-0.03707291558384895,
-0.009026968851685524,
0.033082518726587296,
0.09881362318992615,
-0.05724094808101654,
-0.020924022421240807,
-0.10439655184745789,
-0.10424945503473282,
0.025615397840738297,
-0.045592810958623886,
0.07569485157728195,
0.104737289249897,
0.020421965047717094,
-0.07747498899698257,
0.02936052717268467,
-0.007219390477985144,
0.016412122175097466,
-0.006311265751719475,
-0.011734374798834324,
-0.006198049057275057,
-0.05221051350235939,
0.089166060090065,
0.045892421156167984,
-0.043130893260240555,
0.08871454000473022,
0.07105812430381775,
0.01695801131427288,
0.04592518135905266,
0.18992921710014343,
0.02893678843975067,
0.034342728555202484,
0.017821965739130974,
0.03180660679936409,
0.056741368025541306,
-0.04669509828090668,
0.034898899495601654,
-0.0036259167827665806,
-0.04036374390125275,
0.0407620407640934,
0.04267578944563866,
0.03314294293522835,
0.13087330758571625,
-0.01796874776482582,
-0.034638404846191406,
0.07532306760549545,
-0.07314807176589966,
-0.01865071803331375,
0.008963178843259811,
-0.009349160827696323,
-0.09422469884157181,
-0.03761284798383713,
-0.0553257092833519,
0.031794916838407516,
-0.03948206081986427,
-0.013634446077048779,
0.037425220012664795,
-0.030315477401018143,
-0.04294900223612785,
0.04729732498526573,
-0.016425250098109245,
0.0009377175592817366,
0.010447457432746887,
0.010392963886260986,
0.004715281538665295,
-0.04517405107617378,
-0.13125064969062805,
0.028849443420767784,
0.08107772469520569,
-0.013340577483177185,
0.01464057806879282,
0.0466909222304821,
0.0043266210705041885,
0.008014553226530552,
0.026760855689644814,
-0.004522819072008133,
0.048283569514751434,
0.0017374380258843303,
0.01944764517247677,
0.007083013653755188,
0.0007689422927796841,
-0.09789656847715378,
0.00017492759798187762,
-0.000016257814422715455,
-4.9743732688511955e-8,
-0.043860483914613724,
-0.035382211208343506,
-0.03569580987095833,
-0.02063354291021824,
-0.0014809229178354144,
-0.11910861730575562,
0.0037270961329340935,
0.04683675616979599,
0.06986474990844727,
-0.08340966701507568,
0.05963503196835518,
0.0021709853317588568,
0.06649205088615417,
-0.03850327059626579,
0.05493483319878578,
0.06601262837648392,
0.03193126991391182,
-0.07606424391269684,
-0.004396600648760796,
-0.04643835499882698,
0.014076107181608677,
-0.032814208418130875,
-0.06840184330940247,
0.05087868124246597,
-0.055629294365644455,
-0.05786101892590523,
0.008127452805638313,
0.09754090011119843,
-0.0009823977015912533,
-0.10977855324745178,
0.02960091456770897,
0.02185429446399212,
0.06084941700100899,
0.09797520935535431,
-0.006601741071790457,
0.01620723120868206,
0.12318410724401474,
-0.021138232201337814,
0.036014147102832794,
0.05477811396121979,
-0.011719323694705963,
-0.01753467693924904,
-0.06960810720920563,
0.005396333523094654,
-0.029343966394662857,
0.021596943959593773,
-0.02916361391544342,
0.02962413989007473,
-0.027717547491192818,
-0.005790911614894867,
-0.037830568850040436,
0.02485707402229309,
0.020679423585534096,
0.029168058186769485,
0.0362018421292305,
-0.06099206209182739,
-0.028705626726150513,
0.015317103825509548,
0.025977052748203278,
0.03808832913637161,
0.016542112454771996,
0.08623071014881134,
0.049831002950668335,
-0.03485666215419769
] | 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 non-negative integer. [`net.Socket` constructor]: net.md#new-netsocketoptions [`process.stderr`]: process.md#processstderr [`process.stdin`]: process.md#processstdin [`process.stdout`]: process.md#processstdout [`writeStream.getColorDepth()`]: #writestreamgetcolordepthenv | 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.01908940076828003,
-0.05342083424329758,
-0.0908338651061058,
-0.05014156550168991,
0.005988942459225655,
-0.02382788062095642,
-0.10715659707784653,
0.0208381786942482,
0.03258826956152916,
0.04352763667702675,
-0.01829542964696884,
-0.0023097479715943336,
-0.042409151792526245,
0.010279295034706593,
-0.019222987815737724,
0.021300027146935463,
-0.013348877429962158,
-0.06456467509269714,
0.07843859493732452,
-0.03811021149158478,
0.010534926317632198,
0.09251094609498978,
0.031147701665759087,
0.07351777702569962,
-0.019446570426225662,
-0.053521934896707535,
0.021060151979327202,
0.04791741818189621,
-0.012993866577744484,
-0.03174673765897751,
0.004335834179073572,
-0.04744341969490051,
-0.0020879858639091253,
-0.0869140550494194,
0.006150980945676565,
-0.0508587472140789,
-0.03519891947507858,
0.06981781125068665,
0.102736696600914,
0.009504108689725399,
0.05612841248512268,
0.05939451977610588,
-0.06128619983792305,
-0.006892004050314426,
-0.0003517972945701331,
-0.024792451411485672,
0.0297793410718441,
-0.05162496492266655,
0.06176861375570297,
-0.02588237076997757,
0.004559548106044531,
0.06035473197698593,
0.12460635602474213,
-0.001395224709995091,
-0.06265895813703537,
0.04709313437342644,
-0.00801989994943142,
-0.0379583016037941,
-0.03776964172720909,
-0.02832646295428276,
0.012806697748601437,
-0.01171985175460577,
-0.04604234918951988,
0.05928660184144974,
-0.0002807485871016979,
-0.03114674799144268,
0.055404338985681534,
-0.0634038895368576,
-0.05199339613318443,
0.06339308619499207,
0.014512036927044392,
0.04669225588440895,
0.08272276073694229,
-0.08424864709377289,
0.004675186239182949,
-0.017468370497226715,
0.05623037740588188,
-0.08780980855226517,
-0.007787964306771755,
-0.06896471232175827,
0.027971405535936356,
0.00449660187587142,
0.004017331637442112,
-0.05437184497714043,
-0.021682526916265488,
-0.08844124525785446,
0.03752516955137253,
-0.01364600844681263,
0.04376315325498581,
0.005330020561814308,
0.028453370556235313,
0.07201895117759705,
0.02357187680900097,
0.051157303154468536,
-0.026681626215577126,
-0.0166973527520895,
-0.05487581714987755,
0.022456420585513115,
-0.010594518855214119,
0.08226301521062851,
0.04567468911409378,
0.021250547841191292,
-0.01842891052365303,
-0.01899261586368084,
0.08424115926027298,
0.03577623888850212,
0.011469168588519096,
0.07847829163074493,
-0.008203720673918724,
-0.05848023295402527,
0.05873389169573784,
-0.0033164755441248417,
0.009551946073770523,
0.03149813413619995,
5.0145450245926426e-33,
-0.07410800457000732,
-0.03182549402117729,
0.019603705033659935,
0.021611148491501808,
0.06034967303276062,
0.03300188481807709,
0.03684818744659424,
0.032410986721515656,
0.008660821244120598,
0.011213947087526321,
-0.07578445225954056,
0.0007311657536774874,
-0.03178705647587776,
-0.0340595506131649,
0.05445631593465805,
-0.05763435363769531,
-0.003840146353468299,
0.07694536447525024,
0.009907351806759834,
-0.0003514586132951081,
0.07433652877807617,
0.02827225998044014,
-0.006160467863082886,
-0.04558081924915314,
0.04498089849948883,
-0.04289814829826355,
-0.11524724960327148,
0.0038246270269155502,
-0.0444771982729435,
0.01369002740830183,
-0.08939000219106674,
-0.05855242535471916,
0.012753507122397423,
-0.028342852368950844,
-0.03847046568989754,
-0.10811576247215271,
-0.03108097054064274,
-0.02430945634841919,
-0.06811472028493881,
-0.018783699721097946,
-0.018763136118650436,
-0.04500819742679596,
-0.0727098360657692,
-0.031144283711910248,
-0.07954955846071243,
-0.08504585921764374,
-0.1128116324543953,
0.021115731447935104,
-0.008454876951873302,
-0.06177069991827011,
0.11580513417720795,
0.0755470022559166,
0.028780655935406685,
-0.05323854833841324,
0.037383370101451874,
-0.13324104249477386,
0.05333699658513069,
0.04912044107913971,
0.055223602801561356,
0.10976120829582214,
-0.0445491224527359,
-0.015005278401076794,
0.010800786316394806,
0.024232015013694763,
0.06732694804668427,
0.013394362293183804,
0.01160868164151907,
-0.06567441672086716,
-0.018929041922092438,
0.042091887444257736,
-0.08696514368057251,
0.060249313712120056,
0.04821030795574188,
0.05198827013373375,
0.005033437628298998,
0.025722546502947807,
0.0374775193631649,
-0.037581391632556915,
-0.03766970336437225,
-0.026527466252446175,
0.05708162114024162,
-0.018340103328227997,
-0.032383743673563004,
0.01881960593163967,
0.061209388077259064,
-0.06122593954205513,
-0.026968611404299736,
-0.06174475699663162,
0.022296790033578873,
-0.018208762630820274,
-0.020101169124245644,
-0.041353337466716766,
0.06254515051841736,
-0.005320821423083544,
-0.04076801612973213,
-6.254540219812488e-33,
-0.05210375413298607,
0.02150159887969494,
-0.06424073874950409,
-0.010493614710867405,
-0.12879304587841034,
-0.04713297262787819,
0.042741745710372925,
0.0162209365516901,
-0.025029096752405167,
-0.1067245826125145,
0.05935748666524887,
0.028505487367510796,
0.015605044551193714,
0.012918759137392044,
-0.029520437121391296,
0.07608885318040848,
-0.06187354773283005,
-0.028759757056832314,
0.0524483397603035,
0.0032398437615484,
-0.017170023173093796,
0.024831116199493408,
0.05097479000687599,
0.03328287601470947,
0.01988382823765278,
-0.00026111514307558537,
0.01661437191069126,
0.045335154980421066,
-0.05956059694290161,
-0.008810416795313358,
0.019396884366869926,
0.05088618025183678,
-0.07102319598197937,
0.025780949741601944,
-0.02672397345304489,
-0.004726863000541925,
0.09661383181810379,
0.03621365502476692,
0.059040367603302,
0.1372871845960617,
0.16218815743923187,
0.03889145702123642,
-0.026152238249778748,
0.046830061823129654,
0.025112394243478775,
0.035963963717222214,
-0.023838788270950317,
-0.030955839902162552,
0.04275921359658241,
-0.05586933344602585,
0.05748993158340454,
0.015650222077965736,
0.092325858771801,
0.09107542037963867,
-0.0277701448649168,
0.052151091396808624,
0.08523746579885483,
-0.04799794778227806,
-0.052177347242832184,
0.013835443183779716,
0.057058680802583694,
-0.11495647579431534,
-0.054222140461206436,
-0.04688435047864914,
0.022076115012168884,
-0.05879870802164078,
-0.02413257583975792,
0.00458753714337945,
-0.022797543555498123,
-0.017031177878379822,
0.1014317125082016,
-0.01982692815363407,
-0.009914766065776348,
0.10276245325803757,
-0.07266205549240112,
0.014057927764952183,
0.08660822361707687,
-0.0889739841222763,
-0.02785537950694561,
0.09487850219011307,
-0.06257383525371552,
0.05569286271929741,
-0.037120793014764786,
-0.001174983917735517,
-0.004051180090755224,
0.018408117815852165,
-0.007773165591061115,
0.08517038822174072,
0.012845213524997234,
-0.003429579781368375,
-0.06249554827809334,
0.06554342061281204,
-0.0559336319565773,
-0.03390903025865555,
0.04386977106332779,
-4.88797589071055e-8,
-0.06035497039556503,
-0.04109826683998108,
-0.047261614352464676,
0.03095836751163006,
0.030465921387076378,
0.03630729392170906,
-0.0367729552090168,
-0.10284367203712463,
-0.0018030101200565696,
-0.08726765215396881,
-0.05744558945298195,
-0.017320998013019562,
0.001432029064744711,
-0.04313169792294502,
0.09197860211133957,
0.03576052188873291,
-0.008779826574027538,
-0.032458994537591934,
-0.01074984110891819,
-0.12394466996192932,
0.05961969867348671,
0.023922642692923546,
-0.005056329071521759,
0.03088877908885479,
-0.11259734630584717,
-0.07168975472450256,
0.07550887763500214,
0.08875763416290283,
-0.09824692457914352,
-0.027287015691399574,
-0.009390761144459248,
0.023923637345433235,
0.04547450318932533,
0.04029771685600281,
-0.0216677263379097,
0.08313213288784027,
-0.009645186364650726,
0.04946655407547951,
-0.008525465615093708,
-0.02637961320579052,
-0.05787689983844757,
0.020809974521398544,
-0.1306902915239334,
0.027874218299984932,
-0.020446380600333214,
0.00111761421430856,
0.040225349366664886,
0.04167929291725159,
-0.024178629741072655,
-0.008217200636863708,
0.060765646398067474,
0.02580069936811924,
0.03653470426797867,
0.036680132150650024,
-0.008497816510498524,
0.008899365551769733,
-0.036438193172216415,
0.0072921873070299625,
-0.01242472417652607,
0.027620630338788033,
-0.007886109873652458,
0.016128182411193848,
0.020881999284029007,
-0.07747630774974823
] | 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:` scheme. ## `quic.connect(address[, options])` \* `address` {string|net.SocketAddress} \* `options` {quic.SessionOptions} \* Returns: {Promise} a promise for a {quic.QuicSession} Initiate a new client-side session. ```mjs import { connect } from 'node:quic'; import { Buffer } from 'node:buffer'; const enc = new TextEncoder(); const alpn = 'foo'; const client = await connect('123.123.123.123:8888', { alpn }); await client.createUnidirectionalStream({ body: enc.encode('hello world'), }); ``` By default, every call to `connect(...)` will create a new local `QuicEndpoint` instance bound to a new random local IP port. To specify the exact local address to use, or to multiplex multiple QUIC sessions over a single local port, pass the `endpoint` option with either a `QuicEndpoint` or `EndpointOptions` as the argument. ```mjs import { QuicEndpoint, connect } from 'node:quic'; const endpoint = new QuicEndpoint({ address: '127.0.0.1:1234', }); const client = await connect('123.123.123.123:8888', { endpoint }); ``` ## `quic.listen(onsession,[options])` \* `onsession` {quic.OnSessionCallback} \* `options` {quic.SessionOptions} \* Returns: {Promise} a promise for a {quic.QuicEndpoint} Configures the endpoint to listen as a server. When a new session is initiated by a remote peer, the given `onsession` callback will be invoked with the created session. ```mjs import { listen } from 'node:quic'; const endpoint = await listen((session) => { // ... handle the session }); // Closing the endpoint allows any sessions open when close is called // to complete naturally while preventing new sessions from being // initiated. Once all existing sessions have finished, the endpoint // will be destroyed. The call returns a promise that is resolved once // the endpoint is destroyed. await endpoint.close(); ``` By default, every call to `listen(...)` will create a new local `QuicEndpoint` instance bound to a new random local IP port. To specify the exact local address to use, or to multiplex multiple QUIC sessions over a single local port, pass the `endpoint` option with either a `QuicEndpoint` or `EndpointOptions` as the argument. At most, any single `QuicEndpoint` can only be configured to listen as a server once. ## Class: `QuicEndpoint` A `QuicEndpoint` encapsulates the local UDP-port binding for QUIC. It can be used as both a client and a server. ### `new QuicEndpoint([options])` \* `options` {quic.EndpointOptions} ### `endpoint.address` \* Type: {net.SocketAddress|undefined} The local UDP socket address to which the endpoint is bound, if any. If the endpoint is not currently bound then the value will be `undefined`. Read only. ### `endpoint.busy` \* Type: {boolean} When `endpoint.busy` is set to true, the endpoint will temporarily reject new sessions from being created. Read/write. ```mjs // Mark the endpoint busy. New sessions will be prevented. endpoint.busy = true; // Mark the endpoint free. New session will be allowed. endpoint.busy = false; ``` The `busy` property is useful when the endpoint is under heavy load and needs to temporarily reject new sessions while it catches up. ### `endpoint.close()` \* Returns: {Promise} Gracefully close the endpoint. The endpoint will close and destroy itself when all currently open sessions close. Once called, new sessions will be rejected. Returns a promise that is fulfilled when the endpoint is destroyed. ### `endpoint.closed` \* 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. ### `endpoint.destroy([error])` | 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.013355167582631111,
0.07508926838636398,
0.036066554486751556,
0.05171790346503258,
-0.09050468355417252,
0.04447642341256142,
-0.018043609336018562,
-0.07202090322971344,
-0.0484638437628746,
0.04107264056801796,
-0.030915571376681328,
-0.01990951970219612,
-0.0528637059032917,
0.003939891699701548,
0.07824791967868805,
0.03032325766980648,
0.014185355044901371,
0.008556808345019817,
0.08231061697006226,
-0.09834925830364227,
-0.0009102785843424499,
-0.07784522324800491,
0.1066451221704483,
0.01944098062813282,
-0.053311411291360855,
-0.007743136491626501,
-0.04396327584981918,
0.025080174207687378,
0.09459187090396881,
-0.0668012723326683,
0.019921662285923958,
0.07119133323431015,
0.00875602662563324,
-0.0065083689987659454,
0.0391739085316658,
-0.10303948819637299,
0.037318430840969086,
0.013573877513408661,
-0.01169542782008648,
-0.03757559880614281,
0.07774503529071808,
0.004051027819514275,
0.08807133138179779,
-0.05512479692697525,
0.06796449422836304,
0.03991168737411499,
0.1249748021364212,
-0.11099579930305481,
0.000019205021089874208,
0.0012065171031281352,
-0.03538603335618973,
-0.02489631436765194,
0.007455134764313698,
-0.005007497500628233,
0.05227143317461014,
0.012222640216350555,
0.04163583368062973,
-0.029982861131429672,
-0.0326717384159565,
-0.03514515608549118,
-0.05214088037610054,
0.021010110154747963,
-0.029134586453437805,
0.0224185511469841,
-0.028228111565113068,
-0.08298419415950775,
0.057654790580272675,
-0.04833657667040825,
-0.022759953513741493,
-0.050808876752853394,
0.06457208096981049,
-0.01783188059926033,
-0.014976593665778637,
0.0486593060195446,
-0.002828978467732668,
0.04261920228600502,
-0.009553257375955582,
-0.018261222168803215,
0.006010223180055618,
-0.045499660074710846,
-0.06104803830385208,
-0.015072636306285858,
0.07254475355148315,
-0.038100965321063995,
-0.008655626326799393,
-0.03289744257926941,
0.05022326856851578,
0.03640967607498169,
-0.05412153899669647,
0.0517587773501873,
-0.0499439537525177,
-0.03110852651298046,
0.05134997516870499,
0.031668856739997864,
0.04497876390814781,
0.06398023664951324,
0.038130633533000946,
-0.0603397972881794,
0.01769605278968811,
0.06169271841645241,
-0.02931509166955948,
-0.05476098880171776,
-0.000348042172845453,
0.03021950274705887,
-0.036132119596004486,
0.11423290520906448,
0.037457890808582306,
0.0605226568877697,
-0.02734297327697277,
0.002192228566855192,
-0.011594444513320923,
0.020369816571474075,
-0.03477192670106888,
0.09113124012947083,
3.318838587549829e-33,
0.0027163922786712646,
-0.04857513681054115,
-0.03276180475950241,
0.09459913522005081,
-0.0032593212090432644,
0.022207923233509064,
0.069938525557518,
0.01350930705666542,
-0.1518772393465042,
-0.03150249645113945,
-0.041879698634147644,
-0.024174796417355537,
0.044030580669641495,
-0.02848799340426922,
-0.043904006481170654,
0.0675269216299057,
-0.0056859408505260944,
-0.014292683452367783,
0.05722714215517044,
0.031772784888744354,
-0.014680635184049606,
-0.02451941929757595,
0.025621376931667328,
-0.03507161885499954,
0.06090172752737999,
-0.001005840953439474,
0.009836340323090553,
0.03968169167637825,
0.017721517011523247,
-0.050750210881233215,
0.039312828332185745,
0.07823430746793747,
0.06303779780864716,
0.01580512896180153,
-0.008922296576201916,
0.021895136684179306,
0.009151936508715153,
0.007435665000230074,
-0.13943149149417877,
-0.010162756778299809,
-0.005872323177754879,
0.1007731705904007,
-0.004518635105341673,
-0.02664576843380928,
0.0003194728633388877,
-0.06181946024298668,
-0.041302286088466644,
0.040632214397192,
0.022055912762880325,
-0.024632425978779793,
-0.05704135075211525,
0.021829983219504356,
-0.050744228065013885,
0.055377475917339325,
0.010198486037552357,
-0.009523874148726463,
0.025542622432112694,
-0.01568641886115074,
-0.00872744619846344,
-0.0325515978038311,
0.03640031814575195,
-0.033160269260406494,
-0.04654230177402496,
-0.031535279005765915,
0.0358227901160717,
0.030828306451439857,
-0.13944971561431885,
-0.022280652076005936,
0.0335514098405838,
0.0629180371761322,
-0.07478784769773483,
0.030408760532736778,
-0.047376956790685654,
-0.008620387874543667,
-0.04487035423517227,
-0.012389138340950012,
-0.07669805735349655,
-0.04223484545946121,
0.015307911671698093,
-0.0029453332535922527,
0.10648051649332047,
-0.04705941677093506,
-0.01547054573893547,
0.07642747461795807,
-0.00020185083849355578,
-0.08748442679643631,
-0.02147791162133217,
-0.021918250247836113,
0.026374295353889465,
-0.01738862693309784,
-0.0004781627794727683,
0.014143086969852448,
0.06956320255994797,
-0.03087104856967926,
-0.08430231362581253,
-3.775507489926733e-33,
-0.0234274510294199,
-0.00025202156393788755,
-0.12510281801223755,
0.15706117451190948,
0.01960679329931736,
0.018141966313123703,
0.043572548776865005,
-0.062086671590805054,
-0.042921166867017746,
-0.05159630998969078,
-0.0012464392930269241,
-0.00952601246535778,
0.10532816499471664,
0.040893036872148514,
0.03900381922721863,
-0.014945165254175663,
-0.10599195212125778,
-0.050857845693826675,
0.059879451990127563,
-0.0012070398079231381,
-0.04914531484246254,
-0.03343261405825615,
0.04813374578952789,
-0.031564805656671524,
-0.03800420090556145,
0.020428398624062538,
-0.023442504927515984,
0.0015389698091894388,
-0.032195836305618286,
-0.017434030771255493,
-0.06997402012348175,
-0.008715394884347916,
-0.07610117644071579,
0.09587661176919937,
0.03207744285464287,
0.004819766152650118,
0.006378262769430876,
0.06667281687259674,
-0.014943866059184074,
-0.04337339103221893,
0.09577016532421112,
-0.03512325882911682,
-0.03573125600814819,
0.03178386762738228,
-0.05097323656082153,
0.029608499258756638,
-0.01437756884843111,
0.061484117060899734,
-0.07677144557237625,
0.011127771809697151,
-0.011077959090471268,
-0.017118262127041817,
-0.029489189386367798,
0.013571294955909252,
0.005414844490587711,
-0.005295660346746445,
0.03113686479628086,
-0.05283728986978531,
0.08776487410068512,
-0.011399447917938232,
0.014649813994765282,
-0.11685224622488022,
0.017801307141780853,
-0.029185056686401367,
0.024579081684350967,
0.05613454803824425,
-0.11228112876415253,
0.10837479680776596,
0.09840469062328339,
0.00015989883104339242,
0.017409486696124077,
0.015480631962418556,
-0.0022429288364946842,
-0.01679706573486328,
0.02011670358479023,
0.04733157530426979,
0.0012520257150754333,
-0.10180024802684784,
0.04670655354857445,
0.0919400006532669,
-0.05326691269874573,
0.06330574303865433,
-0.06468996405601501,
-0.01439648400992155,
0.01973305456340313,
0.0006647745613008738,
-0.053519997745752335,
0.12925127148628235,
0.013979231007397175,
-0.016976019367575645,
0.01897132582962513,
0.054524898529052734,
-0.02726571448147297,
0.008318424224853516,
0.05426136031746864,
-4.832814326505286e-8,
-0.07352296262979507,
-0.052761513739824295,
-0.10330309718847275,
0.060572363436222076,
-0.03940751403570175,
0.03345268964767456,
0.0441579706966877,
-0.018526941537857056,
-0.01277594082057476,
0.08286254107952118,
-0.01938753016293049,
-0.006173156201839447,
-0.02665174938738346,
-0.01219914760440588,
0.05343519151210785,
0.08775632828474045,
-0.0036319890059530735,
0.0054438053630292416,
-0.02471679076552391,
0.009152824059128761,
-0.009997141547501087,
0.023621786385774612,
-0.04318954423069954,
0.03189646452665329,
-0.06364510953426361,
-0.06696914881467819,
0.031571488827466965,
0.12981203198432922,
-0.12885552644729614,
0.004987888969480991,
-0.10113716870546341,
-0.004999709781259298,
-0.015122078359127045,
-0.03444644436240196,
-0.013646851293742657,
0.07679309695959091,
-0.058967772871255875,
0.03871152922511101,
0.039998698979616165,
-0.025409700348973274,
0.012228019535541534,
0.023056207224726677,
-0.15442048013210297,
-0.0379711352288723,
-0.029231460765004158,
-0.041963446885347366,
0.04995947331190109,
0.012869425117969513,
0.01556427776813507,
0.03501899540424347,
0.045308925211429596,
-0.04413527995347977,
0.014362337067723274,
-0.025691360235214233,
0.048723746091127396,
0.004577917978167534,
0.002090135356411338,
-0.10581415146589279,
-0.010365251451730728,
-0.003177015343680978,
0.009498895145952702,
-0.009621105156838894,
0.03910980001091957,
-0.01821209490299225
] | 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. ### `endpoint.destroy([error])` \* `error` {any} Forcefully closes the endpoint by forcing all open sessions to be immediately closed. ### `endpoint.destroyed` \* Type: {boolean} True if `endpoint.destroy()` has been called. Read only. ### `endpoint.stats` \* Type: {quic.QuicEndpoint.Stats} The statistics collected for an active session. Read only. ### `endpoint[Symbol.asyncDispose]()` Calls `endpoint.close()` and returns a promise that fulfills when the endpoint has closed. ## Class: `QuicEndpoint.Stats` A view of the collected statistics for an endpoint. ### `endpointStats.createdAt` \* Type: {bigint} A timestamp indicating the moment the endpoint was created. Read only. ### `endpointStats.destroyedAt` \* Type: {bigint} A timestamp indicating the moment the endpoint was destroyed. Read only. ### `endpointStats.bytesReceived` \* Type: {bigint} The total number of bytes received by this endpoint. Read only. ### `endpointStats.bytesSent` \* Type: {bigint} The total number of bytes sent by this endpoint. Read only. ### `endpointStats.packetsReceived` \* Type: {bigint} The total number of QUIC packets successfully received by this endpoint. Read only. ### `endpointStats.packetsSent` \* Type: {bigint} The total number of QUIC packets successfully sent by this endpoint. Read only. ### `endpointStats.serverSessions` \* Type: {bigint} The total number of peer-initiated sessions received by this endpoint. Read only. ### `endpointStats.clientSessions` \* Type: {bigint} The total number of sessions initiated by this endpoint. Read only. ### `endpointStats.serverBusyCount` \* Type: {bigint} The total number of times an initial packet was rejected due to the endpoint being marked busy. Read only. ### `endpointStats.retryCount` \* Type: {bigint} The total number of QUIC retry attempts on this endpoint. Read only. ### `endpointStats.versionNegotiationCount` \* Type: {bigint} The total number sessions rejected due to QUIC version mismatch. Read only. ### `endpointStats.statelessResetCount` \* Type: {bigint} The total number of stateless resets handled by this endpoint. Read only. ### `endpointStats.immediateCloseCount` \* Type: {bigint} The total number of sessions that were closed before handshake completed. Read only. ## Class: `QuicSession` A `QuicSession` represents the local side of a QUIC connection. ### `session.close()` \* Returns: {Promise} Initiate a graceful close of the session. Existing streams will be allowed to complete but no new streams will be opened. Once all streams have closed, the session will be destroyed. The returned promise will be fulfilled once the session has been destroyed. ### `session.closed` \* Type: {Promise} A promise that is fulfilled once the session is destroyed. ### `session.destroy([error])` \* `error` {any} Immediately destroy the session. All streams will be destroys and the session will be closed. ### `session.destroyed` \* Type: {boolean} True if `session.destroy()` has been called. Read only. ### `session.endpoint` \* Type: {quic.QuicEndpoint} The endpoint that created this session. Read only. ### `session.onstream` \* Type: {quic.OnStreamCallback} The callback to invoke when a new stream is initiated by a remote peer. Read/write. ### `session.ondatagram` \* Type: {quic.OnDatagramCallback} The callback to invoke when a new datagram is received from a remote peer. Read/write. ### `session.ondatagramstatus` \* Type: {quic.OnDatagramStatusCallback} The callback to invoke when the status of a datagram is updated. Read/write. ### `session.onpathvalidation` \* Type: {quic.OnPathValidationCallback} The callback to invoke when the path validation is updated. Read/write. ### `session.onsessionticket` \* Type: {quic.OnSessionTicketCallback} The callback to 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 handshake is completed. Read/write. ### `session.createBidirectionalStream([options])` \* `options` {Object} \* `body` {ArrayBuffer | | 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.00329101225361228,
0.06014951318502426,
-0.0010623590787872672,
-0.06228592246770859,
-0.06432796269655228,
0.01943817362189293,
-0.02893294021487236,
0.10752730071544647,
0.07246993482112885,
0.04106272757053375,
0.03223538026213646,
-0.019101569429039955,
-0.03347412496805191,
-0.054218828678131104,
-0.03784149885177612,
-0.008908928371965885,
-0.0345592238008976,
-0.0030529978685081005,
0.005792820826172829,
-0.1398029327392578,
-0.04729166254401207,
-0.015497436746954918,
0.10783044248819351,
-0.03205401450395584,
-0.04885879158973694,
0.030710531398653984,
-0.0662447065114975,
0.05772560089826584,
0.07869115471839905,
-0.0908823311328888,
0.03636106476187706,
0.05166786536574364,
0.0007053609006106853,
-0.05303492397069931,
-0.03485092148184776,
-0.07989330589771271,
0.04059486463665962,
0.0003350502229295671,
0.037036024034023285,
-0.04805378243327141,
0.03320919722318649,
0.0435359887778759,
0.058975089341402054,
-0.005907305050641298,
-0.06672105193138123,
-0.03385239094495773,
0.07897218316793442,
-0.06275372952222824,
-0.0012273354222998023,
-0.021771535277366638,
-0.015596856363117695,
0.05436495319008827,
-0.0022048219107091427,
0.012757604010403156,
0.007857526652514935,
0.08978088945150375,
0.04086436331272125,
0.01385661493986845,
-0.03149436414241791,
-0.05490522086620331,
-0.038810525089502335,
0.010891570709645748,
-0.013852806761860847,
-0.030352983623743057,
-0.05011556297540665,
-0.06554703414440155,
0.022519025951623917,
-0.0542181096971035,
-0.10895486921072006,
0.03131475672125816,
0.030614638701081276,
0.004540452733635902,
0.025777684524655342,
0.07361545413732529,
0.010004542768001556,
0.12263346463441849,
-0.021813297644257545,
0.005724276416003704,
0.018291747197508812,
-0.04552387073636055,
0.08374766260385513,
-0.016736064106225967,
0.044199276715517044,
-0.031748201698064804,
-0.029535794630646706,
-0.0009352162014693022,
0.0630648210644722,
0.039576925337314606,
-0.020353946834802628,
0.07999488711357117,
-0.07491562515497208,
0.010235043242573738,
0.01648395135998726,
0.01576784998178482,
0.0034099973272532225,
-0.022564174607396126,
0.0069651296362280846,
-0.008458593860268593,
-0.029047217220067978,
0.053317777812480927,
0.01079920306801796,
-0.017444944009184837,
0.08353497087955475,
-0.0006913533434271812,
0.05117981508374214,
0.036458924412727356,
0.06281311064958572,
0.16164427995681763,
0.06480948626995087,
0.03782077878713608,
0.018261173740029335,
0.032971397042274475,
-0.029209967702627182,
0.054760631173849106,
4.493339278303687e-33,
0.033116430044174194,
-0.10231085121631622,
-0.03701981157064438,
0.043193519115448,
0.03203761950135231,
0.06994958966970444,
-0.016574615612626076,
0.04450877010822296,
-0.13934442400932312,
0.04506451264023781,
-0.025723550468683243,
0.03916307911276817,
-0.03563417121767998,
-0.03276503086090088,
0.021537965163588524,
0.04579189419746399,
0.0646820068359375,
0.01606539823114872,
-0.004342836327850819,
0.032698482275009155,
0.09043616056442261,
-0.032540421932935715,
-0.027248352766036987,
0.0056571741588413715,
0.016000637784600258,
0.018749017268419266,
-0.012990678660571575,
0.050583794713020325,
-0.040284816175699234,
-0.015772972255945206,
-0.002831019228324294,
0.00008565440657548606,
0.025728536769747734,
0.056661613285541534,
-0.015522423200309277,
-0.010823501273989677,
-0.011620324105024338,
-0.005375963635742664,
-0.07595366984605789,
-0.09275472164154053,
-0.02399202436208725,
0.07039207965135574,
-0.07054612040519714,
0.007831476628780365,
-0.03657526150345802,
-0.15406815707683563,
-0.015133575536310673,
0.05323749780654907,
0.07933253049850464,
-0.00933642964810133,
-0.037293702363967896,
-0.010475685819983482,
0.011941035278141499,
0.0010501487413421273,
-0.005623792763799429,
-0.006887153256684542,
0.027129802852869034,
0.01885698176920414,
0.021205099299550056,
-0.039515260607004166,
0.09113956987857819,
-0.06230921298265457,
-0.07098405808210373,
-0.09466764330863953,
-0.06287102401256561,
0.00296399206854403,
-0.045556362718343735,
0.01910017989575863,
0.01969284750521183,
0.002980477176606655,
-0.0429358147084713,
0.02068456821143627,
-0.0060624838806688786,
-0.018954621627926826,
-0.005120192654430866,
-0.06160230189561844,
-0.07263972610235214,
0.008008290082216263,
0.06248203665018082,
-0.0019346480257809162,
0.13195091485977173,
-0.07657479494810104,
-0.09808818250894547,
0.09626294672489166,
-0.031042708083987236,
-0.004333372227847576,
-0.002219871152192354,
-0.04981370270252228,
-0.043657273054122925,
-0.010063409805297852,
-0.07243454456329346,
-0.07857152074575424,
0.028216585516929626,
0.011124094016849995,
-0.11329024285078049,
-5.891489891586978e-33,
-0.027810780331492424,
-0.00020689843222498894,
-0.057040490210056305,
0.08749397844076157,
-0.0260026678442955,
-0.004109999164938927,
0.010442651808261871,
-0.0287402905523777,
-0.017666080966591835,
-0.06299761682748795,
0.07089472562074661,
0.01193015743046999,
0.11875760555267334,
0.022878549993038177,
0.021587004885077477,
0.02475244365632534,
0.016450224444270134,
-0.08033474534749985,
-0.019991585984826088,
-0.025906680151820183,
-0.0537368468940258,
-0.017835469916462898,
-0.014705331064760685,
-0.044981468468904495,
-0.008768080733716488,
0.02373729832470417,
-0.06550183147192001,
-0.06405053287744522,
-0.03319544345140457,
-0.030442576855421066,
-0.0558902882039547,
-0.0466611422598362,
-0.04004296287894249,
0.03812935948371887,
0.03020290657877922,
-0.0064741563983261585,
0.02417038381099701,
0.04763302579522133,
-0.1095786988735199,
-0.056103117763996124,
0.18079687654972076,
-0.010212120600044727,
0.009941966272890568,
-0.04103359580039978,
0.04461695998907089,
0.02276446670293808,
-0.00986793078482151,
0.042837198823690414,
-0.06064286828041077,
-0.03539244085550308,
-0.016495076939463615,
-0.017808066681027412,
-0.06263459473848343,
0.02571682073175907,
-0.019560454413294792,
-0.028558440506458282,
0.05888301134109497,
-0.07195554673671722,
-0.010386995039880276,
-0.08298584073781967,
0.008670968003571033,
-0.05842543765902519,
-0.027523666620254517,
0.0663457065820694,
-0.004788173362612724,
-0.015866102650761604,
-0.05293986573815346,
0.03318220004439354,
0.04616108909249306,
0.016959842294454575,
0.01687667891383171,
0.031019801273941994,
0.0036599929444491863,
-0.05493861809372902,
0.0023799757473170757,
0.05392609164118767,
-0.05545680969953537,
-0.17242759466171265,
0.030591540038585663,
0.05130333453416824,
-0.012597180902957916,
0.0024730528239160776,
-0.0015061679296195507,
0.03842385858297348,
-0.0028477702289819717,
-0.004420851357281208,
-0.030550887808203697,
0.060450583696365356,
0.014730607159435749,
0.0757555440068245,
-0.0591420978307724,
0.029103867709636688,
-0.056682735681533813,
0.022620921954512596,
0.01434173621237278,
-5.257511048739616e-8,
-0.07893452048301697,
0.021080350503325462,
0.001304890145547688,
0.029158174991607666,
-0.011977043934166431,
-0.03323620930314064,
0.06361883133649826,
0.06849450618028641,
0.004654733929783106,
0.043228793889284134,
-0.007806092035025358,
0.0034462851472198963,
0.009332680143415928,
0.01787611097097397,
-0.01142992451786995,
0.07870262116193771,
0.050567951053380966,
0.04730530083179474,
0.010028967633843422,
-0.07065580040216446,
-0.059856534004211426,
-0.026871439069509506,
0.03627027943730354,
-0.03282248228788376,
-0.0645541399717331,
0.0068846396170556545,
0.04862426966428757,
0.09962181001901627,
-0.028997810557484627,
-0.05885147303342819,
-0.06480991840362549,
-0.037450842559337616,
0.04592717066407204,
0.05045350268483162,
-0.04869355633854866,
0.12183354049921036,
-0.015413892455399036,
0.06676239520311356,
0.035512592643499374,
0.08850355446338654,
0.013360772281885147,
-0.007664925418794155,
-0.06897915154695511,
0.06576669961214066,
0.015965625643730164,
-0.04384373873472214,
0.04555303230881691,
0.02978542074561119,
0.04106873646378517,
0.02254023589193821,
0.021901048719882965,
-0.012488842941820621,
-0.0521402508020401,
-0.016938554123044014,
-0.035940058529376984,
-0.0024405906442552805,
0.014198512770235538,
-0.08445537090301514,
-0.030982397496700287,
-0.03487458452582359,
0.07820144295692444,
-0.0709291398525238,
-0.01625039428472519,
-0.020455988124012947
] | 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 handshake is completed. Read/write. ### `session.createBidirectionalStream([options])` \* `options` {Object} \* `body` {ArrayBuffer | ArrayBufferView | Blob} \* `sendOrder` {number} \* Returns: {Promise} for a {quic.QuicStream} Open a new bidirectional stream. If the `body` option is not specified, the outgoing stream will be half-closed. ### `session.createUnidirectionalStream([options])` \* `options` {Object} \* `body` {ArrayBuffer | ArrayBufferView | Blob} \* `sendOrder` {number} \* Returns: {Promise} for a {quic.QuicStream} Open a new unidirectional stream. If the `body` option is not specified, the outgoing stream will be closed. ### `session.path` \* Type: {Object|undefined} \* `local` {net.SocketAddress} \* `remote` {net.SocketAddress} The local and remote socket addresses associated with the session. Read only. ### `session.sendDatagram(datagram)` \* `datagram` {string|ArrayBufferView} \* Returns: {bigint} Sends an unreliable datagram to the remote peer, returning the datagram ID. If the datagram payload is specified as an `ArrayBufferView`, then ownership of that view will be transfered to the underlying stream. ### `session.stats` \* Type: {quic.QuicSession.Stats} Return the current statistics for the session. Read only. ### `session.updateKey()` Initiate a key update for the session. ### `session[Symbol.asyncDispose]()` Calls `session.close()` and returns a promise that fulfills when the session has closed. ## Class: `QuicSession.Stats` ### `sessionStats.createdAt` \* Type: {bigint} ### `sessionStats.closingAt` \* Type: {bigint} ### `sessionStats.handshakeCompletedAt` \* Type: {bigint} ### `sessionStats.handshakeConfirmedAt` \* Type: {bigint} ### `sessionStats.bytesReceived` \* Type: {bigint} ### `sessionStats.bytesSent` \* Type: {bigint} ### `sessionStats.bidiInStreamCount` \* Type: {bigint} ### `sessionStats.bidiOutStreamCount` \* Type: {bigint} ### `sessionStats.uniInStreamCount` \* Type: {bigint} ### `sessionStats.uniOutStreamCount` \* Type: {bigint} ### `sessionStats.maxBytesInFlights` \* Type: {bigint} ### `sessionStats.bytesInFlight` \* Type: {bigint} ### `sessionStats.blockCount` \* Type: {bigint} ### `sessionStats.cwnd` \* Type: {bigint} ### `sessionStats.latestRtt` \* Type: {bigint} ### `sessionStats.minRtt` \* Type: {bigint} ### `sessionStats.rttVar` \* Type: {bigint} ### `sessionStats.smoothedRtt` \* Type: {bigint} ### `sessionStats.ssthresh` \* Type: {bigint} ### `sessionStats.datagramsReceived` \* Type: {bigint} ### `sessionStats.datagramsSent` \* Type: {bigint} ### `sessionStats.datagramsAcknowledged` \* Type: {bigint} ### `sessionStats.datagramsLost` \* Type: {bigint} ## Class: `QuicStream` ### `stream.closed` \* Type: {Promise} A promise that is fulfilled when the stream is fully closed. ### `stream.destroy([error])` \* `error` {any} Immediately and abruptly destroys the stream. ### `stream.destroyed` \* Type: {boolean} True if `stream.destroy()` has been called. ### `stream.direction` \* Type: {string} One of either `'bidi'` or `'uni'`. The directionality of the stream. Read only. ### `stream.id` \* Type: {bigint} The stream ID. Read only. ### `stream.onblocked` \* Type: {quic.OnBlockedCallback} The callback to invoke when the stream is blocked. Read/write. ### `stream.onreset` \* Type: {quic.OnStreamErrorCallback} The callback to invoke when the stream is reset. Read/write. ### `stream.readable` \* Type: {ReadableStream} ### `stream.session` \* Type: {quic.QuicSession} The session that created this stream. Read only. ### `stream.stats` \* Type: {quic.QuicStream.Stats} The current statistics for the stream. Read only. ## Class: `QuicStream.Stats` ### `streamStats.ackedAt` \* Type: {bigint} ### `streamStats.bytesReceived` \* Type: {bigint} ### `streamStats.bytesSent` \* Type: {bigint} ### `streamStats.createdAt` \* Type: {bigint} ### `streamStats.destroyedAt` \* Type: {bigint} ### `streamStats.finalSize` \* Type: {bigint} ### `streamStats.isConnected` \* Type: {bigint} ### `streamStats.maxOffset` \* Type: {bigint} ### `streamStats.maxOffsetAcknowledged` \* Type: {bigint} ### `streamStats.maxOffsetReceived` \* Type: {bigint} ### `streamStats.openedAt` \* Type: {bigint} ### `streamStats.receivedAt` \* Type: {bigint} ## Types ### Type: `EndpointOptions` \* Type: {Object} The endpoint configuration options passed when constructing a new `QuicEndpoint` 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 of validated socket addresses as a | 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.05184146389365196,
0.04701162502169609,
-0.04713115468621254,
0.0003606692480389029,
-0.12070218473672867,
-0.02599433623254299,
-0.005846741609275341,
0.008938051760196686,
-0.01627565547823906,
0.001369626959785819,
0.0010102717205882072,
-0.003373097162693739,
-0.10457859933376312,
0.0027340848464518785,
-0.011865601874887943,
0.008920134045183659,
0.025191200897097588,
-0.01825370267033577,
0.050291698426008224,
-0.13431653380393982,
-0.03780170902609825,
-0.045471496880054474,
0.10148310661315918,
0.05354335904121399,
0.0195626188069582,
0.012288917787373066,
-0.042069997638463974,
0.08638042956590652,
0.013211419805884361,
-0.10011918097734451,
0.045980703085660934,
0.01335924956947565,
-0.00964817963540554,
-0.0006736808572895825,
-0.01678542234003544,
-0.0910283774137497,
0.07865288108587265,
-0.003572275163605809,
0.0065622758120298386,
-0.006370480637997389,
0.0891750231385231,
-0.021298114210367203,
0.08287017047405243,
-0.03969508782029152,
0.08995848149061203,
0.009638586081564426,
0.11756344139575958,
-0.08946941792964935,
-0.047459427267313004,
-0.040300920605659485,
-0.03722619265317917,
-0.05170074477791786,
0.030029308050870895,
0.06379301846027374,
0.014147138223052025,
0.027580080553889275,
0.007376489695161581,
-0.008685505017638206,
0.0012003586161881685,
-0.004434185102581978,
-0.09063234180212021,
0.050594672560691833,
0.004659044090658426,
0.0211318526417017,
-0.015193400904536247,
-0.07509635388851166,
-0.03474314883351326,
-0.019048796966671944,
-0.06574033945798874,
-0.03802581503987312,
0.029818357899785042,
-0.039938490837812424,
-0.04296451434493065,
0.026425808668136597,
-0.01249025296419859,
0.07464641332626343,
-0.007432153448462486,
-0.02981542982161045,
0.03969448804855347,
-0.022641094401478767,
-0.02830684557557106,
-0.026611439883708954,
0.0856492817401886,
-0.049272630363702774,
0.01567765139043331,
0.022104665637016296,
0.06954699754714966,
0.0520683117210865,
-0.04011686146259308,
0.03473208472132683,
-0.017116796225309372,
-0.009488995186984539,
0.04800071194767952,
0.03967142850160599,
-0.014797259122133255,
0.019377896562218666,
0.043111469596624374,
-0.013915241695940495,
0.024972496554255486,
0.09949154406785965,
-0.024640796706080437,
-0.030963871628046036,
0.05208933353424072,
-0.025219444185495377,
0.011986815370619297,
0.06048618629574776,
-0.07449576258659363,
0.09573221206665039,
-0.04227352514863014,
0.003078557550907135,
0.003560782177373767,
0.010045874863862991,
-0.033880967646837234,
0.09181296825408936,
8.705384962507508e-33,
0.023190584033727646,
-0.0604095384478569,
-0.04550337418913841,
0.08798687160015106,
0.01688956283032894,
0.04853327199816704,
0.11913733929395676,
0.04030058532953262,
-0.13483424484729767,
-0.04045423865318298,
-0.044045645743608475,
-0.025805218145251274,
-0.0030457042157649994,
-0.021210329607129097,
-0.07163549959659576,
0.02745344489812851,
-0.06463448703289032,
-0.010134752839803696,
0.03799576684832573,
0.07462410628795624,
0.011094147339463234,
-0.0315474309027195,
-0.03647303953766823,
0.012971294112503529,
0.027005698531866074,
-0.011641857214272022,
0.03786206617951393,
-0.01908946968615055,
-0.033477965742349625,
-0.01695917174220085,
0.0750376433134079,
0.05882459133863449,
0.05710407346487045,
0.0011021933751180768,
0.010714235715568066,
-0.01849164068698883,
0.0038929523434489965,
0.07890325784683228,
-0.08093947917222977,
-0.018370335921645164,
0.03638948127627373,
0.029852455481886864,
-0.08723088353872299,
-0.029377320781350136,
-0.049669597297906876,
-0.07981536537408829,
-0.03202991932630539,
-0.01965559646487236,
0.08330654352903366,
-0.02626885287463665,
-0.046307019889354706,
0.009812409989535809,
-0.024496180936694145,
-0.01395243126899004,
-0.004185840487480164,
-0.05041327327489853,
-0.03153958171606064,
0.016935573890805244,
0.036299996078014374,
-0.04682321473956108,
0.02044731192290783,
-0.01945529319345951,
-0.06439514458179474,
-0.03599410876631737,
-0.020723391324281693,
0.03230530023574829,
-0.10680121928453445,
-0.041551440954208374,
-0.0028722903225570917,
-0.04438699781894684,
-0.07296346873044968,
0.04564034566283226,
-0.03639291599392891,
-0.0032914052717387676,
0.017888560891151428,
-0.017068346962332726,
-0.03890556842088699,
0.032807305455207825,
0.030552590265870094,
0.0034262926783412695,
0.07088333368301392,
-0.0268759373575449,
0.04244093969464302,
0.0816182941198349,
-0.020198499783873558,
-0.029675625264644623,
-0.026492662727832794,
-0.10316114127635956,
-0.028823968023061752,
-0.007373293861746788,
-0.04745858162641525,
-0.02094670571386814,
0.05196726322174072,
0.0056670838966965675,
-0.025611137971282005,
-8.005475789560748e-33,
0.04600522667169571,
-0.026057584211230278,
-0.10674997419118881,
0.10445582866668701,
0.03723539039492607,
0.035157497972249985,
0.04226195067167282,
0.01377952191978693,
-0.025854744017124176,
-0.07034321129322052,
0.01879364810883999,
0.007693502586334944,
0.05011092498898506,
0.016866765916347504,
-0.010570690967142582,
-0.05205560848116875,
-0.027293402701616287,
-0.07475386559963226,
0.00847992766648531,
0.005443456117063761,
-0.007749713957309723,
-0.02668878808617592,
0.032653797417879105,
0.030647478997707367,
-0.0076771872118115425,
0.017098180949687958,
-0.009377779439091682,
0.04270745813846588,
-0.036216456443071365,
-0.02411491610109806,
-0.0240072812885046,
-0.06525303423404694,
-0.03656298667192459,
0.06172136589884758,
0.023022301495075226,
-0.011760308407247066,
0.03973289579153061,
0.07494787871837616,
-0.05847931653261185,
0.05560107156634331,
0.112821064889431,
-0.09931407868862152,
-0.0077532497234642506,
0.015494960360229015,
-0.03204905986785889,
0.016717035323381424,
-0.031156271696090698,
0.006701945792883635,
-0.09117401391267776,
0.016757715493440628,
0.06151309609413147,
0.03886314108967781,
-0.039273835718631744,
0.011781959794461727,
0.06304091215133667,
0.01661176048219204,
0.08501029759645462,
-0.04543554410338402,
0.026335889473557472,
-0.01566631719470024,
0.0276293084025383,
-0.08512204140424728,
0.07215061038732529,
-0.037699103355407715,
0.048458464443683624,
0.06564618647098541,
-0.05461297184228897,
0.10067709535360336,
0.09951326251029968,
0.09335294365882874,
-0.005848558619618416,
-0.06006469577550888,
-0.029702983796596527,
-0.025365760549902916,
0.15258461236953735,
-0.016945799812674522,
-0.020586390048265457,
-0.13684870302677155,
0.06285030394792557,
0.1028081551194191,
-0.06545942276716232,
0.021806322038173676,
-0.028900036588311195,
0.04820629954338074,
0.058718953281641006,
0.038696516305208206,
-0.008503208868205547,
0.12062792479991913,
0.009515302255749702,
0.029760129749774933,
-0.02454288676381111,
0.04795196279883385,
-0.05036674812436104,
0.0203691516071558,
0.12016555666923523,
-5.255604307308204e-8,
-0.03196035325527191,
-0.016375165432691574,
-0.06677857041358948,
0.09690812975168228,
-0.06776679307222366,
0.03810666501522064,
-0.010072070173919201,
-0.01677626743912697,
-0.029397206380963326,
0.0028363140299916267,
-0.04825759306550026,
-0.037292320281267166,
0.012286946177482605,
0.009242675267159939,
0.005851542577147484,
0.021967492997646332,
-0.009388756938278675,
-0.04218598082661629,
-0.05200700834393501,
-0.08867137879133224,
-0.03351672738790512,
-0.04206346720457077,
0.0018007931066676974,
0.03277586027979851,
-0.04072374477982521,
0.0008819270296953619,
0.04324612021446228,
0.09713930636644363,
-0.07722316682338715,
-0.015962064266204834,
-0.12080945074558258,
-0.009035170078277588,
-0.02536373771727085,
-0.005914812907576561,
-0.00529156718403101,
0.09317715466022491,
-0.05344901233911514,
0.01960030011832714,
0.051653917878866196,
0.022707805037498474,
0.03711588680744171,
0.031234871596097946,
-0.08786637336015701,
0.005179589614272118,
0.022546706721186638,
-0.01915144734084606,
-0.04190301522612572,
0.029597880318760872,
0.04393484443426132,
0.04264414310455322,
0.014723018743097782,
-0.015133586712181568,
0.002281518653035164,
0.03333559259772301,
-0.010523653589189053,
-0.0503554604947567,
0.028115928173065186,
-0.11537151783704758,
0.05707284435629845,
0.03394827991724014,
0.09140083193778992,
-0.03521214798092842,
-0.041459422558546066,
-0.024695876985788345
] | 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 of validated socket addresses as a performance optimization. This option sets the maximum number of addresses that are cache. This is an advanced option that users typically won't have need to specify. #### `endpointOptions.ipv6Only` \* Type: {boolean} When `true`, indicates that the endpoint should bind only to IPv6 addresses. #### `endpointOptions.maxConnectionsPerHost` \* Type: {bigint|number} Specifies the maximum number of concurrent sessions allowed per remote peer address. #### `endpointOptions.maxConnectionsTotal` \* Type: {bigint|number} Specifies the maximum total number of concurrent sessions. #### `endpointOptions.maxRetries` \* Type: {bigint|number} Specifies the maximum number of QUIC retry attempts allowed per remote peer address. #### `endpointOptions.maxStatelessResetsPerHost` \* Type: {bigint|number} Specifies the maximum number of stateless resets that are allowed per remote peer address. #### `endpointOptions.retryTokenExpiration` \* Type: {bigint|number} Specifies the length of time a QUIC retry token is considered valid. #### `endpointOptions.resetTokenSecret` \* Type: {ArrayBufferView} Specifies the 16-byte secret used to generate QUIC retry tokens. #### `endpointOptions.tokenExpiration` \* Type: {bigint|number} Specifies the length of time a QUIC token is considered valid. #### `endpointOptions.tokenSecret` \* Type: {ArrayBufferView} Specifies the 16-byte secret used to generate QUIC tokens. #### `endpointOptions.udpReceiveBufferSize` \* Type: {number} #### `endpointOptions.udpSendBufferSize` \* Type: {number} #### `endpointOptions.udpTTL` \* Type: {number} #### `endpointOptions.validateAddress` \* Type: {boolean} When `true`, requires that the endpoint validate peer addresses using retry packets while establishing a new connection. ### Type: `SessionOptions` #### `sessionOptions.alpn` \* Type: {string} The ALPN protocol identifier. #### `sessionOptions.ca` \* Type: {ArrayBuffer|ArrayBufferView|ArrayBuffer\[]|ArrayBufferView\[]} The CA certificates to use for sessions. #### `sessionOptions.cc` \* Type: {string} Specifies the congestion control algorithm that will be used . Must be set to one of either `'reno'`, `'cubic'`, or `'bbr'`. This is an advanced option that users typically won't have need to specify. #### `sessionOptions.certs` \* Type: {ArrayBuffer|ArrayBufferView|ArrayBuffer\[]|ArrayBufferView\[]} The TLS certificates to use for sessions. #### `sessionOptions.ciphers` \* Type: {string} The list of supported TLS 1.3 cipher algorithms. #### `sessionOptions.crl` \* Type: {ArrayBuffer|ArrayBufferView|ArrayBuffer\[]|ArrayBufferView\[]} The CRL to use for sessions. #### `sessionOptions.groups` \* Type: {string} The list of support TLS 1.3 cipher groups. #### `sessionOptions.keylog` \* Type: {boolean} True to enable TLS keylogging output. #### `sessionOptions.keys` \* Type: {KeyObject|CryptoKey|KeyObject\[]|CryptoKey\[]} The TLS crypto keys to use for sessions. #### `sessionOptions.maxPayloadSize` \* Type: {bigint|number} Specifies the maximum UDP packet payload size. #### `sessionOptions.maxStreamWindow` \* Type: {bigint|number} Specifies the maximum stream flow-control window size. #### `sessionOptions.maxWindow` \* Type: {bigint|number} Specifies the maximum session flow-control window size. #### `sessionOptions.minVersion` \* Type: {number} The minimum QUIC version number to allow. This is an advanced option that users typically won't have need to specify. #### `sessionOptions.preferredAddressPolicy` \* Type: {string} One of `'use'`, `'ignore'`, or `'default'`. When the remote peer advertises a preferred address, this option specifies whether to use it or ignore it. #### `sessionOptions.qlog` \* Type: {boolean} True if qlog output should be enabled. #### `sessionOptions.sessionTicket` \* Type: {ArrayBufferView} A session ticket to use for 0RTT session resumption. #### `sessionOptions.handshakeTimeout` \* Type: {bigint|number} Specifies the maximum number of milliseconds a TLS handshake is permitted to take to complete before timing out. #### `sessionOptions.sni` \* Type: {string} The peer server name to target. #### `sessionOptions.tlsTrace` \* Type: {boolean} 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. #### `sessionOptions.verifyClient` \* Type: {boolean} True to require verification of TLS client certificate. #### | 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.0011416454799473286,
0.03982001170516014,
0.039619479328393936,
0.09284904599189758,
-0.07861770689487457,
0.04486206918954849,
-0.006521223578602076,
0.05281681567430496,
0.03322233632206917,
0.036967042833566666,
-0.06588717550039291,
-0.003839865094050765,
-0.07217758893966675,
-0.0065773469395935535,
-0.025768227875232697,
0.036475151777267456,
0.013531153090298176,
-0.021109694615006447,
-0.014739966951310635,
-0.07830749452114105,
0.042624011635780334,
0.0256167221814394,
0.04085958003997803,
0.0356137789785862,
0.006064301822334528,
-0.0779486745595932,
0.05179545283317566,
0.12634041905403137,
-0.005223660729825497,
0.013857712969183922,
0.017687413841485977,
0.02542724832892418,
0.027316341176629066,
-0.030227113515138626,
-0.02266114018857479,
-0.01834326796233654,
-0.06963758915662766,
0.07249650359153748,
0.049726005643606186,
-0.019012538716197014,
0.019432876259088516,
0.06417615711688995,
-0.08940025418996811,
-0.02548634074628353,
-0.0018169305985793471,
0.003461807267740369,
0.0540270172059536,
0.053548455238342285,
-0.024923201650381088,
-0.013654330745339394,
-0.027047600597143173,
0.0027009996119886637,
-0.006787746679037809,
0.0821448415517807,
-0.013867558911442757,
-0.029688220471143723,
0.05889112129807472,
-0.125203937292099,
0.06458676606416702,
-0.09199637919664383,
0.043206412345170975,
0.013446549884974957,
0.12897351384162903,
-0.02694399282336235,
-0.060342855751514435,
-0.02293039672076702,
-0.11850540339946747,
-0.037426453083753586,
-0.056113120168447495,
-0.018347304314374924,
0.06188450753688812,
-0.06233151629567146,
-0.02953110821545124,
-0.04720636457204819,
-0.027656234800815582,
0.076273612678051,
0.057613153010606766,
-0.008337676525115967,
0.019582942128181458,
-0.06314054131507874,
0.02062774822115898,
0.0365385040640831,
0.08207797259092331,
-0.022022483870387077,
-0.05838098004460335,
-0.047092221677303314,
-0.019582562148571014,
0.06146539747714996,
-0.10222209990024567,
-0.0059873485006392,
0.006324952933937311,
0.04754449799656868,
-0.06981832534074783,
-0.010278052650392056,
-0.004539266228675842,
0.006558422464877367,
0.04487565532326698,
-0.03678471967577934,
0.012066164053976536,
0.041173748672008514,
-0.03151500225067139,
-0.024010661989450455,
0.06516363471746445,
0.05540484935045242,
0.04116474837064743,
-0.026830008253455162,
-0.015441366471350193,
-0.0006037302664481103,
0.014398113824427128,
0.03896388038992882,
-0.017599090933799744,
-0.058010246604681015,
-0.007909802719950676,
0.03757009282708168,
1.0205877787393234e-32,
0.030231399461627007,
-0.05138755589723587,
-0.019886409863829613,
0.040860097855329514,
0.023750141263008118,
0.03726893663406372,
0.06299395114183426,
0.051282480359077454,
-0.07717058062553406,
0.04932567477226257,
-0.06861364096403122,
-0.03540970757603645,
0.08169504255056381,
0.03514454513788223,
0.019276142120361328,
0.056640781462192535,
0.057434916496276855,
0.07383937388658524,
0.055692531168460846,
0.04860159382224083,
0.014596553519368172,
-0.043020524084568024,
0.02694632299244404,
-0.03149963542819023,
0.02499690093100071,
0.015312232077121735,
-0.030348997563123703,
0.032937854528427124,
-0.049594249576330185,
-0.015017933212220669,
0.04042249545454979,
0.03352639079093933,
0.01788840815424919,
0.018413089215755463,
0.05239799618721008,
-0.02298644557595253,
-0.026202792301774025,
-0.03877733275294304,
-0.035777002573013306,
-0.06910022348165512,
0.029328668490052223,
-0.005089600570499897,
-0.12002792954444885,
0.03402254730463028,
-0.04891650006175041,
-0.04097571596503258,
-0.06784091144800186,
-0.022712165489792824,
0.043006062507629395,
-0.0007137880311347544,
0.01499792467802763,
0.03473490849137306,
-0.009271690621972084,
0.026903236284852028,
0.03813258558511734,
-0.030697934329509735,
0.030133895576000214,
0.08977953344583511,
-0.00038408016553148627,
0.03455866500735283,
-0.051561564207077026,
-0.009488734416663647,
-0.044974397867918015,
-0.014251692220568657,
0.06123228743672371,
0.026212958618998528,
0.03147873654961586,
-0.008783277124166489,
-0.0223400741815567,
0.0020007886923849583,
0.039620719850063324,
0.040735598653554916,
0.04863160848617554,
0.038930900394916534,
-0.10810313373804092,
-0.0011215024860575795,
-0.026840228587388992,
0.032650090754032135,
0.02434622496366501,
-0.04350198805332184,
-0.038907065987586975,
0.10385610908269882,
-0.05769161507487297,
0.02572595328092575,
-0.06374110281467438,
-0.039872247725725174,
-0.0010460647754371166,
-0.0003213245945516974,
0.01939382404088974,
0.03084813803434372,
-0.00006083989137550816,
-0.02774239145219326,
0.03668859228491783,
0.00048483983846381307,
-0.07388767600059509,
-9.84738800990693e-33,
-0.01909516379237175,
0.0162588432431221,
-0.14630049467086792,
-0.008555681444704533,
-0.026429280638694763,
-0.07140901684761047,
0.04911676049232483,
0.015308080241084099,
-0.024713832885026932,
-0.08434925973415375,
0.05691327154636383,
-0.04311908781528473,
0.13809387385845184,
-0.016183461993932724,
-0.02543605864048004,
-0.022405272349715233,
-0.082941934466362,
-0.07018500566482544,
0.04347020015120506,
-0.021451305598020554,
-0.03984036296606064,
-0.028782878071069717,
0.047093555331230164,
0.007203651126474142,
-0.0021410007029771805,
-0.007862687110900879,
-0.045638538897037506,
-0.01010396983474493,
-0.11545935273170471,
-0.07443327456712723,
0.060193222016096115,
0.051150090992450714,
-0.049191705882549286,
-0.043345797806978226,
-0.03011845424771309,
0.03609031066298485,
0.061479583382606506,
0.07613198459148407,
0.08970563858747482,
0.05390782281756401,
0.10764062404632568,
-0.04575324431061745,
-0.021569659933447838,
0.013401046395301819,
0.07487182319164276,
0.03598116710782051,
-0.03547496721148491,
-0.03840886056423187,
-0.08029467612504959,
0.017450442537665367,
-0.004844282288104296,
-0.047674715518951416,
-0.04232298210263252,
0.08676950633525848,
0.059018731117248535,
0.050907693803310394,
0.02542939782142639,
-0.04154834896326065,
0.07529561221599579,
-0.011506618931889534,
0.08706744015216827,
-0.13456861674785614,
-0.08117853850126266,
0.09948894381523132,
-0.0015073701506480575,
0.0450093075633049,
-0.02836247906088829,
-0.08744366466999054,
0.001108979806303978,
-0.04298113286495209,
-0.011686723679304123,
-0.07937886565923691,
0.01588933728635311,
0.03671422228217125,
-0.0684308186173439,
0.010738218203186989,
0.06013195589184761,
-0.05710899829864502,
0.001993591897189617,
0.05461248382925987,
-0.15334996581077576,
0.09170076996088028,
-0.08447352051734924,
0.0028631875757128,
0.0006675818585790694,
-0.031075866892933846,
-0.0048644267953932285,
0.10093704611063004,
-0.0031145745888352394,
0.01414449606090784,
-0.06533315032720566,
0.016577111557126045,
-0.05888772010803223,
-0.015088148415088654,
-0.02571050636470318,
-5.726172602749102e-8,
-0.02066941186785698,
0.013453883118927479,
-0.015932898968458176,
0.027697550132870674,
-0.07043243199586868,
0.08792851120233536,
0.020977139472961426,
0.03741874918341637,
0.08528098464012146,
0.05085848271846771,
-0.0029652018565684557,
-0.010155843570828438,
0.006044457200914621,
-0.022157153114676476,
0.06993617117404938,
0.01305511686950922,
0.011530190706253052,
-0.038062550127506256,
-0.01720357872545719,
-0.08402015268802643,
-0.05211758241057396,
-0.05617207661271095,
-0.06696701794862747,
-0.009898834861814976,
-0.04498714581131935,
-0.03782379999756813,
0.11054453253746033,
0.1180342510342598,
-0.04891275241971016,
-0.012799469754099846,
-0.03794264793395996,
-0.019783763214945793,
-0.0034952620044350624,
0.021166175603866577,
-0.016105931252241135,
0.13038426637649536,
-0.129470095038414,
0.029719600453972816,
0.08501719683408737,
0.10754849016666412,
-0.03185031935572624,
-0.04358188807964325,
-0.05403890460729599,
0.02096356824040413,
0.042366307228803635,
0.045422930270433426,
-0.024198800325393677,
0.12852691113948822,
-0.03565451130270958,
0.019526714459061623,
-0.04811067506670952,
-0.024675855413079262,
-0.006066550500690937,
0.00463828444480896,
0.01718520000576973,
0.00851377286016941,
-0.03768182173371315,
-0.04427856579422951,
0.03470447659492493,
0.05792509764432907,
-0.02780112251639366,
0.028834782540798187,
-0.07144387066364288,
-0.035845331847667694
] | 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. #### `sessionOptions.verifyClient` \* Type: {boolean} True to require verification of TLS client certificate. #### `sessionOptions.verifyPrivateKey` \* Type: {boolean} True to require private key verification. #### `sessionOptions.version` \* Type: {number} The QUIC version number to use. This is an advanced option that users typically won't have need to specify. ### Type: `TransportParams` #### `transportParams.preferredAddressIpv4` \* Type: {net.SocketAddress} The preferred IPv4 address to advertise. #### `transportParams.preferredAddressIpv6` \* Type: {net.SocketAddress} The preferred IPv6 address to advertise. #### `transportParams.initialMaxStreamDataBidiLocal` \* Type: {bigint|number} #### `transportParams.initialMaxStreamDataBidiRemote` \* Type: {bigint|number} #### `transportParams.initialMaxStreamDataUni` \* Type: {bigint|number} #### `transportParams.initialMaxData` \* Type: {bigint|number} #### `transportParams.initialMaxStreamsBidi` \* Type: {bigint|number} #### `transportParams.initialMaxStreamsUni` \* Type: {bigint|number} #### `transportParams.maxIdleTimeout` \* Type: {bigint|number} #### `transportParams.activeConnectionIDLimit` \* Type: {bigint|number} #### `transportParams.ackDelayExponent` \* Type: {bigint|number} #### `transportParams.maxAckDelay` \* Type: {bigint|number} #### `transportParams.maxDatagramFrameSize` \* Type: {bigint|number} ## Callbacks ### Callback: `OnSessionCallback` \* `this` {quic.QuicEndpoint} \* `session` {quic.QuicSession} The callback function that is invoked when a new session is initiated by a remote peer. ### Callback: `OnStreamCallback` \* `this` {quic.QuicSession} \* `stream` {quic.QuicStream} ### Callback: `OnDatagramCallback` \* `this` {quic.QuicSession} \* `datagram` {Uint8Array} \* `early` {boolean} ### Callback: `OnDatagramStatusCallback` \* `this` {quic.QuicSession} \* `id` {bigint} \* `status` {string} One of either `'lost'` or `'acknowledged'`. ### Callback: `OnPathValidationCallback` \* `this` {quic.QuicSession} \* `result` {string} One of either `'success'`, `'failure'`, or `'aborted'`. \* `newLocalAddress` {net.SocketAddress} \* `newRemoteAddress` {net.SocketAddress} \* `oldLocalAddress` {net.SocketAddress} \* `oldRemoteAddress` {net.SocketAddress} \* `preferredAddress` {boolean} ### Callback: `OnSessionTicketCallback` \* `this` {quic.QuicSession} \* `ticket` {Object} ### Callback: `OnVersionNegotiationCallback` \* `this` {quic.QuicSession} \* `version` {number} \* `requestedVersions` {number\[]} \* `supportedVersions` {number\[]} ### Callback: `OnHandshakeCallback` \* `this` {quic.QuicSession} \* `sni` {string} \* `alpn` {string} \* `cipher` {string} \* `cipherVersion` {string} \* `validationErrorReason` {string} \* `validationErrorCode` {number} \* `earlyDataAccepted` {boolean} ### Callback: `OnBlockedCallback` \* `this` {quic.QuicStream} ### Callback: `OnStreamErrorCallback` \* `this` {quic.QuicStream} \* `error` {any} ## Diagnostic Channels ### Channel: `quic.endpoint.created` \* `endpoint` {quic.QuicEndpoint} \* `config` {quic.EndpointOptions} ### Channel: `quic.endpoint.listen` \* `endpoint` {quic.QuicEndpoint} \* `optoins` {quic.SessionOptions} ### Channel: `quic.endpoint.closing` \* `endpoint` {quic.QuicEndpoint} \* `hasPendingError` {boolean} ### Channel: `quic.endpoint.closed` \* `endpoint` {quic.QuicEndpoint} ### Channel: `quic.endpoint.error` \* `endpoint` {quic.QuicEndpoint} \* `error` {any} ### Channel: `quic.endpoint.busy.change` \* `endpoint` {quic.QuicEndpoint} \* `busy` {boolean} ### Channel: `quic.session.created.client` ### Channel: `quic.session.created.server` ### Channel: `quic.session.open.stream` ### Channel: `quic.session.received.stream` ### Channel: `quic.session.send.datagram` ### Channel: `quic.session.update.key` ### Channel: `quic.session.closing` ### Channel: `quic.session.closed` ### Channel: `quic.session.receive.datagram` ### Channel: `quic.session.receive.datagram.status` ### Channel: `quic.session.path.validation` ### Channel: `quic.session.ticket` ### Channel: `quic.session.version.negotiation` ### Channel: `quic.session.handshake` | 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.07745344936847687,
0.027351943776011467,
-0.04697825387120247,
0.008957218378782272,
-0.05884675681591034,
0.05807347968220711,
-0.08795765787363052,
0.005612045060843229,
-0.0513637401163578,
0.007488906383514404,
-0.009318720549345016,
-0.021868322044610977,
-0.1368667334318161,
-0.02273315005004406,
0.07939201593399048,
-0.030694086104631424,
0.05847237631678581,
-0.012151109986007214,
0.03447514399886131,
-0.09673571586608887,
-0.027453403919935226,
0.01920684613287449,
0.021613173186779022,
0.11414521932601929,
0.06622977554798126,
0.031862854957580566,
-0.05534734949469566,
0.0896187573671341,
-0.06667007505893707,
-0.052484624087810516,
0.041731853038072586,
0.013977615162730217,
-0.006206532008945942,
0.012787352316081524,
-0.03684646636247635,
-0.0890517607331276,
0.04785700514912605,
0.020489228889346123,
0.04401428997516632,
-0.0249057337641716,
0.0529964305460453,
-0.09410147368907928,
0.07121874392032623,
-0.05169428139925003,
0.05878207087516785,
0.026278432458639145,
0.07560283690690994,
-0.10565555840730667,
-0.013073607347905636,
-0.046765267848968506,
-0.04493291676044464,
-0.07762347161769867,
0.08567368239164352,
-0.009105113334953785,
0.005715545266866684,
0.04514101892709732,
0.06961233913898468,
-0.05084261670708656,
0.0185092706233263,
-0.034523069858551025,
-0.09406247735023499,
0.004444988444447517,
-0.011049920693039894,
-0.007133169565349817,
-0.03169858455657959,
-0.0953742265701294,
-0.05301772803068161,
-0.034366291016340256,
-0.03468543291091919,
-0.033353403210639954,
0.0704573392868042,
-0.017859993502497673,
-0.017177389934659004,
0.019528014585375786,
-0.008103062398731709,
0.0413898341357708,
0.057857245206832886,
0.07499552518129349,
0.016766292974352837,
-0.06196330115199089,
-0.008724692277610302,
0.0655333548784256,
0.08223940432071686,
-0.03658350184559822,
-0.0005165935726836324,
0.012743113562464714,
0.03782564401626587,
0.012373303063213825,
-0.05408962815999985,
0.03871571645140648,
-0.048829253762960434,
-0.007517809513956308,
0.08099157363176346,
0.024819504469633102,
0.0012461442966014147,
0.09701981395483017,
0.06225980818271637,
-0.008511116728186607,
0.03877784684300423,
0.07937252521514893,
-0.060947783291339874,
-0.008840546011924744,
0.05466144159436226,
-0.04953223094344139,
0.04615561291575432,
0.03156481683254242,
-0.04132799804210663,
0.014794517308473587,
-0.03368860483169556,
0.019822856411337852,
0.014680218882858753,
0.059372033923864365,
-0.03273641690611839,
0.14057470858097076,
1.258704804117914e-32,
0.04061181843280792,
0.048551108688116074,
-0.017535340040922165,
0.08831964433193207,
-0.01961340196430683,
0.09253271669149399,
0.08740580081939697,
-0.029398910701274872,
-0.0720253735780716,
0.011922634206712246,
-0.07873904705047607,
-0.009750834666192532,
-0.04758598655462265,
-0.04451882839202881,
-0.06189758703112602,
0.060193028301000595,
-0.01841488853096962,
0.047943755984306335,
0.06465340405702591,
0.04374925047159195,
-0.012730195187032223,
-0.07127473503351212,
0.02976858988404274,
-0.01812068000435829,
0.03153756260871887,
0.03548993542790413,
0.015911243855953217,
0.042358122766017914,
0.023227496072649956,
-0.0021929615177214146,
0.04945855960249901,
0.00597094651311636,
0.08933722972869873,
0.026708651334047318,
0.01598242297768593,
-0.015422898344695568,
0.023457961156964302,
0.019454361870884895,
-0.03613705933094025,
-0.01024594996124506,
-0.01199539378285408,
-0.007368076127022505,
-0.0017518604872748256,
-0.012472792528569698,
-0.036273445934057236,
-0.015478699468076229,
-0.02554807998239994,
0.01658777892589569,
0.09751034528017044,
0.03909899666905403,
-0.053015369921922684,
-0.0092686852440238,
-0.08108878880739212,
-0.026061881333589554,
-0.0013308505294844508,
-0.10279709845781326,
0.022729091346263885,
0.04349399730563164,
0.010745426639914513,
-0.0512540228664875,
0.02821888029575348,
-0.003715221304446459,
-0.09428746998310089,
-0.09959126263856888,
0.05125419422984123,
0.028745129704475403,
-0.07696201652288437,
-0.009084049612283707,
-0.049585577100515366,
-0.02387458086013794,
-0.0685393437743187,
0.056923650205135345,
0.01397206075489521,
0.03800693526864052,
0.039811696857213974,
-0.035366784781217575,
-0.03126182407140732,
0.06079378351569176,
0.04627391695976257,
-0.01008215919137001,
0.016714762896299362,
0.017270566895604134,
0.0503113754093647,
0.05640081688761711,
-0.017594225704669952,
-0.043387431651353836,
0.009570506401360035,
0.047939181327819824,
-0.03287305682897568,
-0.011912313289940357,
-0.017201652750372887,
0.0352613627910614,
-0.018346212804317474,
0.048265647143125534,
-0.09941007196903229,
-1.0174475925178955e-32,
-0.015370619483292103,
0.012931765988469124,
-0.04504188150167465,
0.0951320081949234,
-0.039845239371061325,
0.0010638677049428225,
0.04194556549191475,
0.002255083527415991,
0.010269691236317158,
-0.04188484326004982,
0.05906243994832039,
-0.08444294333457947,
0.07508253306150436,
-0.04703174903988838,
0.0039018243551254272,
-0.05615905299782753,
-0.10325229912996292,
0.022460464388132095,
-0.03215760737657547,
-0.003919555805623531,
-0.023455100134015083,
-0.027883481234312057,
-0.000668559514451772,
0.0586291067302227,
0.017728429287672043,
0.022480415180325508,
0.0009064459009096026,
0.045870162546634674,
-0.005832084454596043,
0.013431348837912083,
0.020666489377617836,
0.032356783747673035,
-0.014889814890921116,
0.058396115899086,
-0.03220926225185394,
-0.04757409170269966,
0.03930530324578285,
0.1050570160150528,
0.020279623568058014,
0.08029825985431671,
0.06922364979982376,
-0.08713378012180328,
-0.038645267486572266,
-0.005058107431977987,
-0.052504267543554306,
0.029247183352708817,
0.02179117128252983,
0.034801583737134933,
-0.09088733792304993,
0.0017110740300267935,
0.09123575687408447,
0.011203009635210037,
-0.07106561958789825,
-0.038762472569942474,
0.06289736926555634,
0.055012185126543045,
-0.009443060494959354,
-0.03706299886107445,
0.02293427661061287,
-0.0937841460108757,
0.01566525734961033,
-0.06349673122167587,
0.01602870598435402,
0.026384752243757248,
0.03427744656801224,
0.07436991482973099,
-0.03229919821023941,
0.1132531687617302,
0.05195009708404541,
0.03258790075778961,
-0.03964793682098389,
-0.08348148316144943,
-0.03994226083159447,
-0.07939044386148453,
0.10596250742673874,
-0.04720519855618477,
0.010450952686369419,
-0.020544415339827538,
0.043349530547857285,
0.061964523047208786,
-0.01524105854332447,
0.004011353477835655,
-0.04862072691321373,
-0.03284076601266861,
0.031974174082279205,
0.011857160367071629,
0.002286781556904316,
0.08134684711694717,
0.02906090021133423,
0.045022569596767426,
-0.01589079760015011,
0.08521135151386261,
-0.026285290718078613,
0.06674566864967346,
0.10302651673555374,
-6.047033451750394e-8,
-0.06352248042821884,
-0.0035870519932359457,
-0.060482535511255264,
0.04113622009754181,
-0.01873890310525894,
0.1044391468167305,
0.05822838097810745,
-0.030169108882546425,
-0.04643798992037773,
0.016938909888267517,
-0.05841285362839699,
-0.06330282986164093,
-0.06629492342472076,
-0.00008830021397443488,
0.014652999117970467,
0.010702799074351788,
-0.09915377199649811,
-0.04085633158683777,
-0.027755215764045715,
-0.05778346583247185,
0.008204176090657711,
-0.04824957251548767,
-0.07082507759332657,
0.0357920303940773,
-0.03789276257157326,
-0.017472751438617706,
0.031239379197359085,
0.08524180203676224,
-0.045399684458971024,
0.009462570771574974,
-0.12275245785713196,
-0.056082628667354584,
-0.07819724828004837,
-0.03274958208203316,
-0.03246455639600754,
0.15560585260391235,
-0.0878041535615921,
0.0003929658269044012,
0.01318864244967699,
0.03737904131412506,
-0.05479535833001137,
0.020984092727303505,
-0.07015249878168106,
-0.022848866879940033,
-0.023797594010829926,
-0.029199974611401558,
-0.0697452500462532,
0.026008041575551033,
-0.021120693534612656,
0.011301761493086815,
-0.0007094065076671541,
-0.04235491901636124,
0.03234351426362991,
0.024200191721320152,
-0.07128607481718063,
0.026676269248127937,
-0.006280036643147469,
-0.09533434361219406,
0.023316936567425728,
0.0019352093804627657,
0.046533554792404175,
-0.004508995451033115,
-0.012474304996430874,
-0.027191998437047005
] | -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 the V8 embedder API. Because using Node.js as an embedded library is different from writing code that is executed by Node.js, breaking changes do not follow typical Node.js [deprecation policy][] and may occur on each semver-major release without prior warning. ## Example embedding application The following sections will provide an overview over how to use these APIs to create an application from scratch that will perform the equivalent of `node -e ```` `, i.e. that will take a piece of JavaScript and run it in a Node.js-specific environment. The full code can be found [in the Node.js source tree][embedtest.cc]. ### Setting up a per-process state Node.js requires some per-process state management in order to run: * Arguments parsing for Node.js [CLI options][], * V8 per-process requirements, such as a `v8::Platform` instance. The following example shows how these can be set up. Some class names are from the `node` and `v8` C++ namespaces, respectively. ```cpp int main(int argc, char** argv) { argv = uv_setup_args(argc, argv); std::vector args(argv, argv + argc); // Parse Node.js CLI options, and print any errors that have occurred while // trying to parse them. std::unique_ptr result = node::InitializeOncePerProcess(args, { node::ProcessInitializationFlags::kNoInitializeV8, node::ProcessInitializationFlags::kNoInitializeNodeV8Platform }); for (const std::string& error : result->errors()) fprintf(stderr, "%s: %s\n", args[0].c_str(), error.c_str()); if (result->early_return() != 0) { return result->exit_code(); } // Create a v8::Platform instance. `MultiIsolatePlatform::Create()` is a way // to create a v8::Platform instance that Node.js can use when creating // Worker threads. When no `MultiIsolatePlatform` instance is present, // Worker threads are disabled. std::unique_ptr platform = MultiIsolatePlatform::Create(4); V8::InitializePlatform(platform.get()); V8::Initialize(); // See below for the contents of this function. int ret = RunNodeInstance( platform.get(), result->args(), result->exec_args()); V8::Dispose(); V8::DisposePlatform(); node::TearDownOncePerProcess(); return ret; } ``` ### Setting up a per-instance state Node.js has a concept of a “Node.js instance”, that is commonly being referred to as `node::Environment`. Each `node::Environment` is associated with: * Exactly one `v8::Isolate`, i.e. one JS Engine instance, * Exactly one `uv_loop_t`, i.e. one event loop, * A number of `v8::Context`s, but exactly one main `v8::Context`, and * One `node::IsolateData` instance that contains information that could be shared by multiple `node::Environment`s. The embedder should make sure that `node::IsolateData` is shared only among `node::Environment`s that use the same `v8::Isolate`, Node.js does not perform this check. In order to set up a `v8::Isolate`, an `v8::ArrayBuffer::Allocator` needs to be provided. One possible choice is the default Node.js allocator, which can be created through `node::ArrayBufferAllocator::Create()`. Using the Node.js allocator allows minor performance optimizations when addons use the Node.js C++ `Buffer` API, and is required in order to track `ArrayBuffer` memory in [`process.memoryUsage()`][]. Additionally, each `v8::Isolate` that is used for a Node.js instance needs to be registered and unregistered with the `MultiIsolatePlatform` instance, if one is being used, in order for the platform to know which event loop to use for tasks scheduled by the `v8::Isolate`. The `node::NewIsolate()` helper function creates a `v8::Isolate`, sets it up with some Node.js-specific hooks (e.g. the Node.js error handler), and registers it with the platform automatically. ```cpp int 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) { for (const std::string& err : errors) fprintf(stderr, "%s: %s\n", args[0].c_str(), err.c_str()); return 1; } | 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.08250269293785095,
0.042219050228595734,
0.03305669128894806,
0.05743718519806862,
0.06290165334939957,
0.03749467059969902,
-0.02125893346965313,
-0.039774928241968155,
-0.0686381459236145,
-0.05998031422495842,
-0.05105825141072273,
0.06569241732358932,
-0.028075888752937317,
-0.03992944583296776,
0.0128360316157341,
0.01686984859406948,
0.02642573043704033,
0.05126078799366951,
-0.09992364794015884,
-0.04451984912157059,
0.05840108171105385,
-0.08944395184516907,
0.09175856411457062,
-0.016206840053200722,
-0.14891721308231354,
-0.0842498242855072,
-0.008255038410425186,
-0.006793390028178692,
0.09817606955766678,
-0.11303891986608505,
-0.04054957628250122,
0.024454539641737938,
-0.049850087612867355,
-0.05090997740626335,
-0.060144003480672836,
-0.15012630820274353,
0.028785767033696175,
0.014768625609576702,
-0.03765827417373657,
0.0057869465090334415,
-0.07292871177196503,
-0.0402347706258297,
-0.08400245755910873,
-0.0011605557519942522,
-0.00898460391908884,
0.04499456658959389,
0.12936201691627502,
0.006448039785027504,
-0.03959450125694275,
0.10967177897691727,
0.014331300742924213,
0.06911832839250565,
-0.0010855321306735277,
-0.006736209150403738,
0.026232361793518066,
0.03861987218260765,
0.009490705095231533,
-0.08467229455709457,
0.01041332259774208,
-0.057688288390636444,
-0.017950940877199173,
-0.10116660594940186,
-0.01880052499473095,
-0.022136148065328598,
0.01656174659729004,
0.03915032371878624,
-0.05307988449931145,
-0.009301675483584404,
-0.005753776989877224,
-0.012701711617410183,
0.0041365730576217175,
0.023527435958385468,
0.12022444605827332,
0.021673403680324554,
0.01101253367960453,
-0.005801564548164606,
0.04790591448545456,
-0.04358799383044243,
-0.09037204831838608,
-0.0212525874376297,
0.06368802487850189,
0.06893399357795715,
-0.007702321745455265,
-0.012783033773303032,
0.02634289860725403,
-0.035389188677072525,
-0.019329268485307693,
-0.054475050419569016,
0.032951951026916504,
0.033967114984989166,
-0.03039451315999031,
-0.0076543958857655525,
-0.04255874082446098,
-0.028731444850564003,
0.013297971338033676,
0.004514697939157486,
-0.020078931003808975,
0.0036553461104631424,
0.0616699680685997,
0.018601877614855766,
-0.07079193741083145,
0.017009226605296135,
-0.010599987581372261,
0.09653453528881073,
-0.06273023039102554,
0.12019190192222595,
0.10522735118865967,
0.06240774318575859,
0.03618457168340683,
0.02154279127717018,
0.03705177083611488,
0.023704281076788902,
-0.01777663081884384,
-0.025792043656110764,
3.987882584921857e-33,
0.023057591170072556,
-0.08305175602436066,
0.0008884444832801819,
0.08666874468326569,
0.0666181817650795,
0.009886067360639572,
0.004947085399180651,
0.11935332417488098,
-0.10835876315832138,
-0.029229694977402687,
0.00919712707400322,
0.039016008377075195,
0.06512060761451721,
0.06415259838104248,
0.05464928224682808,
-0.06377294659614563,
0.006023193243891001,
-0.04229443892836571,
0.05818420276045799,
-0.025289634242653847,
-0.03783797100186348,
-0.05440549924969673,
-0.001855816226452589,
0.09200585633516312,
-0.012607533484697342,
0.03193685784935951,
0.03832970932126045,
0.022421862930059433,
-0.009893147274851799,
-0.024175256490707397,
-0.03238561004400253,
-0.013446323573589325,
-0.07544287294149399,
0.022409213706851006,
0.06137761101126671,
-0.005727589596062899,
-0.026982374489307404,
0.015479104593396187,
-0.10580030828714371,
0.012063860893249512,
0.01214329618960619,
0.028551071882247925,
-0.05871376022696495,
-0.05932381749153137,
-0.022121736779808998,
-0.046121444553136826,
0.015237943269312382,
-0.062370724976062775,
0.0360085554420948,
-0.08614110201597214,
-0.032903168350458145,
0.0881185457110405,
0.014546554535627365,
-0.02185104414820671,
0.06666529178619385,
-0.016734186559915543,
-0.016847141087055206,
-0.07852140814065933,
0.0003530263202264905,
-0.006994848605245352,
0.03936981037259102,
0.021670322865247726,
0.004986119922250509,
-0.017001347616314888,
-0.008798249997198582,
0.04223102703690529,
-0.04645638167858124,
0.012241688556969166,
-0.03218081220984459,
0.03571850806474686,
0.008140504360198975,
0.02074882760643959,
-0.013237075880169868,
0.03428162634372711,
0.01060150470584631,
0.0026022002566605806,
-0.06827882677316666,
-0.0056380704045295715,
0.047528546303510666,
0.00593763729557395,
-0.004392851144075394,
-0.024451391771435738,
-0.007306460756808519,
-0.006785532925277948,
0.06944132596254349,
-0.11516311764717102,
-0.05572032183408737,
-0.0064803981222212315,
0.09673956036567688,
0.06786149740219116,
0.10702811181545258,
-0.08391250669956207,
-0.007825687527656555,
0.011632501147687435,
-0.03195031359791756,
-6.395756029596615e-33,
-0.04683499038219452,
-0.005059447605162859,
-0.09315476566553116,
0.0680113434791565,
-0.05486494302749634,
-0.016613410785794258,
-0.08055995404720306,
0.028369713574647903,
-0.02023465745151043,
-0.0078129218891263,
-0.055769551545381546,
0.049198001623153687,
0.09951914846897125,
0.04470936954021454,
-0.018918022513389587,
0.04704183712601662,
-0.14366325736045837,
-0.018477927893400192,
0.004310707561671734,
-0.006784818135201931,
0.0010164325358346105,
0.0011581431608647108,
0.10668536275625229,
0.03715499863028526,
0.028130142018198967,
0.04540932551026344,
-0.00670012878254056,
-0.010366727598011494,
-0.06963355094194412,
-0.0956648513674736,
-0.02177201397716999,
0.06039030849933624,
-0.01814563199877739,
0.04890546202659607,
-0.013758753426373005,
-0.019314832985401154,
0.0070361061953008175,
0.014528898522257805,
0.03689762204885483,
-0.09752662479877472,
0.10721646249294281,
-0.021908339112997055,
-0.03414551168680191,
0.006331190932542086,
0.038217056542634964,
0.023594699800014496,
-0.0869876816868782,
0.06377814710140228,
0.024060314521193504,
-0.08628099411725998,
-0.07460218667984009,
-0.06482357531785965,
0.01761263981461525,
-0.05010949820280075,
-0.0036575777921825647,
-0.04208490625023842,
-0.013288160786032677,
0.051280852407217026,
0.015178370289504528,
0.07702679932117462,
0.05078403651714325,
-0.051814574748277664,
0.01582545042037964,
-0.04155399277806282,
-0.04247942194342613,
-0.01859237626194954,
-0.05345619097352028,
0.03323083743453026,
0.010452034883201122,
-0.021845277398824692,
0.02976028062403202,
-0.009851514361798763,
-0.04244095832109451,
-0.035453058779239655,
-0.05178286135196686,
-0.027245501056313515,
0.051948633044958115,
-0.05427834764122963,
-0.02915377728641033,
-0.03430397808551788,
-0.04648823291063309,
0.0465596541762352,
0.007414897438138723,
0.0018817009404301643,
0.03920124098658562,
0.039861585944890976,
-0.023272784426808357,
0.012953784316778183,
-0.004075321368873119,
-0.014807823114097118,
-0.007535054814070463,
0.0907384604215622,
-0.1213945522904396,
0.04662734642624855,
0.017984719946980476,
-5.333954788966366e-8,
-0.04340258240699768,
0.023841610178351402,
-0.04988677799701691,
-0.04310600087046623,
0.008348662406206131,
-0.007370663341134787,
0.06408043950796127,
0.01783631183207035,
0.036283206194639206,
0.0467693954706192,
0.010352500714361668,
-0.01944722793996334,
-0.006286196876317263,
-0.024781309068202972,
0.022853823378682137,
0.03462310880422592,
-0.009567764587700367,
0.0061194500885903835,
0.03988974168896675,
0.03962516784667969,
-0.037009771913290024,
0.05959607660770416,
0.047994304448366165,
0.08550288528203964,
-0.03369323909282684,
-0.07338789850473404,
0.07796787470579147,
0.03749430179595947,
0.0433671772480011,
-0.015535038895905018,
-0.10377861559391022,
0.08138388395309448,
0.023839132860302925,
0.0060395109467208385,
-0.03277485445141792,
0.0093383202329278,
-0.0043309093452990055,
0.0005384662072174251,
0.026754217222332954,
0.035956986248493195,
0.03580813482403755,
0.046544864773750305,
-0.001422197325155139,
-0.021863680332899094,
-0.0032474214676767588,
0.03967803716659546,
-0.02095157839357853,
0.022057795897126198,
-0.026572059839963913,
0.012077847495675087,
0.05406295135617256,
-0.014324410818517208,
-0.07376499474048615,
0.0807376578450203,
-0.009724867530167103,
0.0011194247053936124,
-0.07805753499269485,
-0.07491876184940338,
0.04589056968688965,
0.013637809082865715,
-0.013679037801921368,
-0.07394089549779892,
0.10716746002435684,
0.01284390315413475
] | 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) { for (const std::string& err : errors) fprintf(stderr, "%s: %s\n", args[0].c_str(), err.c_str()); return 1; } Isolate* isolate = setup->isolate(); Environment* env = setup->env(); { Locker locker(isolate); Isolate::Scope isolate_scope(isolate); HandleScope handle_scope(isolate); // The v8::Context needs to be entered when node::CreateEnvironment() and // node::LoadEnvironment() are being called. Context::Scope context_scope(setup->context()); // Set up the Node.js instance for execution, and run code inside of it. // There is also a variant that takes a callback and provides it with // the `require` and `process` objects, so that it can manually compile // and run scripts as needed. // The `require` function inside this script does *not* access the file // system, and can only load built-in Node.js modules. // `module.createRequire()` is being used to create one that is able to // load files from the disk, and uses the standard CommonJS file loader // instead of the internal-only `require` function. MaybeLocal loadenv_ret = node::LoadEnvironment( env, "const publicRequire =" " require('node:module').createRequire(process.cwd() + '/');" "globalThis.require = publicRequire;" "require('node:vm').runInThisContext(process.argv[1]);"); if (loadenv_ret.IsEmpty()) // There has been a JS exception. return 1; exit_code = node::SpinEventLoop(env).FromMaybe(1); // node::Stop() can be used to explicitly stop the event loop and keep // further JavaScript from running. It can be called from any thread, // and will act like worker.terminate() if called from another thread. node::Stop(env); } return exit_code; } ``` [CLI options]: cli.md [`process.memoryUsage()`]: process.md#processmemoryusage [deprecation policy]: deprecations.md [embedtest.cc]: https://github.com/nodejs/node/blob/HEAD/test/embedding/embedtest.cc [src/node.h]: https://github.com/nodejs/node/blob/HEAD/src/node.h ```` | 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.06521910429000854,
-0.0027016536332666874,
-0.01240540761500597,
-0.07707298547029495,
0.06746473908424377,
0.039346568286418915,
-0.02241232432425022,
-0.03420929238200188,
0.03204035013914108,
-0.05429939925670624,
-0.011676942929625511,
-0.03862962871789932,
0.007616633083671331,
-0.06228754296898842,
0.025386452674865723,
0.08233288675546646,
-0.003997503314167261,
0.14889445900917053,
-0.03145018219947815,
-0.05093606561422348,
0.0408947579562664,
0.03327488899230957,
0.12507294118404388,
-0.041746124625205994,
-0.05271322280168533,
-0.10377483814954758,
0.0035120826214551926,
0.0118904709815979,
0.11543010920286179,
-0.06008389964699745,
-0.03969557210803032,
0.03891652449965477,
0.021194586530327797,
-0.10971193015575409,
0.05806182324886322,
0.0006957821315154433,
-0.07258976995944977,
-0.008917444385588169,
-0.03264990448951721,
-0.01331687904894352,
-0.08088231831789017,
-0.007652888540178537,
0.00026188595802523196,
0.01927010342478752,
-0.007723197340965271,
0.04684290662407875,
0.012409145012497902,
-0.0362822599709034,
0.01515578106045723,
0.03566993027925491,
-0.04449905455112457,
0.03482280671596527,
0.06589183956384659,
0.005168543197214603,
0.04357236623764038,
0.01076635904610157,
0.03437534347176552,
-0.008998574689030647,
0.033561304211616516,
-0.06579825282096863,
0.0022156701888889074,
-0.09480598568916321,
0.02582048997282982,
-0.05283975973725319,
0.03537634760141373,
-0.014626913703978062,
-0.005155949387699366,
0.01556761097162962,
0.03702180087566376,
-0.07112495601177216,
0.012035994790494442,
0.00466242665424943,
0.05263523757457733,
-0.07131648063659668,
-0.016587039455771446,
0.07821838557720184,
0.06140134111046791,
-0.0826428011059761,
-0.028546743094921112,
-0.04678129404783249,
0.02883903682231903,
0.12208188325166702,
0.02840486727654934,
0.030786529183387756,
0.030454091727733612,
0.052651297301054,
0.06943497806787491,
-0.022570623084902763,
-0.05014398694038391,
0.07101057469844818,
0.010778013616800308,
-0.025434983894228935,
0.031859930604696274,
-0.03967011719942093,
-0.06793686747550964,
-0.002775360131636262,
-0.06713531911373138,
0.0011839594226330519,
0.10686691850423813,
0.008660282008349895,
-0.02724059298634529,
0.06360512226819992,
-0.04481549561023712,
0.13230736553668976,
-0.07483221590518951,
0.11759026348590851,
0.10955170542001724,
0.052734408527612686,
-0.0037998859770596027,
0.01785527728497982,
0.0775977373123169,
0.024584637954831123,
-0.07114440202713013,
0.016823671758174896,
5.910000988876552e-33,
-0.0563935823738575,
-0.09574690461158752,
0.021566644310951233,
0.09415657818317413,
0.03154855966567993,
0.08938421308994293,
-0.023527149111032486,
0.011840532533824444,
-0.0649891123175621,
0.05097518116235733,
-0.05874357745051384,
-0.044027235358953476,
-0.020897135138511658,
-0.06217176839709282,
0.08421513438224792,
-0.047218941152095795,
0.10699296742677689,
0.04120108485221863,
0.028075622394680977,
-0.024110952392220497,
0.06108701601624489,
-0.06591252982616425,
-0.07035384327173233,
0.012962167151272297,
0.012493700720369816,
0.014404572546482086,
-0.014025826938450336,
-0.053530968725681305,
0.00641902768984437,
-0.020157966762781143,
0.042048245668411255,
0.00264176307246089,
-0.05049272999167442,
0.12263844162225723,
0.01947864517569542,
-0.006777680478990078,
-0.019634515047073364,
0.001972184982150793,
-0.10612478852272034,
-0.004355326760560274,
0.0024757308419793844,
0.007067824713885784,
0.01908491738140583,
-0.010109471157193184,
0.061288218945264816,
-0.02800101786851883,
-0.1016298159956932,
-0.0010311659425497055,
0.014992126263678074,
-0.05459514260292053,
-0.01094099972397089,
0.07661470025777817,
0.04421219602227211,
-0.111846923828125,
0.036945343017578125,
-0.011982599273324013,
-0.06284286081790924,
-0.02279032953083515,
-0.0004062639782205224,
0.04911225289106369,
-0.04952774569392204,
0.1273970901966095,
-0.03745183348655701,
0.03967824578285217,
0.007588337641209364,
-0.01748417504131794,
-0.04428541287779808,
-0.047563519328832626,
0.03541237860918045,
0.05406996235251427,
-0.0324699692428112,
0.02078288234770298,
-0.01705506443977356,
-0.011042083613574505,
0.03369520232081413,
0.004893645644187927,
-0.004988533910363913,
0.02742733806371689,
-0.020669657737016678,
-0.07732082903385162,
-0.05024943873286247,
0.05059687793254852,
-0.030826520174741745,
0.04769939184188843,
0.022276954725384712,
-0.012881736271083355,
-0.04871354252099991,
-0.007521565072238445,
-0.005829405039548874,
0.06788692623376846,
0.022362206131219864,
-0.09264613687992096,
-0.022271471098065376,
-0.06409970670938492,
-0.03512543439865112,
-8.330446345633354e-33,
-0.012939834967255592,
0.01974395290017128,
-0.004158369731158018,
-0.04198494181036949,
-0.023950977250933647,
-0.001543607795611024,
-0.011640124954283237,
-0.04153761640191078,
-0.04420220106840134,
0.04651906341314316,
-0.09189345687627792,
0.02048930712044239,
0.08013372868299484,
0.04963115602731705,
-0.0005281510530039668,
0.06365667283535004,
-0.04300357401371002,
0.07376087456941605,
0.01993481069803238,
0.0417591892182827,
-0.012189061380922794,
0.03418818861246109,
0.04474814608693123,
0.026636244729161263,
-0.0006752062472514808,
-0.00884020235389471,
-0.047759976238012314,
0.007207063026726246,
0.018524039536714554,
-0.05162983760237694,
-0.07675626128911972,
0.04070572182536125,
-0.00036324726534076035,
0.08997417986392975,
0.018060272559523582,
-0.05130122974514961,
-0.08136643469333649,
0.051381684839725494,
0.05984819680452347,
-0.05761118605732918,
0.05256374180316925,
0.039861105382442474,
-0.0944623127579689,
-0.015372754074633121,
0.0013869318645447493,
0.07003220170736313,
0.024718724191188812,
-0.004833529237657785,
0.008686932735145092,
-0.024317871779203415,
-0.07632572948932648,
-0.03117857500910759,
-0.042410798370838165,
-0.0031659225933253765,
-0.04117465019226074,
-0.00040580076165497303,
0.07110730558633804,
0.013838941231369972,
-0.05335139110684395,
0.030053775757551193,
0.04771401360630989,
-0.13820910453796387,
-0.03496292605996132,
-0.014540370553731918,
0.06550546735525131,
-0.09094388782978058,
-0.08348821103572845,
0.01055195927619934,
0.010379194281995296,
-0.04875750094652176,
-0.04274106025695801,
0.050742898136377335,
0.009693657979369164,
-0.029572471976280212,
-0.01589342951774597,
0.02943728305399418,
-0.025224456563591957,
-0.12624002993106842,
0.025226470082998276,
0.02687319926917553,
-0.06775268912315369,
0.018277084454894066,
0.005381347145885229,
0.02030348591506481,
-0.014351305551826954,
-0.007958059199154377,
0.03689821809530258,
0.018339740112423897,
0.043023865669965744,
-0.009426013566553593,
0.03291090205311775,
0.0650637075304985,
-0.041007936000823975,
-0.007875138893723488,
-0.002511539263650775,
-6.172598432385712e-8,
0.01562567800283432,
-0.026403337717056274,
-0.09138068556785583,
-0.014458855614066124,
0.03291444852948189,
-0.025270063430070877,
0.0047840154729783535,
-0.093478724360466,
0.0013492356520146132,
0.03091495856642723,
-0.0758190006017685,
-0.06119745969772339,
0.012567313387989998,
-0.025745240971446037,
0.029162395745515823,
-0.01159689947962761,
-0.030908258631825447,
-0.00022409633675124496,
-0.026867179200053215,
-0.0013904478400945663,
0.010970721952617168,
0.049905698746442795,
-0.05168314278125763,
0.06717349588871002,
-0.04448721557855606,
-0.12879212200641632,
0.03012092225253582,
0.02555946819484234,
0.10314720124006271,
0.029787130653858185,
-0.026366140693426132,
0.04340642690658569,
-0.06620420515537262,
0.061395179480314255,
-0.10577327013015747,
0.05129187926650047,
0.047674812376499176,
0.05657282471656799,
0.10810542851686478,
-0.020589470863342285,
-0.05609318986535072,
0.06820362061262131,
-0.03072596713900566,
0.018596922978758812,
-0.0659455806016922,
-0.006852593272924423,
-0.019944755360484123,
0.018513204529881477,
0.0316300205886364,
0.04805459454655647,
-0.0002930213522631675,
0.04029768332839012,
-0.026902876794338226,
0.06520403921604156,
0.07843560725450516,
-0.07066468149423599,
-0.004850211553275585,
-0.1118726134300232,
-0.0020566226448863745,
0.04039190337061882,
-0.05568879097700119,
-0.051593925803899765,
0.06673438847064972,
-0.0048365420661866665
] | 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` or calling `require('node:https')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: ```cjs let https; try { https = require('node:https'); } catch (err) { console.error('https support is disabled!'); } ``` When using the lexical ESM `import` keyword, the error can only be caught if a handler for `process.on('uncaughtException')` is registered \_before\_ any attempt to load the module is made (using, for instance, a preload module). When using ESM, if there is a chance that the code may be run on a build of Node.js where crypto support is not enabled, consider using the [`import()`][] function instead of the lexical `import` keyword: ```mjs let https; try { https = await import('node:https'); } catch (err) { console.error('https support is disabled!'); } ``` ## Class: `https.Agent` An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See [`https.request()`][] for more information. Like `http.Agent`, the `createConnection(options[, callback])` method can be overridden to customize how TLS connections are established. > See [`agent.createConnection()`][] for details on overriding this method, > including asynchronous socket creation with a callback. ### `new Agent([options])` \* `options` {Object} Set of configurable options to set on the agent. Can have the same fields as for [`http.Agent(options)`][], and \* `maxCachedSessions` {number} maximum number of TLS cached sessions. Use `0` to disable TLS session caching. \*\*Default:\*\* `100`. \* `servername` {string} the value of [Server Name Indication extension][sni wiki] to be sent to the server. Use empty string `''` to disable sending the extension. \*\*Default:\*\* host name of the target server, unless the target server is specified using an IP address, in which case the default is `''` (no extension). See [`Session Resumption`][] for information about TLS session reuse. #### Event: `'keylog'` \* `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format. \* `tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance on which it was generated. The `keylog` event is emitted when key material is generated or received by a connection managed by this agent (typically before handshake has completed, but not necessarily). This keying material can be stored for debugging, as it allows captured TLS traffic to be decrypted. It may be emitted multiple times for each socket. A typical use case is to append received lines to a common text file, which is later used by software (such as Wireshark) to decrypt the traffic: ```js // ... https.globalAgent.on('keylog', (line, tlsSocket) => { fs.appendFileSync('/tmp/ssl-keys.log', line, { mode: 0o600 }); }); ``` ## Class: `https.Server` \* Extends: {tls.Server} See [`http.Server`][] for more information. ### `server.close([callback])` \* `callback` {Function} \* Returns: {https.Server} See [`server.close()`][] in the `node:http` module. ### `server[Symbol.asyncDispose]()` Calls [`server.close()`][httpsServerClose] and returns a promise that fulfills when the server has closed. ### `server.closeAllConnections()` See [`server.closeAllConnections()`][] in the `node:http` module. ### `server.closeIdleConnections()` See [`server.closeIdleConnections()`][] in the `node:http` module. ### `server.headersTimeout` \* Type: {number} \*\*Default:\*\* `60000` See [`server.headersTimeout`][] in the `node:http` module. ### `server.listen()` Starts the HTTPS server listening for encrypted connections. This method is identical to [`server.listen()`][] from [`net.Server`][]. ### `server.maxHeadersCount` \* Type: {number} \*\*Default:\*\* `2000` See [`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} \* Returns: {https.Server} See [`server.setTimeout()`][] in the `node:http` module. ### `server.timeout` \* Type: {number} \*\*Default:\*\* 0 (no timeout) See | 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.022658590227365494,
0.0672997385263443,
-0.03297930955886841,
0.007245715241879225,
0.05343746393918991,
-0.03698166832327843,
0.009169425815343857,
0.0012662119697779417,
-0.04295923933386803,
0.004477784037590027,
-0.00707835191860795,
-0.09340205043554306,
-0.05732276290655136,
-0.03687816485762596,
0.01141464151442051,
-0.01188401598483324,
0.016086148098111153,
-0.0516805425286293,
0.008655699901282787,
-0.0748465359210968,
0.048468343913555145,
-0.11659351736307144,
0.10608448088169098,
-0.04602809250354767,
-0.09821409732103348,
-0.0133195286616683,
-0.04082782194018364,
0.003604680299758911,
0.026269150897860527,
-0.05564513057470322,
-0.06161165237426758,
-0.007116283290088177,
-0.03343650698661804,
-0.045199401676654816,
-0.026597294956445694,
-0.09608792513608932,
-0.04755116254091263,
-0.009568111971020699,
-0.013069749809801579,
-0.028759408742189407,
0.0006202970980666578,
-0.08151515573263168,
0.03429439663887024,
0.004694374278187752,
0.0421186164021492,
0.0213699359446764,
0.0664270669221878,
0.028950229287147522,
-0.00803105067461729,
0.024371972307562828,
0.0294791292399168,
0.02365904487669468,
-0.00926725659519434,
0.02373170480132103,
0.012772086076438427,
-0.005454130936414003,
0.08334852755069733,
0.004795853514224291,
-0.0016045528464019299,
-0.04155677184462547,
0.05731434375047684,
-0.039215926080942154,
-0.06084577739238739,
-0.005024092271924019,
-0.05446028709411621,
0.011640301905572414,
0.048442285507917404,
-0.0075803413055837154,
-0.07154692709445953,
-0.017803112044930458,
0.008424964733421803,
0.015231909230351448,
0.09800618886947632,
-0.005687197204679251,
-0.009948838502168655,
0.0947781503200531,
0.06908009201288223,
-0.03474317118525505,
-0.02387193962931633,
-0.0034516125451773405,
0.06248966231942177,
0.055014483630657196,
0.002839927561581135,
0.04439258947968483,
0.023832621052861214,
-0.09548235684633255,
-0.074074886739254,
0.003958927467465401,
0.026449311524629593,
0.05467767268419266,
-0.04081946611404419,
0.055460069328546524,
0.013117955066263676,
0.0336773619055748,
-0.05970866605639458,
0.012496632523834705,
-0.010352198965847492,
0.0463007390499115,
0.019197741523385048,
0.028974955901503563,
-0.034250978380441666,
-0.03781399503350258,
0.03155319020152092,
0.027337202802300453,
-0.06252816319465637,
0.06493974477052689,
0.11020459234714508,
0.025825418531894684,
0.02064383774995804,
0.07931150496006012,
-0.03444555029273033,
0.0018125490751117468,
-0.06552179902791977,
0.094951331615448,
3.58698133859987e-33,
-0.018533436581492424,
-0.05394153669476509,
-0.027740826830267906,
0.06812775880098343,
0.0665174350142479,
-0.01054968312382698,
0.047843948006629944,
0.01948726922273636,
-0.13584722578525543,
-0.05037539824843407,
0.0300898477435112,
0.008887726813554764,
-0.005785576533526182,
-0.0416644848883152,
0.05340323597192764,
0.004536652471870184,
0.08533848822116852,
-0.019391175359487534,
0.09389761835336685,
0.05288355052471161,
0.06506993621587753,
-0.05718058720231056,
0.06308373808860779,
-0.004945479799062014,
0.018633591011166573,
0.0448574498295784,
0.023150427266955376,
0.03710139915347099,
0.045208919793367386,
0.010670946910977364,
-0.04510362446308136,
0.07219032943248749,
-0.014038513414561749,
0.0024950774386525154,
0.09220664203166962,
-0.0035188780166208744,
0.019336741417646408,
0.04385284334421158,
-0.0648772194981575,
-0.026508448645472527,
-0.005506702233105898,
0.09226534515619278,
0.010124136693775654,
0.03820090368390083,
-0.009976699948310852,
-0.07790696620941162,
-0.06189815327525139,
-0.09844796359539032,
0.049740925431251526,
0.058608461171388626,
-0.07973537594079971,
0.02918154001235962,
-0.007141597103327513,
-0.08539599925279617,
0.026336364448070526,
-0.018192995339632034,
0.023937726393342018,
-0.018160630017518997,
-0.07890212535858154,
-0.04818715155124664,
0.010483245365321636,
-0.03667480871081352,
-0.038542378693819046,
-0.02912740595638752,
0.02446039579808712,
0.0413779616355896,
-0.06393350660800934,
-0.0022965555544942617,
-0.09021776169538498,
0.03467312455177307,
-0.016622774302959442,
-0.03302747383713722,
0.02213527262210846,
0.0194929800927639,
0.05833325535058975,
0.028883840888738632,
-0.021685907617211342,
0.00985979288816452,
0.05291174352169037,
-0.04797812178730965,
0.026172442361712456,
-0.05762562155723572,
0.02620680257678032,
0.052958760410547256,
-0.010815424844622612,
0.07167710363864899,
-0.0454908050596714,
0.042831819504499435,
0.06794510036706924,
0.05175069347023964,
0.06216420605778694,
0.012870261445641518,
-0.003125207731500268,
-0.09175873547792435,
-0.11862246692180634,
-5.4992476305267354e-33,
-0.014219813048839569,
-0.004261803813278675,
-0.0348108671605587,
0.12425743043422699,
-0.011585968546569347,
-0.06275247037410736,
-0.04349302500486374,
-0.021435143426060677,
0.08450201898813248,
0.010808306746184826,
-0.043442193418741226,
-0.023002035915851593,
0.12265694886445999,
0.047200679779052734,
0.0012141145998612046,
0.02992679364979267,
-0.10743784159421921,
0.042827069759368896,
-0.022983085364103317,
-0.0020253174006938934,
0.01440812461078167,
-0.05353410542011261,
-0.018439030274748802,
0.05083528161048889,
-0.039247702807188034,
0.02320440672338009,
-0.11504185199737549,
-0.04315172880887985,
-0.04219578206539154,
-0.0429183691740036,
-0.025736326351761818,
-0.006114180665463209,
0.0199989452958107,
0.05501510947942734,
-0.028215352445840836,
-0.0969204306602478,
-0.04220578074455261,
0.046885475516319275,
0.0506819412112236,
-0.07392136752605438,
0.0814012885093689,
0.0423106886446476,
-0.02533169835805893,
-0.0013129402650520205,
0.044533636420965195,
-0.06998637318611145,
0.0019879010505974293,
0.03356001898646355,
0.006926217116415501,
0.0014401376247406006,
-0.0470413938164711,
-0.04043692722916603,
-0.025552935898303986,
-0.009533718228340149,
-0.030229806900024414,
-0.024366503581404686,
0.040969155728816986,
0.07872971892356873,
-0.052890121936798096,
0.005591570399701595,
0.034930504858493805,
-0.03986019268631935,
-0.04616668075323105,
-0.02705044113099575,
0.06920548528432846,
0.08016674965620041,
-0.1468069851398468,
0.02733447775244713,
0.10939045250415802,
0.02370717003941536,
0.01090783067047596,
-0.01829826459288597,
-0.007046345621347427,
-0.07338990271091461,
-0.0072438535280525684,
-0.04369330406188965,
-0.04203709214925766,
-0.10096059739589691,
0.03341980278491974,
0.06890758126974106,
-0.012877332977950573,
0.07224078476428986,
-0.03366141393780708,
0.027065705507993698,
0.06791810691356659,
0.020947253331542015,
-0.004813941661268473,
-0.010515422560274601,
-0.026877541095018387,
-0.03479064255952835,
0.028941718861460686,
-0.01618867553770542,
-0.11440803110599518,
0.025173533707857132,
0.07116388529539108,
-5.115627388363464e-8,
-0.03392081335186958,
0.04005138576030731,
-0.11293769627809525,
-0.05191021412611008,
0.11072809249162674,
0.009978524409234524,
0.032901469618082047,
-0.08469344675540924,
0.05789859965443611,
0.05872758477926254,
-0.04166365787386894,
0.023641956970095634,
-0.010436308570206165,
-0.008390488103032112,
0.0042023323476314545,
0.05827812850475311,
-0.09231317788362503,
0.037285298109054565,
-0.015488047152757645,
-0.07025964558124542,
0.015216266736388206,
-0.005165464244782925,
-0.00941072590649128,
0.12387638539075851,
-0.04251362383365631,
0.030050426721572876,
0.032226208597421646,
0.0618925467133522,
-0.03745715692639351,
-0.05176887288689613,
-0.12335764616727829,
-0.05030759796500206,
0.004507938865572214,
0.028050633147358894,
-0.0240803062915802,
0.05985556170344353,
-0.02556811273097992,
-0.03266486898064613,
0.0940365195274353,
0.019896045327186584,
0.03304516151547432,
0.06944717466831207,
0.025731176137924194,
0.04541788250207901,
-0.03679141402244568,
0.057034656405448914,
-0.002723453799262643,
0.036084625869989395,
-0.001602544100023806,
-0.012623822316527367,
-0.003134314902126789,
-0.007909534499049187,
-0.09698067605495453,
0.0405946709215641,
-0.046375252306461334,
0.00008751500718062744,
-0.0012393721845000982,
-0.09630972892045975,
-0.036654964089393616,
-0.07831761986017227,
0.11341767013072968,
-0.04477343708276749,
0.11707969009876251,
-0.06348197907209396
] | 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} \* Returns: {https.Server} See [`server.setTimeout()`][] in the `node:http` module. ### `server.timeout` \* Type: {number} \*\*Default:\*\* 0 (no timeout) See [`server.timeout`][] in the `node:http` module. ### `server.keepAliveTimeout` \* Type: {number} \*\*Default:\*\* `5000` (5 seconds) See [`server.keepAliveTimeout`][] in the `node:http` module. ## `https.createServer([options][, requestListener])` \* `options` {Object} Accepts `options` from [`tls.createServer()`][], [`tls.createSecureContext()`][] and [`http.createServer()`][]. \* `requestListener` {Function} A listener to be added to the `'request'` event. \* Returns: {https.Server} ```mjs // curl -k https://localhost:8000/ import { createServer } from 'node:https'; import { readFileSync } from 'node:fs'; const options = { key: readFileSync('private-key.pem'), cert: readFileSync('certificate.pem'), }; createServer(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }).listen(8000); ``` ```cjs // curl -k https://localhost:8000/ const https = require('node:https'); const fs = require('node:fs'); const options = { key: fs.readFileSync('private-key.pem'), cert: fs.readFileSync('certificate.pem'), }; https.createServer(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }).listen(8000); ``` Or ```mjs import { createServer } from 'node:https'; import { readFileSync } from 'node:fs'; const options = { pfx: readFileSync('test\_cert.pfx'), passphrase: 'sample', }; createServer(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }).listen(8000); ``` ```cjs const https = require('node:https'); const fs = require('node:fs'); const options = { pfx: fs.readFileSync('test\_cert.pfx'), passphrase: 'sample', }; https.createServer(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }).listen(8000); ``` To generate the certificate and key for this example, run: ```bash openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \ -keyout private-key.pem -out certificate.pem ``` Then, to generate the `pfx` certificate for this example, run: ```bash openssl pkcs12 -certpbe AES-256-CBC -export -out test\_cert.pfx \ -inkey private-key.pem -in certificate.pem -passout pass:sample ``` ## `https.get(options[, callback])` ## `https.get(url[, options][, callback])` \* `url` {string | URL} \* `options` {Object | string | URL} Accepts the same `options` as [`https.request()`][], with the method set to GET by default. \* `callback` {Function} \* Returns: {http.ClientRequest} Like [`http.get()`][] but for HTTPS. `options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is automatically parsed with [`new URL()`][]. If it is a [`URL`][] object, it will be automatically converted to an ordinary `options` object. ```mjs import { get } from 'node:https'; import process from 'node:process'; get('https://encrypted.google.com/', (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }).on('error', (e) => { console.error(e); }); ``` ```cjs const https = require('node:https'); https.get('https://encrypted.google.com/', (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }).on('error', (e) => { console.error(e); }); ``` ## `https.globalAgent` Global instance of [`https.Agent`][] for all HTTPS client requests. Diverges from a default [`https.Agent`][] configuration by having `keepAlive` enabled and a `timeout` of 5 seconds. ## `https.request(options[, callback])` ## `https.request(url[, options][, callback])` \* `url` {string | URL} \* `options` {Object | string | URL} Accepts all `options` from [`http.request()`][], with some differences in default values: \* `protocol` \*\*Default:\*\* `'https:'` \* `port` \*\*Default:\*\* `443` \* `agent` \*\*Default:\*\* `https.globalAgent` \* `callback` {Function} \* Returns: {http.ClientRequest} Makes a request to a secure web server. The following additional `options` from [`tls.connect()`][] are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine` (deprecated), `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. `options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is automatically parsed 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 `ClientRequest` | 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.04200873151421547,
-0.007512778043746948,
-0.023106416687369347,
-0.04638468101620674,
0.03471120446920395,
-0.0038620452396571636,
-0.08704980462789536,
0.04714685678482056,
0.07243552058935165,
0.018423883244395256,
0.037685830146074295,
-0.028509238734841347,
-0.03370264172554016,
-0.09022267162799835,
-0.046472471207380295,
0.026894520968198776,
-0.006507555488497019,
0.036501575261354446,
-0.060544874519109726,
-0.09145918488502502,
-0.0045300498604774475,
-0.04008171707391739,
0.09055550396442413,
-0.02445685863494873,
-0.05756071209907532,
-0.034314896911382675,
-0.03328839689493179,
0.06946700811386108,
0.034197911620140076,
-0.0037276786752045155,
-0.01875842548906803,
-0.018085012212395668,
0.032915957272052765,
-0.06787630915641785,
-0.05061919242143631,
-0.05437415465712547,
0.012524121440947056,
-0.009824598208069801,
0.02010445110499859,
-0.04503273218870163,
-0.006532086059451103,
-0.014081760309636593,
0.022887755185365677,
-0.060266830027103424,
0.04744797572493553,
-0.007934303022921085,
0.12303436547517776,
-0.010516470298171043,
-0.07316745817661285,
0.003111729398369789,
-0.04682888835668564,
0.01391000859439373,
0.024578923359513283,
-0.011859775520861149,
-0.05065964534878731,
0.010765375569462776,
0.07823479175567627,
0.033897437155246735,
0.07472054660320282,
-0.14112511277198792,
-0.011776242405176163,
-0.02564612217247486,
-0.040120817720890045,
-0.01564526930451393,
-0.0026613932568579912,
-0.03428107872605324,
-0.0009476604755036533,
-0.0006081504980102181,
-0.10561049729585648,
-0.04023262485861778,
0.03854166716337204,
-0.0186863224953413,
0.028993545100092888,
0.029346313327550888,
0.08619213849306107,
-0.016756920143961906,
-0.003364388830959797,
-0.07123719900846481,
0.06045379117131233,
-0.0521489679813385,
0.033015668392181396,
-0.05950973182916641,
0.0810217633843422,
-0.057082079350948334,
0.04466797411441803,
-0.031726203858852386,
-0.0444372221827507,
0.005833286792039871,
-0.06772252172231674,
-0.01618381217122078,
-0.01805131882429123,
0.0664437785744667,
-0.042956527322530746,
0.07330363243818283,
0.03919801861047745,
0.053424011915922165,
0.005543871782720089,
0.021832751110196114,
0.03577343374490738,
0.04316697642207146,
0.01387884933501482,
-0.021580170840024948,
0.06299810856580734,
0.022415511310100555,
-0.016986940056085587,
0.049344535917043686,
0.0624690018594265,
0.14681993424892426,
-0.0039737168699502945,
0.012517198920249939,
-0.09127189964056015,
0.02462158352136612,
0.01764415018260479,
0.14381840825080872,
4.663818652609551e-33,
-0.0016948060365393758,
-0.0655968189239502,
-0.04864368587732315,
0.019866932183504105,
0.09106850624084473,
-0.024573244154453278,
0.059745512902736664,
-0.003447702620178461,
-0.033699873834848404,
0.0038336673751473427,
-0.030609367415308952,
-0.07353174686431885,
0.002870779251679778,
-0.030921733006834984,
-0.00016975878679659218,
-0.072857566177845,
0.15677139163017273,
0.025195468217134476,
0.11788883060216904,
-0.003608058439567685,
0.049097441136837006,
-0.07778092473745346,
0.019086645916104317,
0.03705083951354027,
0.0036089394707232714,
0.0359392911195755,
-0.021418515592813492,
-0.006473988760262728,
-0.04682360589504242,
-0.016357680782675743,
0.06375795602798462,
0.10863394290208817,
-0.09161783009767532,
-0.019756613299250603,
0.0829133689403534,
-0.07110214978456497,
0.030195213854312897,
0.011004430241882801,
-0.04126865416765213,
-0.0025288963224738836,
-0.021545136347413063,
0.039710573852062225,
-0.12349151819944382,
0.07637667655944824,
-0.10887780040502548,
-0.12331067025661469,
-0.05300438404083252,
-0.02525799348950386,
0.025301221758127213,
0.07816796749830246,
-0.045140720903873444,
0.04500652104616165,
0.042841337621212006,
-0.03635650873184204,
0.02621745504438877,
0.035315316170454025,
-0.022785166278481483,
0.024101637303829193,
-0.04805857315659523,
0.0187318604439497,
0.06548497080802917,
-0.03336196392774582,
0.000120279670227319,
-0.07797423005104065,
0.038582514971494675,
0.03539831191301346,
0.010230116546154022,
0.09506943076848984,
-0.04206635057926178,
0.039942674338817596,
0.040862105786800385,
0.00522345956414938,
0.03882128372788429,
0.0003611457359511405,
-0.08386775106191635,
-0.03349967300891876,
0.002981577068567276,
0.007436924614012241,
-0.016317158937454224,
-0.00829370878636837,
0.10619465261697769,
-0.0007149848970584571,
-0.019712481647729874,
-0.012618012726306915,
0.07401541620492935,
-0.03641945868730545,
-0.020720381289720535,
-0.019323434680700302,
0.01096490491181612,
0.014475768432021141,
-0.04499681666493416,
-0.02204006537795067,
0.04195121303200722,
-0.07159071415662766,
-0.12386475503444672,
-5.99215775842346e-33,
0.032161008566617966,
-0.024168994277715683,
-0.02258618175983429,
0.07477822154760361,
0.04201526939868927,
-0.03376208618283272,
-0.019255127757787704,
0.12043784558773041,
-0.012850484810769558,
0.03939808905124664,
0.03678637742996216,
0.010275771841406822,
0.011101148091256618,
-0.014983651228249073,
-0.06421686708927155,
0.04779256135225296,
-0.01812261901795864,
-0.06547854095697403,
-0.009990042075514793,
-0.05527578294277191,
-0.019939018413424492,
0.0016681611305102706,
-0.020777586847543716,
0.04788726940751076,
-0.05605325847864151,
0.010488444939255714,
-0.06957786530256271,
-0.024146072566509247,
-0.04487886279821396,
-0.1186460480093956,
-0.02085402049124241,
0.02284984663128853,
-0.05077522248029709,
0.0445413738489151,
0.03932381793856621,
-0.02357008121907711,
0.024824541062116623,
0.15704898536205292,
0.03628724813461304,
0.0876627042889595,
0.1542474925518036,
0.022061709314584732,
0.007490735501050949,
-0.002815911779180169,
0.03191223740577698,
0.0031046003568917513,
-0.010734301060438156,
-0.016535969451069832,
-0.06390748918056488,
0.04948170483112335,
-0.03294380381703377,
-0.07075900584459305,
0.028322966769337654,
0.08751441538333893,
0.03746969997882843,
-0.050687629729509354,
0.04540001228451729,
-0.030972352251410484,
0.030995206907391548,
-0.012272132560610771,
0.0547940768301487,
-0.1244683787226677,
-0.017259905114769936,
0.07121925801038742,
0.022725095972418785,
0.04268183559179306,
-0.09485650062561035,
-0.03517596796154976,
0.01946963183581829,
0.023476433008909225,
-0.009266689419746399,
-0.018088901415467262,
-0.035798199474811554,
0.0005507614696398377,
-0.035805005580186844,
0.0154230622574687,
-0.05263379216194153,
-0.0990658849477768,
-0.0001926674012793228,
0.11863390356302261,
-0.05489049106836319,
0.10512380301952362,
-0.08370748162269592,
-0.030034329742193222,
0.05485906824469566,
0.017057595774531364,
-0.06498179584741592,
0.10341515392065048,
0.008555283769965172,
-0.013401152566075325,
0.003000707132741809,
0.0022693967912346125,
-0.06787313520908356,
0.017920156940817833,
-0.03302779048681259,
-4.763461802781421e-8,
-0.03650597855448723,
0.0447467677295208,
0.010380062274634838,
-0.025317158550024033,
0.017089050263166428,
0.020571626722812653,
0.026445863768458366,
-0.019649039953947067,
-0.007374252658337355,
-0.010098199360072613,
0.022294817492365837,
-0.03919240087270737,
0.07521786540746689,
-0.003904531942680478,
-0.036565620452165604,
-0.019815649837255478,
-0.003310044528916478,
-0.03249088302254677,
0.026983847841620445,
-0.046779610216617584,
-0.04197259992361069,
-0.025588564574718475,
0.02975423075258732,
0.010170906782150269,
-0.02621617540717125,
-0.011495011858642101,
0.026580048725008965,
0.12085937708616257,
-0.0881173387169838,
-0.025902671739459038,
-0.07568264752626419,
0.01178682129830122,
-0.04499424621462822,
-0.019212275743484497,
-0.04612116515636444,
0.013081789016723633,
-0.07261959463357925,
-0.026638956740498543,
-0.01058465987443924,
0.06309327483177185,
0.030340885743498802,
-0.005294265225529671,
-0.025974463671445847,
0.03937279060482979,
0.06037195771932602,
0.02835451252758503,
0.010463140904903412,
0.06267830729484558,
0.004663797561079264,
-0.014135685749351978,
0.03376094624400139,
-0.05746590718626976,
-0.011649001389741898,
-0.002742429729551077,
0.001501633902080357,
-0.009991011582314968,
0.06337352097034454,
-0.09143304824829102,
0.009296725504100323,
0.017052093520760536,
0.03554100915789604,
0.007631039712578058,
-0.01690242812037468,
-0.03578687459230423
] | 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 `ClientRequest` object. ```mjs import { request } from 'node:https'; import process from 'node:process'; const options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET', }; const req = request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); ``` ```cjs const https = require('node:https'); const options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET', }; const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); ``` Example using options from [`tls.connect()`][]: ```js const options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET', key: fs.readFileSync('private-key.pem'), cert: fs.readFileSync('certificate.pem'), }; options.agent = new https.Agent(options); const req = https.request(options, (res) => { // ... }); ``` Alternatively, opt out of connection pooling by not using an [`Agent`][]. ```js const options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET', key: fs.readFileSync('private-key.pem'), cert: fs.readFileSync('certificate.pem'), agent: false, }; const req = https.request(options, (res) => { // ... }); ``` Example using a [`URL`][] as `options`: ```js const options = new URL('https://abc:xyz@example.com'); const req = https.request(options, (res) => { // ... }); ``` Example pinning on certificate fingerprint, or the public key (similar to `pin-sha256`): ```mjs import { checkServerIdentity } from 'node:tls'; import { Agent, request } from 'node:https'; import { createHash } from 'node:crypto'; function sha256(s) { return 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 = checkServerIdentity(host, cert); if (err) { return err; } // Pin the public key, similar to HPKP pin-sha256 pinning const pubkey256 = 'SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8='; if (sha256(cert.pubkey) !== pubkey256) { const msg = 'Certificate verification error: ' + `The public key of '${cert.subject.CN}' ` + 'does not match our pinned fingerprint'; return new Error(msg); } // Pin the exact certificate, rather than the pub key const cert256 = 'FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:' + '0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65'; if (cert.fingerprint256 !== cert256) { const msg = 'Certificate verification error: ' + `The certificate of '${cert.subject.CN}' ` + 'does not match our pinned fingerprint'; return new Error(msg); } // This loop is informational only. // Print the certificate and public key fingerprints of all certs in the // chain. Its common to pin the public key of the issuer on the public // internet, while pinning the public key of the service in sensitive // environments. let lastprint256; do { console.log('Subject Common Name:', cert.subject.CN); console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); const hash = createHash('sha256'); console.log(' Public key ping-sha256:', sha256(cert.pubkey)); lastprint256 = cert.fingerprint256; cert = cert.issuerCertificate; } while (cert.fingerprint256 !== lastprint256); }, }; options.agent = new Agent(options); const req = request(options, (res) => { console.log('All OK. Server matched our pinned cert or public key'); console.log('statusCode:', res.statusCode); res.on('data', (d) => {}); }); req.on('error', (e) => { console.error(e.message); }); req.end(); ``` ```cjs const tls = require('node:tls'); const https = require('node:https'); const crypto = require('node:crypto'); function sha256(s) { 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) { return err; } // Pin the public key, | 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.0014284744393080473,
0.0404679998755455,
-0.05889790505170822,
-0.02573336288332939,
0.03247185796499252,
0.02481604926288128,
-0.05500106140971184,
0.0712774395942688,
-0.007339070085436106,
0.04267904907464981,
-0.014852707274258137,
-0.06381796300411224,
-0.03522564098238945,
0.022550124675035477,
-0.0320889912545681,
0.023807674646377563,
0.03486165404319763,
0.02706272527575493,
-0.04909547418355942,
-0.09797528386116028,
-0.009677467867732048,
-0.08164701610803604,
0.06931696832180023,
0.005849032662808895,
-0.10155358910560608,
-0.02111845649778843,
0.005137047730386257,
0.07091569900512695,
0.023297475650906563,
-0.0785551518201828,
-0.026935026049613953,
-0.02124183066189289,
0.03337877243757248,
-0.019264599308371544,
-0.0029059352818876505,
-0.05359815061092377,
-0.03150080516934395,
-0.05419910326600075,
-0.005650908686220646,
-0.1284509152173996,
0.01852700300514698,
-0.08756537735462189,
-0.0006361217820085585,
-0.1032603457570076,
0.06628695875406265,
0.05367070809006691,
0.053461723029613495,
-0.05507425591349602,
-0.04752262309193611,
0.05762326344847679,
-0.024642258882522583,
0.01728113368153572,
0.04672761261463165,
-0.03392963856458664,
0.044035736471414566,
0.022331926971673965,
0.036568913608789444,
0.025598254054784775,
0.0334797129034996,
-0.16113243997097015,
-0.05094164237380028,
-0.050636183470487595,
-0.16644473373889923,
-0.07753442227840424,
0.004834204446524382,
-0.03586471080780029,
0.10964906215667725,
0.07758291810750961,
-0.10354286432266235,
0.009904252365231514,
0.09081988781690598,
-0.060499776154756546,
0.01791571080684662,
-0.022525323554873466,
0.04000481590628624,
0.062397535890340805,
-0.01718929596245289,
-0.07914920896291733,
0.012623905204236507,
-0.07441452890634537,
-0.016976622864603996,
-0.005590198561549187,
0.09240135550498962,
-0.015807155519723892,
0.017436712980270386,
0.005692324135452509,
-0.045287638902664185,
0.0716078132390976,
-0.033235371112823486,
0.020651904866099358,
-0.08854467421770096,
0.06795106083154678,
0.028586311265826225,
-0.005728221032768488,
0.05757063627243042,
0.048678554594516754,
0.027494369074702263,
-0.039155036211013794,
0.039248064160346985,
-0.01193905621767044,
-0.05282849445939064,
-0.04733096808195114,
0.01849706470966339,
-0.02489929087460041,
-0.014613105915486813,
0.005514056421816349,
0.10789512097835541,
0.06627188622951508,
-0.014809779822826385,
0.013930177316069603,
-0.004491959232836962,
0.01105275098234415,
-0.06046919524669647,
0.10119269788265228,
6.283470972496147e-34,
0.033886030316352844,
-0.053191959857940674,
0.05486912652850151,
0.045504871755838394,
-0.0046066101640462875,
0.045298926532268524,
0.0660332590341568,
0.008143316023051739,
-0.04609449952840805,
-0.058365803211927414,
-0.050417810678482056,
-0.005740306340157986,
-0.00628127483651042,
-0.04707690700888634,
-0.015095687471330166,
0.006564088631421328,
0.022085776552557945,
0.017188815400004387,
0.12602709233760834,
0.06799672544002533,
0.03321154788136482,
0.032636016607284546,
0.035580113530159,
-0.006351863499730825,
0.01534891314804554,
-0.03783639520406723,
0.0035308124497532845,
-0.006839744746685028,
-0.08307357877492905,
-0.06297022849321365,
0.04433383420109749,
0.005906686186790466,
0.011766745708882809,
0.0037728564348071814,
0.06765703856945038,
-0.0429663211107254,
0.03904455900192261,
0.03807751461863518,
-0.11489614844322205,
-0.08359671384096146,
0.07205422222614288,
0.021887481212615967,
-0.007731263525784016,
0.03687485679984093,
-0.06996022909879684,
0.031039148569107056,
-0.08218209445476532,
-0.0874660462141037,
0.10059574991464615,
0.02752584218978882,
-0.027876876294612885,
0.0276492889970541,
-0.0010264393640682101,
-0.055032894015312195,
-0.009080780670046806,
0.045697618275880814,
-0.005420048721134663,
0.0038069027941673994,
-0.07804542034864426,
-0.08294766396284103,
0.04285639151930809,
0.012089612893760204,
0.006468026898801327,
-0.030893474817276,
0.007074205204844475,
-0.022482143715023994,
-0.04068934544920921,
0.07519855350255966,
0.018295761197805405,
-0.0009270686423406005,
-0.06364535540342331,
-0.01698206551373005,
0.02724289521574974,
-0.012884354218840599,
0.002013101475313306,
0.027223020792007446,
-0.07086488604545593,
0.013432914391160011,
0.0032915326301008463,
-0.027242545038461685,
0.05490655452013016,
-0.03558722883462906,
-0.029624948278069496,
0.04503336921334267,
0.045345500111579895,
0.04510730877518654,
0.0014003698015585542,
-0.02969493716955185,
0.027226869016885757,
0.014792017638683319,
-0.02714533358812332,
-0.007492668926715851,
-0.0308177899569273,
-0.060819655656814575,
-0.042200807482004166,
-3.632841046645294e-33,
0.003665550844743848,
-0.05355283245444298,
-0.01137511432170868,
0.10410405695438385,
0.03699534758925438,
-0.005821146536618471,
0.09222088009119034,
0.05671270191669464,
0.023303525522351265,
0.0804908275604248,
-0.05921030044555664,
0.011780381202697754,
0.075766421854496,
0.022425422444939613,
-0.050517935305833817,
-0.0022596511989831924,
-0.10062509775161743,
0.00041264676838181913,
-0.05676058679819107,
-0.07651404291391373,
-0.08171723783016205,
0.004476479720324278,
0.08538907766342163,
0.045888639986515045,
-0.0024731324519962072,
0.01012946292757988,
-0.014312410727143288,
-0.0037385020405054092,
-0.017183983698487282,
-0.059730466455221176,
-0.024990884587168694,
0.05073237419128418,
-0.03069772943854332,
0.08932921290397644,
0.019176620990037918,
-0.06361883878707886,
0.06445275992155075,
0.17252075672149658,
0.1079350933432579,
-0.02538420632481575,
0.058901917189359665,
-0.03789671137928963,
0.007772707846015692,
0.029659505933523178,
0.10077987611293793,
-0.004750474356114864,
0.010502508841454983,
0.057093843817710876,
0.0008440107922069728,
0.011393866501748562,
-0.02487681433558464,
-0.014444313012063503,
-0.0689062625169754,
0.032251641154289246,
0.08503864705562592,
-0.03441948816180229,
0.00841780286282301,
-0.07461971789598465,
0.0006790313054807484,
0.03201084956526756,
0.015556920319795609,
-0.12512756884098053,
-0.019211770966649055,
-0.0018928329227492213,
0.008235782384872437,
0.043998800218105316,
-0.08288433402776718,
-0.00670848973095417,
0.053741030395030975,
0.03589320555329323,
-0.04798208549618721,
-0.05598069727420807,
0.02623620256781578,
-0.029342303052544594,
0.12403371185064316,
-0.040219537913799286,
-0.011697073467075825,
-0.06037697196006775,
0.023408055305480957,
0.05941374599933624,
0.015407008118927479,
0.016255484893918037,
-0.0871414989233017,
0.07300924509763718,
0.06644086539745331,
-0.0745280385017395,
-0.01285691000521183,
0.03512754663825035,
-0.01038452610373497,
-0.005265428218990564,
-0.030355900526046753,
0.05453292280435562,
-0.0770234540104866,
-0.0242258682847023,
0.0022490164265036583,
-4.968042688346941e-8,
-0.031003788113594055,
0.012491165660321712,
-0.05409366264939308,
0.06596474349498749,
0.02854584902524948,
0.025092117488384247,
0.007869170047342777,
-0.07100491225719452,
0.06173088401556015,
-0.01685888133943081,
-0.03603918105363846,
-0.09935908764600754,
0.006857667583972216,
0.02190249040722847,
-0.011298194527626038,
0.002036705845966935,
0.009110047481954098,
-0.02192288637161255,
0.028753265738487244,
-0.03713161125779152,
0.02366401068866253,
-0.09315093606710434,
0.003399069420993328,
0.08440027385950089,
0.05020205304026604,
-0.028169360011816025,
0.021531298756599426,
0.03957900404930115,
-0.062172770500183105,
0.04368968307971954,
-0.10114705562591553,
-0.022059662267565727,
0.023115195333957672,
0.023555517196655273,
-0.00596732459962368,
0.01667739637196064,
-0.0393008328974247,
0.001818111166357994,
0.03766116872429848,
-0.028803212568163872,
0.07510025054216385,
0.07998872548341751,
0.007398491725325584,
0.01049481425434351,
0.0032180193811655045,
-0.003163432003930211,
0.0384887270629406,
0.04257514327764511,
0.030577540397644043,
0.045096561312675476,
-0.015640288591384888,
-0.05887012183666229,
-0.015071514993906021,
0.011432466097176075,
-0.03935931622982025,
-0.029343001544475555,
-0.007923560217022896,
-0.1142072007060051,
-0.0022367113269865513,
-0.03806914761662483,
0.10488217324018478,
0.06581002473831177,
0.04573323205113411,
-0.011292017064988613
] | -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) { return err; } // Pin the public key, similar to HPKP pin-sha256 pinning const pubkey256 = 'SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8='; if (sha256(cert.pubkey) !== pubkey256) { const msg = 'Certificate verification error: ' + `The public key of '${cert.subject.CN}' ` + 'does not match our pinned fingerprint'; return new Error(msg); } // Pin the exact certificate, rather than the pub key const cert256 = 'FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:' + '0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65'; if (cert.fingerprint256 !== cert256) { const msg = 'Certificate verification error: ' + `The certificate of '${cert.subject.CN}' ` + 'does not match our pinned fingerprint'; return new Error(msg); } // This loop is informational only. // Print the certificate and public key fingerprints of all certs in the // chain. Its common to pin the public key of the issuer on the public // internet, while pinning the public key of the service in sensitive // environments. do { console.log('Subject Common Name:', cert.subject.CN); console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); hash = crypto.createHash('sha256'); console.log(' Public key ping-sha256:', sha256(cert.pubkey)); lastprint256 = cert.fingerprint256; cert = cert.issuerCertificate; } while (cert.fingerprint256 !== lastprint256); }, }; options.agent = new https.Agent(options); const req = https.request(options, (res) => { console.log('All OK. Server matched our pinned cert or public key'); console.log('statusCode:', res.statusCode); res.on('data', (d) => {}); }); req.on('error', (e) => { console.error(e.message); }); req.end(); ``` Outputs for example: ```text Subject Common Name: github.com Certificate SHA256 fingerprint: FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65 Public key ping-sha256: SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8= Subject Common Name: Sectigo ECC Domain Validation Secure Server CA Certificate SHA256 fingerprint: 61:E9:73:75:E9:F6:DA:98:2F:F5:C1:9E:2F:94:E6:6C:4E:35:B6:83:7C:E3:B9:14:D2:24:5C:7F:5F:65:82:5F Public key ping-sha256: Eep0p/AsSa9lFUH6KT2UY+9s1Z8v7voAPkQ4fGknZ2g= Subject Common Name: USERTrust ECC Certification Authority Certificate SHA256 fingerprint: A6:CF:64:DB:B4:C8:D5:FD:19:CE:48:89:60:68:DB:03:B5:33:A8:D1:33:6C:62:56:A8:7D:00:CB:B3:DE:F3:EA Public key ping-sha256: UJM2FOhG9aTNY0Pg4hgqjNzZ/lQBiMGRxPD5Y2/e0bw= Subject Common Name: AAA Certificate Services Certificate SHA256 fingerprint: D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4 Public key ping-sha256: vRU+17BDT2iGsXvOi76E7TQMcTLXAqj0+jGPdW7L1vM= All OK. Server matched our pinned cert or public key statusCode: 200 ``` [`Agent`]: #class-httpsagent [`Session Resumption`]: tls.md#session-resumption [`URL`]: url.md#the-whatwg-url-api [`agent.createConnection()`]: http.md#agentcreateconnectionoptions-callback [`http.Agent(options)`]: http.md#new-agentoptions [`http.Agent`]: http.md#class-httpagent [`http.ClientRequest`]: http.md#class-httpclientrequest [`http.Server`]: http.md#class-httpserver [`http.createServer()`]: http.md#httpcreateserveroptions-requestlistener [`http.get()`]: http.md#httpgetoptions-callback [`http.request()`]: http.md#httprequestoptions-callback [`https.Agent`]: #class-httpsagent [`https.request()`]: #httpsrequestoptions-callback [`import()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import [`net.Server`]: net.md#class-netserver [`new URL()`]: url.md#new-urlinput-base [`server.close()`]: http.md#serverclosecallback [`server.closeAllConnections()`]: http.md#servercloseallconnections [`server.closeIdleConnections()`]: http.md#servercloseidleconnections [`server.headersTimeout`]: http.md#serverheaderstimeout [`server.keepAliveTimeout`]: http.md#serverkeepalivetimeout [`server.listen()`]: net.md#serverlisten [`server.maxHeadersCount`]: http.md#servermaxheaderscount [`server.requestTimeout`]: http.md#serverrequesttimeout [`server.setTimeout()`]: http.md#serversettimeoutmsecs-callback [`server.timeout`]: http.md#servertimeout [`tls.connect()`]: tls.md#tlsconnectoptions-callback [`tls.createSecureContext()`]: tls.md#tlscreatesecurecontextoptions [`tls.createServer()`]: tls.md#tlscreateserveroptions-secureconnectionlistener [httpsServerClose]: #serverclosecallback [sni wiki]: https://en.wikipedia.org/wiki/Server\_Name\_Indication | 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.03933367505669594,
0.03122280351817608,
-0.046783436089754105,
-0.10377168655395508,
0.031233597546815872,
0.04638770967721939,
0.00868881307542324,
-0.014820757322013378,
-0.06004241853952408,
0.04288594052195549,
-0.019953088834881783,
-0.029623843729496002,
-0.11167321354150772,
0.04174543544650078,
0.09692108631134033,
-0.009358394891023636,
0.01981731876730919,
0.1576264351606369,
0.036740876734256744,
-0.08199866116046906,
0.01664501242339611,
-0.048851896077394485,
0.11084964871406555,
0.010768922045826912,
-0.01801932230591774,
0.05183621123433113,
-0.0002861274697352201,
0.04604293778538704,
-0.030211525037884712,
-0.025456370785832405,
0.0024100563023239374,
0.050070684403181076,
0.05109398066997528,
-0.0462493933737278,
-0.00330320093780756,
0.016860948875546455,
-0.02194441296160221,
0.0030431500636041164,
-0.10802077502012253,
-0.030729500576853752,
0.004632221534848213,
-0.051916155964136124,
-0.006373732350766659,
-0.0768742561340332,
0.03360074758529663,
0.06855440139770508,
-0.04369109869003296,
0.05643099546432495,
-0.011870134621858597,
0.044305671006441116,
-0.015179058536887169,
0.026894140988588333,
-0.0055259219370782375,
-0.009166164323687553,
-0.03506754711270332,
-0.012040574103593826,
0.016043737530708313,
-0.005670938640832901,
-0.033191315829753876,
0.015380117110908031,
0.026430251076817513,
-0.05861914902925491,
-0.008674920536577702,
-0.09202243387699127,
-0.009634792804718018,
0.03668079152703285,
0.0395393930375576,
-0.07044889032840729,
-0.11041869968175888,
-0.030305979773402214,
0.09526234120130539,
-0.039111364632844925,
0.06328848749399185,
0.017894065007567406,
0.04991408810019493,
-0.019921747967600822,
0.0008689007954671979,
0.019276956096291542,
0.016151219606399536,
-0.05527748540043831,
-0.043008726090192795,
0.11820375919342041,
0.0023492099717259407,
-0.007510925177484751,
0.01917332224547863,
-0.004614819772541523,
0.007751194294542074,
-0.00794527679681778,
0.008393459022045135,
-0.04014172777533531,
-0.0950261652469635,
0.0573122575879097,
0.06349661946296692,
-0.013207130134105682,
0.0545952133834362,
0.016154924407601357,
-0.02481146901845932,
-0.013276693411171436,
-0.001188345835544169,
0.014490519650280476,
-0.07864905893802643,
-0.021544277667999268,
0.1296633630990982,
0.037361398339271545,
0.002360626356676221,
0.048406973481178284,
-0.025267241522669792,
0.04902327060699463,
0.023160915821790695,
-0.03751768916845322,
-0.016695966944098473,
-0.0472511425614357,
-0.03377971798181534,
0.0345592200756073,
8.359992396141272e-33,
0.07046476006507874,
0.06696519255638123,
0.04526027292013168,
-0.006774319801479578,
0.029188279062509537,
0.03317572921514511,
0.018501626327633858,
-0.04681030660867691,
-0.11759460717439651,
0.06125885993242264,
-0.04696916416287422,
-0.022423429414629936,
-0.028852209448814392,
-0.09343870729207993,
0.031056424602866173,
0.0027855532243847847,
-0.03146912530064583,
-0.007118970155715942,
-0.03998847305774689,
0.08594203740358353,
0.013609989546239376,
-0.09148695319890976,
0.032565146684646606,
0.012241416610777378,
0.030187973752617836,
0.002954815048724413,
0.023298416286706924,
0.005891620181500912,
0.004181342665106058,
-0.044654570519924164,
0.03560240939259529,
0.051674410700798035,
-0.013347516767680645,
-0.024532215669751167,
0.049824681133031845,
-0.09226461499929428,
0.06025739759206772,
0.07337940484285355,
-0.04587319493293762,
-0.05708827078342438,
0.1398826241493225,
-0.047169242054224014,
-0.047797612845897675,
0.073306605219841,
0.034638937562704086,
0.021413985639810562,
-0.008419927209615707,
-0.08883224427700043,
0.16605503857135773,
0.06640665233135223,
-0.030429527163505554,
-0.028182625770568848,
-0.05332651361823082,
-0.09752488136291504,
0.005057424772530794,
-0.06025262176990509,
-0.0026389616541564465,
0.023142129182815552,
-0.12827168405056,
-0.03227870911359787,
-0.026684528216719627,
-0.03310619667172432,
-0.03547712415456772,
-0.017735103145241737,
0.05829829350113869,
-0.013486217707395554,
-0.021949386224150658,
0.045301057398319244,
-0.08246780186891556,
0.012857943773269653,
-0.06459106504917145,
0.021348167210817337,
0.028329070657491684,
0.004509599879384041,
-0.04779071360826492,
0.0020879285875707865,
-0.07209751009941101,
0.041818805038928986,
-0.019254522398114204,
-0.08886727690696716,
0.02997721917927265,
0.035951536148786545,
-0.010996023193001747,
0.0017514739884063601,
0.029668236151337624,
0.13023081421852112,
-0.00615381496027112,
0.0050764488987624645,
0.0041191899217665195,
0.05828607454895973,
-0.0018674804596230388,
0.04199107736349106,
-0.015914548188447952,
-0.03545079007744789,
-0.09702365845441818,
-9.194738852651011e-33,
-0.020414365455508232,
-0.049842361360788345,
-0.016190994530916214,
0.08983577787876129,
0.015515713021159172,
-0.002480060327798128,
0.006368929520249367,
-0.0043633561581373215,
0.016239410266280174,
-0.02756388671696186,
0.05372828245162964,
-0.015153060667216778,
0.06539084017276764,
0.02129828743636608,
0.02812720090150833,
0.013361416757106781,
-0.10490283370018005,
0.08770157396793365,
-0.002529013901948929,
-0.03300889953970909,
0.013254606164991856,
0.019715381786227226,
-0.004009012132883072,
0.06290736794471741,
-0.04928494989871979,
0.07558856159448624,
-0.016674429178237915,
-0.024174025282263756,
-0.005225448869168758,
-0.02114279940724373,
-0.005213321652263403,
0.06507788598537445,
-0.015613293275237083,
0.0652199313044548,
-0.030926058068871498,
-0.07572523504495621,
0.0365128219127655,
0.06655634939670563,
0.04991014674305916,
0.03351980447769165,
0.004831906408071518,
-0.04343724995851517,
-0.017440952360630035,
-0.023454371839761734,
0.0054678586311638355,
-0.0563301146030426,
0.035981807857751846,
0.0517459437251091,
-0.017373403534293175,
0.0523957759141922,
-0.00043836317490786314,
-0.05193505808711052,
0.0027094827964901924,
-0.005478637758642435,
0.02588062360882759,
0.059030745178461075,
-0.03522622212767601,
0.04076678305864334,
0.000055666034313617274,
0.03533889725804329,
-0.002033419208601117,
-0.061306338757276535,
0.01977655664086342,
0.037189729511737823,
0.006805321201682091,
0.05497618019580841,
-0.09982120990753174,
0.056880734860897064,
0.07319878786802292,
0.07076334208250046,
-0.04041006788611412,
0.016661491245031357,
0.012420563027262688,
-0.06669751554727554,
0.12699384987354279,
-0.04205182194709778,
-0.032039299607276917,
0.030373625457286835,
0.05523573234677315,
0.07781588286161423,
0.026943668723106384,
0.09330569952726364,
-0.06037775054574013,
-0.007975997403264046,
0.06466615945100784,
-0.01880401000380516,
0.0012442145962268114,
-0.011238230392336845,
-0.0822778269648552,
-0.040302276611328125,
-0.049036577343940735,
0.01572433114051819,
-0.029111240059137344,
-0.03871908783912659,
0.08201330155134201,
-5.5851437252840697e-8,
0.043482456356287,
0.06033536046743393,
-0.12551836669445038,
-0.08593019843101501,
0.042415447533130646,
0.016837259754538536,
0.03160015493631363,
-0.12856599688529968,
-0.0560157373547554,
-0.0494382306933403,
-0.032241735607385635,
0.0011832162272185087,
0.020844800397753716,
-0.0021320225205272436,
-0.017867814749479294,
-0.036327023059129715,
-0.11722322553396225,
0.017187071964144707,
0.019331151619553566,
-0.045219242572784424,
0.032988399267196655,
-0.08624275773763657,
0.03149209916591644,
0.07795344293117523,
-0.010704818181693554,
-0.007836208678781986,
0.06820517033338547,
0.08078223466873169,
-0.017852263525128365,
0.029337706044316292,
-0.0589800700545311,
-0.035183604806661606,
-0.03372788801789284,
-0.0611829049885273,
0.009641255252063274,
0.043179623782634735,
-0.08214511722326279,
-0.04068823158740997,
0.14081040024757385,
0.07103078067302704,
0.016269896179437637,
0.0034592035226523876,
-0.06986542791128159,
-0.008988898247480392,
-0.10153989493846893,
0.012338424101471901,
0.05652393028140068,
0.03768543154001236,
-0.03533497825264931,
0.022471105679869652,
-0.004103212151676416,
-0.017161782830953598,
-0.011995379813015461,
-0.04579584300518036,
-0.09252484142780304,
0.06014081463217735,
-0.019031863659620285,
-0.035996563732624054,
-0.017315426841378212,
-0.07764402776956558,
0.04567527770996094,
-0.01950083300471306,
0.08114376664161682,
-0.027167171239852905
] | -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 time being but should expect to have to migrate to a different solution in the future. Domains provide a way to handle multiple different IO operations as a single group. If any of the event emitters or callbacks registered to a domain emit an `'error'` event, or throw an error, then the domain object will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to exit immediately with an error code. ## Warning: Don't ignore errors! Domain error handlers are not a substitute for closing down a process when an error occurs. By the very nature of how [`throw`][] works in JavaScript, there is almost never any way to safely "pick up where it left off", without leaking references, or creating some other sort of undefined brittle state. The safest way to respond to a thrown error is to shut down the process. Of course, in a normal web server, there may be many open connections, and it is not reasonable to abruptly shut those down because an error was triggered by someone else. The better approach is to send an error response to the request that triggered the error, while letting the others finish in their normal time, and stop listening for new requests in that worker. In this way, `domain` usage goes hand-in-hand with the cluster module, since the primary process can fork a new worker when a worker encounters an error. For Node.js programs that scale to multiple machines, the terminating proxy or service registry can take note of the failure, and react accordingly. For example, this is not a good idea: ```js // XXX WARNING! BAD IDEA! const d = require('node:domain').create(); d.on('error', (er) => { // The error won't crash the process, but what it does is worse! // Though we've prevented abrupt process restarting, we are leaking // a lot of resources if this ever happens. // This is no better than process.on('uncaughtException')! console.log(`error, but oh well ${er.message}`); }); d.run(() => { require('node:http').createServer((req, res) => { handleRequest(req, res); }).listen(PORT); }); ``` By using the context of a domain, and the resilience of separating our program into multiple worker processes, we can react more appropriately, and handle errors with much greater safety. ```js // Much better! const cluster = require('node:cluster'); const PORT = +process.env.PORT || 1337; if (cluster.isPrimary) { // A more realistic scenario would have more than 2 workers, // and perhaps not put the primary and worker in the same file. // // It is also possible to get a bit fancier about logging, and // implement whatever custom logic is needed to prevent DoS // attacks and other bad behavior. // // See the options in the cluster documentation. // // The important thing is that the primary does very little, // increasing our resilience to unexpected errors. cluster.fork(); cluster.fork(); cluster.on('disconnect', (worker) => { console.error('disconnect!'); cluster.fork(); }); } else { // the worker // // This is where we put our bugs! const 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're in dangerous territory! // By definition, something | 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.017617685720324516,
0.02099345251917839,
0.024448489770293236,
-0.02515544928610325,
-0.008105157874524593,
-0.08720189332962036,
-0.0379919596016407,
0.06615696102380753,
0.0058893742971122265,
-0.052505284547805786,
0.05339081585407257,
-0.08941824734210968,
-0.023931078612804413,
-0.014686151407659054,
-0.06064467877149582,
0.01886982098221779,
0.014899964444339275,
0.021718595176935196,
-0.047608084976673126,
-0.10534512996673584,
-0.04890873283147812,
0.0034808386117219925,
0.0815417468547821,
-0.045379698276519775,
-0.012949845753610134,
-0.009119133464992046,
-0.07941600680351257,
0.034887105226516724,
-0.0012981975451111794,
0.00007581117824884132,
-0.021718118339776993,
-0.01346312090754509,
-0.0012293292675167322,
-0.06853366643190384,
-0.04570181667804718,
-0.07204978168010712,
0.06596028804779053,
0.06352231651544571,
0.03260979428887367,
0.03031088411808014,
0.04692063853144646,
0.035542506724596024,
-0.0017337491735816002,
-0.02188713103532791,
-0.01782921701669693,
-0.014651685021817684,
0.09932077676057816,
0.01897304505109787,
-0.04461769014596939,
-0.003984418231993914,
-0.017190946266055107,
0.05447159707546234,
-0.03282557800412178,
0.03286127746105194,
-0.03632127121090889,
-0.030683884397149086,
0.08447324484586716,
-0.027196619659662247,
0.03427208960056305,
-0.045032475143671036,
0.09322147816419601,
0.07203477621078491,
0.041795726865530014,
-0.05454426258802414,
-0.051043104380369186,
-0.026443053036928177,
-0.02065647393465042,
0.015415232628583908,
-0.053943831473588943,
0.017081275582313538,
0.022775661200284958,
0.037999700754880905,
0.09854482114315033,
-0.019374992698431015,
0.02256925217807293,
0.08983616530895233,
-0.029970219358801842,
-0.10020923614501953,
-0.06609214097261429,
0.054576169699430466,
0.11126196384429932,
0.017869733273983,
0.04026636481285095,
-0.017866000533103943,
-0.07878562808036804,
-0.08166395872831345,
0.005458514671772718,
0.016334708780050278,
0.04212651401758194,
-0.011486681178212166,
-0.06252332776784897,
0.056633662432432175,
-0.053587689995765686,
-0.03282111510634422,
0.03206011280417442,
0.025692559778690338,
-0.021780023351311684,
-0.02311396412551403,
0.049533549696207047,
0.06615380197763443,
-0.012535969726741314,
-0.03719419240951538,
-0.008732075802981853,
0.03396565839648247,
-0.018131565302610397,
0.06684305518865585,
0.008264448493719101,
0.08803693950176239,
0.054759640246629715,
0.015880323946475983,
-0.047678761184215546,
0.09065817296504974,
-0.06997893005609512,
0.01793694868683815,
3.6169123635076826e-33,
-0.030176149681210518,
0.02701793983578682,
-0.057494767010211945,
0.03728871792554855,
-0.01910783350467682,
0.011510437354445457,
-0.012102430686354637,
-0.01774531416594982,
-0.037628158926963806,
0.003872239962220192,
0.03735103830695152,
0.03133169561624527,
0.00563664548099041,
-0.10047163814306259,
0.09100845456123352,
0.0007892892463132739,
0.12057070434093475,
0.013689560815691948,
0.08569610118865967,
0.06118641048669815,
-0.04416605830192566,
0.0341789685189724,
-0.0587008073925972,
0.08924917131662369,
0.01805512234568596,
0.08153976500034332,
-0.07636141777038574,
0.030412930995225906,
-0.013244225643575191,
0.029975617304444313,
-0.02041667327284813,
0.008584472350776196,
-0.0641499012708664,
0.028897659853100777,
0.08966826647520065,
-0.009930131956934929,
-0.0279304850846529,
-0.021398354321718216,
-0.03649235889315605,
-0.04081721976399422,
-0.07788893580436707,
0.0362020879983902,
-0.15498808026313782,
0.03932938352227211,
0.012460287660360336,
-0.08935187011957169,
0.006383662112057209,
-0.037250787019729614,
0.06928630918264389,
-0.029778139665722847,
-0.004785026423633099,
0.060967955738306046,
0.08158467710018158,
-0.030527302995324135,
0.04896608740091324,
-0.023004041984677315,
0.009749934077262878,
-0.051565561443567276,
0.02328299731016159,
-0.022161856293678284,
0.0803615003824234,
-0.030375419184565544,
-0.06355135887861252,
0.015311764553189278,
-0.03121424838900566,
-0.07713043689727783,
-0.0009548152447678149,
0.004489080980420113,
-0.06920558959245682,
-0.051066335290670395,
0.0016340059228241444,
0.08500955998897552,
-0.019095314666628838,
0.03329971805214882,
-0.019022075459361076,
-0.06471706926822662,
0.005601550452411175,
-0.0005797874764539301,
0.05039926990866661,
-0.06219162046909332,
0.08504661172628403,
-0.09038222581148148,
-0.08163048326969147,
0.0301026850938797,
0.02784009464085102,
0.05637947842478752,
0.0030546439811587334,
-0.04475609213113785,
-0.08817947655916214,
0.059366948902606964,
0.0116268927231431,
-0.027888569980859756,
-0.008059526793658733,
-0.0005959377740509808,
-0.06634410470724106,
-6.735628915301771e-33,
-0.048700958490371704,
-0.002843155525624752,
-0.07671108841896057,
0.08964093774557114,
-0.07490306347608566,
-0.041541937738657,
0.04308339208364487,
-0.00896010547876358,
0.02551782689988613,
-0.08639014512300491,
-0.06665604561567307,
0.03207235410809517,
-0.05162222310900688,
0.07037661969661713,
0.04709601029753685,
0.050870053470134735,
-0.05920899659395218,
-0.07734902203083038,
0.005596700590103865,
-0.006284820381551981,
0.0879044234752655,
0.0042394534684717655,
-0.044084712862968445,
0.07754603028297424,
-0.10352203249931335,
0.03808120638132095,
-0.07863369584083557,
-0.0036750591825693846,
-0.05969689041376114,
-0.05985803157091141,
0.002770427381619811,
-0.0018117192666977644,
0.026613060384988785,
0.10310414433479309,
0.08880557864904404,
-0.0918242409825325,
0.04201333969831467,
0.031548745930194855,
-0.031147712841629982,
-0.07240630686283112,
0.03866976872086525,
0.042704492807388306,
0.012074940837919712,
0.03755006194114685,
0.02146153710782528,
0.0414055697619915,
-0.010801106691360474,
0.06228836998343468,
0.04205945506691933,
0.01725850999355316,
-0.02642296813428402,
-0.06872671842575073,
0.02180887572467327,
0.00040724885184317827,
-0.025006836280226707,
-0.01699439249932766,
0.08677814155817032,
-0.02317730337381363,
-0.001260623219422996,
0.05193333700299263,
-0.04790835827589035,
-0.0513080395758152,
0.05401666462421417,
0.06459006667137146,
-0.040508612990379333,
0.07142558693885803,
-0.018056189641356468,
0.025889087468385696,
0.08335977792739868,
0.016207784414291382,
0.03140708804130554,
-0.0027107198256999254,
-0.11333432048559189,
-0.09803970158100128,
-0.04864092543721199,
0.0400981679558754,
0.028009410947561264,
-0.12891681492328644,
0.01189840491861105,
0.04218713566660881,
-0.030539831146597862,
0.00029166057356633246,
0.06402938067913055,
-0.03136567398905754,
0.004486894700676203,
0.005736858583986759,
-0.0016637459630146623,
0.03962695598602295,
-0.027958720922470093,
-0.04076161980628967,
-0.02224062755703926,
0.08367306739091873,
-0.04064618796110153,
-0.10422790050506592,
-0.041905585676431656,
-5.8639294309159595e-8,
-0.07902923971414566,
0.03510349988937378,
-0.06449510157108307,
-0.0772404745221138,
-0.00581875117495656,
-0.06757006794214249,
0.019415147602558136,
-0.002933040028437972,
0.01731189526617527,
-0.0023762471973896027,
0.0018252485897392035,
-0.005084528587758541,
-0.004412911832332611,
0.011989078484475613,
-0.008022142574191093,
0.005822372157126665,
0.020919961854815483,
0.060208071023225784,
-0.0207691453397274,
0.02276652306318283,
-0.007169385906308889,
-0.019321074709296227,
0.016502898186445236,
-0.08042971044778824,
-0.015103279612958431,
-0.045356545597314835,
0.0593847930431366,
0.07169711589813232,
-0.0014680451713502407,
-0.05761803686618805,
-0.004142003133893013,
0.010651669465005398,
0.03526196628808975,
0.04356599971652031,
-0.0901428833603859,
0.023014143109321594,
0.016917452216148376,
-0.06475226581096649,
0.054455503821372986,
-0.00826546922326088,
0.069727823138237,
0.04346891865134239,
-0.03368525579571724,
0.03490075469017029,
0.010503717698156834,
0.04399804398417473,
0.046050071716308594,
-0.010409260168671608,
0.016989290714263916,
-0.06961382925510406,
-0.08982457965612411,
0.03209099546074867,
-0.08726351708173752,
0.09446205943822861,
0.00003672707680379972,
-0.052792008966207504,
-0.02736746147274971,
-0.07432859390974045,
0.01758361980319023,
0.014998562633991241,
0.05796331912279129,
0.03901863470673561,
0.01502054464071989,
0.0037444857880473137
] | 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're in dangerous territory! // By definition, something unexpected occurred, // which we probably didn't want. // Anything can happen now! Be very careful! try { // Make sure we close down within 30 seconds const killtimer = setTimeout(() => { process.exit(1); }, 30000); // But don't keep the process open just for that! killtimer.unref(); // Stop taking new requests. server.close(); // Let the primary know we're dead. This will trigger a // 'disconnect' in the cluster primary, and then it will fork // a new worker. cluster.worker.disconnect(); // Try to send an error to the request that triggered the problem res.statusCode = 500; res.setHeader('content-type', 'text/plain'); res.end('Oops, there was a problem!\n'); } catch (er2) { // Oh well, not much we can do at this point. console.error(`Error sending 500! ${er2.stack}`); } }); // Because req and res were created before this domain existed, // we need to explicitly add them. // See the explanation of implicit vs explicit binding below. d.add(req); d.add(res); // Now run the handler function in the domain. d.run(() => { handleRequest(req, res); }); }); server.listen(PORT); } // This part is not important. Just an example routing thing. // Put fancy application logic here. function handleRequest(req, res) { switch (req.url) { case '/error': // We do some async stuff, and then... setTimeout(() => { // Whoops! flerb.bark(); }, timeout); break; default: res.end('ok'); } } ``` ## Additions to `Error` objects Any time an `Error` object is routed through a domain, a few extra fields are added to it. \* `error.domain` The domain that first handled the error. \* `error.domainEmitter` The event emitter that emitted an `'error'` event with the error object. \* `error.domainBound` The callback function which was bound to the domain, and passed an error as its first argument. \* `error.domainThrown` A boolean indicating whether the error was thrown, emitted, or passed to a bound callback function. ## Implicit binding If domains are in use, then all \*\*new\*\* `EventEmitter` objects (including Stream objects, requests, responses, etc.) will be implicitly bound to the active domain at the time of their creation. Additionally, callbacks passed to low-level event loop requests (such as to `fs.open()`, or other callback-taking methods) will automatically be bound to the active domain. If they throw, then the domain will catch the error. In order to prevent excessive memory usage, `Domain` objects themselves are not implicitly added as children of the active domain. If they were, then it would be too easy to prevent request and response objects from being properly garbage collected. To nest `Domain` objects as children of a parent `Domain` they must be explicitly added. Implicit binding routes thrown errors and `'error'` events to the `Domain`'s `'error'` event, but does not register the `EventEmitter` on the `Domain`. Implicit binding only takes care of thrown errors and `'error'` events. ## Explicit binding Sometimes, the domain in use is not the one that ought to be used for a specific event emitter. Or, the event emitter could have been created in the context of one domain, but ought to instead be bound 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 = | 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.03612494096159935,
0.0015736623900011182,
-0.011816753074526787,
0.023902002722024918,
-0.00886918418109417,
0.026354670524597168,
-0.04580669477581978,
0.015298928134143353,
-0.03638017550110817,
0.024966662749648094,
0.012089977040886879,
-0.09226342290639877,
-0.02049807272851467,
0.006846416275948286,
-0.05035007745027542,
0.036141179502010345,
0.025126280263066292,
0.05041532590985298,
-0.07513764500617981,
-0.0757412239909172,
-0.020730894058942795,
0.006119778845459223,
0.19502320885658264,
-0.039080362766981125,
-0.045340895652770996,
-0.05830788612365723,
-0.025159241631627083,
0.08434060215950012,
0.03187447041273117,
-0.023747609928250313,
-0.05458514392375946,
-0.01485279481858015,
0.00586751289665699,
-0.12000202387571335,
0.0263670701533556,
0.01867990382015705,
-0.0198710635304451,
0.013587822206318378,
-0.008077281527221203,
0.0286379624158144,
0.03798351809382439,
-0.017543761059641838,
0.04626280441880226,
0.048530299216508865,
-0.02686842530965805,
0.031899429857730865,
0.048074524849653244,
0.01596185378730297,
-0.07318220287561417,
0.0670924186706543,
-0.03131222724914551,
0.05740630254149437,
0.004157980438321829,
0.03753533214330673,
-0.0036040821578353643,
0.01997707039117813,
0.03254540637135506,
0.011225896887481213,
0.041284721344709396,
-0.1096661314368248,
0.01113090943545103,
-0.06561654806137085,
0.0010780805023387074,
-0.030962927266955376,
-0.06643623858690262,
-0.02775290608406067,
0.061194103211164474,
0.017699457705020905,
-0.00596731249243021,
0.022181449458003044,
0.0423535592854023,
-0.0847906768321991,
0.10666853934526443,
0.022037196904420853,
-0.01843910850584507,
0.09238443523645401,
-0.076633021235466,
-0.08245819061994553,
0.07323283702135086,
-0.015410790219902992,
0.011789985001087189,
0.03831062093377113,
0.04362611472606659,
-0.007887938991189003,
0.03215239569544792,
-0.022042257711291313,
-0.009987636469304562,
0.021936524659395218,
-0.04324794188141823,
0.05244230106472969,
-0.03428124636411667,
-0.022776806727051735,
-0.0307279322296381,
-0.046416014432907104,
0.05093361437320709,
0.027329057455062866,
0.04110528528690338,
0.009760996326804161,
0.06484957784414291,
-0.011033196933567524,
0.035315170884132385,
-0.046513594686985016,
0.01722760684788227,
0.13943490386009216,
-0.08960552513599396,
0.01274412963539362,
0.05194220691919327,
0.10407715290784836,
-0.014816473238170147,
-0.05009737238287926,
-0.04351671040058136,
0.08977612107992172,
-0.06374453753232956,
0.03865189105272293,
-7.458309617875867e-34,
0.008118952624499798,
-0.0720430463552475,
0.009464778937399387,
0.017183922231197357,
0.10553149878978729,
-0.04006155952811241,
-0.015377365052700043,
0.014997271820902824,
-0.04778410494327545,
-0.02515001781284809,
-0.0027056289836764336,
-0.06237109750509262,
0.07512111216783524,
-0.0919172614812851,
0.004170940723270178,
-0.08245186507701874,
0.13974325358867645,
0.017217203974723816,
0.09548702090978622,
-0.0365346297621727,
0.005652590189129114,
-0.029380396008491516,
-0.02683599665760994,
0.09094060957431793,
-0.006568581331521273,
-0.031685106456279755,
-0.03297685831785202,
-0.005629504565149546,
0.0051465327851474285,
-0.04773367568850517,
0.02728843130171299,
0.030691951513290405,
-0.07818236202001572,
0.05415838584303856,
-0.013314325362443924,
0.029229067265987396,
0.01982184126973152,
0.02049686200916767,
-0.07492812722921371,
-0.07405709475278854,
-0.01841246709227562,
0.05090588703751564,
-0.039506249129772186,
0.04268743470311165,
0.008749809116125107,
-0.056799713522195816,
0.006141026969999075,
-0.09891624003648758,
0.06256672739982605,
0.025818245485424995,
0.024836190044879913,
-0.03195425495505333,
0.07168949395418167,
0.013191157020628452,
0.015282446518540382,
0.09698811173439026,
0.013049493543803692,
-0.05442655086517334,
-0.01774766482412815,
0.00515539338812232,
0.04991038888692856,
-0.06865155696868896,
-0.06702449172735214,
0.00943790003657341,
0.0006177332834340632,
-0.06295988708734512,
-0.012010309845209122,
0.033409129828214645,
0.01177863497287035,
0.02828017622232437,
-0.016348689794540405,
0.06361503154039383,
0.02538769133388996,
0.01713266596198082,
-0.032467231154441833,
0.05143725126981735,
-0.016257960349321365,
-0.016024243086576462,
-0.06689934432506561,
-0.03240141645073891,
0.08958496898412704,
-0.06014508381485939,
-0.06532320380210876,
0.058362215757369995,
0.07230330258607864,
0.008849461562931538,
-0.024120869114995003,
0.03675610572099686,
0.01583172008395195,
0.044985197484493256,
-0.0250242967158556,
-0.020101742818951607,
0.04532447084784508,
0.016435086727142334,
-0.08176598697900772,
-5.501253409598322e-34,
-0.034724198281764984,
-0.028200706467032433,
-0.03704383969306946,
0.07142522931098938,
0.05915466696023941,
-0.013949143700301647,
-0.008530890569090843,
0.005606379359960556,
-0.07350272685289383,
0.012158255092799664,
-0.044533390551805496,
0.011516822502017021,
0.02937047928571701,
0.04580460488796234,
-0.06698750704526901,
0.010355816222727299,
0.06515171378850937,
-0.025391092523932457,
-0.005747583229094744,
0.028450587764382362,
-0.03904750943183899,
-0.019777409732341766,
-0.012672986835241318,
-0.0142254289239645,
-0.039829351007938385,
0.0806647315621376,
-0.06775013357400894,
-0.023682910948991776,
-0.1250646710395813,
-0.05467545986175537,
-0.04348742216825485,
-0.025074778124690056,
0.0567910261452198,
0.0789744108915329,
0.07973501086235046,
-0.03299730271100998,
-0.020989809185266495,
0.07297927141189575,
0.03215046226978302,
-0.10281173139810562,
0.09581272304058075,
-0.0028509513940662146,
-0.05389551445841789,
0.009477270767092705,
-0.0005779933999292552,
-0.03340577706694603,
0.00896548293530941,
-0.007464129012078047,
-0.11562701314687729,
0.027360856533050537,
-0.1094006821513176,
-0.04666648432612419,
0.030810879543423653,
0.06110569089651108,
-0.0238817036151886,
-0.030382711440324783,
0.04467013478279114,
0.016078758984804153,
0.07594939321279526,
0.023394210264086723,
0.07288842648267746,
-0.08407200872898102,
-0.00936427153646946,
0.11603756248950958,
0.019199030473828316,
-0.06160213425755501,
-0.040887363255023956,
0.020004766061902046,
0.0029859396163374186,
0.06888318806886673,
-0.06461155414581299,
0.1815117746591568,
-0.020835211500525475,
0.056770212948322296,
-0.015720637515187263,
-0.06547722965478897,
0.010216517373919487,
-0.11402914673089981,
-0.008407057262957096,
0.07833154499530792,
-0.029209304600954056,
0.05873863771557808,
-0.07674834877252579,
0.016469404101371765,
0.06915778666734695,
0.04599756374955177,
0.046008236706256866,
0.021628567948937416,
0.01136311050504446,
0.011376394890248775,
-0.046122804284095764,
-0.004433483351022005,
-0.04033295065164566,
0.00641693826764822,
-0.03954233601689339,
-5.031387573239954e-8,
0.0352063812315464,
0.04557717591524124,
-0.02003605291247368,
-0.03139573708176613,
0.014125285670161247,
-0.04812213405966759,
0.04083000868558884,
-0.0016414399724453688,
-0.026365021243691444,
0.08867359906435013,
0.0017589688068255782,
0.00053646374726668,
0.014864226803183556,
0.023809321224689484,
0.0198198352009058,
-0.013059495016932487,
0.08140909671783447,
0.03850853443145752,
-0.018115537241101265,
-0.056234829127788544,
-0.03817358985543251,
-0.0231721680611372,
0.019618576392531395,
0.0538380891084671,
-0.026377910748124123,
-0.007132961414754391,
0.12444230914115906,
0.0015047072665765882,
-0.05924615263938904,
-0.07174753397703171,
-0.14338646829128265,
0.025348104536533356,
0.004764661658555269,
0.057189665734767914,
-0.05100197345018387,
0.05621565133333206,
-0.09891446679830551,
0.018280765041708946,
0.023192014545202255,
0.03899276256561279,
0.025759855285286903,
0.10663402080535889,
-0.03193122521042824,
0.004892515949904919,
0.04234865680336952,
0.019732501357793808,
-0.0014266648795455694,
0.05896763131022453,
0.051742639392614365,
-0.015487397089600563,
-0.0010802984470501542,
-0.05045998468995094,
-0.0648837685585022,
0.04938337206840515,
0.0015072152018547058,
-0.05602232366800308,
-0.01997324265539646,
-0.06447681784629822,
-0.004362691193819046,
0.008499909192323685,
0.070815309882164,
0.027928436174988747,
-0.0442403219640255,
-0.022723224014043808
] | 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:http'); const serverDomain = domain.create(); serverDomain.run(() => { // Server is created in the scope of serverDomain http.createServer((req, res) => { // Req and res are also created in the scope of serverDomain // however, we'd prefer to have a separate domain for each request. // create it first thing, and add req and res to it. const reqd = domain.create(); reqd.add(req); reqd.add(res); reqd.on('error', (er) => { console.error('Error', er, req.url); try { res.writeHead(500); res.end('Error occurred, sorry.'); } catch (er2) { console.error('Error sending 500', er2, req.url); } }); }).listen(1337); }); ``` ## `domain.create()` \* Returns: {Domain} ## Class: `Domain` \* Extends: {EventEmitter} The `Domain` class encapsulates the functionality of routing errors and uncaught exceptions to the active `Domain` object. To handle the errors that it catches, listen to its `'error'` event. ### `domain.members` \* Type: {Array} An array of event emitters that have been explicitly added to the domain. ### `domain.add(emitter)` \* `emitter` {EventEmitter} emitter to be added to the domain Explicitly adds an emitter to the domain. If any event handlers called by the emitter throw an error, or if the emitter emits an `'error'` event, it will be routed to the domain's `'error'` event, just like with implicit binding. If the `EventEmitter` was already bound to a domain, it is removed from that one, and bound to this one instead. ### `domain.bind(callback)` \* `callback` {Function} The callback function \* Returns: {Function} The bound function The returned function will be a wrapper around the supplied callback function. When the returned function is called, any errors that are thrown will be routed to the domain's `'error'` event. ```js const d = domain.create(); function readSomeFile(filename, cb) { fs.readFile(filename, 'utf8', d.bind((er, data) => { // If this throws, it will also be passed to the domain. return cb(er, data ? JSON.parse(data) : null); })); } d.on('error', (er) => { // An error occurred somewhere. If we throw it now, it will crash the program // with the normal line number and stack message. }); ``` ### `domain.enter()` The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly pushes the domain onto the domain stack managed by the domain module (see [`domain.exit()`][] for details on the domain stack). The call to `enter()` delimits the beginning of a chain of asynchronous calls and I/O operations bound to a domain. Calling `enter()` 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. ### `domain.exit()` The `exit()` method exits the current domain, popping it off the domain stack. Any time execution is going to switch to the context of a different chain of asynchronous calls, it's important to ensure that the current domain is exited. The call to `exit()` delimits either the end of or an interruption to the chain of asynchronous calls and I/O operations bound to 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 | 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.023972058668732643,
0.10007959604263306,
-0.007282945327460766,
-0.025777693837881088,
0.06197188422083855,
0.04251275584101677,
-0.015848694369196892,
0.15497630834579468,
-0.0013832005206495523,
0.05355076491832733,
-0.04422987625002861,
-0.03733314201235771,
-0.05460060387849808,
-0.004394238814711571,
0.021199744194746017,
0.07645715028047562,
0.03631508722901344,
0.08910693228244781,
-0.018464837223291397,
-0.14492399990558624,
0.01295675802975893,
-0.09659261256456375,
0.09100976586341858,
-0.02442401461303234,
-0.05509575456380844,
-0.0576922707259655,
0.012537146918475628,
0.03265001252293587,
0.10744062811136246,
0.054883696138858795,
-0.047979217022657394,
0.01622048020362854,
0.014964685775339603,
-0.06181170418858528,
0.08021992444992065,
0.003655410837382078,
0.010615237057209015,
0.0642995536327362,
-0.059949085116386414,
-0.07340991497039795,
0.03098011203110218,
-0.027203887701034546,
0.04475469887256622,
-0.05561596155166626,
0.010108917951583862,
0.03765878826379776,
0.03635658696293831,
-0.025900259613990784,
-0.06808987259864807,
0.09340309351682663,
-0.045307375490665436,
0.085041843354702,
-0.050376806408166885,
-0.037671055644750595,
0.04189841076731682,
-0.041193414479494095,
0.06861191987991333,
-0.004108555149286985,
0.020767558366060257,
-0.08473202586174011,
-0.022163189947605133,
-0.013485891744494438,
-0.01286152470856905,
-0.045344021171331406,
0.02186429873108864,
-0.03548698127269745,
0.027091480791568756,
0.06177058815956116,
0.013578975573182106,
0.0299014151096344,
0.03328392654657364,
-0.05929652228951454,
0.005684905685484409,
-0.034543927758932114,
-0.03003089129924774,
0.04156678915023804,
-0.034299589693546295,
-0.06390969455242157,
-0.04643509164452553,
0.0022405055351555347,
0.023402685299515724,
-0.0022275347728282213,
0.049597278237342834,
0.014032071456313133,
0.038435470312833786,
-0.014299893751740456,
-0.06254102289676666,
-0.0030661351047456264,
-0.040991924703121185,
0.04368598759174347,
-0.008278309367597103,
0.0017961292760446668,
-0.04921378940343857,
-0.004013546276837587,
0.06132056191563606,
0.008581605739891529,
0.005547048524022102,
-0.014907359145581722,
0.07553636282682419,
0.08083952218294144,
-0.026722023263573647,
-0.013867249712347984,
-0.019526485353708267,
0.05950694531202316,
-0.06765858083963394,
0.06152595207095146,
0.004074965603649616,
-0.048697635531425476,
-0.054124921560287476,
-0.04505832865834236,
-0.03373219445347786,
0.11325187236070633,
-0.08415086567401886,
0.004920292645692825,
3.87238806090166e-33,
0.035345904529094696,
0.021578332409262657,
-0.011825424619019032,
0.05065478757023811,
0.03806392848491669,
0.0642145648598671,
0.025532545521855354,
0.0002621129679027945,
-0.11230902373790741,
0.026638245210051537,
0.04912213608622551,
0.024350805208086967,
0.03424127772450447,
-0.07555290311574936,
0.03367418795824051,
0.006869626697152853,
0.09156860411167145,
0.015646494925022125,
0.1305011659860611,
0.03057125397026539,
-0.1149953082203865,
0.05535751208662987,
0.01711631380021572,
0.09469440579414368,
-0.003300788812339306,
-0.05110164359211922,
-0.007537274621427059,
-0.016147760674357414,
-0.09075824916362762,
-0.05806323513388634,
0.07315635681152344,
0.021108364686369896,
-0.05866719409823418,
0.07262304425239563,
0.0707908570766449,
0.026174701750278473,
0.10104212164878845,
0.0857388898730278,
-0.12821240723133087,
-0.03972011059522629,
0.054729901254177094,
0.03223850578069687,
-0.09209080040454865,
0.0734168216586113,
-0.054082099348306656,
-0.06307722628116608,
-0.04523010924458504,
-0.07593180239200592,
0.06893733888864517,
0.003908409737050533,
-0.034719690680503845,
-0.005108915269374847,
0.09378812462091446,
-0.05318552255630493,
0.03371255844831467,
0.024144703522324562,
-0.06532858312129974,
-0.018151815980672836,
-0.02485109679400921,
-0.017686713486909866,
-0.025605401024222374,
-0.04274788126349449,
-0.05911100283265114,
0.03527066111564636,
-0.006625760346651077,
-0.008586638607084751,
-0.024071278050541878,
-0.016185279935598373,
0.024869034066796303,
-0.00636447174474597,
0.06671999394893646,
0.033854637295007706,
-0.03187189996242523,
0.018043577671051025,
-0.01676522195339203,
0.06373530626296997,
-0.043029215186834335,
0.05027955025434494,
0.02412104234099388,
-0.06907721608877182,
-0.0005162391462363303,
0.02146833762526512,
-0.08264515548944473,
0.13401401042938232,
0.05054516717791557,
-0.006110172253102064,
0.003969909157603979,
0.0012595703592523932,
0.05625561252236366,
-0.025763986632227898,
-0.048588480800390244,
-0.0167402196675539,
0.048263851553201675,
-0.05116896703839302,
0.010997016914188862,
-3.905461329146014e-33,
0.0015789145836606622,
0.016911903396248817,
-0.07493413984775543,
0.06645450741052628,
-0.005954825785011053,
0.0237082839012146,
0.062135741114616394,
-0.05246978625655174,
-0.042199231684207916,
-0.007410831283777952,
-0.007544611115008593,
-0.03971749171614647,
0.0009159502224065363,
0.03439294546842575,
-0.041484568268060684,
0.024753335863351822,
-0.07119067758321762,
-0.049121368676424026,
-0.02727566845715046,
-0.037811245769262314,
-0.05191081762313843,
-0.025726579129695892,
0.0014914121711626649,
0.030103063210844994,
-0.041339509189128876,
0.08965875208377838,
-0.12344612181186676,
-0.02532372809946537,
-0.1431247740983963,
-0.057175349444150925,
-0.0651751458644867,
-0.03482011705636978,
0.07014808803796768,
-0.00462555093690753,
-0.02309148944914341,
-0.08659642934799194,
0.044383130967617035,
0.0956040695309639,
0.0545162558555603,
-0.04684711620211601,
0.00660527590662241,
-0.058464761823415756,
-0.012648659758269787,
0.06362466514110565,
0.019911523908376694,
-0.008323686197400093,
-0.009506125934422016,
0.07690293341875076,
-0.0203394778072834,
0.0001283598830923438,
-0.08248123526573181,
-0.05829132720828056,
-0.04085933044552803,
-0.05157618969678879,
-0.0075658224523067474,
-0.033038679510354996,
0.005918886512517929,
0.039818208664655685,
0.11944592744112015,
0.026136599481105804,
0.0687331035733223,
-0.029482485726475716,
-0.022843798622488976,
0.06409585475921631,
0.005460731685161591,
-0.007230816874653101,
-0.027682257816195488,
-0.04556424170732498,
0.03743313252925873,
0.014453720301389694,
-0.0960768386721611,
0.02568759024143219,
0.021334651857614517,
-0.01292549166828394,
0.06577408313751221,
-0.02363751269876957,
0.0652826800942421,
-0.10223288834095001,
-0.004124131985008717,
0.08766146749258041,
-0.058396920561790466,
0.0022506299428641796,
-0.045997899025678635,
0.009751841425895691,
0.047333117574453354,
0.021294105798006058,
-0.006841372232884169,
-0.00881462823599577,
-0.03953101485967636,
-0.06041710078716278,
0.01763090118765831,
0.07031054049730301,
-0.03337383642792702,
-0.06386049836874008,
-0.022169990465044975,
-5.3861946014421846e-8,
0.011398791335523129,
0.0865219235420227,
-0.04590163752436638,
-0.04195697605609894,
-0.06685461103916168,
-0.033447686582803726,
0.04503770172595978,
0.028895726427435875,
0.05881299450993538,
0.07885405421257019,
-0.06510749459266663,
0.010680492036044598,
-0.001859371899627149,
0.0346686989068985,
-0.003691904479637742,
-0.034673504531383514,
0.09071481227874756,
0.06117616966366768,
-0.02344171144068241,
-0.019359277561306953,
-0.01885346695780754,
0.02248646318912506,
0.05860782042145729,
0.003690466983243823,
0.006007597781717777,
-0.05285310745239258,
0.028583483770489693,
-0.07067938894033432,
-0.005012654233723879,
0.014619361609220505,
-0.06602230668067932,
0.049338459968566895,
0.012124537490308285,
0.03499901294708252,
-0.00298791890963912,
-0.037739723920822144,
-0.07003068178892136,
0.05392429605126381,
0.04150315746665001,
0.005500264465808868,
0.057965707033872604,
0.05360623821616173,
0.0004602230037562549,
0.036819662898778915,
-0.004476602654904127,
0.007936346344649792,
0.0732894241809845,
0.050723880529403687,
0.06566067039966583,
0.011148806661367416,
-0.055070020258426666,
-0.01975417509675026,
0.02196180820465088,
-0.045364029705524445,
-0.0036987755447626114,
0.031908318400382996,
-0.0352107435464859,
-0.03897226229310036,
-0.0019563103560358286,
-0.030076107010245323,
0.053644679486751556,
0.009377109818160534,
-0.010694889351725578,
-0.01115233451128006
] | -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. ### `domain.intercept(callback)` \* `callback` {Function} The callback function \* Returns: {Function} The intercepted function This method is almost identical to [`domain.bind(callback)`][]. However, in addition to catching thrown errors, it will also intercept [`Error`][] objects sent as the first argument to the function. In this way, the common `if (err) return callback(err);` pattern can be replaced with a single error handler in a single place. ```js const d = domain.create(); function readSomeFile(filename, cb) { fs.readFile(filename, 'utf8', d.intercept((data) => { // Note, the first argument is never passed to the // callback since it is assumed to be the 'Error' argument // and thus intercepted by the domain. // If this throws, it will also be passed to the domain // so the error-handling logic can be moved to the 'error' // event on the domain instead of being repeated throughout // the program. return cb(null, JSON.parse(data)); })); } d.on('error', (er) => { // An error occurred somewhere. If we throw it now, it will crash the program // with the normal line number and stack message. }); ``` ### `domain.remove(emitter)` \* `emitter` {EventEmitter} emitter to be removed from the domain The opposite of [`domain.add(emitter)`][]. Removes domain handling from the specified emitter. ### `domain.run(fn[, ...args])` \* `fn` {Function} \* `...args` {any} Run the supplied function in the context of the domain, implicitly binding all event emitters, timers, and low-level requests that are created in that context. Optionally, arguments can be passed to the function. This is the most basic way to use a domain. ```js const domain = require('node:domain'); const fs = require('node:fs'); const d = domain.create(); d.on('error', (er) => { console.error('Caught error!', er); }); d.run(() => { process.nextTick(() => { setTimeout(() => { // Simulating some various async stuff fs.open('non-existent file', 'r', (er, fd) => { if (er) throw er; // proceed... }); }, 100); }); }); ``` In this example, the `d.on('error')` handler will be triggered, rather than crashing the program. ## Domains and promises As of Node.js 8.0.0, the handlers of promises are run inside the domain in which the call to `.then()` or `.catch()` itself was made: ```js const d1 = domain.create(); const d2 = domain.create(); let p; d1.run(() => { p = Promise.resolve(42); }); d2.run(() => { p.then((v) => { // running in d2 }); }); ``` A callback may be bound to a specific domain using [`domain.bind(callback)`][]: ```js const d1 = domain.create(); const d2 = domain.create(); let p; d1.run(() => { p = Promise.resolve(42); }); d2.run(() => { p.then(p.domain.bind((v) => { // running in d1 })); }); ``` Domains will not interfere with the error handling mechanisms for promises. In other words, no `'error'` event will be emitted for unhandled `Promise` rejections. [`Error`]: errors.md#class-error [`domain.add(emitter)`]: #domainaddemitter [`domain.bind(callback)`]: #domainbindcallback [`domain.exit()`]: #domainexit [`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw | 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.055879026651382446,
0.010883134789764881,
-0.023027800023555756,
-0.06432085484266281,
0.0033313650637865067,
-0.051299355924129486,
-0.03682083263993263,
0.04101148992776871,
0.03369150683283806,
-0.008849956095218658,
-0.013185032643377781,
-0.13556453585624695,
-0.010562712326645851,
-0.05417816713452339,
-0.10895849019289017,
-0.0051801674999296665,
-0.03051021136343479,
-0.001404841779731214,
-0.017354028299450874,
-0.10418974608182907,
0.015202353708446026,
-0.08255106210708618,
0.10974062979221344,
-0.01497855968773365,
-0.029785072430968285,
-0.04641634225845337,
-0.017507454380393028,
-0.00801002886146307,
0.08080136030912399,
0.013447469100356102,
-0.020158635452389717,
0.007634531240910292,
-0.018356608226895332,
-0.07916548103094101,
-0.0013661094708368182,
0.0015967742074280977,
0.023462330922484398,
0.050822965800762177,
0.07549191266298294,
-0.03577415645122528,
0.0996163934469223,
0.03702422231435776,
0.015131506137549877,
0.005168579053133726,
-0.02510259300470352,
-0.004872540477663279,
0.0794624388217926,
-0.013482453301548958,
-0.033233076333999634,
-0.0338442362844944,
0.010304277762770653,
0.08177020400762558,
-0.04139789193868637,
-0.019678905606269836,
-0.004303803667426109,
-0.02807093970477581,
0.06502699106931686,
-0.04383440315723419,
-0.008646760135889053,
-0.072930708527565,
0.06366521865129471,
0.07699781656265259,
0.020472785457968712,
-0.02954736538231373,
0.023545656353235245,
-0.0392497256398201,
-0.06464604288339615,
0.0697271078824997,
-0.0539928562939167,
0.014187820255756378,
0.02454625628888607,
0.006282435264438391,
0.07840768247842789,
-0.032748784869909286,
-0.02677765116095543,
0.08955749124288559,
0.012779958546161652,
-0.0515531525015831,
-0.0711539164185524,
0.010476753115653992,
0.09119189530611038,
-0.030386706814169884,
0.013679932802915573,
0.016480090096592903,
-0.028719687834382057,
-0.007617644965648651,
-0.033445898443460464,
0.03058989718556404,
0.011960419826209545,
0.038832876831293106,
-0.05479378625750542,
0.07657734304666519,
-0.027745408937335014,
-0.008377817459404469,
-0.04342539235949516,
0.02883289009332657,
-0.03188049793243408,
-0.03778742253780365,
0.03324143961071968,
0.06712911278009415,
-0.020979808643460274,
0.010005556978285313,
-0.03114009089767933,
0.07199282199144363,
-0.011886090971529484,
0.024984557181596756,
0.02283075638115406,
0.07169026881456375,
0.03896499052643776,
0.05796634033322334,
-0.03591908514499664,
0.047879334539175034,
-0.09339844435453415,
0.010019790381193161,
-6.107414061166624e-34,
0.013694769702851772,
-0.030473802238702774,
-0.03249799832701683,
0.0685444176197052,
-0.004642905201762915,
0.008474327623844147,
-0.005365289282053709,
-0.03639506548643112,
-0.07936009019613266,
0.08561994135379791,
-0.034562718123197556,
-0.008793199434876442,
0.032820217311382294,
-0.024932952597737312,
0.12586137652397156,
0.11473604291677475,
0.04173072800040245,
-0.02379646897315979,
0.04688604921102524,
0.06705699861049652,
-0.0008406047127209604,
0.013886386528611183,
-0.018576286733150482,
0.0979754626750946,
0.066921666264534,
0.05369540676474571,
-0.06856989860534668,
0.028439275920391083,
-0.014050262048840523,
-0.01832685060799122,
-0.015598371624946594,
-0.0055170622654259205,
-0.01903795264661312,
0.041551172733306885,
0.06617120653390884,
0.005029549356549978,
0.07848426699638367,
-0.001617464586161077,
-0.10438042879104614,
-0.07816696166992188,
-0.049978382885456085,
-0.028404077515006065,
-0.12702155113220215,
0.09745267778635025,
0.01994119957089424,
-0.12435518950223923,
-0.053095120936632156,
-0.031535554677248,
0.06990926712751389,
0.048677194863557816,
0.012206299230456352,
0.04235192388296127,
0.13074837625026703,
-0.016405172646045685,
0.03104512393474579,
0.03468454256653786,
-0.03525219485163689,
-0.0533282496035099,
-0.022888371720910072,
0.009750808589160442,
0.07012686878442764,
-0.04725564643740654,
-0.1139797493815422,
0.054344963282346725,
-0.05595168098807335,
-0.011526014655828476,
-0.02300455793738365,
-0.019353704527020454,
-0.04416242614388466,
-0.019636984914541245,
-0.04691081866621971,
0.022230060771107674,
-0.04056587442755699,
0.03724989295005798,
-0.000467909179860726,
0.0007919429335743189,
-0.06394544243812561,
-0.02510901354253292,
0.09601783007383347,
-0.07476874440908432,
0.07728397101163864,
-0.028880473226308823,
-0.10254822671413422,
0.08716709166765213,
-0.02892136760056019,
0.05750221759080887,
-0.032305289059877396,
-0.08294890075922012,
-0.004138946998864412,
0.032392717897892,
-0.06749609857797623,
-0.016381673514842987,
0.016865018755197525,
-0.015412621200084686,
-0.02898244746029377,
-3.711128970410058e-33,
0.01546488143503666,
0.0004631653428077698,
-0.07344383746385574,
0.06876946240663528,
-0.07102200388908386,
-0.010390282608568668,
0.0626663789153099,
0.024464501067996025,
0.017135709524154663,
-0.04889870807528496,
-0.052082862704992294,
0.027797220274806023,
0.03919191285967827,
0.03968239203095436,
0.018776418641209602,
0.02470015548169613,
-0.0696130022406578,
-0.08202198892831802,
-0.03795929625630379,
-0.06901465356349945,
0.048213351517915726,
-0.07074130326509476,
0.047319747507572174,
0.06163730099797249,
-0.0683819055557251,
0.06784870475530624,
-0.08919517695903778,
-0.007127168122678995,
-0.06653270870447159,
-0.0525868684053421,
-0.03278571367263794,
0.020459197461605072,
0.07174713164567947,
0.13590046763420105,
0.026387371122837067,
-0.04952497035264969,
0.01927124336361885,
0.0430721715092659,
0.015024478547275066,
-0.09316004067659378,
0.032923124730587006,
0.07348448783159256,
0.05563933774828911,
-0.017825733870267868,
0.015904488041996956,
0.025174591690301895,
-0.05741450563073158,
0.0966406762599945,
-0.000052036957640666515,
-0.04049237072467804,
-0.0549793615937233,
-0.01940957084298134,
0.012303978204727173,
0.05911281332373619,
-0.0316106416285038,
0.010343640111386776,
0.08058658987283707,
-0.04512680321931839,
0.05751384422183037,
0.07554121315479279,
-0.031746674329042435,
-0.04931401461362839,
0.004628938622772694,
0.07799271494150162,
-0.052372515201568604,
0.022519001737236977,
-0.006190537009388208,
-0.01736123114824295,
0.1012059897184372,
0.022926025092601776,
0.03522569313645363,
0.005729016847908497,
-0.049677345901727676,
-0.055774617940187454,
0.019150912761688232,
0.01897926814854145,
-0.04242273047566414,
-0.17821823060512543,
0.0023459075018763542,
0.10373654961585999,
0.04550642892718315,
-0.004988233558833599,
0.0684383362531662,
0.07802291214466095,
0.002705364255234599,
0.00910922046750784,
-0.01168073434382677,
-0.00787405762821436,
0.004357782192528248,
-0.03578777611255646,
-0.006148471962660551,
0.03338298946619034,
-0.03708729147911072,
-0.0803740918636322,
-0.009880004450678825,
-4.933084341018912e-8,
-0.03480668365955353,
0.010486191138625145,
-0.059250522404909134,
-0.05994459614157677,
-0.0750541090965271,
-0.057783275842666626,
-0.01726933754980564,
-0.061333123594522476,
0.00945421401411295,
-0.03716949000954628,
0.009687555022537708,
0.016947759315371513,
-0.023832617327570915,
0.017514728009700775,
-0.029200756922364235,
-0.03190624713897705,
0.10134204477071762,
0.03955407440662384,
-0.02133619412779808,
0.03842940926551819,
-0.008624069392681122,
-0.007949535734951496,
0.0011678501032292843,
-0.029414106160402298,
0.012996473349630833,
-0.029186969622969627,
0.05163191258907318,
0.0632401704788208,
-0.03650091215968132,
-0.03965548798441887,
-0.005816585849970579,
0.04170503839850426,
0.017470745369791985,
0.09001652896404266,
-0.11302229762077332,
0.040249891579151154,
0.02901928499341011,
-0.03462059795856476,
0.05109193176031113,
-0.0029247100464999676,
0.041864052414894104,
0.02373228594660759,
-0.04968569055199623,
-0.001641315990127623,
-0.0183393657207489,
0.007586787920445204,
0.056371547281742096,
0.033782944083213806,
0.039897460490465164,
-0.051053669303655624,
-0.059704046696424484,
0.0009524659835733473,
-0.051410652697086334,
0.04355468600988388,
0.015235528349876404,
-0.06764949858188629,
-0.07493551075458527,
-0.051012665033340454,
-0.013906490057706833,
-0.0025718489196151495,
-0.004698708187788725,
0.030640212818980217,
0.04150616377592087,
-0.021114105358719826
] | 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 resolution. It may not need to perform any network communication. To perform name resolution the way other applications on the same system do, use [`dns.lookup()`][]. ```mjs import dns from 'node:dns'; dns.lookup('example.org', (err, address, family) => { console.log('address: %j family: IPv%s', address, family); }); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 ``` ```cjs const dns = require('node:dns'); dns.lookup('example.org', (err, address, family) => { console.log('address: %j family: IPv%s', address, family); }); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 ``` All other functions in the `node:dns` module connect to an actual DNS server to perform name resolution. They will always use the network to perform DNS queries. These functions do not use the same set of configuration files used by [`dns.lookup()`][] (e.g. `/etc/hosts`). Use these functions to always perform DNS queries, bypassing other name-resolution facilities. ```mjs import dns from 'node:dns'; dns.resolve4('archive.org', (err, addresses) => { if (err) throw err; console.log(`addresses: ${JSON.stringify(addresses)}`); addresses.forEach((a) => { dns.reverse(a, (err, hostnames) => { if (err) { throw err; } console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); }); }); }); ``` ```cjs const dns = require('node:dns'); dns.resolve4('archive.org', (err, addresses) => { if (err) throw err; console.log(`addresses: ${JSON.stringify(addresses)}`); addresses.forEach((a) => { dns.reverse(a, (err, hostnames) => { if (err) { throw err; } console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); }); }); }); ``` See the [Implementation considerations section][] for more information. ## Class: `dns.Resolver` An independent resolver for DNS requests. Creating a new resolver uses the default server settings. Setting the servers used for a resolver using [`resolver.setServers()`][`dns.setServers()`] does not affect other resolvers: ```mjs import { Resolver } from 'node:dns'; const resolver = new Resolver(); resolver.setServers(['4.4.4.4']); // This request will use the server at 4.4.4.4, independent of global settings. resolver.resolve4('example.org', (err, addresses) => { // ... }); ``` ```cjs const { Resolver } = require('node:dns'); const resolver = new Resolver(); resolver.setServers(['4.4.4.4']); // This request will use the server at 4.4.4.4, independent of global settings. resolver.resolve4('example.org', (err, addresses) => { // ... }); ``` The following methods from the `node:dns` module are available: \* [`resolver.getServers()`][`dns.getServers()`] \* [`resolver.resolve()`][`dns.resolve()`] \* [`resolver.resolve4()`][`dns.resolve4()`] \* [`resolver.resolve6()`][`dns.resolve6()`] \* [`resolver.resolveAny()`][`dns.resolveAny()`] \* [`resolver.resolveCaa()`][`dns.resolveCaa()`] \* [`resolver.resolveCname()`][`dns.resolveCname()`] \* [`resolver.resolveMx()`][`dns.resolveMx()`] \* [`resolver.resolveNaptr()`][`dns.resolveNaptr()`] \* [`resolver.resolveNs()`][`dns.resolveNs()`] \* [`resolver.resolvePtr()`][`dns.resolvePtr()`] \* [`resolver.resolveSoa()`][`dns.resolveSoa()`] \* [`resolver.resolveSrv()`][`dns.resolveSrv()`] \* [`resolver.resolveTlsa()`][`dns.resolveTlsa()`] \* [`resolver.resolveTxt()`][`dns.resolveTxt()`] \* [`resolver.reverse()`][`dns.reverse()`] \* [`resolver.setServers()`][`dns.setServers()`] ### `Resolver([options])` Create a new resolver. \* `options` {Object} \* `timeout` {integer} Query timeout in milliseconds, or `-1` to use the default timeout. \* `tries` {integer} The number of tries the resolver will try contacting each name server before giving up. \*\*Default:\*\* `4` \* `maxTimeout` {integer} The max retry timeout, in milliseconds. \*\*Default:\*\* `0`, disabled. ### `resolver.cancel()` Cancel all outstanding DNS queries made by this resolver. The corresponding callbacks will be called with an error with code `ECANCELLED`. ### `resolver.setLocalAddress([ipv4][, ipv6])` \* `ipv4` {string} A string representation of an IPv4 address. \*\*Default:\*\* `'0.0.0.0'` \* `ipv6` {string} A string representation of an IPv6 address. \*\*Default:\*\* `'::0'` The resolver instance will send its requests from the specified IP address. This allows programs to specify outbound interfaces when used on multi-homed systems. If a v4 or v6 address is not specified, it is set 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 | 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.056238096207380295,
0.041314590722322464,
0.0003693173930514604,
-0.03031417541205883,
0.06044243276119232,
0.0425930954515934,
-0.09026403725147247,
0.034541722387075424,
0.040184635668992996,
0.05221547558903694,
-0.02174310013651848,
-0.10353121161460876,
-0.009013202972710133,
-0.06067097559571266,
0.045094363391399384,
0.028011441230773926,
0.005033774301409721,
0.04696781188249588,
0.04180658981204033,
-0.03465984761714935,
0.042481109499931335,
-0.01575508713722229,
0.11101049929857254,
-0.03863918036222458,
0.015355431474745274,
-0.09532976150512695,
-0.05406351387500763,
0.06839976459741592,
0.08759210258722305,
0.11739907413721085,
-0.1001083105802536,
0.06619107723236084,
0.04391534626483917,
-0.03310246765613556,
0.12320783734321594,
0.0024886038154363632,
-0.02754138968884945,
-0.008748635649681091,
-0.08506191521883011,
0.011647285893559456,
-0.0210172887891531,
0.05458869785070419,
0.06357866525650024,
-0.06422345340251923,
-0.019166553393006325,
0.012820483185350895,
0.017855066806077957,
-0.019681937992572784,
-0.0027460043784230947,
0.06678079068660736,
-0.044037215411663055,
0.00913315825164318,
-0.00972516369074583,
-0.00412476621568203,
0.05018959566950798,
0.004046210553497076,
0.061534155160188675,
0.03411725535988808,
0.06721820682287216,
-0.03546125814318657,
-0.012363208457827568,
-0.09695139527320862,
-0.04369020462036133,
-0.044388625770807266,
-0.005272573791444302,
-0.025268204510211945,
0.04634920507669449,
0.03305236995220184,
-0.03460320830345154,
-0.030904218554496765,
0.06345875561237335,
-0.08329915255308151,
-0.0047528669238090515,
0.013412782922387123,
-0.0772826299071312,
0.017969414591789246,
0.004818856716156006,
-0.06018634885549545,
-0.11940524727106094,
-0.013680055737495422,
-0.0393650121986866,
-0.001510725123807788,
0.061253100633621216,
0.08136819303035736,
0.05972326919436455,
-0.0605471096932888,
0.014313459396362305,
0.02847890742123127,
-0.017516111955046654,
0.02917633205652237,
-0.02946559339761734,
0.03723195195198059,
0.031052937731146812,
0.03436191380023956,
0.022446077316999435,
0.06715142726898193,
0.040149517357349396,
-0.0030627481173723936,
0.015634603798389435,
-0.004223443567752838,
0.016162922605872154,
-0.008568224497139454,
-0.11143835633993149,
0.09085554629564285,
-0.008754758164286613,
0.047333065420389175,
0.019345499575138092,
0.03950883820652962,
-0.0038282889872789383,
-0.041053734719753265,
-0.11645306646823883,
0.010646549984812737,
-0.0007523508393205702,
0.05759340524673462,
4.204211381697575e-33,
-0.0006018246640451252,
0.008973147720098495,
0.006987778469920158,
0.029724380001425743,
-0.012819789350032806,
-0.015370338223874569,
0.027968738228082657,
0.014682820066809654,
-0.11011672019958496,
0.02796313166618347,
-0.04416142404079437,
0.013663260266184807,
0.07986481487751007,
-0.09980197995901108,
-0.028317250311374664,
0.03526926040649414,
0.08314114063978195,
0.013552679680287838,
0.09686622023582458,
0.08758240193128586,
0.011715780012309551,
-0.00008206250640796497,
0.051482755690813065,
0.06565484404563904,
0.02344883605837822,
-0.04505603387951851,
-0.021052943542599678,
-0.02105194330215454,
-0.03768383339047432,
-0.06905809789896011,
0.06612313538789749,
0.03700214624404907,
-0.026117805391550064,
-0.003617852693423629,
0.06785780936479568,
-0.020313406363129616,
0.09327264875173569,
0.012669517658650875,
-0.13296030461788177,
-0.09175359457731247,
0.007069761399179697,
0.03509121015667915,
-0.10720712691545486,
0.06686392426490784,
-0.014719250611960888,
-0.005542533937841654,
-0.060825858265161514,
-0.10686527192592621,
0.04185215011239052,
0.02019529975950718,
0.007879331707954407,
-0.020734762772917747,
-0.023661311715841293,
-0.049691397696733475,
0.030318278819322586,
0.06690037995576859,
0.03507941961288452,
0.04074239730834961,
-0.062070805579423904,
0.018625935539603233,
-0.03493063524365425,
-0.0894128754734993,
-0.046697113662958145,
0.03853928670287132,
0.03427794948220253,
0.03906025364995003,
-0.02313961274921894,
0.054852381348609924,
-0.014070790261030197,
0.02821394056081772,
0.03833124414086342,
0.03248501941561699,
0.01070846151560545,
0.06120564416050911,
0.01916375569999218,
0.0032000509090721607,
-0.08201662451028824,
-0.06342752277851105,
-0.01803291030228138,
-0.0013217247324064374,
0.06535237282514572,
0.009137976914644241,
-0.05091166868805885,
0.044466014951467514,
-0.012105452828109264,
0.018520537763834,
-0.019351167604327202,
0.0003350699844304472,
0.03769383952021599,
-0.0068211923353374004,
0.0009009605273604393,
0.05930535867810249,
0.025498459115624428,
0.009567812085151672,
-0.0739235058426857,
-5.421260927189369e-33,
0.006101502105593681,
0.0006582261412404478,
-0.03320447355508804,
0.03133020177483559,
-0.059364862740039825,
-0.07050324976444244,
0.04424251988530159,
0.018213637173175812,
0.01022108644247055,
-0.06644261628389359,
-0.012691155076026917,
-0.02705807238817215,
0.03814394026994705,
-0.04103142023086548,
0.06080453470349312,
0.09550169110298157,
-0.01042870432138443,
-0.053653422743082047,
-0.01616307720541954,
-0.036210596561431885,
-0.0882648378610611,
0.02063828334212303,
-0.06361512094736099,
-0.036501895636320114,
-0.04050031304359436,
0.015795961022377014,
-0.06314195692539215,
-0.027337735518813133,
-0.025445619598031044,
-0.08922404795885086,
0.008341643959283829,
0.029354937374591827,
-0.021718444302678108,
0.07392521947622299,
0.018934952095150948,
0.03609389439225197,
-0.02712424471974373,
0.05739464983344078,
0.08456087112426758,
-0.08263767510652542,
0.06057078763842583,
0.050662823021411896,
-0.0980982854962349,
0.03771284595131874,
0.007033683359622955,
0.004450374282896519,
-0.05190266668796539,
0.11412300169467926,
0.021907927468419075,
0.01714898645877838,
-0.004527255427092314,
-0.13866731524467468,
-0.032733894884586334,
-0.0009489529184065759,
0.05229165032505989,
0.02346625179052353,
0.021479511633515358,
0.0321158729493618,
0.019637903198599815,
0.0607140026986599,
0.03412275388836861,
-0.17157740890979767,
-0.09634175896644592,
0.139867901802063,
-0.014225015416741371,
0.061497293412685394,
-0.12377828359603882,
-0.00698388647288084,
0.11329058557748795,
-0.01943519525229931,
0.011997510679066181,
-0.03506747633218765,
-0.002520752139389515,
0.03720352053642273,
-0.0060855248011648655,
0.04940959811210632,
0.06373260915279388,
-0.008151505142450333,
-0.04693759232759476,
0.09848648309707642,
-0.05881394445896149,
0.095998115837574,
-0.05217074602842331,
0.028524363413453102,
-0.007224646862596273,
0.022046245634555817,
0.05579705908894539,
0.04953240975737572,
0.0011324107181280851,
0.031406283378601074,
0.04210757091641426,
0.024641282856464386,
-0.028881393373012543,
-0.07215767353773117,
-0.05297549441456795,
-4.774015494035666e-8,
-0.015072518028318882,
0.014645970426499844,
-0.05525225028395653,
-0.021963326260447502,
-0.02312665432691574,
0.03563487157225609,
0.05353855714201927,
-0.020011479035019875,
0.07481532543897629,
0.08134014159440994,
-0.043151985853910446,
-0.003542091464623809,
-0.09493576735258102,
0.0034272850025445223,
0.011443193070590496,
-0.032746702432632446,
0.03020198456943035,
0.04329206794500351,
-0.022387614473700523,
0.007187201175838709,
-0.05829322338104248,
-0.07000076025724411,
-0.028749598190188408,
0.027309641242027283,
-0.04142718389630318,
-0.08816490322351456,
0.030996259301900864,
-0.04013742133975029,
-0.0598842091858387,
0.020827502012252808,
-0.05103752017021179,
0.02987442910671234,
0.044295746833086014,
0.01851963810622692,
0.034877002239227295,
0.034083109349012375,
-0.008801720105111599,
0.019497236236929893,
0.09777581691741943,
0.030357271432876587,
-0.0037466047797352076,
0.028008604422211647,
-0.021386127918958664,
-0.01479427795857191,
0.008959392085671425,
0.014855096116662025,
0.026502473279833794,
0.025561310350894928,
0.048393864184617996,
-0.06092694029211998,
-0.0039216079749166965,
-0.019686924293637276,
-0.03723149001598358,
-0.06283075362443924,
-0.024615488946437836,
0.007962946780025959,
-0.051476337015628815,
-0.040534622967243195,
-0.02955438569188118,
-0.03675387427210808,
0.025401026010513306,
0.013845112174749374,
0.025038504973053932,
-0.010688668116927147
] | 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.getServers()` \* Returns: {string\[]} Returns an array of IP address strings, formatted according to [RFC 5952][], that are currently configured for DNS resolution. A string will include a port section if a custom port is used. ```js [ '8.8.8.8', '2001:4860:4860::8888', '8.8.8.8:1053', '[2001:4860:4860::8888]:1053', ] ``` ## `dns.lookup(hostname[, options], callback)` \* `hostname` {string} \* `options` {integer | Object} \* `family` {integer|string} The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. \*\*Default:\*\* `0`. \* `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple flags may be passed by bitwise `OR`ing their values. \* `all` {boolean} When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. \*\*Default:\*\* `false`. \* `order` {string} When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 addresses before IPv4 addresses. \*\*Default:\*\* `verbatim` (addresses are not reordered). Default value is configurable using [`dns.setDefaultResultOrder()`][] or [`--dns-result-order`][]. \* `verbatim` {boolean} When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. \*\*Default:\*\* `true` (addresses are not reordered). Default value is configurable using [`dns.setDefaultResultOrder()`][] or [`--dns-result-order`][]. \* `callback` {Function} \* `err` {Error} \* `address` {string} A string representation of an IPv4 or IPv6 address. \* `family` {integer} `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a bug in the name resolution service used by the operating system. Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or AAAA (IPv6) record. All `option` properties are optional. If `options` is an integer, then it must be `4` or `6` – if `options` is not provided, then either IPv4 or IPv6 addresses, or both, are returned if found. With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the properties `address` and `family`. On error, `err` is an [`Error`][] object, where `err.code` is the error code. Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when the host name does not exist but also when the lookup fails in other ways such as no available file descriptors. `dns.lookup()` does not necessarily have anything to do with the DNS protocol. The implementation uses an operating system facility that can associate names with addresses and 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.ADDRCONFIG | dns.V4MAPPED, }; dns.lookup('example.org', options, | 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.01447497121989727,
0.0003775582881644368,
-0.022097347304224968,
-0.037879738956689835,
-0.06238158047199249,
0.032924868166446686,
-0.006009824573993683,
0.018104825168848038,
0.057022836059331894,
0.045517999678850174,
-0.05266460031270981,
-0.021620076149702072,
-0.04843645170331001,
0.02531152032315731,
0.06615261733531952,
0.07474542409181595,
0.05459515377879143,
0.014134815894067287,
0.08564724028110504,
-0.037179991602897644,
0.042079973965883255,
-0.015210321173071861,
0.04224415495991707,
-0.007438311818987131,
0.07907102257013321,
-0.05017579719424248,
0.03765179216861725,
0.11069086939096451,
0.01533572655171156,
0.11801551282405853,
-0.06732096523046494,
0.025663884356617928,
0.037119291722774506,
-0.03638569265604019,
0.10644795745611191,
-0.04497061297297478,
-0.1118907481431961,
0.018209582194685936,
0.048410311341285706,
-0.04188745468854904,
-0.020947158336639404,
0.046401482075452805,
0.006062047090381384,
-0.0635327473282814,
-0.03809700533747673,
-0.00497576966881752,
0.10388116538524628,
-0.010270911268889904,
-0.025100652128458023,
0.032628703862428665,
-0.009135307744145393,
0.0002575820544734597,
-0.04617904871702194,
0.03951936215162277,
0.001038696733303368,
-0.01035378035157919,
-0.024105042219161987,
-0.0692172423005104,
0.09256628900766373,
-0.001278710551559925,
-0.0030319688376039267,
0.001523888553492725,
-0.04761970043182373,
-0.020863130688667297,
-0.07621771097183228,
0.03135611116886139,
0.007621288765221834,
-0.010217433795332909,
-0.03753332048654556,
-0.05562104284763336,
0.04791712760925293,
-0.06797809898853302,
-0.056241393089294434,
0.0033318332862108946,
-0.05828845128417015,
0.12369025498628616,
0.031032754108309746,
-0.04087986424565315,
-0.07436154037714005,
-0.03347848355770111,
-0.03280715271830559,
-0.03481461480259895,
0.0518382228910923,
0.08558862656354904,
-0.024596359580755234,
-0.016911540180444717,
-0.01864621229469776,
0.09222868084907532,
-0.05165524780750275,
-0.010770200751721859,
0.015182649716734886,
0.02905644290149212,
-0.03190512955188751,
-0.03856774419546127,
0.06649798154830933,
0.040645770728588104,
0.05607776343822479,
0.002220927970483899,
0.014019675552845001,
0.011011611670255661,
0.007932515814900398,
-0.055741067975759506,
-0.0035935454070568085,
0.05024335905909538,
-0.0211886428296566,
-0.0038851501885801554,
-0.06139376759529114,
-0.04284771531820297,
0.024792686104774475,
0.0023450397420674562,
-0.07820023596286774,
0.004904191941022873,
0.042769547551870346,
-0.012204967439174652,
6.004806812322277e-33,
0.030567187815904617,
-0.0056404792703688145,
0.04025527462363243,
-0.0517231710255146,
0.00510588102042675,
0.008390755392611027,
0.014323471114039421,
0.05321041867136955,
-0.0027323386166244745,
-0.012636327184736729,
-0.018835118040442467,
0.007651276420801878,
0.03543580323457718,
-0.03967593237757683,
0.004506086930632591,
0.12970221042633057,
0.028739873319864273,
0.03294263780117035,
-0.0036854688078165054,
0.1614314764738083,
0.01291724108159542,
0.0005902003031224012,
0.0513325072824955,
-0.013068566098809242,
-0.03971271961927414,
-0.01782502420246601,
-0.039456989616155624,
0.023699479177594185,
-0.11545667052268982,
-0.07393492013216019,
0.06603174656629562,
-0.06910175085067749,
-0.05190495401620865,
0.028935614973306656,
0.12707571685314178,
0.02624473161995411,
0.04649091139435768,
-0.013953951187431812,
-0.08599533140659332,
0.03784405440092087,
0.02340766414999962,
0.002554173581302166,
-0.1316896229982376,
0.018318161368370056,
0.0012964596971869469,
-0.04158017411828041,
-0.06858557462692261,
-0.07823286205530167,
0.008620024658739567,
0.08840315043926239,
0.0021311454474925995,
-0.028308214619755745,
-0.0065946197137236595,
0.019648849964141846,
0.04634055122733116,
0.020391805097460747,
0.011247225105762482,
0.02934999205172062,
0.010892651975154877,
-0.04032469913363457,
-0.012380054220557213,
-0.0956900492310524,
-0.0427720807492733,
0.000132514483993873,
0.043186675757169724,
-0.01484881155192852,
0.11948498338460922,
-0.015149680897593498,
-0.01772577501833439,
0.0031099277548491955,
0.056644171476364136,
0.052968502044677734,
0.04876799136400223,
0.05557249113917351,
-0.005120268557220697,
0.036337465047836304,
-0.09722064435482025,
0.002785088261589408,
0.025178268551826477,
-0.033547163009643555,
0.04037677124142647,
0.09054620563983917,
-0.08109104633331299,
0.09452129900455475,
-0.03314570337533951,
0.04488781839609146,
-0.005493487697094679,
-0.03777049481868744,
0.10645980387926102,
-0.06326840817928314,
-0.004157658200711012,
-0.031550534069538116,
-0.009679710492491722,
-0.04677161946892738,
-0.04601136967539787,
-7.630325583703446e-33,
0.029763394966721535,
-0.061959683895111084,
-0.03260324150323868,
-0.0015625758096575737,
-0.0772813931107521,
-0.061564262956380844,
0.08411096781492233,
0.06578226387500763,
0.039203595370054245,
-0.12145725637674332,
0.01224551722407341,
0.010437770746648312,
0.07435834407806396,
-0.018357228487730026,
0.04603411629796028,
0.09670127928256989,
-0.029166204854846,
0.005662749987095594,
-0.010629694908857346,
-0.004254811909049749,
-0.02654908038675785,
0.013784474693238735,
-0.028652820736169815,
0.0061197527684271336,
-0.06880483031272888,
-0.041160572320222855,
-0.01590186357498169,
-0.012020130641758442,
-0.08612363785505295,
-0.12071749567985535,
0.06273175030946732,
0.021057067438960075,
0.0011055073700845242,
0.01786365918815136,
-0.013812181539833546,
0.07379371672868729,
0.0007028093677945435,
0.07252512872219086,
0.05471322312951088,
0.034485965967178345,
0.008522512391209602,
-0.02534845843911171,
-0.08137916773557663,
0.13863343000411987,
-0.032555628567934036,
0.003177754348143935,
-0.029519665986299515,
0.0586993582546711,
-0.03176404535770416,
0.007344689220190048,
0.040928326547145844,
-0.07572340965270996,
0.003348155179992318,
0.051145054399967194,
0.04100048542022705,
0.03713647648692131,
0.012652325443923473,
-0.05449356138706207,
0.02870936691761017,
0.09124362468719482,
0.03608773648738861,
-0.18407106399536133,
-0.10035824775695801,
0.04586716741323471,
-0.04541929066181183,
0.08639279752969742,
-0.025571372359991074,
-0.03429578244686127,
0.04751790687441826,
-0.059863120317459106,
0.013697687536478043,
-0.08487430959939957,
-0.004805273376405239,
-0.0022280176635831594,
0.01876658760011196,
0.03925982117652893,
0.023623790591955185,
0.007383987307548523,
-0.03378874063491821,
0.11369110643863678,
-0.09429626166820526,
0.04645838588476181,
-0.06290195882320404,
-0.02588433027267456,
0.0067347572185099125,
-0.03730791062116623,
0.06938762962818146,
0.03732442855834961,
-0.035878926515579224,
-0.035224635154008865,
0.03040577657520771,
0.053620439022779465,
-0.05745270475745201,
-0.040271177887916565,
-0.06321850419044495,
-5.2709740572254304e-8,
-0.018790483474731445,
0.012246490456163883,
-0.060796719044446945,
-0.02575995773077011,
-0.07732581347227097,
0.08238157629966736,
0.03439359739422798,
0.007849062792956829,
0.008354129269719124,
0.07112360745668411,
0.04066760838031769,
-0.04982050508260727,
-0.0024877204559743404,
-0.0218059029430151,
0.07779068499803543,
-0.005952921230345964,
0.0689970850944519,
0.007051554508507252,
-0.0855693593621254,
0.010065418668091297,
-0.0213463194668293,
-0.06615015119314194,
-0.020309345796704292,
-0.026284407824277878,
-0.037107959389686584,
-0.05594603717327118,
0.04524324834346771,
0.026637690141797066,
-0.025352541357278824,
0.014043162576854229,
-0.02045934461057186,
0.06440091878175735,
0.05742141231894493,
0.057392094284296036,
-0.007163246162235737,
0.04887591674923897,
-0.05617327615618706,
0.0035493280738592148,
0.0356060229241848,
0.04671432822942734,
-0.013330639339983463,
-0.04271852970123291,
-0.0879499539732933,
0.018693871796131134,
0.023530248552560806,
0.011574541218578815,
-0.03205091506242752,
0.006937470752745867,
0.02656705304980278,
-0.019123880192637444,
-0.05599629133939743,
0.003867268329486251,
-0.002920973114669323,
-0.033978648483753204,
0.02608604170382023,
0.03170366212725639,
-0.08380179107189178,
-0.06321191042661667,
-0.04618572071194649,
0.035549670457839966,
-0.009097224101424217,
0.08833057433366776,
-0.027836965397000313,
0.009854193776845932
] | -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.ADDRCONFIG | dns.V4MAPPED, }; dns.lookup('example.org', options, (err, address, family) => console.log('address: %j family: IPv%s', address, family)); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 // When options.all is true, the result will be an Array. options.all = true; dns.lookup('example.org', options, (err, addresses) => console.log('addresses: %j', addresses)); // addresses: [{"address":"2606:2800:21f:cb07:6820:80da:af6b:8b2c","family":6}] ``` ```cjs const dns = require('node:dns'); const options = { family: 6, hints: dns.ADDRCONFIG | dns.V4MAPPED, }; dns.lookup('example.org', options, (err, address, family) => console.log('address: %j family: IPv%s', address, family)); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 // When options.all is true, the result will be an Array. options.all = true; dns.lookup('example.org', options, (err, addresses) => console.log('addresses: %j', addresses)); // addresses: [{"address":"2606:2800:21f:cb07:6820:80da:af6b:8b2c","family":6}] ``` If this method is invoked as its [`util.promisify()`][]ed version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. ### Supported getaddrinfo flags The following flags can be passed as hints to [`dns.lookup()`][]. \* `dns.ADDRCONFIG`: Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are only returned if the current system has at least one IPv4 address configured. \* `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported on some operating systems (e.g. FreeBSD 10.1). \* `dns.ALL`: If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as well as IPv4 mapped IPv6 addresses. ## `dns.lookupService(address, port, callback)` \* `address` {string} \* `port` {number} \* `callback` {Function} \* `err` {Error} \* `hostname` {string} e.g. `example.com` \* `service` {string} e.g. `http` Resolves the given `address` and `port` into a host name and service using the operating system's underlying `getnameinfo` implementation. If `address` is not a valid IP address, a `TypeError` will be thrown. The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. On an error, `err` is an [`Error`][] object, where `err.code` is the error code. ```mjs import dns from 'node:dns'; dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { console.log(hostname, service); // Prints: localhost ssh }); ``` ```cjs const dns = require('node:dns'); dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { console.log(hostname, service); // Prints: localhost ssh }); ``` If this method is invoked as its [`util.promisify()`][]ed version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. ## `dns.resolve(hostname[, rrtype], callback)` \* `hostname` {string} Host name to resolve. \* `rrtype` {string} Resource record type. \*\*Default:\*\* `'A'`. \* `callback` {Function} \* `err` {Error} \* `records` {string\[] | Object\[] | Object} Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource records. The type and structure of individual results varies based on `rrtype`: | `rrtype` | `records` contains | Result type | Shorthand method | | --------- | ------------------------------ | ----------- | ------------------------ | | `'A'` | IPv4 addresses (default) | {string} | [`dns.resolve4()`][] | | `'AAAA'` | IPv6 addresses | {string} | [`dns.resolve6()`][] | | `'ANY'` | 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 | {Object} | | 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.0583653524518013,
0.06048492342233658,
0.008309226483106613,
-0.08852826803922653,
-0.0014121879357844591,
0.0189557746052742,
-0.0666620060801506,
0.05270110443234444,
0.03203432634472847,
0.015793979167938232,
-0.06450445204973221,
-0.05094392970204353,
0.004915797617286444,
-0.033253490924835205,
0.09453859180212021,
0.07182254642248154,
-0.0021885265596210957,
0.05816177651286125,
0.08269231766462326,
-0.03494856879115105,
0.010483650490641594,
-0.03980041295289993,
0.10150643438100815,
0.01079416461288929,
0.025273757055401802,
-0.08390781283378601,
0.01022779755294323,
0.06537465006113052,
0.08936077356338501,
0.1238255575299263,
-0.046913087368011475,
0.07200706750154495,
0.07548106461763382,
-0.03183450922369957,
0.09922988712787628,
0.013117147609591484,
-0.013679120689630508,
0.04029619321227074,
-0.03826725482940674,
0.014406741596758366,
-0.019330749288201332,
0.09703707695007324,
0.04617169871926308,
-0.1244337260723114,
-0.05832860246300697,
0.01615513116121292,
0.0351414680480957,
-0.02507512830197811,
-0.025661321356892586,
0.08128108084201813,
-0.04194019362330437,
0.0834587886929512,
-0.030344992876052856,
0.004799740854650736,
0.06688133627176285,
0.019520988687872887,
0.05709516629576683,
0.017876481637358665,
0.07479853928089142,
-0.03273654729127884,
-0.002523178933188319,
-0.08856643736362457,
-0.01665131188929081,
-0.044966407120227814,
-0.035317350178956985,
0.007195835467427969,
0.006473197136074305,
0.030462030321359634,
-0.05350576341152191,
0.009429938159883022,
0.052496034651994705,
-0.11354506015777588,
-0.007218289654701948,
-0.04838072136044502,
-0.09414014220237732,
0.0509493425488472,
0.06432007253170013,
-0.05071723088622093,
-0.09442497789859772,
-0.006963278632611036,
-0.0290787685662508,
0.030424872413277626,
0.06892666965723038,
0.05485629662871361,
0.020721595734357834,
-0.05191665142774582,
0.01301258523017168,
0.0547667071223259,
-0.0391417033970356,
-0.024363018572330475,
-0.08033636957406998,
0.039035215973854065,
-0.029911918565630913,
-0.001838996191509068,
0.04305345192551613,
0.007579336874186993,
0.0919903889298439,
0.004623130429536104,
0.04640623554587364,
0.008108945563435555,
-0.040869906544685364,
-0.05922470614314079,
-0.0904548391699791,
0.0897335559129715,
-0.03381912410259247,
0.05066521093249321,
0.028918784111738205,
0.011036611162126064,
0.03964497521519661,
-0.006352463737130165,
-0.06319279968738556,
-0.02672271616756916,
-0.039210204035043716,
0.004511060193181038,
5.859192816956151e-33,
0.020932244136929512,
-0.01935531757771969,
0.01721009984612465,
-0.016679447144269943,
-0.028742151334881783,
-0.027889272198081017,
-0.0036294888705015182,
0.015557561069726944,
-0.15113461017608643,
0.05915231257677078,
-0.06859154254198074,
0.007790680043399334,
0.0945788249373436,
-0.028409158810973167,
-0.0018182034837082028,
0.04525740072131157,
0.0714007019996643,
0.028191495686769485,
0.0323043130338192,
0.0641065388917923,
0.013250195421278477,
0.029215335845947266,
0.06220362335443497,
0.03938247635960579,
0.032818686217069626,
-0.039536960422992706,
-0.02038213424384594,
0.008440657518804073,
-0.008512214757502079,
-0.07247909903526306,
0.024267666041851044,
0.0768180564045906,
-0.059960100799798965,
-0.011405454948544502,
0.11451040953397751,
0.0055407327599823475,
0.053456902503967285,
-0.011257302947342396,
-0.14186909794807434,
-0.08419687300920486,
0.029468247666954994,
0.040807683020830154,
-0.11630742996931076,
0.06594028323888779,
0.0060380143113434315,
-0.019900912418961525,
-0.055013205856084824,
-0.09438078850507736,
0.06731116771697998,
0.03720736876130104,
-0.022033652290701866,
0.01605818420648575,
-0.02941531501710415,
-0.06658778339624405,
0.044675081968307495,
0.04672599583864212,
0.03532375767827034,
0.019120585173368454,
-0.028120256960392,
0.05784469470381737,
-0.01514730229973793,
-0.04704120010137558,
-0.02870659902691841,
0.0446995384991169,
-0.016784418374300003,
0.02565307915210724,
0.00721413129940629,
-0.0032811672426760197,
0.0036438489332795143,
-0.00600776681676507,
0.06019922345876694,
0.05333219841122627,
-0.021326670423150063,
0.04013821855187416,
-0.01644357293844223,
-0.001745335990563035,
-0.08199179917573929,
-0.04770944267511368,
-0.014486215077340603,
-0.06833107024431229,
0.08801810443401337,
0.015303246676921844,
-0.06334374845027924,
0.07184834778308868,
-0.01724451780319214,
0.024735931307077408,
-0.0297512449324131,
-0.021404949948191643,
0.06629715114831924,
-0.0007075509056448936,
0.017257925122976303,
0.005889216437935829,
-0.03649313747882843,
-0.03447006642818451,
-0.0665721446275711,
-6.658181469997845e-33,
-0.006156757473945618,
0.001348998281173408,
-0.054186586290597916,
-0.0005892114131711423,
-0.06548413634300232,
-0.07284077256917953,
0.10148818045854568,
-0.015433179214596748,
0.06444412469863892,
-0.019608858972787857,
-0.016625775024294853,
0.006722442340105772,
0.060177866369485855,
-0.043661147356033325,
0.034645356237888336,
0.03861277550458908,
-0.07506301254034042,
-0.06726478040218353,
0.010900448076426983,
-0.04493631795048714,
-0.07411067187786102,
-0.010722090490162373,
-0.008724095299839973,
-0.011069388128817081,
-0.04478169605135918,
0.0008003194816410542,
-0.03942960500717163,
0.005634894594550133,
-0.07064726948738098,
-0.11168964207172394,
-0.009297855198383331,
0.01612781174480915,
-0.022459611296653748,
0.08074861019849777,
0.017549609765410423,
0.029198624193668365,
-0.012931732460856438,
0.11777503788471222,
0.09255342185497284,
-0.08454558253288269,
-0.025675257667899132,
0.06361238658428192,
-0.06028583273291588,
0.052707817405462265,
-0.006455196999013424,
0.03336470201611519,
0.022026823833584785,
0.10817139595746994,
0.004778721835464239,
0.016251487657427788,
-0.013865522108972073,
-0.12272552400827408,
-0.030693812295794487,
0.07791560888290405,
0.03479817509651184,
-0.025389164686203003,
0.010456808842718601,
-0.01341627910733223,
0.0589163713157177,
0.07393065840005875,
0.044295262545347214,
-0.15244868397712708,
-0.07471572607755661,
0.09972312301397324,
-0.009615298360586166,
0.06809448450803757,
-0.08418723195791245,
-0.0185486301779747,
0.06402207911014557,
-0.03584297373890877,
0.029788000509142876,
-0.08535381406545639,
-0.02241107076406479,
0.008984869346022606,
0.023904237896203995,
0.023451432585716248,
0.09251401573419571,
-0.009549738839268684,
-0.08145761489868164,
0.059725839644670486,
-0.11877263337373734,
0.036219507455825806,
-0.041983623057603836,
0.053217753767967224,
0.007529314607381821,
0.018554843962192535,
0.052297718822956085,
0.019499236717820168,
-0.027777139097452164,
0.06254204362630844,
0.026757653802633286,
0.04070712625980377,
-0.05662984028458595,
-0.038183003664016724,
-0.07472690939903259,
-5.400919533826709e-8,
-0.040654897689819336,
-0.007866214029490948,
-0.06528246402740479,
-0.038725510239601135,
-0.018308687955141068,
-0.012486306950449944,
0.08460747450590134,
0.035444676876068115,
0.037987831979990005,
0.024910064414143562,
0.015873800963163376,
0.013281552121043205,
-0.07433289289474487,
-0.052675336599349976,
0.030571559444069862,
-0.006517235189676285,
0.05746733397245407,
-0.001297371694818139,
-0.03781095892190933,
0.04374802112579346,
-0.0300914254039526,
-0.03302808851003647,
-0.05663762241601944,
0.029098916798830032,
-0.005887181963771582,
-0.031205372884869576,
0.0013036548625677824,
0.0201704278588295,
-0.03165050968527794,
0.022836321964859962,
-0.019641326740384102,
0.06942504644393921,
0.020368870347738266,
0.006587695330381393,
-0.01167325023561716,
0.034536249935626984,
-0.014396083541214466,
0.011190909892320633,
0.061462774872779846,
0.041943445801734924,
0.010458669625222683,
-0.05285050719976425,
-0.0016609999584034085,
-0.00046389427734538913,
-0.03220153972506523,
-0.0009586795349605381,
0.012248080223798752,
0.009097266010940075,
0.03883294016122818,
-0.07839211076498032,
-0.044948313385248184,
-0.012736476957798004,
-0.027469627559185028,
-0.004653895273804665,
0.005815064534544945,
-0.01538811344653368,
-0.06192004308104515,
-0.07578649371862411,
0.000016819236407172866,
0.0295836441218853,
0.05582055076956749,
-0.019612448289990425,
0.01758432574570179,
-0.014049958437681198
] | 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 | {Object} | [`dns.resolveNaptr()`][] | | `'NS'` | name server records | {string} | [`dns.resolveNs()`][] | | `'PTR'` | pointer records | {string} | [`dns.resolvePtr()`][] | | `'SOA'` | start of authority records | {Object} | [`dns.resolveSoa()`][] | | `'SRV'` | service records | {Object} | [`dns.resolveSrv()`][] | | `'TLSA'` | certificate associations | {Object} | [`dns.resolveTlsa()`][] | | `'TXT'` | text records | {string\[]} | [`dns.resolveTxt()`][] | On error, `err` is an [`Error`][] object, where `err.code` is one of the [DNS error codes][]. ## `dns.resolve4(hostname[, options], callback)` \* `hostname` {string} Host name to resolve. \* `options` {Object} \* `ttl` {boolean} Retrieves the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. \* `callback` {Function} \* `err` {Error} \* `addresses` {string\[] | Object\[]} Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of IPv4 addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). ## `dns.resolve6(hostname[, options], callback)` \* `hostname` {string} Host name to resolve. \* `options` {Object} \* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. \* `callback` {Function} \* `err` {Error} \* `addresses` {string\[] | Object\[]} Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of IPv6 addresses. ## `dns.resolveAny(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `ret` {Object\[]} Uses the DNS protocol to resolve all records (also known as `ANY` or `\*` query). The `ret` argument passed to the `callback` function will be an array containing various types of records. Each object has a property `type` that indicates the type of the current record. And depending on the `type`, additional properties will be present on the object: | Type | Properties | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | `'A'` | `address`/`ttl` | | `'AAAA'` | `address`/`ttl` | | `'CAA'` | Refer to [`dns.resolveCaa()`][] | | `'CNAME'` | `value` | | `'MX'` | Refer to [`dns.resolveMx()`][] | | `'NAPTR'` | Refer to [`dns.resolveNaptr()`][] | | `'NS'` | `value` | | `'PTR'` | `value` | | `'SOA'` | Refer to [`dns.resolveSoa()`][] | | `'SRV'` | Refer to [`dns.resolveSrv()`][] | | `'TLSA'` | Refer to [`dns.resolveTlsa()`][] | | `'TXT'` | This type of record contains an array property called `entries` which refers to [`dns.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | Here is an example of the `ret` object passed to the callback: ```js [ { type: 'A', address: '127.0.0.1', ttl: 299 }, { type: 'CNAME', value: 'example.com' }, { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, { type: 'NS', value: 'ns1.example.com' }, { type: 'TXT', entries: [ 'v=spf1 include:\_spf.example.com ~all' ] }, { type: 'SOA', nsname: '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, see [RFC 8482][]. ## `dns.resolveCname(hostname, callback)` | 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.00990794412791729,
0.008176526054739952,
0.03383233770728111,
-0.0936059057712555,
0.031453024595975876,
0.012752501294016838,
-0.060271527618169785,
0.030692048370838165,
0.09483878314495087,
-0.07489968091249466,
-0.02922961115837097,
-0.11940501630306244,
0.020936254411935806,
-0.026162486523389816,
-0.00817809347063303,
0.013182856142520905,
-0.04089215770363808,
0.06667283922433853,
-0.022545503452420235,
-0.04807007685303688,
0.05735539272427559,
0.041217416524887085,
0.015610811300575733,
0.11380326002836227,
-0.002528328448534012,
-0.01892869733273983,
-0.06407082825899124,
0.11811722069978714,
0.07539746910333633,
0.0977911576628685,
-0.06782180815935135,
0.022656995803117752,
0.04797229543328285,
-0.038049835711717606,
0.04173436388373375,
-0.0133122019469738,
-0.05882224440574646,
-0.02321683242917061,
-0.03683090582489967,
-0.017483916133642197,
0.04951602593064308,
0.06757823377847672,
0.04227611422538757,
-0.08442000299692154,
-0.040163666009902954,
-0.006443209946155548,
-0.05908781662583351,
-0.043966930359601974,
0.0059348298236727715,
0.021978231146931648,
-0.07203080505132675,
-0.03153890371322632,
-0.067164845764637,
0.01828368753194809,
-0.03164801001548767,
0.03997229039669037,
0.014620770700275898,
-0.0807378888130188,
0.054673098027706146,
-0.02633412927389145,
0.008844119496643543,
-0.025088129565119743,
-0.004156830254942179,
-0.015289236791431904,
-0.01781550422310829,
-0.091313436627388,
-0.07695824652910233,
0.05377839133143425,
0.03150886669754982,
-0.009405963122844696,
0.0525674931704998,
-0.04197220876812935,
0.000205793694476597,
-0.03600499406456947,
-0.05566086992621422,
0.03910958766937256,
0.059894759207963943,
0.006930909119546413,
-0.08392596989870071,
0.009112938307225704,
-0.0705314427614212,
0.03677338734269142,
0.07488788664340973,
0.042892199009656906,
-0.03893173485994339,
-0.004183126147836447,
0.09257689118385315,
0.07703839242458344,
-0.0029426589608192444,
-0.05341304838657379,
-0.054829008877277374,
0.0012165550142526627,
0.008693594485521317,
-0.017919030040502548,
-0.002124388236552477,
0.02398192696273327,
0.11031587421894073,
-0.015504289418458939,
0.05523879453539848,
-0.018660254776477814,
-0.08495959639549255,
-0.028964539989829063,
-0.06499774754047394,
-0.04933464899659157,
0.020355377346277237,
0.024523301050066948,
-0.06963816285133362,
-0.0005146080511622131,
-0.06604398787021637,
-0.06083594262599945,
-0.04817897081375122,
-0.027530107647180557,
-0.003220402868464589,
0.018497684970498085,
6.105011093574154e-33,
0.03823346272110939,
-0.0018406705930829048,
-0.010354452766478062,
-0.0361374132335186,
0.026546696200966835,
0.02886822819709778,
0.07771965861320496,
0.06555824726819992,
-0.012086711823940277,
0.007902991026639938,
-0.06823339313268661,
0.03451045602560043,
0.02418292872607708,
-0.13770486414432526,
-0.05087465047836304,
0.07055409252643585,
0.06497921794652939,
-0.016713930293917656,
0.05004020035266876,
0.0850418359041214,
0.009948799386620522,
0.026959644630551338,
0.014392674900591373,
0.09325267374515533,
0.03752647340297699,
-0.033362895250320435,
-0.04002368822693825,
-0.04294976219534874,
-0.034860752522945404,
-0.05749323219060898,
0.1098242700099945,
-0.029312152415513992,
-0.053336430341005325,
0.06906044483184814,
0.10069028288125992,
-0.01751990057528019,
0.0933484137058258,
-0.018141629174351692,
-0.06237052381038666,
-0.08556213229894638,
-0.004610853269696236,
-0.00444987416267395,
-0.07762190699577332,
0.053899653255939484,
-0.02810911275446415,
-0.006634129676967859,
-0.08013729006052017,
-0.07165148854255676,
0.10998231172561646,
-0.018498515710234642,
0.020749103277921677,
-0.0474725142121315,
-0.05404023826122284,
-0.07399863749742508,
0.00340439029969275,
0.0013370568631216884,
-0.07139959931373596,
0.030700944364070892,
-0.013878955505788326,
0.006988975685089827,
-0.006676866672933102,
-0.060147061944007874,
-0.043543994426727295,
-0.019389651715755463,
-0.007629772182554007,
-0.03765300288796425,
-0.006388039793819189,
-0.049497462809085846,
0.03448929265141487,
-0.05738046392798424,
0.025027064606547356,
0.004906260408461094,
0.05346634238958359,
0.060039617121219635,
-0.03328054025769234,
0.0018526914063841105,
-0.021601378917694092,
-0.03529531508684158,
-0.035158008337020874,
-0.028245653957128525,
-0.027932826429605484,
0.036094266921281815,
-0.08911070972681046,
0.10391423851251602,
0.01448601670563221,
-0.006489920429885387,
-0.031138481572270393,
-0.0025136556942015886,
0.01067078486084938,
-0.015147866681218147,
-0.07136436551809311,
-0.005771552212536335,
0.052794214338064194,
0.023697568103671074,
-0.06304441392421722,
-8.065073353147438e-33,
0.038783419877290726,
-0.06367601454257965,
0.009286735206842422,
-0.0525498241186142,
-0.05670101195573807,
-0.027890091761946678,
0.03751219063997269,
0.04672051593661308,
-0.0135538000613451,
-0.040408916771411896,
0.010668285191059113,
-0.02996329963207245,
0.094385527074337,
-0.0022774662356823683,
0.053794682025909424,
0.07713111490011215,
-0.050948962569236755,
-0.013428911566734314,
-0.03565361350774765,
0.06131455674767494,
-0.061863839626312256,
0.12312083691358566,
0.009363248944282532,
0.06219419836997986,
-0.05560049042105675,
0.0034077023155987263,
-0.020992271602153778,
0.001418410916812718,
-0.046768806874752045,
-0.03293637931346893,
0.06606084853410721,
0.0686386451125145,
-0.04057232290506363,
0.055610161274671555,
-0.09559144824743271,
-0.04121772199869156,
0.028936197981238365,
0.026829924434423447,
0.0228134635835886,
0.05834509804844856,
0.06683630496263504,
0.029530439525842667,
-0.06895352900028229,
0.0418165884912014,
-0.017008652910590172,
-0.07246675342321396,
0.0011734849540516734,
0.16467492282390594,
-0.008330211043357849,
0.07050233334302902,
0.041697677224874496,
-0.12252262979745865,
-0.0023863855749368668,
-0.04318838194012642,
0.07823362946510315,
0.036211300641298294,
0.11797386407852173,
-0.08953750133514404,
0.04508907347917557,
0.02029567025601864,
0.027508225291967392,
-0.09465301036834717,
-0.036714743822813034,
0.13236337900161743,
0.04265771061182022,
0.04442312940955162,
-0.04548218846321106,
-0.00806928426027298,
-0.006947246380150318,
-0.047829169780015945,
-0.005700599867850542,
-0.044270966202020645,
-0.028679151087999344,
-0.021162228658795357,
0.12547920644283295,
0.006638951133936644,
-0.030644288286566734,
-0.003231378737837076,
-0.03937937319278717,
0.11100465059280396,
-0.05582344904541969,
0.009492872282862663,
-0.006096339784562588,
0.022254370152950287,
-0.052603185176849365,
0.017442043870687485,
0.08096349984407425,
0.020732570439577103,
-0.030288921669125557,
0.07438431680202484,
0.034544412046670914,
0.004897024482488632,
0.025692880153656006,
-0.01874472200870514,
-0.022276930510997772,
-4.412113341345503e-8,
-0.10152123868465424,
-0.051385585218667984,
-0.033319320529699326,
0.0468578115105629,
-0.017912104725837708,
0.06038197502493858,
0.05946704000234604,
-0.0041325027123093605,
-0.010247835889458656,
-0.01756223849952221,
-0.018297817558050156,
-0.02689882181584835,
-0.02824518270790577,
-0.025277236476540565,
0.040142208337783813,
-0.000048480109398951754,
0.012780515477061272,
-0.007045653183013201,
-0.06091197580099106,
-0.03165854141116142,
-0.011161510832607746,
-0.046815045177936554,
0.014073362573981285,
-0.04700915887951851,
-0.0011323160724714398,
-0.027925144881010056,
0.02653065323829651,
0.016476383432745934,
-0.016752982512116432,
0.08219115436077118,
-0.06195531412959099,
-0.006882847752422094,
0.04001689329743385,
-0.03977072611451149,
0.008964926935732365,
-0.002190378261730075,
0.02227957919239998,
-0.04841134324669838,
-0.024944256991147995,
0.006640572100877762,
0.006566109601408243,
0.05934620276093483,
0.03256653621792793,
0.03297540545463562,
0.036272577941417694,
0.03808111697435379,
0.035577673465013504,
0.07069900631904602,
0.1097697839140892,
-0.07626377791166306,
-0.04015468806028366,
0.007942904718220234,
0.032833281904459,
0.03406395763158798,
-0.13954469561576843,
0.025710592046380043,
-0.04364846646785736,
-0.006756846327334642,
-0.007542161270976067,
0.021540945395827293,
0.029596911743283272,
0.05137649551033974,
-0.01825898513197899,
0.04543452709913254
] | 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, see [RFC 8482][]. ## `dns.resolveCname(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {string\[]} Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). ## `dns.resolveCaa(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `records` {Object\[]} Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). ## `dns.resolveMx(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {Object\[]} Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). ## `dns.resolveNaptr(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {Object\[]} Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of objects with the following properties: \* `flags` \* `service` \* `regexp` \* `replacement` \* `order` \* `preference` ```js { flags: 's', service: 'SIP+D2U', regexp: '', replacement: '\_sip.\_udp.example.com', order: 30, preference: 100 } ``` ## `dns.resolveNs(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {string\[]} Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). ## `dns.resolvePtr(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {string\[]} Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will be an array of strings containing the reply records. ## `dns.resolveSoa(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `address` {Object} Uses the DNS protocol to resolve a start of authority record (`SOA` record) for the `hostname`. The `address` argument passed to the `callback` function will be an object with the following properties: \* `nsname` \* `hostmaster` \* `serial` \* `refresh` \* `retry` \* `expire` \* `minttl` ```js { nsname: 'ns.example.com', hostmaster: 'root.example.com', serial: 2013101809, refresh: 10000, retry: 2400, expire: 604800, minttl: 3600 } ``` ## `dns.resolveSrv(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `addresses` {Object\[]} Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will be an array of objects with the following properties: \* `priority` \* `weight` \* `port` \* `name` ```js { priority: 10, weight: 5, port: 21223, name: 'service.example.com' } ``` ## `dns.resolveTlsa(hostname, callback)` \* `hostname` {string} \* `callback` {Function} \* `err` {Error} \* `records` {Object\[]} Uses the DNS protocol to resolve certificate associations (`TLSA` records) for 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` {Function} \* `err` {Error} | 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.014943758025765419,
-0.006070718169212341,
-0.02837751992046833,
-0.06497064232826233,
0.003607134334743023,
0.018124887719750404,
-0.061922091990709305,
0.08574313670396805,
0.11680503934621811,
-0.014522629790008068,
-0.013560201972723007,
-0.08809925615787506,
-0.052483320236206055,
-0.1024673655629158,
0.02482808567583561,
0.017063502222299576,
0.06304283440113068,
0.052247557789087296,
-0.008647766895592213,
-0.0697617456316948,
0.05386842414736748,
0.025504371151328087,
0.04158415645360947,
0.009303341619670391,
0.0655703991651535,
-0.07843736559152603,
-0.04070238396525383,
0.11617612093687057,
0.08666752278804779,
0.09315190464258194,
-0.015999509021639824,
0.02984389290213585,
0.06559178978204727,
-0.025522852316498756,
0.07101281732320786,
0.008134463801980019,
-0.03309733793139458,
0.08144186437129974,
-0.010851512663066387,
-0.01729114167392254,
0.017134014517068863,
0.09322622418403625,
0.05265328660607338,
-0.07743825763463974,
-0.0007266890606842935,
0.05096331611275673,
0.057331278920173645,
0.013344662263989449,
0.004126823041588068,
0.01627553068101406,
-0.042710501700639725,
0.040316142141819,
-0.062496036291122437,
-0.010162417776882648,
-0.004681432154029608,
0.00599980354309082,
0.06442882120609283,
-0.01905973069369793,
0.05260993540287018,
-0.04930458962917328,
0.001674649422056973,
-0.018087057396769524,
-0.012554440647363663,
-0.0163201242685318,
-0.0021891670767217875,
-0.06692355871200562,
-0.017825111746788025,
0.03842924162745476,
-0.04294445738196373,
0.01454448327422142,
0.047661010175943375,
-0.04651658609509468,
-0.029652828350663185,
-0.004087531939148903,
-0.04022933915257454,
0.056264087557792664,
0.022231386974453926,
0.01732451841235161,
-0.07776156067848206,
0.011892959475517273,
-0.022908207029104233,
0.01847623847424984,
0.04014771804213524,
0.0994158685207367,
0.021799998357892036,
-0.022253520786762238,
0.010625733993947506,
0.06813016533851624,
0.017092226073145866,
-0.00571234617382288,
-0.04088907316327095,
0.02509811706840992,
0.024748440831899643,
0.03092486411333084,
0.026138728484511375,
0.027451809495687485,
0.0521707609295845,
-0.03327823802828789,
0.045680318027734756,
0.06316284090280533,
-0.05327305197715759,
-0.05241197720170021,
-0.07284761220216751,
0.006327147129923105,
0.02169550023972988,
0.009273003786802292,
-0.05614890530705452,
0.03869276121258736,
0.017908824607729912,
0.0009873139206320047,
-0.08439088612794876,
0.015330196358263493,
-0.02007541060447693,
0.02492891065776348,
4.335800260090453e-33,
-0.010424667969346046,
0.003799618221819401,
0.0056158630177378654,
-0.018943248316645622,
-0.0017289828974753618,
0.001361730508506298,
0.040154919028282166,
0.07571038603782654,
0.038227807730436325,
0.03379480913281441,
0.01613559015095234,
-0.019776601344347,
0.02065931260585785,
-0.1193799078464508,
-0.012337190099060535,
0.11835494637489319,
0.11950146406888962,
-0.00933272298425436,
0.09154120087623596,
0.12178811430931091,
-0.0514979287981987,
-0.02033480443060398,
0.02724500373005867,
0.07768531143665314,
0.020101256668567657,
-0.007816199213266373,
-0.01956172287464142,
0.016083797439932823,
0.02838478982448578,
-0.055851589888334274,
0.0035134272184222937,
-0.06674262881278992,
-0.09835612773895264,
-0.03229779750108719,
0.05288137495517731,
0.01287036295980215,
0.10026565939188004,
0.03459596261382103,
-0.11854762583971024,
-0.047251537442207336,
-0.05669894441962242,
0.017546165734529495,
-0.12229855358600616,
0.08318652212619781,
0.024869846180081367,
-0.025204939767718315,
-0.05187563598155975,
-0.04738057777285576,
0.0689074695110321,
0.06535609811544418,
-0.00729162385687232,
-0.036953914910554886,
0.005722440779209137,
-0.04428714141249657,
0.018845032900571823,
0.010509968735277653,
0.005873708054423332,
-0.0055063944309949875,
-0.06351121515035629,
-0.031410157680511475,
0.036123521625995636,
-0.14958062767982483,
-0.10118009895086288,
-0.042967360466718674,
0.032257214188575745,
0.058587685227394104,
0.03178166225552559,
-0.0010751531226560473,
-0.05637480318546295,
-0.00039040809497237206,
-0.014196732081472874,
0.05853157490491867,
0.0019826595671474934,
0.014158844016492367,
-0.021218005567789078,
-0.0030582721810787916,
-0.03800450265407562,
-0.05776010453701019,
-0.019673576578497887,
-0.04257248714566231,
0.04037690535187721,
0.03381521627306938,
-0.08726126700639725,
0.09857939183712006,
0.00942440889775753,
0.06287136673927307,
0.026060283184051514,
0.056172195822000504,
0.002020985819399357,
-0.029757268726825714,
-0.045233745127916336,
-0.029945407062768936,
-0.0032307954970747232,
0.040669508278369904,
-0.07626970112323761,
-4.8074089609823395e-33,
0.027662161737680435,
-0.05497217923402786,
-0.058709193021059036,
0.012497230432927608,
-0.051454417407512665,
-0.048074450343847275,
-0.015274201519787312,
0.0717351883649826,
-0.03290567174553871,
-0.15292219817638397,
0.028849922120571136,
-0.025224963203072548,
0.029619554057717323,
-0.03447534888982773,
-0.00014891587488818914,
0.10213806480169296,
-0.08520141988992691,
-0.05075589194893837,
-0.08495643734931946,
0.016865503042936325,
-0.017307931557297707,
0.044937796890735626,
-0.05154990032315254,
-0.005413209553807974,
-0.10961273312568665,
0.040216535329818726,
-0.009743447415530682,
0.012978439219295979,
-0.036930378526449203,
-0.0387120246887207,
0.05628715828061104,
-0.024250207468867302,
-0.04808821529150009,
0.06183609738945961,
-0.007227711845189333,
0.061787042766809464,
0.012966960668563843,
0.07270955294370651,
0.013238572515547276,
-0.003218643367290497,
0.056423380970954895,
0.05064472183585167,
-0.036774642765522,
0.04945071041584015,
0.0043081012554466724,
0.0406864657998085,
-0.0395541749894619,
0.10306805372238159,
0.003479115664958954,
0.07981947809457779,
0.06035681441426277,
-0.11742541939020157,
-0.03476307541131973,
-0.006945308763533831,
0.050882644951343536,
0.00912391860038042,
0.042497582733631134,
0.00991208665072918,
0.02813500352203846,
0.030928457155823708,
-0.020156970247626305,
-0.10602619498968124,
-0.06742239743471146,
0.11591485142707825,
-0.024505039677023888,
0.0685945451259613,
-0.08143565058708191,
0.05456174910068512,
0.07107876986265182,
0.01571016199886799,
0.022060293704271317,
-0.024048855528235435,
-0.004738896619528532,
-0.021588176488876343,
0.03141895309090614,
0.036797016859054565,
0.03820452839136124,
-0.02901296317577362,
-0.04374047368764877,
0.13523215055465698,
-0.010042562149465084,
0.08867913484573364,
0.04765155166387558,
0.00460750050842762,
0.0009473887621425092,
0.05147605761885643,
0.07597382366657257,
0.06871408969163895,
-0.05537698045372963,
0.017772872000932693,
0.07023190706968307,
-0.026575513184070587,
-0.0017217930871993303,
-0.01698080636560917,
-0.05743024870753288,
-5.4239876590145286e-8,
-0.01540947426110506,
0.032690417021512985,
-0.04659704864025116,
-0.07411591708660126,
-0.024857250973582268,
0.06938489526510239,
-0.0186280757188797,
-0.008466844446957111,
0.014096939004957676,
0.027778979390859604,
-0.0026987765450030565,
-0.01876409351825714,
-0.024387961253523827,
0.020032105967402458,
0.0104918098077178,
-0.029345862567424774,
0.006875487510114908,
0.05053632706403732,
-0.05490189045667648,
-0.09986411780118942,
-0.07725813239812851,
-0.046381305903196335,
-0.028570400550961494,
-0.095869280397892,
-0.03804713115096092,
-0.06846554577350616,
0.053347211331129074,
0.020951975136995316,
-0.03489300608634949,
0.041213203221559525,
-0.04417112469673157,
0.038402020931243896,
0.06256742030382156,
-0.0349736288189888,
0.02349597029387951,
-0.007739642634987831,
-0.02198227308690548,
-0.0315551683306694,
0.01469375379383564,
-0.03369928151369095,
0.0022472443524748087,
-0.003639667760580778,
-0.00026140364934690297,
0.003994363825768232,
0.035394083708524704,
0.0034968433901667595,
0.070662721991539,
0.08886957913637161,
0.12805575132369995,
-0.05777186155319214,
-0.05616021901369095,
0.009993348270654678,
0.019373716786503792,
-0.020162004977464676,
-0.091783806681633,
-0.019343679770827293,
-0.11559094488620758,
-0.037009961903095245,
-0.02509082295000553,
-0.013024203479290009,
0.007488760631531477,
0.010050077922642231,
-0.03346531093120575,
0.05695095658302307
] | 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` {Function} \* `err` {Error} \* `records` {string\[]} Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a two-dimensional array of the text records available for `hostname` (e.g. `[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of one record. Depending on the use case, these could be either joined together or treated separately. ## `dns.reverse(ip, callback)` \* `ip` {string} \* `callback` {Function} \* `err` {Error} \* `hostnames` {string\[]} Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of host names. On error, `err` is an [`Error`][] object, where `err.code` is one of the [DNS error codes][]. ## `dns.setDefaultResultOrder(order)` \* `order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. Set the default value of `order` in [`dns.lookup()`][] and [`dnsPromises.lookup()`][]. The value could be: \* `ipv4first`: sets default `order` to `ipv4first`. \* `ipv6first`: sets default `order` to `ipv6first`. \* `verbatim`: sets default `order` to `verbatim`. The default is `verbatim` and [`dns.setDefaultResultOrder()`][] have higher priority than [`--dns-result-order`][]. When using [worker threads][], [`dns.setDefaultResultOrder()`][] from the main thread won't affect the default dns orders in workers. ## `dns.getDefaultResultOrder()` Get the default value for `order` in [`dns.lookup()`][] and [`dnsPromises.lookup()`][]. The value could be: \* `ipv4first`: for `order` defaulting to `ipv4first`. \* `ipv6first`: for `order` defaulting to `ipv6first`. \* `verbatim`: for `order` defaulting to `verbatim`. ## `dns.setServers(servers)` \* `servers` {string\[]} array of [RFC 5952][] formatted addresses Sets the IP address and port of servers to be used when performing DNS resolution. The `servers` argument is an array of [RFC 5952][] formatted addresses. If the port is the IANA default DNS port (53) it can be omitted. ```js dns.setServers([ '8.8.8.8', '[2001:4860:4860::8888]', '8.8.8.8:1053', '[2001:4860:4860::8888]:1053', ]); ``` An error will be thrown if an invalid address is provided. The `dns.setServers()` method must not be called while a DNS query is in progress. The [`dns.setServers()`][] method affects only [`dns.resolve()`][], `dns.resolve\*()` and [`dns.reverse()`][] (and specifically \_not\_ [`dns.lookup()`][]). This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will \_not\_ attempt to resolve with subsequent servers provided. Fallback DNS servers will only be used if the earlier ones time out or result in some other error. ## DNS promises API The `dns.promises` API provides an alternative set of asynchronous DNS methods that return `Promise` objects rather than using callbacks. The API is accessible via `require('node:dns').promises` or `require('node:dns/promises')`. ### Class: `dnsPromises.Resolver` An independent resolver for DNS requests. Creating a new resolver uses the default server settings. Setting the servers used for a resolver using [`resolver.setServers()`][`dnsPromises.setServers()`] does not affect other resolvers: ```mjs import { Resolver } from 'node:dns/promises'; const resolver = new Resolver(); resolver.setServers(['4.4.4.4']); // This request will use the server at 4.4.4.4, independent of global settings. const addresses = await resolver.resolve4('example.org'); ``` ```cjs const { Resolver } = require('node:dns').promises; const resolver = new Resolver(); resolver.setServers(['4.4.4.4']); // This request will use the server at 4.4.4.4, independent of global settings. resolver.resolve4('example.org').then((addresses) => { // ... }); // 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()`][`dnsPromises.resolve()`] \* [`resolver.resolve4()`][`dnsPromises.resolve4()`] \* [`resolver.resolve6()`][`dnsPromises.resolve6()`] \* [`resolver.resolveAny()`][`dnsPromises.resolveAny()`] \* [`resolver.resolveCaa()`][`dnsPromises.resolveCaa()`] \* [`resolver.resolveCname()`][`dnsPromises.resolveCname()`] \* [`resolver.resolveMx()`][`dnsPromises.resolveMx()`] \* [`resolver.resolveNaptr()`][`dnsPromises.resolveNaptr()`] | 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.00989770982414484,
0.027027590200304985,
-0.045910488814115524,
-0.06742755323648453,
0.007007175125181675,
-0.01234674546867609,
-0.10735639929771423,
0.045500632375478745,
0.08831977844238281,
-0.023207945749163628,
-0.03681951388716698,
-0.11334564536809921,
-0.029401006177067757,
-0.08442264050245285,
0.0017600849969312549,
0.03352395072579384,
0.004021275322884321,
0.07457493990659714,
0.05278807133436203,
-0.10017663240432739,
0.05609646812081337,
-0.06148650497198105,
0.04214748367667198,
-0.0034580572973936796,
-0.0009517004946246743,
-0.07421044260263443,
-0.007279772777110338,
0.14801493287086487,
0.01643110066652298,
0.015007250010967255,
-0.036048006266355515,
-0.004703589249402285,
0.021240215748548508,
-0.08283422142267227,
0.030423428863286972,
-0.04858908802270889,
-0.030808279290795326,
0.026788797229528427,
-0.007777403108775616,
-0.008583413437008858,
0.043361954391002655,
0.08304886519908905,
0.0416879840195179,
-0.06657659262418747,
0.010814852081239223,
-0.004106499720364809,
0.035999298095703125,
0.02387113869190216,
-0.035861797630786896,
-0.008075178600847721,
0.0016434160061180592,
0.04810008406639099,
-0.07472915202379227,
-0.019399132579565048,
0.056104470044374466,
-0.03690727800130844,
0.029734835028648376,
-0.05977898836135864,
0.05639003589749336,
-0.05489274486899376,
0.009144018404185772,
0.008740536868572235,
0.0034001818858087063,
-0.051823150366544724,
-0.09948912262916565,
-0.016590924933552742,
-0.03565782308578491,
0.07680536061525345,
-0.043303120881319046,
-0.021545665338635445,
0.05391186848282814,
-0.014851328916847706,
-0.02676529809832573,
0.025809545069932938,
-0.05717087164521217,
0.05255797132849693,
0.020471228286623955,
-0.03764176741242409,
-0.09760746359825134,
-0.011643894948065281,
0.04023401439189911,
-0.06759559363126755,
0.09366606920957565,
0.02165880613029003,
-0.02656061016023159,
0.06568826735019684,
0.0022079814225435257,
0.029432469978928566,
0.03424495458602905,
0.05364936590194702,
-0.011435187421739101,
0.010320748202502728,
0.015159713104367256,
-0.008624748326838017,
0.004112597554922104,
0.036183521151542664,
0.07479473203420639,
-0.015056510455906391,
0.06967011839151382,
0.03803468123078346,
-0.09727278351783752,
-0.06695643067359924,
-0.010486708953976631,
0.009354695677757263,
-0.011574129574000835,
0.05809406563639641,
-0.09084414690732956,
0.03203842416405678,
0.03288385272026062,
-0.017243370413780212,
-0.057829760015010834,
-0.009893987327814102,
-0.005824557971209288,
0.03376307711005211,
4.102205288011079e-33,
0.05374523252248764,
-0.017148645594716072,
-0.0029168021865189075,
-0.0029389297123998404,
0.03349725902080536,
0.006858737673610449,
0.011920401826500893,
0.028374433517456055,
-0.09283099323511124,
0.05938773229718208,
-0.03186744078993797,
0.043395426124334335,
0.017146674916148186,
-0.0750788077712059,
-0.011330487206578255,
0.04675156623125076,
0.05665130540728569,
0.013809957541525364,
0.04520982503890991,
0.11326476186513901,
0.02617223747074604,
0.015829140320420265,
0.0556514598429203,
0.06968532502651215,
0.07020500302314758,
-0.012446281500160694,
-0.01056496798992157,
0.05779886618256569,
-0.020737458020448685,
-0.040095992386341095,
0.022202789783477783,
-0.04707254841923714,
-0.03030090034008026,
0.03444249927997589,
0.12283151596784592,
0.04750165343284607,
0.11430235207080841,
-0.03843436390161514,
-0.10186666995286942,
0.004685678984969854,
0.011344008147716522,
-0.0042378585785627365,
-0.059356700628995895,
0.04934616759419441,
-0.07506085932254791,
-0.06939004361629486,
-0.07781751453876495,
-0.07288511097431183,
0.10030283778905869,
0.10098281502723694,
-0.014613904990255833,
-0.008794711902737617,
0.014838971197605133,
-0.07929680496454239,
0.056401003152132034,
0.0334894172847271,
-0.006061570718884468,
0.018628790974617004,
-0.0296948105096817,
0.05541921779513359,
-0.07432372123003006,
-0.09900812059640884,
-0.0784139558672905,
-0.02796749584376812,
0.015590086579322815,
0.044470593333244324,
0.017547624185681343,
-0.005955533590167761,
-0.04293501377105713,
-0.05506234988570213,
-0.0033445244189351797,
0.05904630199074745,
-0.0009127624216489494,
0.034270938485860825,
0.04896477609872818,
0.032787490636110306,
-0.092864029109478,
-0.0117043387144804,
-0.01940319873392582,
-0.055776216089725494,
-0.002248416654765606,
-0.016901833936572075,
-0.0888143852353096,
0.1259842813014984,
-0.03776511549949646,
0.053458623588085175,
-0.04379040375351906,
-0.0396912656724453,
0.018731076270341873,
-0.062161803245544434,
-0.049568913877010345,
0.01173283439129591,
0.027324317023158073,
-0.061632949858903885,
-0.10280562192201614,
-5.4770822151740426e-33,
0.012866652570664883,
-0.04867926985025406,
-0.041160475462675095,
0.06484068930149078,
-0.028355810791254044,
-0.07291599363088608,
0.04593854770064354,
0.09478295594453812,
0.012308290228247643,
-0.02907663770020008,
-0.032520826905965805,
-0.02089548110961914,
0.09269169718027115,
-0.12667740881443024,
0.029477931559085846,
0.11792510747909546,
-0.07629573345184326,
-0.05139458179473877,
-0.06711678951978683,
-0.023932067677378654,
0.03991258516907692,
0.07153347134590149,
-0.011920197866857052,
0.0548347644507885,
-0.08046795427799225,
-0.017047295346856117,
-0.009858743287622929,
-0.011412328109145164,
-0.0010443038772791624,
-0.0762166753411293,
0.03800211474299431,
-0.029529063031077385,
-0.02761252038180828,
0.07158446311950684,
-0.04156913608312607,
-0.0035207539331167936,
0.062461987137794495,
0.10766839236021042,
0.004427052102982998,
-0.0263668280094862,
-0.022472647950053215,
0.05398140847682953,
-0.09675166755914688,
0.06477116048336029,
0.03845281898975372,
0.026663031429052353,
-0.057765670120716095,
0.10627114772796631,
0.08202365040779114,
0.029169954359531403,
0.016185494139790535,
-0.078920878469944,
-0.008130419068038464,
0.05296865478157997,
-0.006120447069406509,
-0.02906002104282379,
0.033692821860313416,
0.013253750279545784,
0.004037779290229082,
0.06858418881893158,
0.04093525558710098,
-0.12368617206811905,
0.01844484731554985,
0.056636858731508255,
0.02489585429430008,
0.07587125152349472,
-0.06770311295986176,
-0.028787029907107353,
0.07501063495874405,
-0.01966916024684906,
0.0030303439125418663,
-0.05718938633799553,
-0.03233956918120384,
-0.04361032322049141,
0.04261382669210434,
-0.011052414774894714,
-0.0016099148197099566,
-0.07750166207551956,
0.00002318897531949915,
0.1496589630842209,
0.008383098058402538,
0.010295324958860874,
0.05203027278184891,
0.018870802596211433,
0.07543441653251648,
0.014179046265780926,
0.03808657452464104,
0.0363234281539917,
-0.028628196567296982,
-0.005775583442300558,
-0.0016600295202806592,
0.05522345006465912,
-0.026655271649360657,
-0.014630703255534172,
-0.0012402549618855119,
-5.629954813457516e-8,
-0.059592604637145996,
0.024834664538502693,
-0.1475840061903,
-0.04122985526919365,
-0.04028734564781189,
0.0032065168488770723,
0.03554088622331619,
-0.04389074817299843,
0.03212202712893486,
-0.047386109828948975,
-0.014919131994247437,
-0.017240485176444054,
-0.011715175583958626,
-0.012332907877862453,
0.05399693176150322,
0.03718771040439606,
0.028510896489024162,
0.004157232120633125,
-0.04289829730987549,
0.024479394778609276,
0.024462874978780746,
-0.03337661549448967,
-0.07098028063774109,
-0.02937738597393036,
0.02500893734395504,
-0.010797455906867981,
0.06880718469619751,
0.08041616529226303,
-0.005066596902906895,
0.008040482178330421,
-0.06420432776212692,
0.03556840866804123,
-0.0036521675065159798,
0.04503599554300308,
0.0016917446628212929,
0.04081061854958534,
-0.019130609929561615,
-0.0732293352484703,
0.04350821673870087,
0.06293293833732605,
0.011484777554869652,
0.014332026243209839,
-0.03632073849439621,
0.07106044143438339,
-0.013794222846627235,
0.03987414762377739,
-0.022678961977362633,
0.04314161464571953,
0.060647908598184586,
-0.04160167649388313,
-0.01761922426521778,
-0.03955771028995514,
-0.010900222696363926,
-0.02219105139374733,
-0.09401428699493408,
-0.010049372911453247,
-0.029443347826600075,
-0.03895091265439987,
0.004700418096035719,
-0.001823930535465479,
0.02575492486357689,
0.002722683595493436,
0.06590096652507782,
0.005904792807996273
] | 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()`][`dnsPromises.resolve()`] \* [`resolver.resolve4()`][`dnsPromises.resolve4()`] \* [`resolver.resolve6()`][`dnsPromises.resolve6()`] \* [`resolver.resolveAny()`][`dnsPromises.resolveAny()`] \* [`resolver.resolveCaa()`][`dnsPromises.resolveCaa()`] \* [`resolver.resolveCname()`][`dnsPromises.resolveCname()`] \* [`resolver.resolveMx()`][`dnsPromises.resolveMx()`] \* [`resolver.resolveNaptr()`][`dnsPromises.resolveNaptr()`] \* [`resolver.resolveNs()`][`dnsPromises.resolveNs()`] \* [`resolver.resolvePtr()`][`dnsPromises.resolvePtr()`] \* [`resolver.resolveSoa()`][`dnsPromises.resolveSoa()`] \* [`resolver.resolveSrv()`][`dnsPromises.resolveSrv()`] \* [`resolver.resolveTlsa()`][`dnsPromises.resolveTlsa()`] \* [`resolver.resolveTxt()`][`dnsPromises.resolveTxt()`] \* [`resolver.reverse()`][`dnsPromises.reverse()`] \* [`resolver.setServers()`][`dnsPromises.setServers()`] ### `resolver.cancel()` Cancel all outstanding DNS queries made by this resolver. The corresponding promises will be rejected with an error with the code `ECANCELLED`. ### `dnsPromises.getServers()` \* Returns: {string\[]} Returns an array of IP address strings, formatted according to [RFC 5952][], that are currently configured for DNS resolution. A string will include a port section if a custom port is used. ```js [ '8.8.8.8', '2001:4860:4860::8888', '8.8.8.8:1053', '[2001:4860:4860::8888]:1053', ] ``` ### `dnsPromises.lookup(hostname[, options])` \* `hostname` {string} \* `options` {integer | Object} \* `family` {integer} The record family. Must be `4`, `6`, or `0`. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. \*\*Default:\*\* `0`. \* `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple flags may be passed by bitwise `OR`ing their values. \* `all` {boolean} When `true`, the `Promise` is resolved with all addresses in an array. Otherwise, returns a single address. \*\*Default:\*\* `false`. \* `order` {string} When `verbatim`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `ipv4first`, IPv4 addresses are placed before IPv6 addresses. When `ipv6first`, IPv6 addresses are placed before IPv4 addresses. \*\*Default:\*\* `verbatim` (addresses are not reordered). Default value is configurable using [`dns.setDefaultResultOrder()`][] or [`--dns-result-order`][]. New code should use `{ order: 'verbatim' }`. \* `verbatim` {boolean} When `true`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. \*\*Default:\*\* currently `false` (addresses are reordered) but this is expected to change in the not too distant future. Default value is configurable using [`dns.setDefaultResultOrder()`][] or [`--dns-result-order`][]. Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or AAAA (IPv6) record. All `option` properties are optional. If `options` is an integer, then it must be `4` or `6` – if `options` is not provided, then either IPv4 or IPv6 addresses, or both, are returned if found. With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` is the error code. Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when the host name does not exist but also when the lookup fails in other ways such as no available file descriptors. [`dnsPromises.lookup()`][] does not necessarily have anything to do with the DNS protocol. The implementation uses an operating system facility that can associate names with addresses and 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 `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('example.org', options).then((result) => { console.log('address: %j family: IPv%s', result.address, result.family); | 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.0005098968395031989,
-0.0046167438849806786,
-0.02819257229566574,
-0.07282588630914688,
0.02042466588318348,
0.014582604169845581,
-0.05133071541786194,
0.05762309953570366,
0.0652397871017456,
-0.0071106841787695885,
-0.07978072017431259,
-0.033812444657087326,
-0.03756679967045784,
-0.027421997860074043,
-0.039010029286146164,
0.06738859415054321,
0.04276660084724426,
0.09356804192066193,
0.013129102066159248,
-0.09148601442575455,
0.0012063003377988935,
0.02790171653032303,
0.06704141944646835,
-0.02018442191183567,
0.0478401742875576,
-0.012173231691122055,
-0.039975252002477646,
0.1434740424156189,
0.054909318685531616,
0.07121258974075317,
-0.03706327825784683,
0.06039063632488251,
-0.0030313695315271616,
-0.019078677520155907,
0.05899285525083542,
-0.021262874826788902,
-0.04679175093770027,
0.04433558136224747,
-0.03156917914748192,
-0.044969771057367325,
-0.01973375305533409,
0.06327693909406662,
0.04766394570469856,
-0.018065236508846283,
0.002512931125238538,
-0.02789992094039917,
0.03696031868457794,
0.04533763974905014,
-0.038771193474531174,
0.0019558232743293047,
-0.019155025482177734,
0.017146484926342964,
0.03761409595608711,
0.05832449346780777,
0.06300587207078934,
0.02368171140551567,
0.024237386882305145,
-0.10671652853488922,
0.07010630518198013,
0.00037277545197866857,
-0.027871374040842056,
-0.02485169656574726,
-0.025199729949235916,
0.0027034396771341562,
-0.03644220903515816,
-0.03776112571358681,
-0.03570215404033661,
0.0912836566567421,
0.03996894508600235,
0.05655510723590851,
0.053511474281549454,
-0.03886357694864273,
0.03883148729801178,
-0.020583264529705048,
-0.07036460191011429,
0.05219368636608124,
-0.041589152067899704,
-0.04196636751294136,
-0.10663192719221115,
-0.09120481461286545,
-0.0009528665686957538,
-0.04193326085805893,
0.08171109855175018,
0.026321640238165855,
0.02966582402586937,
-0.03411094844341278,
0.022331921383738518,
0.0309626255184412,
-0.02673330530524254,
-0.03734699636697769,
-0.08179552108049393,
0.0010039586341008544,
0.014906387776136398,
-0.023039067164063454,
-0.022812144830822945,
-0.022372867912054062,
0.117780901491642,
-0.01877034641802311,
0.02736131101846695,
0.04973425716161728,
-0.032439541071653366,
-0.027060091495513916,
-0.04572732374072075,
0.04122763127088547,
-0.04799782857298851,
0.07674682885408401,
-0.036691222339868546,
0.041592925786972046,
0.0025853575207293034,
0.0437498539686203,
-0.06823624670505524,
0.04824497550725937,
0.033390168100595474,
0.0029016060288995504,
4.094711511524587e-33,
0.05847380682826042,
-0.03195696696639061,
0.014711459167301655,
0.001897102571092546,
0.014395278878509998,
-0.004035009536892176,
0.10764090716838837,
0.02319650910794735,
-0.05050831288099289,
0.015040196478366852,
-0.02352403849363327,
-0.03171695023775101,
-0.00011356847971910611,
-0.0985979363322258,
-0.07049378007650375,
0.005794421304017305,
0.11533304303884506,
-0.004547905642539263,
0.03700492903590202,
0.1086825430393219,
-0.055707477033138275,
0.03626227006316185,
0.049605172127485275,
0.04334554821252823,
0.03709840029478073,
-0.05472344160079956,
0.008930937387049198,
0.06873201578855515,
-0.00874942447990179,
-0.08099464327096939,
0.0884648784995079,
-0.026484111323952675,
-0.11882895231246948,
0.027312062680721283,
0.06118858978152275,
-0.005126874428242445,
0.019095083698630333,
-0.0005004838458262384,
-0.09506901353597641,
-0.05354985594749451,
-0.04393737390637398,
0.011618656106293201,
-0.08441182971000671,
0.002967650769278407,
0.020038360729813576,
-0.08621198683977127,
-0.07117220759391785,
-0.10551835596561432,
0.12746188044548035,
-0.02919614501297474,
0.04659608006477356,
0.006453936453908682,
-0.03578425943851471,
-0.0887325182557106,
0.08364845812320709,
-0.014275646768510342,
-0.01653105951845646,
-0.007277634926140308,
0.010443450883030891,
0.018162349238991737,
-0.04482044652104378,
-0.17670658230781555,
-0.09393437951803207,
-0.0527331717312336,
0.056080374866724014,
0.028070766478776932,
-0.024868499487638474,
-0.0015341837424784899,
-0.05766253545880318,
0.002597313141450286,
0.03219334036111832,
0.004262021277099848,
0.05040355771780014,
0.017499860376119614,
0.006686028558760881,
0.024510247632861137,
-0.06052152067422867,
-0.010207101702690125,
-0.027174845337867737,
-0.06351171433925629,
0.018290486186742783,
0.0629001334309578,
-0.0760861337184906,
0.15216468274593353,
-0.019805507734417915,
0.06980571150779724,
0.01340633537620306,
-0.015849407762289047,
0.06834854930639267,
0.001905955490656197,
-0.05323108285665512,
-0.020964330062270164,
0.018783755600452423,
-0.03798868879675865,
-0.03261220455169678,
-5.500979647984275e-33,
0.03307870402932167,
-0.008516582660377026,
-0.03923438861966133,
-0.0010118944337591529,
-0.040018849074840546,
-0.011839407496154308,
0.07120656967163086,
0.02111463062465191,
-0.017303764820098877,
-0.021184023469686508,
0.05687826871871948,
0.013891927897930145,
0.08056650310754776,
-0.029086334630846977,
0.016726424917578697,
0.11729352921247482,
0.04119518771767616,
-0.05993901193141937,
0.010939901694655418,
0.01856048032641411,
0.01996789127588272,
0.0601312518119812,
-0.046166736632585526,
-0.01833339035511017,
-0.050225842744112015,
0.007859619334340096,
0.03632860630750656,
0.03836813196539879,
-0.07801102101802826,
-0.05052824318408966,
0.031864508986473083,
0.010154596529901028,
-0.05767642706632614,
0.040487512946128845,
-0.011309686116874218,
0.036614175885915756,
-0.019305897876620293,
0.011486946605145931,
-0.005690046586096287,
-0.04688750579953194,
0.05662159621715546,
-0.04841338470578194,
-0.041807621717453,
0.01852411776781082,
0.038487110286951065,
-0.05188944935798645,
-0.031610384583473206,
0.0629032626748085,
-0.025847256183624268,
0.050638601183891296,
0.07628485560417175,
-0.08276087045669556,
-0.08285685628652573,
0.0038407985121011734,
0.03809267282485962,
0.03280818834900856,
0.049796316772699356,
-0.05531502887606621,
0.08738886564970016,
0.03690117597579956,
0.0046578338369727135,
-0.14908047020435333,
-0.009526650421321392,
0.05968044698238373,
-0.020040804520249367,
0.053885847330093384,
-0.12453754246234894,
0.0030486572068184614,
0.033208511769771576,
0.04274525120854378,
0.03613091632723808,
-0.0018134575802832842,
-0.07781878858804703,
-0.015382252633571625,
0.06990143656730652,
-0.0438874252140522,
0.02346150577068329,
0.0023347630631178617,
-0.02689329721033573,
0.1204003170132637,
-0.07042726129293442,
0.020347075536847115,
0.0066102840937674046,
-0.033283621072769165,
0.013381782919168472,
0.046468935906887054,
0.09158951789140701,
0.0689079761505127,
-0.009361987002193928,
0.02391512133181095,
0.007632643915712833,
0.04720098152756691,
-0.01779436133801937,
-0.012862903997302055,
-0.009545089676976204,
-4.662346242412241e-8,
-0.009174474515020847,
0.009556157514452934,
-0.03750889375805855,
-0.04577586427330971,
-0.030700160190463066,
0.07310289889574051,
0.014691326767206192,
-0.04704535752534866,
-0.012443621642887592,
0.024824222549796104,
-0.04549170657992363,
-0.018672864884138107,
0.010741207748651505,
0.008337181061506271,
0.018897423520684242,
0.009335228241980076,
0.052887625992298126,
0.024545764550566673,
-0.07141774892807007,
-0.0481005534529686,
-0.011939444579184055,
0.015548286959528923,
-0.06684686243534088,
-0.05088409036397934,
-0.002604341832920909,
-0.022564252838492393,
0.11480913311243057,
-0.019325334578752518,
-0.007144482806324959,
0.05669066682457924,
-0.07955260574817657,
0.014059411361813545,
0.03717071935534477,
-0.07720556110143661,
0.03461451083421707,
0.023059694096446037,
0.04375511035323143,
-0.004564748145639896,
0.06274407356977463,
0.045870304107666016,
0.02129754051566124,
0.01660885289311409,
0.015303891152143478,
0.06760311871767044,
0.012096799910068512,
-0.015953807160258293,
0.026659606024622917,
0.050797704607248306,
0.11120830476284027,
-0.0469408743083477,
-0.06659756600856781,
-0.031175721436738968,
-0.05398687347769737,
0.014684639871120453,
-0.07890443503856659,
0.004836068022996187,
-0.12420269101858139,
-0.07502378523349762,
-0.028489932417869568,
0.06386086344718933,
-0.01010079961270094,
-0.031145285815000534,
-0.050154611468315125,
0.010113169439136982
] | 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('example.org', options).then((result) => { console.log('address: %j family: IPv%s', result.address, result.family); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 }); // When options.all is true, the result will be an Array. options.all = true; await dnsPromises.lookup('example.org', options).then((result) => { console.log('addresses: %j', result); // addresses: [{"address":"2606:2800:21f:cb07:6820:80da:af6b:8b2c","family":6}] }); ``` ```cjs const dns = require('node:dns'); const dnsPromises = dns.promises; const options = { family: 6, hints: dns.ADDRCONFIG | dns.V4MAPPED, }; dnsPromises.lookup('example.org', options).then((result) => { console.log('address: %j family: IPv%s', result.address, result.family); // address: "2606:2800:21f:cb07:6820:80da:af6b:8b2c" family: IPv6 }); // When options.all is true, the result will be an Array. options.all = true; dnsPromises.lookup('example.org', options).then((result) => { console.log('addresses: %j', result); // addresses: [{"address":"2606:2800:21f:cb07:6820:80da:af6b:8b2c","family":6}] }); ``` ### `dnsPromises.lookupService(address, port)` \* `address` {string} \* `port` {number} Resolves the given `address` and `port` into a host name and service using the operating system's underlying `getnameinfo` implementation. If `address` is not a valid IP address, a `TypeError` will be thrown. The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` is the error code. ```mjs import dnsPromises from 'node:dns/promises'; const result = await dnsPromises.lookupService('127.0.0.1', 22); console.log(result.hostname, result.service); // Prints: localhost ssh ``` ```cjs const dnsPromises = require('node:dns').promises; dnsPromises.lookupService('127.0.0.1', 22).then((result) => { console.log(result.hostname, result.service); // Prints: localhost ssh }); ``` ### `dnsPromises.resolve(hostname[, rrtype])` \* `hostname` {string} Host name to resolve. \* `rrtype` {string} Resource record type. \*\*Default:\*\* `'A'`. Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array of the resource records. When successful, the `Promise` is resolved with an array of resource records. The type and structure of individual results vary based on `rrtype`: | `rrtype` | `records` contains | Result type | Shorthand method | | --------- | ------------------------------ | ----------- | -------------------------------- | | `'A'` | IPv4 addresses (default) | {string} | [`dnsPromises.resolve4()`][] | | `'AAAA'` | IPv6 addresses | {string} | [`dnsPromises.resolve6()`][] | | `'ANY'` | any records | {Object} | [`dnsPromises.resolveAny()`][] | | `'CAA'` | CA authorization records | {Object} | [`dnsPromises.resolveCaa()`][] | | `'CNAME'` | canonical name records | {string} | [`dnsPromises.resolveCname()`][] | | `'MX'` | mail exchange records | {Object} | [`dnsPromises.resolveMx()`][] | | `'NAPTR'` | name authority pointer records | {Object} | [`dnsPromises.resolveNaptr()`][] | | `'NS'` | name server records | {string} | [`dnsPromises.resolveNs()`][] | | `'PTR'` | pointer records | {string} | [`dnsPromises.resolvePtr()`][] | | `'SOA'` | start of authority records | {Object} | [`dnsPromises.resolveSoa()`][] | | `'SRV'` | service records | {Object} | [`dnsPromises.resolveSrv()`][] | | `'TLSA'` | certificate associations | {Object} | [`dnsPromises.resolveTlsa()`][] | | `'TXT'` | text records | {string\[]} | [`dnsPromises.resolveTxt()`][] | On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` is one of the [DNS error codes][]. ### `dnsPromises.resolve4(hostname[, options])` \* `hostname` {string} Host name to resolve. \* `options` {Object} \* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. Uses the 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} \* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each | 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.045276835560798645,
0.023747645318508148,
-0.00015135139983613044,
-0.09340956062078476,
-0.006112547125667334,
0.03281569480895996,
-0.09475032240152359,
0.06565456837415695,
0.012929090298712254,
0.038775909692049026,
-0.07341131567955017,
-0.030648963525891304,
-0.003829661989584565,
-0.014834895730018616,
0.06133938208222389,
0.042127590626478195,
0.013400882482528687,
0.07619849592447281,
0.028273893520236015,
-0.047622814774513245,
-0.031092453747987747,
0.006769686006009579,
0.14524351060390472,
-0.03931916877627373,
0.03453194722533226,
-0.053484268486499786,
-0.036807525902986526,
0.08659449964761734,
0.08812566846609116,
0.09976916015148163,
-0.06910960376262665,
0.08225051313638687,
0.04863069951534271,
-0.013062063604593277,
0.1056666299700737,
0.015422112308442593,
-0.027210639789700508,
0.0048430669121444225,
-0.06089571490883827,
0.008782817050814629,
-0.05274256691336632,
0.09136004745960236,
0.05521206930279732,
-0.0843772366642952,
-0.0668695718050003,
0.001904985518194735,
-0.01498064398765564,
0.0067050824873149395,
-0.05887971073389053,
0.07899411767721176,
-0.061499107629060745,
0.055237751454114914,
0.0012164876097813249,
-0.0015588265378028154,
0.13485898077487946,
0.02577279880642891,
0.08593455702066422,
-0.023311112076044083,
0.07135991007089615,
-0.03683433309197426,
-0.019016290083527565,
-0.08739165961742401,
-0.023076476529240608,
-0.03285135701298714,
-0.06402374058961868,
0.004171069711446762,
0.008624921552836895,
0.014121698215603828,
-0.029633453115820885,
0.014421834610402584,
0.06246240809559822,
-0.09585723280906677,
0.029062123969197273,
-0.028087040409445763,
-0.06645694375038147,
0.04615853726863861,
-0.013687416911125183,
-0.06826252490282059,
-0.12702690064907074,
-0.08469093590974808,
-0.004759409464895725,
0.02204252779483795,
0.08092864602804184,
0.027961943298578262,
0.0035791946575045586,
-0.05011948198080063,
0.0213642455637455,
0.0395875982940197,
-0.05290398374199867,
0.00244919303804636,
-0.0976557508111,
-0.0021130528766661882,
-0.0013045533560216427,
-0.011997757479548454,
0.02794456295669079,
0.004273883067071438,
0.10980746895074844,
0.003076795022934675,
0.03890072926878929,
0.012800600379705429,
-0.018952032551169395,
-0.01879454404115677,
-0.0880943164229393,
0.07402987033128738,
-0.04817819222807884,
0.03752633184194565,
0.014795633032917976,
0.046994417905807495,
0.06648746877908707,
0.0026196700055152178,
-0.05103559419512749,
0.002488359808921814,
-0.00825850386172533,
0.05162130296230316,
7.370833001707518e-33,
0.04804298281669617,
-0.013641360215842724,
0.030482428148388863,
0.00008832781168166548,
-0.004754624795168638,
-0.038470517843961716,
0.034390535205602646,
0.0316295251250267,
-0.15878473222255707,
0.04921729117631912,
-0.06942623853683472,
-0.018785076215863228,
0.06590992212295532,
-0.06345509737730026,
-0.04840865731239319,
0.025029942393302917,
0.1088879406452179,
0.026123128831386566,
0.07274699956178665,
0.058685678988695145,
-0.02263365499675274,
-0.0006820300477556884,
0.06716770678758621,
0.005215806420892477,
0.046349991112947464,
-0.0524008609354496,
0.01973254419863224,
0.0482688844203949,
0.006919958163052797,
-0.08871660381555557,
0.07338782399892807,
0.05995173379778862,
-0.07783503830432892,
-0.01471962220966816,
0.10756400972604752,
-0.020315658301115036,
0.041559673845767975,
0.009159104898571968,
-0.13883142173290253,
-0.07798002660274506,
0.031600259244441986,
0.040503229945898056,
-0.09582925587892532,
0.04547194018959999,
0.014098691754043102,
-0.016098160296678543,
-0.014674581587314606,
-0.09257139265537262,
0.08708450943231583,
0.034423962235450745,
0.013711905106902122,
0.0010415866272524,
-0.0253324992954731,
-0.08794533461332321,
0.030583059415221214,
0.02696048654615879,
0.020664148032665253,
0.02550070732831955,
-0.007355401758104563,
0.027179231867194176,
-0.0241414625197649,
-0.11470820009708405,
-0.04116680845618248,
-0.0009876762051135302,
0.005900554358959198,
0.02061905711889267,
-0.01917596161365509,
-0.008311020210385323,
-0.02391081675887108,
0.007277525495737791,
0.03433441370725632,
0.0291941836476326,
0.028097542002797127,
0.031019732356071472,
0.010367215611040592,
-0.001228808076120913,
-0.08982693403959274,
-0.05522104352712631,
-0.014114274643361568,
-0.059267979115247726,
0.07011568546295166,
0.023495672270655632,
-0.0992809534072876,
0.08205030113458633,
-0.009938723407685757,
0.048839014023542404,
-0.023921625688672066,
-0.017618998885154724,
0.057349853217601776,
0.009165236726403236,
-0.0074151442386209965,
-0.003849767381325364,
-0.02018124610185623,
-0.014775577001273632,
-0.074738509953022,
-7.82879678458025e-33,
0.008545063436031342,
-0.014946332201361656,
-0.030641064047813416,
0.008913821540772915,
-0.03650100156664848,
-0.0414947085082531,
0.10527632385492325,
0.02020549774169922,
0.04125102236866951,
-0.019220102578401566,
-0.002349860966205597,
0.013394094072282314,
0.11856004595756531,
-0.04388514906167984,
0.0032215905375778675,
0.08057475090026855,
-0.036345213651657104,
-0.0472027026116848,
0.01534943375736475,
-0.05520210787653923,
-0.03461616113781929,
0.021412566304206848,
-0.04376620426774025,
-0.017780741676688194,
-0.05478215217590332,
0.02165684849023819,
0.01554973516613245,
0.029539290815591812,
-0.06042507663369179,
-0.09619688242673874,
-0.0019384217448532581,
0.005091886501759291,
-0.06402675062417984,
0.09601514041423798,
0.020674651488661766,
0.032472506165504456,
0.01259338017553091,
0.08301343768835068,
0.03266476094722748,
-0.07069692015647888,
0.0089172488078475,
0.015883132815361023,
-0.0633300244808197,
0.01416997890919447,
0.006195756606757641,
0.0032875656615942717,
0.041664570569992065,
0.074985072016716,
0.02120320498943329,
0.0366472490131855,
0.01876814477145672,
-0.09856162965297699,
-0.08375904709100723,
0.053607773035764694,
0.05807386711239815,
-0.031569842249155045,
0.014074872247874737,
-0.04041542112827301,
0.05928340181708336,
0.05428243800997734,
-0.004898502491414547,
-0.16659857332706451,
-0.03396647796034813,
0.11959782242774963,
-0.007488630712032318,
0.0525473952293396,
-0.12175805866718292,
-0.0010184334823861718,
0.10286858677864075,
-0.00044649181654676795,
0.02007037028670311,
-0.010468707419931889,
-0.02875450998544693,
-0.0379643552005291,
0.06972427666187286,
-0.01837056688964367,
0.06447643786668777,
-0.015458020381629467,
-0.03287922590970993,
0.09317763149738312,
-0.07784071564674377,
0.007227958645671606,
0.0011408500140532851,
0.01619299128651619,
0.05045732855796814,
0.04315103217959404,
0.08327443152666092,
0.03000509738922119,
-0.01108772587031126,
0.06654872745275497,
0.0013648730237036943,
0.019552914425730705,
-0.03569512441754341,
-0.023000245913863182,
-0.04277004301548004,
-5.56926664785351e-8,
-0.04470546916127205,
-0.0028113052248954773,
-0.03708638995885849,
-0.0325213223695755,
-0.003263755002990365,
-0.014706972986459732,
0.07903836667537689,
0.0011346781393513083,
0.011899068020284176,
0.016612067818641663,
-0.03325838968157768,
-0.019579008221626282,
-0.03710697218775749,
-0.028684409335255623,
0.043439216911792755,
-0.0411527045071125,
0.04484610632061958,
0.01949932985007763,
-0.048702653497457504,
0.011956018395721912,
0.008987709879875183,
-0.00867552775889635,
-0.056006040424108505,
-0.005213393829762936,
0.03467540815472603,
-0.04567638784646988,
0.03630697727203369,
-0.0037089872639626265,
-0.026632186025381088,
0.037146858870983124,
-0.05820079892873764,
0.028869636356830597,
0.035268478095531464,
-0.029641050845384598,
0.0012600841000676155,
0.03221776336431503,
0.030983658507466316,
0.030673256143927574,
0.08411276340484619,
0.02483549900352955,
0.021486349403858185,
-0.017050044611096382,
-0.015926754102110863,
0.015290115028619766,
-0.043785952031612396,
-0.02005440555512905,
0.008934715762734413,
0.014047707431018353,
0.044611647725105286,
-0.059625592082738876,
-0.04056093841791153,
-0.03640960901975632,
-0.05928550288081169,
0.011624552309513092,
-0.007174222264438868,
-0.031849704682826996,
-0.06224223971366882,
-0.09924931079149246,
-0.029644297435879707,
0.03765569627285004,
0.08271624892950058,
-0.042927924543619156,
-0.02793794684112072,
-0.012725405395030975
] | 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} \* `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds. Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 addresses. ### `dnsPromises.resolveAny(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve all records (also known as `ANY` or `\*` query). On success, the `Promise` is resolved with an array containing various types of records. Each object has a property `type` that indicates the type of the current record. And depending on the `type`, additional properties will be present on the object: | Type | Properties | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `'A'` | `address`/`ttl` | | `'AAAA'` | `address`/`ttl` | | `'CAA'` | Refer to [`dnsPromises.resolveCaa()`][] | | `'CNAME'` | `value` | | `'MX'` | Refer to [`dnsPromises.resolveMx()`][] | | `'NAPTR'` | Refer to [`dnsPromises.resolveNaptr()`][] | | `'NS'` | `value` | | `'PTR'` | `value` | | `'SOA'` | Refer to [`dnsPromises.resolveSoa()`][] | | `'SRV'` | Refer to [`dnsPromises.resolveSrv()`][] | | `'TLSA'` | Refer to [`dnsPromises.resolveTlsa()`][] | | `'TXT'` | This type of record contains an array property called `entries` which refers to [`dnsPromises.resolveTxt()`][], e.g. `{ entries: ['...'], type: 'TXT' }` | Here is an example of the result object: ```js [ { type: 'A', address: '127.0.0.1', ttl: 299 }, { type: 'CNAME', value: 'example.com' }, { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, { type: 'NS', value: 'ns1.example.com' }, { type: 'TXT', entries: [ 'v=spf1 include:\_spf.example.com ~all' ] }, { type: 'SOA', nsname: 'ns1.example.com', hostmaster: 'admin.example.com', serial: 156696742, refresh: 900, retry: 900, expire: 1800, minttl: 60 } ] ``` ### `dnsPromises.resolveCaa(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, the `Promise` is resolved with an array of objects containing available certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). ### `dnsPromises.resolveCname(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, the `Promise` is resolved with an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). ### `dnsPromises.resolveMx(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). ### `dnsPromises.resolveNaptr(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with the following properties: \* `flags` \* `service` \* `regexp` \* `replacement` \* `order` \* `preference` ```js { flags: 's', service: 'SIP+D2U', regexp: '', replacement: '\_sip.\_udp.example.com', order: 30, preference: 100 } ``` ### `dnsPromises.resolveNs(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of 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 reply records. ### `dnsPromises.resolveSoa(hostname)` \* `hostname` {string} Uses the DNS | 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.0009809361072257161,
0.027371341362595558,
-0.03280768543481827,
-0.0880478098988533,
0.001412533107213676,
-0.030088763684034348,
-0.08975844830274582,
0.08012117445468903,
0.08420149236917496,
0.007787104230374098,
-0.029643291607499123,
-0.08896476775407791,
0.05056473985314369,
-0.05357024446129799,
0.03292384743690491,
0.0606546513736248,
0.021865300834178925,
0.0015423813601955771,
0.03814302384853363,
-0.08156804740428925,
0.03507864847779274,
-0.06218615919351578,
0.0652816891670227,
0.02433556318283081,
0.020437508821487427,
-0.05172938480973244,
-0.008835917338728905,
0.17110368609428406,
0.02541321888566017,
0.048953305929899216,
-0.020008141174912453,
-0.0032266259659081697,
0.03157997131347656,
-0.008603089489042759,
0.08802381157875061,
-0.02837054431438446,
-0.050467513501644135,
-0.026907077059149742,
0.014548581093549728,
-0.006295134779065847,
0.036662910133600235,
0.07187157869338989,
0.0405745655298233,
-0.08452431857585907,
-0.045664601027965546,
0.026669971644878387,
0.05458971858024597,
-0.03229214996099472,
-0.050060518085956573,
0.029962370172142982,
0.02711283229291439,
0.024928374215960503,
-0.07431834936141968,
0.045317742973566055,
0.041437435895204544,
-0.0010067474795505404,
0.05754322558641434,
-0.059697363525629044,
0.046136438846588135,
-0.029479563236236572,
-0.000424074794864282,
-0.02300470881164074,
-0.015224641188979149,
-0.002399207092821598,
-0.07847356796264648,
-0.00891690794378519,
-0.026557933539152145,
0.05400676280260086,
-0.03935064747929573,
-0.00453090900555253,
0.06473226100206375,
-0.07732411473989487,
-0.05449682101607323,
-0.016438936814665794,
-0.013739227317273617,
0.039012957364320755,
0.0072161429561674595,
-0.05511102080345154,
-0.08293093740940094,
-0.043318212032318115,
-0.033996425569057465,
0.008605245500802994,
0.08859129250049591,
0.05137169361114502,
-0.026463983580470085,
-0.005660542752593756,
0.015266899019479752,
0.052382081747055054,
-0.026056816801428795,
-0.028297826647758484,
-0.05687917768955231,
0.009730638936161995,
0.015947602689266205,
-0.059447720646858215,
0.009444531984627247,
-0.016337474808096886,
0.106814444065094,
-0.023305807262659073,
0.02846595086157322,
0.07793339341878891,
-0.03934911638498306,
-0.07108922302722931,
-0.00998512003570795,
-0.05395049601793289,
-0.014021821320056915,
0.08242205530405045,
-0.05855425074696541,
0.02782970480620861,
0.06423832476139069,
0.07205204665660858,
-0.0539737232029438,
-0.0061098611913621426,
0.012388691306114197,
0.06782369315624237,
1.5043858234033592e-33,
0.04913616552948952,
-0.0014838051283732057,
-0.017322195693850517,
-0.030536510050296783,
0.004597614519298077,
0.01944681443274021,
0.042880527675151825,
0.08090399205684662,
-0.0747096911072731,
0.03818574175238609,
-0.054861463606357574,
-0.01834956370294094,
0.031094325706362724,
-0.09335515648126602,
0.013609745539724827,
0.09608332812786102,
0.07645530253648758,
0.06302565336227417,
0.015147289261221886,
0.16499362885951996,
0.03836736083030701,
0.02009301632642746,
0.05694684758782387,
0.02243790216743946,
0.047531090676784515,
-0.016951749101281166,
-0.03213679417967796,
0.018791111186146736,
-0.02544579654932022,
-0.059857629239559174,
0.05270916596055031,
0.00828288123011589,
-0.037264857441186905,
-0.008657785132527351,
0.1316075623035431,
0.03486572206020355,
0.03529534116387367,
-0.00851669441908598,
-0.109037846326828,
-0.024257976561784744,
-0.009952330961823463,
0.01669621281325817,
-0.12268994003534317,
0.043734144419431686,
-0.022752828896045685,
-0.07071848958730698,
-0.04992665722966194,
-0.037623003125190735,
0.06733672320842743,
0.06091969832777977,
0.030251121148467064,
0.015059489756822586,
-0.04497838765382767,
-0.11122909933328629,
0.04033305495977402,
-0.037041984498500824,
0.028304902836680412,
0.06323354691267014,
0.020184870809316635,
0.06576327234506607,
-0.015727847814559937,
-0.11845137923955917,
-0.05574706941843033,
-0.018287399783730507,
0.031326621770858765,
0.04336247593164444,
0.028163854032754898,
0.011699605733156204,
-0.006299417465925217,
0.02781703881919384,
0.06905954331159592,
0.03996656462550163,
0.049402475357055664,
-0.0021676216274499893,
-0.006034247111529112,
0.023463072255253792,
-0.05687757954001427,
-0.08083759993314743,
-0.0063141118735075,
-0.02277798391878605,
0.060042064636945724,
-0.003996437881141901,
-0.09281542152166367,
0.13165809214115143,
-0.0424613319337368,
0.048647191375494,
-0.006475618574768305,
-0.0001371758698951453,
-0.01184361707419157,
-0.045442257076501846,
-0.03820722922682762,
0.002079952973872423,
0.02018354833126068,
-0.08725924044847488,
-0.05425595864653587,
-3.542100229601506e-33,
0.05497545748949051,
-0.014722172170877457,
-0.050614021718502045,
0.08214045315980911,
-0.027836881577968597,
-0.08505059778690338,
0.07367740571498871,
0.0697382241487503,
-0.0015772279584780335,
-0.09158360213041306,
0.026319004595279694,
-0.018267178907990456,
0.05789807811379433,
-0.04168856516480446,
0.024794815108180046,
0.06094301864504814,
-0.03217919543385506,
-0.09537355601787567,
0.008210932835936546,
-0.024723101407289505,
-0.0048139519058167934,
0.033840712159872055,
-0.08468559384346008,
0.029528986662626266,
0.01364066544920206,
-0.033627934753894806,
0.0485321469604969,
-0.01748410426080227,
-0.06473825126886368,
-0.05932004004716873,
0.026910288259387016,
-0.0328233502805233,
-0.058590009808540344,
0.01580622047185898,
-0.01913539506494999,
0.06727487593889236,
0.04641776904463768,
0.048640843480825424,
0.02638201415538788,
-0.023156335577368736,
0.06110572814941406,
-0.009829751215875149,
-0.08083482086658478,
0.030260510742664337,
-0.0041351113468408585,
-0.0037439540028572083,
-0.03718968853354454,
0.07327631860971451,
0.025528831407427788,
0.018736818805336952,
0.08004987239837646,
-0.08504599332809448,
-0.03638472408056259,
0.014049123041331768,
0.048917509615421295,
-0.026882493868470192,
-0.03747960180044174,
-0.07685117423534393,
0.05832822993397713,
0.03759543225169182,
0.015504463575780392,
-0.12967683374881744,
0.036549173295497894,
0.10132856667041779,
0.0011897782096639276,
0.07113384455442429,
-0.05782531201839447,
-0.021528778597712517,
0.030305486172437668,
-0.03806834667921066,
0.050816453993320465,
-0.04331047460436821,
-0.02727814018726349,
0.014262489974498749,
0.04633120819926262,
-0.03507692739367485,
0.02615504153072834,
-0.02250835858285427,
-0.00923367589712143,
0.10935553908348083,
-0.10006853193044662,
0.07686445862054825,
-0.005052481312304735,
0.015614185482263565,
0.03713752701878548,
0.026014622300863266,
0.09325601905584335,
0.07728331536054611,
-0.031213879585266113,
0.08618738502264023,
0.006888720206916332,
0.08715886622667313,
-0.05482368543744087,
0.006033448036760092,
-0.040882717818021774,
-5.170688410771618e-8,
-0.048353083431720734,
0.0012245309771969914,
-0.07257211208343506,
-0.026356371119618416,
-0.03379875794053078,
0.07892024517059326,
0.02091430127620697,
-0.041957344859838486,
0.03932663053274155,
-0.027026178315281868,
0.039319511502981186,
-0.01604650355875492,
-0.01595279946923256,
-0.015524789690971375,
0.05163804814219475,
0.013768821954727173,
-0.0007396641303785145,
-0.05842229723930359,
-0.0598461851477623,
-0.07003621011972427,
-0.018961206078529358,
-0.00461208401247859,
-0.05858640745282173,
-0.0842357650399208,
-0.00578768365085125,
-0.04490379989147186,
0.07867921143770218,
0.06067696586251259,
-0.023327115923166275,
0.018677568063139915,
-0.09599205106496811,
-0.007653771433979273,
0.02752785198390484,
-0.01904750056564808,
0.04396302253007889,
0.011761890724301338,
-0.02133977599442005,
-0.01712813787162304,
0.03211699798703194,
-0.010634149424731731,
-0.025162529200315475,
-0.004952810239046812,
-0.06475046277046204,
0.0030712781008332968,
0.004387731198221445,
-0.0246789138764143,
-0.011111855506896973,
0.03916175663471222,
0.06412667781114578,
-0.03018096089363098,
-0.026708116754889488,
-0.011261564679443836,
-0.01838604547083378,
0.020756227895617485,
-0.03688513860106468,
0.007500882726162672,
-0.03935965895652771,
-0.13027241826057434,
0.00453416770324111,
-0.0035620362032204866,
0.06012974679470062,
-0.022659415379166603,
-0.013247044757008553,
0.0011264113709330559
] | 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 reply records. ### `dnsPromises.resolveSoa(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve a start of authority record (`SOA` record) for the `hostname`. On success, the `Promise` is resolved with an object with the following properties: \* `nsname` \* `hostmaster` \* `serial` \* `refresh` \* `retry` \* `expire` \* `minttl` ```js { nsname: 'ns.example.com', hostmaster: 'root.example.com', serial: 2013101809, refresh: 10000, retry: 2400, expire: 604800, minttl: 3600 } ``` ### `dnsPromises.resolveSrv(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with the following properties: \* `priority` \* `weight` \* `port` \* `name` ```js { priority: 10, weight: 5, port: 21223, name: 'service.example.com' } ``` ### `dnsPromises.resolveTlsa(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve certificate associations (`TLSA` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with these properties: \* `certUsage` \* `selector` \* `match` \* `data` ```js { certUsage: 3, selector: 1, match: 1, data: [ArrayBuffer] } ``` ### `dnsPromises.resolveTxt(hostname)` \* `hostname` {string} Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array of the text records available for `hostname` (e.g. `[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of one record. Depending on the use case, these could be either joined together or treated separately. ### `dnsPromises.reverse(ip)` \* `ip` {string} Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of host names. On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` is one of the [DNS error codes][]. ### `dnsPromises.setDefaultResultOrder(order)` \* `order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. Set the default value of `order` in [`dns.lookup()`][] and [`dnsPromises.lookup()`][]. The value could be: \* `ipv4first`: sets default `order` to `ipv4first`. \* `ipv6first`: sets default `order` to `ipv6first`. \* `verbatim`: sets default `order` to `verbatim`. The default is `verbatim` and [`dnsPromises.setDefaultResultOrder()`][] have higher priority than [`--dns-result-order`][]. When using [worker threads][], [`dnsPromises.setDefaultResultOrder()`][] from the main thread won't affect the default dns orders in workers. ### `dnsPromises.getDefaultResultOrder()` Get the value of `dnsOrder`. ### `dnsPromises.setServers(servers)` \* `servers` {string\[]} array of [RFC 5952][] formatted addresses Sets the IP address and port of servers to be used when performing DNS resolution. The `servers` argument is an array of [RFC 5952][] formatted addresses. If the port is the IANA default DNS port (53) it can be omitted. ```js dnsPromises.setServers([ '8.8.8.8', '[2001:4860:4860::8888]', '8.8.8.8:1053', '[2001:4860:4860::8888]:1053', ]); ``` An error will be thrown if an invalid address is provided. The `dnsPromises.setServers()` method must not be called while a DNS query is in progress. This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will \_not\_ attempt to resolve with subsequent servers provided. Fallback DNS servers will only be used if the earlier ones time out or result in some other error. ## Error codes Each DNS query can return one of the following 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`: DNS server refused query. \* | 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.03942904248833656,
0.03146480396389961,
-0.006499378476291895,
-0.06131604313850403,
-0.02528926357626915,
0.015182225964963436,
-0.0707511156797409,
0.08603883534669876,
0.036508288234472275,
-0.011006614193320274,
-0.010718551464378834,
-0.05387823283672333,
0.014021643437445164,
-0.08297346532344818,
0.023348750546574593,
-0.0028746183961629868,
-0.0022197768557816744,
0.04300761595368385,
0.004930115770548582,
-0.08134397864341736,
0.04572584852576256,
-0.014378705993294716,
0.09248200058937073,
-0.025204503908753395,
0.05407392978668213,
-0.05717295780777931,
-0.08840111643075943,
0.12613098323345184,
0.057951055467128754,
0.030135421082377434,
-0.007191173732280731,
0.02957073785364628,
0.05767478793859482,
-0.008498303592205048,
0.07949646562337875,
-0.07115358859300613,
-0.026651890948414803,
-0.01219575572758913,
0.002926415530964732,
-0.016794631257653236,
0.06800320744514465,
0.06671269983053207,
0.08608511835336685,
-0.04062919691205025,
0.014361866749823093,
0.04015582799911499,
0.08152776956558228,
-0.012859653681516647,
-0.01872178353369236,
-0.03173426166176796,
-0.043722569942474365,
0.03539695590734482,
-0.08282258361577988,
0.002014780417084694,
0.02828817628324032,
-0.013763277791440487,
0.04033062979578972,
0.000005445389433589298,
0.026099788025021553,
-0.012359480373561382,
-0.012623785063624382,
-0.008404291234910488,
-0.051938850432634354,
-0.04385810345411301,
-0.014208664186298847,
-0.048667553812265396,
-0.02999340556561947,
0.042435675859451294,
-0.005570483859628439,
0.016344117000699043,
0.059863872826099396,
-0.058450378477573395,
0.006416540592908859,
-0.013267435133457184,
-0.03203407675027847,
0.032419055700302124,
0.006081951316446066,
-0.01919841766357422,
-0.11601018160581589,
-0.012264971621334553,
0.007603074423968792,
-0.010104391723871231,
0.04275665059685707,
0.09659457206726074,
0.0011765003437176347,
0.0016437857411801815,
0.006808821111917496,
0.07487370073795319,
0.012649882584810257,
0.018552249297499657,
-0.054539963603019714,
-0.004637426231056452,
0.01603664644062519,
-0.036927834153175354,
-0.008359774015843868,
0.01461334154009819,
0.08510314673185349,
-0.03507278114557266,
0.057749949395656586,
0.03576686605811119,
-0.06115376204252243,
-0.06092357635498047,
-0.029494311660528183,
-0.0654548853635788,
0.019394472241401672,
0.07106468826532364,
-0.08079607039690018,
0.040236711502075195,
0.017267528921365738,
-0.019381403923034668,
-0.03757571801543236,
-0.009097669273614883,
0.004951526876538992,
0.047063086181879044,
4.120786914961702e-33,
0.02821408398449421,
-0.02482643723487854,
-0.03371730074286461,
-0.03812909871339798,
0.010730692185461521,
0.0317598320543766,
0.038334645330905914,
0.08170438557863235,
-0.028717175126075745,
0.038981180638074875,
0.007518939208239317,
-0.010089357383549213,
0.007309222128242254,
-0.12408195436000824,
-0.04581621661782265,
0.08275292068719864,
0.07848694920539856,
0.03984924405813217,
0.07104600965976715,
0.1360192894935608,
-0.0032342877238988876,
0.017678024247288704,
0.0003758916864171624,
0.02535165287554264,
0.0230319332331419,
0.003976558800786734,
-0.0030827224254608154,
-0.018981928005814552,
0.009336215443909168,
-0.05229126289486885,
0.04276996850967407,
-0.044478289783000946,
-0.04566728323698044,
-0.024847431108355522,
0.09445206820964813,
0.041942548006772995,
0.07821591943502426,
-0.04275427758693695,
-0.13615746796131134,
-0.030329156666994095,
0.030179068446159363,
0.04831188544631004,
-0.1394839584827423,
0.08102022856473923,
-0.011308741755783558,
-0.07045436650514603,
-0.06947479397058487,
-0.02825506031513214,
0.08427070826292038,
0.05073119327425957,
-0.021597102284431458,
-0.012659686617553234,
-0.017494317144155502,
-0.05257309228181839,
0.059764984995126724,
0.03379196673631668,
0.011201102286577225,
0.01715782843530178,
-0.0543433241546154,
-0.0004677636898122728,
-0.005372373852878809,
-0.14513874053955078,
-0.11616434156894684,
-0.04892543703317642,
0.019089562818408012,
0.03225118666887283,
-0.009189697913825512,
-0.03304200991988182,
-0.012386572547256947,
0.05416572466492653,
0.002090542810037732,
0.038981303572654724,
0.030561747029423714,
0.05465860292315483,
0.01428371760994196,
0.023374482989311218,
-0.08295737951993942,
-0.021015852689743042,
0.006231272593140602,
-0.044036317616701126,
0.01960352249443531,
0.041624102741479874,
-0.11544783413410187,
0.15896737575531006,
0.0014310784172266722,
0.06506519019603729,
0.005852228030562401,
-0.03392910212278366,
-0.06175771728157997,
-0.025477027520537376,
0.007029995322227478,
-0.03969865292310715,
0.03139612078666687,
0.0012419234262779355,
-0.11813781410455704,
-5.5105511107358456e-33,
0.04842037707567215,
-0.034201543778181076,
-0.051805708557367325,
0.05975709483027458,
-0.015148934908211231,
-0.025421174243092537,
0.004262962378561497,
0.08457397669553757,
0.0021239351481199265,
-0.08919276297092438,
-0.011997588910162449,
-0.03070175275206566,
0.06398773193359375,
0.007332113571465015,
0.05044246464967728,
0.11261952668428421,
-0.039092980325222015,
-0.025602074339985847,
-0.05782639607787132,
-0.00730524118989706,
0.00436882209032774,
0.05263533443212509,
-0.011964586563408375,
0.05748689919710159,
-0.05434601008892059,
-0.012202955782413483,
-0.006221476476639509,
0.028175586834549904,
-0.04476364329457283,
-0.049464382231235504,
0.08146943151950836,
-0.03387506306171417,
-0.09571295976638794,
0.03302587941288948,
-0.00910378247499466,
0.03996668756008148,
0.00026353317662142217,
0.04374168813228607,
-0.052595604211091995,
-0.019260821864008904,
0.06272701174020767,
-0.00021584887872450054,
-0.07208225876092911,
0.060094114392995834,
-0.01307736150920391,
-0.026294132694602013,
-0.03517693653702736,
0.09269339591264725,
0.042263541370630264,
0.036455363035202026,
0.03600020706653595,
-0.14447420835494995,
-0.05246148258447647,
-0.05668025463819504,
0.03389327600598335,
-0.03137419745326042,
0.015666157007217407,
-0.01806100271642208,
0.03856324031949043,
0.018080541864037514,
0.03903951123356819,
-0.09403790533542633,
-0.029406916350126266,
0.12648238241672516,
-0.02596532180905342,
0.0389273427426815,
-0.054756127297878265,
0.005887656006962061,
0.10674889385700226,
0.005682061426341534,
0.03187214583158493,
-0.017527537420392036,
-0.01796470768749714,
-0.026609743013978004,
0.043510884046554565,
0.03163272887468338,
0.003904252778738737,
-0.088284932076931,
-0.014590158127248287,
0.10797077417373657,
-0.03891295567154884,
0.12457823753356934,
0.03258586674928665,
0.03126528486609459,
0.04973269999027252,
0.029645349830389023,
0.08186332881450653,
0.07655397057533264,
-0.036809131503105164,
0.05577852949500084,
0.04064258188009262,
0.02784261852502823,
-0.018218714743852615,
-0.0017037730431184173,
-0.06121702864766121,
-4.90623754956232e-8,
-0.05823464319109917,
-0.030846932902932167,
-0.0666460394859314,
-0.025731878355145454,
-0.014245880767703056,
0.05633341148495674,
0.03779999539256096,
-0.004184257239103317,
-0.019920410588383675,
-0.005022001918405294,
0.033511530607938766,
-0.0003089217352680862,
-0.02761191315948963,
0.001461088191717863,
0.04072707146406174,
-0.0102296844124794,
0.06636558473110199,
0.057753387838602066,
-0.07050511240959167,
-0.07725048065185547,
-0.04215098172426224,
-0.00856856256723404,
-0.05537722259759903,
-0.1032085046172142,
-0.020080287009477615,
-0.059858229011297226,
0.0745328739285469,
0.04638039320707321,
-0.034283120185136795,
0.03801770508289337,
-0.05311012640595436,
0.016695743426680565,
0.10965883731842041,
-0.03239009901881218,
0.018479488790035248,
-0.018375078216195107,
0.020418493077158928,
-0.0018978227162733674,
0.04403334856033325,
-0.04826982319355011,
-0.00410288292914629,
0.010101476684212685,
-0.02698332630097866,
0.047357454895973206,
0.020801449194550514,
-0.004639016464352608,
0.022493647411465645,
0.053543735295534134,
0.08338646590709686,
-0.07479815185070038,
-0.05410044267773628,
-0.04569940268993378,
0.017618244513869286,
-0.017248516902327538,
-0.04295596852898598,
-0.022547205910086632,
-0.06777800619602203,
-0.023771226406097412,
0.012801362201571465,
-0.059508636593818665,
0.027468083426356316,
0.0053305490873754025,
-0.0015448675258085132,
0.03544089198112488
] | 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`: DNS server refused query. \* `dns.BADQUERY`: Misformatted DNS query. \* `dns.BADNAME`: Misformatted host name. \* `dns.BADFAMILY`: Unsupported address family. \* `dns.BADRESP`: Misformatted DNS reply. \* `dns.CONNREFUSED`: Could not contact DNS servers. \* `dns.TIMEOUT`: Timeout while contacting DNS servers. \* `dns.EOF`: End of file. \* `dns.FILE`: Error reading file. \* `dns.NOMEM`: Out of memory. \* `dns.DESTRUCTION`: Channel is being destroyed. \* `dns.BADSTR`: Misformatted string. \* `dns.BADFLAGS`: Illegal flags specified. \* `dns.NONAME`: Given host name is not numeric. \* `dns.BADHINTS`: Illegal hints flags specified. \* `dns.NOTINITIALIZED`: c-ares library initialization not yet performed. \* `dns.LOADIPHLPAPI`: Error loading `iphlpapi.dll`. \* `dns.ADDRGETNETWORKPARAMS`: Could not find `GetNetworkParams` function. \* `dns.CANCELLED`: DNS query cancelled. The `dnsPromises` API also exports the above error codes, e.g., `dnsPromises.NODATA`. ## Implementation considerations Although [`dns.lookup()`][] and the various `dns.resolve\*()/dns.reverse()` functions have the same goal of associating a network name with a network address (or vice versa), their behavior is quite different. These differences can have subtle but significant consequences on the behavior of Node.js programs. ### `dns.lookup()` Under the hood, [`dns.lookup()`][] uses the same operating system facilities as most other programs. For instance, [`dns.lookup()`][] will almost always resolve a given name the same way as the `ping` command. On most POSIX-like operating systems, the behavior of the [`dns.lookup()`][] function can be modified by changing settings in nsswitch.conf(5) and/or resolv.conf(5), but changing these files will change the behavior of all other programs running on the same operating system. Though the call to `dns.lookup()` will be asynchronous from JavaScript's perspective, it is implemented as a synchronous call to getaddrinfo(3) that runs on libuv's threadpool. This can have surprising negative performance implications for some applications, see the [`UV\_THREADPOOL\_SIZE`][] documentation for more information. Various networking APIs will call `dns.lookup()` internally to resolve host names. If that is an issue, consider resolving the host name to an address using `dns.resolve()` and using the address instead of a host name. Also, some networking APIs (such as [`socket.connect()`][] and [`dgram.createSocket()`][]) allow the default resolver, `dns.lookup()`, to be replaced. ### `dns.resolve()`, `dns.resolve\*()`, and `dns.reverse()` These functions are implemented quite differently than [`dns.lookup()`][]. They do not use getaddrinfo(3) and they \_always\_ perform a DNS query on the network. This network communication is always done asynchronously and does not use libuv's threadpool. As a result, these functions cannot have the same negative impact on other processing that happens on libuv's threadpool that [`dns.lookup()`][] can have. They do not use the same set of configuration files that [`dns.lookup()`][] uses. For instance, they do not use the configuration from `/etc/hosts`. [DNS error codes]: #error-codes [Domain Name System (DNS)]: https://en.wikipedia.org/wiki/Domain\_Name\_System [Implementation considerations section]: #implementation-considerations [RFC 5952]: https://tools.ietf.org/html/rfc5952#section-6 [RFC 8482]: https://tools.ietf.org/html/rfc8482 [`--dns-result-order`]: cli.md#--dns-result-orderorder [`Error`]: errors.md#class-error [`UV\_THREADPOOL\_SIZE`]: cli.md#uv\_threadpool\_sizesize [`dgram.createSocket()`]: dgram.md#dgramcreatesocketoptions-callback [`dns.getServers()`]: #dnsgetservers [`dns.lookup()`]: #dnslookuphostname-options-callback [`dns.resolve()`]: #dnsresolvehostname-rrtype-callback [`dns.resolve4()`]: #dnsresolve4hostname-options-callback [`dns.resolve6()`]: #dnsresolve6hostname-options-callback [`dns.resolveAny()`]: #dnsresolveanyhostname-callback [`dns.resolveCaa()`]: #dnsresolvecaahostname-callback [`dns.resolveCname()`]: #dnsresolvecnamehostname-callback [`dns.resolveMx()`]: #dnsresolvemxhostname-callback [`dns.resolveNaptr()`]: #dnsresolvenaptrhostname-callback [`dns.resolveNs()`]: #dnsresolvenshostname-callback [`dns.resolvePtr()`]: #dnsresolveptrhostname-callback [`dns.resolveSoa()`]: #dnsresolvesoahostname-callback [`dns.resolveSrv()`]: #dnsresolvesrvhostname-callback [`dns.resolveTlsa()`]: #dnsresolvetlsahostname-callback [`dns.resolveTxt()`]: #dnsresolvetxthostname-callback [`dns.reverse()`]: #dnsreverseip-callback [`dns.setDefaultResultOrder()`]: #dnssetdefaultresultorderorder [`dns.setServers()`]: #dnssetserversservers [`dnsPromises.getServers()`]: #dnspromisesgetservers [`dnsPromises.lookup()`]: #dnspromiseslookuphostname-options [`dnsPromises.resolve()`]: #dnspromisesresolvehostname-rrtype [`dnsPromises.resolve4()`]: #dnspromisesresolve4hostname-options [`dnsPromises.resolve6()`]: #dnspromisesresolve6hostname-options [`dnsPromises.resolveAny()`]: #dnspromisesresolveanyhostname [`dnsPromises.resolveCaa()`]: #dnspromisesresolvecaahostname [`dnsPromises.resolveCname()`]: #dnspromisesresolvecnamehostname [`dnsPromises.resolveMx()`]: #dnspromisesresolvemxhostname [`dnsPromises.resolveNaptr()`]: #dnspromisesresolvenaptrhostname [`dnsPromises.resolveNs()`]: #dnspromisesresolvenshostname [`dnsPromises.resolvePtr()`]: #dnspromisesresolveptrhostname [`dnsPromises.resolveSoa()`]: #dnspromisesresolvesoahostname [`dnsPromises.resolveSrv()`]: #dnspromisesresolvesrvhostname [`dnsPromises.resolveTlsa()`]: #dnspromisesresolvetlsahostname [`dnsPromises.resolveTxt()`]: #dnspromisesresolvetxthostname [`dnsPromises.reverse()`]: #dnspromisesreverseip [`dnsPromises.setDefaultResultOrder()`]: #dnspromisessetdefaultresultorderorder [`dnsPromises.setServers()`]: #dnspromisessetserversservers [`socket.connect()`]: net.md#socketconnectoptions-connectlistener [`util.promisify()`]: util.md#utilpromisifyoriginal [supported `getaddrinfo` flags]: #supported-getaddrinfo-flags [worker threads]: worker\_threads.md | 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.021792098879814148,
-0.02654409594833851,
-0.04827352985739708,
-0.07697330415248871,
0.011661195196211338,
0.038449861109256744,
0.040102824568748474,
-0.015431352891027927,
0.06198566406965256,
-0.0008507315651513636,
-0.06925908476114273,
-0.006040925160050392,
0.0026385062374174595,
-0.07532059401273727,
-0.008298341184854507,
0.011520632542669773,
-0.04590406268835068,
-0.005382711533457041,
0.03698304668068886,
-0.0036074717063456774,
-0.011704763397574425,
0.10776574164628983,
0.055396195501089096,
0.030801471322774887,
0.1384137123823166,
-0.12565411627292633,
-0.013707200065255165,
0.09799343347549438,
0.061659395694732666,
0.14691457152366638,
-0.01914258487522602,
0.029650747776031494,
0.048479899764060974,
0.03744824230670929,
0.033614952117204666,
-0.0025826937053352594,
-0.017736313864588737,
-0.0636661946773529,
0.008501509204506874,
0.07879555970430374,
-0.04522312432527542,
0.07498012483119965,
0.023618971928954124,
-0.036659419536590576,
0.007137492764741182,
0.004255881533026695,
-0.03933092579245567,
0.025248685851693153,
0.06571535766124725,
-0.00633785268291831,
-0.07260240614414215,
0.023193499073386192,
0.019338274374604225,
0.01656847447156906,
0.021971167996525764,
-0.040401432663202286,
0.048229750245809555,
-0.06429566442966461,
0.03977295011281967,
-0.05302184447646141,
0.016712993383407593,
-0.005235255230218172,
-0.015750562772154808,
0.03618023172020912,
-0.011800543405115604,
0.002576183993369341,
-0.06371418386697769,
0.00491169560700655,
-0.0417010635137558,
0.03146021068096161,
0.044589389115571976,
-0.08818448334932327,
-0.04100029170513153,
-0.019108060747385025,
-0.07738199830055237,
-0.016261154785752296,
-0.03670634329319,
-0.010459370911121368,
-0.034576691687107086,
0.018940508365631104,
-0.010032220743596554,
0.03690587729215622,
0.09233797341585159,
0.059852056205272675,
0.0477309413254261,
-0.07618097960948944,
-0.003636114066466689,
0.0506940558552742,
-0.03120739385485649,
0.0028729704208672047,
-0.11448892951011658,
-0.010696972720324993,
-0.0070894681848585606,
0.009818039834499359,
-0.02915957383811474,
0.10530479997396469,
0.045968666672706604,
-0.03344474360346794,
-0.030384482815861702,
0.006696791388094425,
-0.058187589049339294,
-0.007402410730719566,
-0.14919066429138184,
-0.0468076691031456,
0.019262725487351418,
-0.041555892676115036,
-0.03370410576462746,
-0.030482586473226547,
-0.00014151533832773566,
-0.03280080109834671,
-0.020011242479085922,
0.001830688794143498,
0.0056525408290326595,
0.03642117232084274,
8.949244204321469e-33,
0.03549811616539955,
-0.017151761800050735,
-0.03134359419345856,
-0.01644277758896351,
0.020584598183631897,
-0.06047757714986801,
0.03715290501713753,
0.027114009484648705,
-0.07617361098527908,
0.0419437438249588,
-0.03524012863636017,
-0.0688295066356659,
0.011438489891588688,
-0.04804055765271187,
0.03341357037425041,
0.012507111765444279,
0.09625960886478424,
-0.008921908214688301,
0.0032023745588958263,
0.039078760892152786,
-0.04160420224070549,
0.013365588150918484,
0.018149500712752342,
0.005578237120062113,
0.008309193886816502,
-0.023482222110033035,
-0.0534316822886467,
0.04097905382514,
0.03831303119659424,
-0.07148635387420654,
0.08205989003181458,
-0.04807901382446289,
-0.01766619272530079,
-0.00015338293451350182,
0.08580472320318222,
-0.012143225409090519,
0.05151433125138283,
0.0265448447316885,
-0.10108459740877151,
-0.05692386254668236,
-0.03301742672920227,
0.019687168300151825,
-0.0977506935596466,
0.07063129544258118,
0.09042799472808838,
-0.034016672521829605,
0.006776205729693174,
-0.10235200077295303,
0.024800507351756096,
0.0813690572977066,
0.002311487914994359,
-0.05186915025115013,
-0.005151947028934956,
-0.0018213310977444053,
0.014211148023605347,
0.10399968177080154,
-0.019496183842420578,
-0.011052322573959827,
0.01015738770365715,
0.026389408856630325,
0.022255821153521538,
-0.10098692774772644,
-0.04991001635789871,
-0.09503407776355743,
0.02831203304231167,
-0.06409519910812378,
0.02564261667430401,
0.03813458979129791,
-0.03191490098834038,
-0.02617785334587097,
0.012039002031087875,
0.006539348047226667,
0.05142735689878464,
0.04470155015587807,
-0.01996704190969467,
-0.0693105086684227,
-0.01626148447394371,
-0.06617359817028046,
-0.0484674908220768,
-0.03622264415025711,
0.0001945482799783349,
0.03346331790089607,
-0.04378272220492363,
0.016968151554465294,
-0.0274455975741148,
0.090639129281044,
0.035891853272914886,
0.036072541028261185,
0.04187175631523132,
-0.02099582925438881,
-0.038714926689863205,
-0.011849692091345787,
-0.05202252417802811,
-0.004058359656482935,
-0.023597117513418198,
-9.49195892583658e-33,
-0.021696092560887337,
-0.0022245883010327816,
-0.053356461226940155,
0.021410707384347916,
-0.009750833734869957,
0.007693534251302481,
0.06480623781681061,
0.11650875210762024,
0.10093089938163757,
-0.08397373557090759,
0.018693219870328903,
-0.034007977694272995,
0.0728273093700409,
-0.13118354976177216,
-0.02050049602985382,
0.11063428223133087,
-0.01115284115076065,
-0.04424919933080673,
-0.0680355504155159,
-0.021477408707141876,
0.010333932004868984,
0.10186274349689484,
-0.0724298283457756,
0.01807170920073986,
-0.10418036580085754,
0.05617807060480118,
0.0032988660968840122,
0.034735217690467834,
-0.05496736988425255,
0.031056202948093414,
0.1256726086139679,
0.08924926817417145,
-0.09671065211296082,
0.056586164981126785,
0.006431598216295242,
-0.014047713950276375,
0.018596835434436798,
-0.044557712972164154,
-0.02662045694887638,
-0.09578199684619904,
0.05714212357997894,
0.05604933947324753,
-0.00870636384934187,
0.008781877346336842,
0.005453132558614016,
-0.011154178529977798,
-0.008744814433157444,
0.02690982073545456,
-0.03607870638370514,
-0.0007244325242936611,
0.058492232114076614,
-0.1624019891023636,
0.02651306986808777,
0.02405073121190071,
0.038728173822164536,
0.08344271779060364,
0.0033989243675023317,
0.059593744575977325,
0.03207911550998688,
0.04796556383371353,
-0.006573937367647886,
-0.11184178292751312,
-0.12130087614059448,
0.06551425158977509,
0.022038474678993225,
0.13028335571289062,
-0.02793170139193535,
0.030690046027302742,
0.05756692960858345,
-0.030940882861614227,
-0.028334379196166992,
-0.025477690622210503,
0.0229157917201519,
-0.00249637383967638,
0.001181597588583827,
0.03666066378355026,
0.03577769175171852,
0.07399825751781464,
-0.04422279819846153,
0.10126548260450363,
-0.025479651987552643,
-0.0034579799976199865,
-0.030165795236825943,
0.039987098425626755,
-0.0025885857176035643,
-0.028722036629915237,
0.05087415501475334,
0.02612166292965412,
-0.051228150725364685,
0.0024582776241004467,
0.03252759575843811,
-0.01887374557554722,
0.06988408416509628,
0.03851643204689026,
0.04615839943289757,
-5.349694376377556e-8,
0.046426840126514435,
-0.009521177969872952,
-0.012629627250134945,
-0.06583578884601593,
0.0322943814098835,
0.0461883507668972,
0.02023836225271225,
-0.028296127915382385,
-0.06476388871669769,
-0.004503291565924883,
0.00790506973862648,
0.004855566192418337,
-0.10865169018507004,
-0.030592650175094604,
-0.00344860996119678,
-0.0402502603828907,
-0.015943000093102455,
0.09086422622203827,
-0.012246166355907917,
-0.05926387012004852,
0.019728176295757294,
-0.044598598033189774,
-0.09330587089061737,
-0.08400986343622208,
-0.01662040874361992,
-0.051953721791505814,
0.09487295895814896,
0.002531912876293063,
-0.027682701125741005,
0.0019086598185822368,
-0.05114949867129326,
0.01057019829750061,
0.0970839262008667,
-0.03299795091152191,
-0.0014642811147496104,
0.008081934414803982,
0.0500042550265789,
0.011988486163318157,
-0.017252542078495026,
-0.008182450197637081,
0.01266156230121851,
0.05141652747988701,
0.04063500463962555,
-0.005633996799588203,
-0.009679033420979977,
0.006667269393801689,
0.03699541464447975,
0.06864048540592194,
0.06027709320187569,
-0.10360059887170792,
-0.03283587843179703,
0.002387900836765766,
0.00826241821050644,
0.04768812656402588,
-0.01848009042441845,
0.026216881349682808,
-0.050806332379579544,
-0.027834191918373108,
-0.10450325161218643,
0.0052589294500648975,
0.03759417682886124,
0.009642449207603931,
-0.04224080964922905,
0.03319773077964783
] | 0.044579 |
[`dnsPromises.resolveSoa()`]: #dnspromisesresolvesoahostname [`dnsPromises.resolveSrv()`]: #dnspromisesresolvesrvhostname [`dnsPromises.resolveTlsa()`]: #dnspromisesresolvetlsahostname [`dnsPromises.resolveTxt()`]: #dnspromisesresolvetxthostname [`dnsPromises.reverse()`]: #dnspromisesreverseip [`dnsPromises.setDefaultResultOrder()`]: #dnspromisessetdefaultresultorderorder [`dnsPromises.setServers()`]: #dnspromisessetserversservers [`socket.connect()`]: net.md#socketconnectoptions-connectlistener [`util.promisify()`]: util.md#utilpromisifyoriginal [supported `getaddrinfo` flags]: #supported-getaddrinfo-flags [worker threads]: worker\_threads.md | 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.004672099836170673,
-0.010094041004776955,
-0.006433349102735519,
-0.02008143626153469,
-0.04576292261481285,
0.03414348140358925,
-0.04190293326973915,
-0.003745008260011673,
0.04958336427807808,
-0.010268539190292358,
-0.06842656433582306,
0.001878857845440507,
-0.01282546203583479,
-0.005084454081952572,
0.03603178262710571,
0.0020674301777035,
0.04323522746562958,
0.0696476548910141,
-0.05752471461892128,
-0.06778585910797119,
-0.005193929187953472,
0.020799869671463966,
0.07597986608743668,
0.000471547624329105,
0.04404935613274574,
-0.06569875031709671,
-0.047939032316207886,
0.1418752372264862,
0.009310833178460598,
0.062255896627902985,
-0.003498085541650653,
0.01701502501964569,
0.020260969176888466,
-0.04255026578903198,
0.03764576464891434,
-0.0010292588267475367,
-0.061787888407707214,
0.037287637591362,
0.018564030528068542,
-0.03450043126940727,
0.03204585239291191,
0.0701674371957779,
0.0769893154501915,
-0.04511867091059685,
0.02906663529574871,
0.004320411942899227,
-0.014200923964381218,
0.0297139473259449,
-0.003154088743031025,
-0.022889768704771996,
-0.051964953541755676,
-0.013264107517898083,
0.014140749350190163,
0.034751780331134796,
0.044929347932338715,
0.004725953564047813,
0.044975996017456055,
-0.07242395728826523,
0.08681812137365341,
-0.026767661795020103,
-0.05241358280181885,
0.004957166034728289,
0.016853496432304382,
0.04017945006489754,
-0.05267319455742836,
-0.07449069619178772,
-0.07111401110887527,
0.06639526784420013,
0.031861383467912674,
0.010922831483185291,
0.07822749018669128,
-0.05513148754835129,
0.020046183839440346,
-0.02750193141400814,
-0.04829731211066246,
0.05065261945128441,
-0.011005918495357037,
-0.026439838111400604,
-0.0755939781665802,
-0.1272488683462143,
0.021040091291069984,
-0.0046985941007733345,
0.07656567543745041,
0.010776848532259464,
0.015596522018313408,
-0.08648712933063507,
0.03458886593580246,
0.05887029320001602,
-0.015570874325931072,
-0.011384455487132072,
-0.07077865302562714,
0.02745484560728073,
-0.038494449108839035,
-0.027883319184184074,
0.021266590803861618,
0.0322740375995636,
0.08500570058822632,
-0.0254543274641037,
0.02748972363770008,
0.11385057866573334,
0.0019044415093958378,
-0.030801881104707718,
0.016271326690912247,
0.005370637867599726,
0.015408055856823921,
0.049188997596502304,
-0.023565253242850304,
0.009967943653464317,
-0.023233383893966675,
-0.0017002938548102975,
-0.0739622712135315,
-0.018266860395669937,
0.07100345194339752,
0.03690561279654503,
1.2283303239662538e-32,
0.03617582097649574,
-0.050713635981082916,
-0.01373918354511261,
0.01663845404982567,
0.020574595779180527,
0.016089139506220818,
0.06354694813489914,
0.05809052288532257,
-0.062298521399497986,
0.017850885167717934,
-0.0638066753745079,
-0.04921571537852287,
0.027897339314222336,
-0.10590317100286484,
-0.0976874902844429,
-0.01509531494230032,
0.07562687993049622,
0.0625370517373085,
0.0761789008975029,
0.09506682306528091,
-0.053570929914712906,
-0.03568834438920021,
0.04610661044716835,
-0.039369236677885056,
0.005154052749276161,
-0.006126973312348127,
-0.008398756384849548,
0.05488282069563866,
-0.0030392685439437628,
-0.05489332973957062,
0.06600672751665115,
0.018130598589777946,
-0.07607711851596832,
0.006103718653321266,
0.02828056365251541,
-0.0382462814450264,
0.008496491238474846,
-0.039060626178979874,
-0.05431687831878662,
-0.05876977741718292,
-0.002238405169919133,
-0.013640067540109158,
-0.12128115445375443,
0.008716309443116188,
0.017642775550484657,
-0.09529261291027069,
-0.07851468771696091,
-0.08393117785453796,
0.08323846012353897,
0.017502188682556152,
0.02786414511501789,
-0.017435656860470772,
-0.014314603991806507,
-0.06207514926791191,
-0.01378412265330553,
-0.0033481407444924116,
0.0010163631523028016,
0.05451301112771034,
-0.014286046847701073,
-0.010827736929059029,
0.001652538776397705,
-0.10865052789449692,
-0.07642605155706406,
-0.09719160199165344,
0.1308579295873642,
-0.010505910962820053,
-0.028801176697015762,
-0.011428378522396088,
-0.08152281492948532,
-0.012901918031275272,
0.014303714968264103,
0.0271967314183712,
0.04595852643251419,
0.008471138775348663,
-0.03031342476606369,
0.032782744616270065,
-0.06314641982316971,
0.002026929520070553,
-0.004345415625721216,
-0.06530506908893585,
-0.018916625529527664,
0.08152015507221222,
-0.06330227851867676,
0.07047242671251297,
-0.011548478156328201,
0.0352531261742115,
0.0009048868669196963,
-0.04029884561896324,
-0.025262974202632904,
0.03532955050468445,
-0.045417651534080505,
-0.004917115438729525,
0.05706235021352768,
0.014213952235877514,
-0.0736704096198082,
-1.2490074165340117e-32,
-0.016381802037358284,
-0.008430803194642067,
-0.0719657614827156,
-0.022939670830965042,
0.005988827906548977,
-0.048748623579740524,
0.030619660392403603,
0.047839224338531494,
-0.015011212788522243,
-0.03718957677483559,
0.07067576795816422,
-0.005823606159538031,
0.1010509729385376,
-0.04934597387909889,
0.017019543796777725,
0.07824854552745819,
0.03245077282190323,
0.0031819441355764866,
0.007086840458214283,
0.028057845309376717,
-0.019258126616477966,
0.1053384393453598,
-0.05748486891388893,
0.016811294481158257,
-0.07735873758792877,
0.008387192152440548,
0.05614231526851654,
0.046833060681819916,
-0.06227516010403633,
-0.050547000020742416,
0.08198904991149902,
0.0655239149928093,
-0.10017383843660355,
0.05215943232178688,
-0.02762017399072647,
0.09914779663085938,
0.011594640091061592,
-0.045592691749334335,
0.013934056274592876,
0.016412071883678436,
0.13089251518249512,
-0.013783556409180164,
-0.10919669270515442,
0.026702819392085075,
0.06445040553808212,
-0.012017467990517616,
0.005647345911711454,
0.030514977872371674,
-0.02991451323032379,
0.05186620354652405,
0.08250591903924942,
-0.09826835244894028,
-0.04291577637195587,
0.04599219560623169,
0.06697411835193634,
0.054764896631240845,
0.10345638543367386,
-0.06934820860624313,
0.02820030227303505,
-0.006972988601773977,
0.04627811536192894,
-0.12736257910728455,
-0.02742937207221985,
0.07915909588336945,
0.02919236570596695,
0.08063914626836777,
-0.06638666242361069,
0.02888583205640316,
0.08203660696744919,
-0.02148241177201271,
-0.01510949432849884,
0.05701349303126335,
-0.04381663724780083,
-0.05860774964094162,
0.09347476065158844,
-0.00585080124437809,
0.0036806855350732803,
0.012879986315965652,
-0.06871119886636734,
0.11675430834293365,
-0.10387656837701797,
0.02466060221195221,
-0.02504509501159191,
-0.0640089139342308,
0.018208198249340057,
0.01298096589744091,
0.03670146316289902,
0.11133003979921341,
-0.05397540330886841,
0.008560087531805038,
-0.03896940499544144,
0.014710558578372002,
-0.00169243139680475,
0.03576836735010147,
0.021642686799168587,
-5.1242210474811145e-8,
-0.05447450652718544,
0.021112259477376938,
-0.0530172660946846,
-0.02451084740459919,
-0.0038172053173184395,
0.11082927882671356,
0.04289557412266731,
-0.07360175997018814,
-0.031721655279397964,
0.012532957829535007,
-0.10481730103492737,
-0.022967105731368065,
0.013197180815041065,
0.014030303806066513,
0.05204034596681595,
-0.02710735611617565,
0.012066273018717766,
-0.00874960608780384,
-0.03757653385400772,
-0.07781331241130829,
0.037477921694517136,
-0.023343609645962715,
-0.04349653795361519,
-0.02889290265738964,
-0.0090880636125803,
-0.05161135643720627,
0.08934331685304642,
0.024552147835493088,
-0.06505028903484344,
0.07337574660778046,
-0.08621258288621902,
-0.050341032445430756,
0.025860216468572617,
-0.025256657972931862,
-0.04570802301168442,
0.07593759894371033,
-0.003503263695165515,
-0.001739909639582038,
0.06648402661085129,
0.026579130440950394,
0.006906101480126381,
0.0063676536083221436,
-0.04182170704007149,
0.04181238263845444,
-0.004688693676143885,
0.015390003100037575,
0.00557955726981163,
0.11976874619722366,
0.07866723835468292,
-0.034757357090711594,
-0.08423500508069992,
-0.06371822953224182,
0.018519902601838112,
-0.032989751547575,
0.011651694774627686,
-0.01682754047214985,
-0.052617982029914856,
-0.07442031800746918,
-0.011407840065658092,
0.05788658559322357,
-0.022254452109336853,
0.028534049168229103,
-0.06931912153959274,
-0.03183329105377197
] | 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 API](embedding.md) \* [Child processes](child\_process.md) \* [Cluster](cluster.md) \* [Command-line options](cli.md) \* [Console](console.md) \* [Crypto](crypto.md) \* [Debugger](debugger.md) \* [Deprecated APIs](deprecations.md) \* [Diagnostics Channel](diagnostics\_channel.md) \* [DNS](dns.md) \* [Domain](domain.md) \* [Environment Variables](environment\_variables.md) \* [Errors](errors.md) \* [Events](events.md) \* [File system](fs.md) \* [Globals](globals.md) \* [HTTP](http.md) \* [HTTP/2](http2.md) \* [HTTPS](https.md) \* [Inspector](inspector.md) \* [Internationalization](intl.md) \* [Modules: CommonJS modules](modules.md) \* [Modules: ECMAScript modules](esm.md) \* [Modules: `node:module` API](module.md) \* [Modules: Packages](packages.md) \* [Modules: TypeScript](typescript.md) \* [Net](net.md) \* [OS](os.md) \* [Path](path.md) \* [Performance hooks](perf\_hooks.md) \* [Permissions](permissions.md) \* [Process](process.md) \* [Punycode](punycode.md) \* [Query strings](querystring.md) \* [Readline](readline.md) \* [REPL](repl.md) \* [Report](report.md) \* [Single executable applications](single-executable-applications.md) \* [SQLite](sqlite.md) \* [Stream](stream.md) \* [String decoder](string\_decoder.md) \* [Test runner](test.md) \* [Timers](timers.md) \* [TLS/SSL](tls.md) \* [Trace events](tracing.md) \* [TTY](tty.md) \* [UDP/datagram](dgram.md) \* [URL](url.md) \* [Utilities](util.md) \* [V8](v8.md) \* [VM](vm.md) \* [WASI](wasi.md) \* [Web Crypto API](webcrypto.md) \* [Web Streams API](webstreams.md) \* [Worker threads](worker\_threads.md) \* [Zlib](zlib.md) --- \* [Code repository and issue tracker](https://github.com/nodejs/node) | 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.014965644106268883,
-0.013098953291773796,
0.037311408668756485,
-0.046516820788383484,
0.026805240660905838,
0.019087940454483032,
-0.024480916559696198,
-0.024859078228473663,
-0.0009994301944971085,
-0.044561974704265594,
0.012243962846696377,
-0.08265464752912521,
0.014542537741363049,
-0.018046695739030838,
-0.06239287555217743,
0.014261060394346714,
0.019692260771989822,
0.057042863219976425,
0.018735865131020546,
0.003647508332505822,
0.017083967104554176,
0.04415605589747429,
0.19733171164989471,
0.055622272193431854,
-0.06879929453134537,
-0.11094366759061813,
-0.02608436532318592,
0.12999141216278076,
0.08187882602214813,
-0.0650828406214714,
-0.07264802604913712,
-0.04938964545726776,
-0.1325826644897461,
-0.04857749119400978,
-0.06138308718800545,
-0.08990790694952011,
-0.02795879915356636,
-0.008799523115158081,
-0.006344277411699295,
-0.054708488285541534,
0.029427239671349525,
-0.019887518137693405,
0.023850416764616966,
-0.0031598324421793222,
-0.036070093512535095,
-0.030853966251015663,
0.001252529677003622,
0.01144032645970583,
-0.010143770836293697,
-0.02070651389658451,
0.043150242418050766,
0.022290129214525223,
0.09114966541528702,
0.004856590647250414,
0.0168486125767231,
0.08163756877183914,
-0.010159880854189396,
-0.12280762195587158,
0.004805221222341061,
-0.06234161555767059,
0.032808177173137665,
-0.05402707681059837,
0.049965325742959976,
-0.0003285097482148558,
0.012177472934126854,
-0.014548661187291145,
-0.15715354681015015,
-0.03057130239903927,
0.019353536888957024,
-0.0006530225509777665,
-0.03301457315683365,
0.01270010694861412,
0.17202624678611755,
-0.036171335726976395,
-0.027053765952587128,
0.051770683377981186,
0.02551780454814434,
0.004108891356736422,
-0.023579880595207214,
-0.1060258001089096,
0.021598288789391518,
0.10840004682540894,
0.0031473992858082056,
-0.009052167646586895,
-0.000628426147159189,
0.021296396851539612,
0.03015284426510334,
-0.008863761089742184,
0.04081325605511665,
0.011685769073665142,
-0.015616999939084053,
0.044045109301805496,
0.02226019836962223,
-0.01588067226111889,
-0.061917830258607864,
-0.05804714187979698,
-0.006095231045037508,
-0.011202080175280571,
0.10660777240991592,
0.000409216940170154,
-0.023949772119522095,
0.057511426508426666,
0.04373707249760628,
0.09267471730709076,
-0.03520837053656578,
0.0031270773615688086,
0.050531599670648575,
0.06874210387468338,
-0.009949788451194763,
-0.03842092305421829,
0.013742253184318542,
-0.014052220620214939,
-0.02431255206465721,
-0.06422890722751617,
3.791214298505627e-33,
0.024545958265662193,
-0.12085920572280884,
0.05480765923857689,
0.05483747646212578,
0.11297812312841415,
0.040292222052812576,
0.035523660480976105,
0.016917265951633453,
-0.022502267733216286,
0.0011888031149283051,
-0.04449959099292755,
-0.04388165846467018,
0.012200379744172096,
-0.04975925013422966,
-0.0035731978714466095,
-0.0670502781867981,
0.033235374838113785,
0.06723250448703766,
0.010876689106225967,
0.03189171850681305,
-0.008397665806114674,
0.06182802468538284,
-0.10663658380508423,
-0.0016284524463117123,
0.04365680739283562,
0.024048304185271263,
0.030036339536309242,
-0.009728290140628815,
0.06347063928842545,
0.0015561041655018926,
-0.040468353778123856,
-0.018953800201416016,
-0.04734437167644501,
0.08436252176761627,
-0.0011527214664965868,
0.017170375213027,
-0.008747503161430359,
-0.00413905456662178,
-0.056427765637636185,
-0.05955997481942177,
-0.031973592936992645,
-0.037804216146469116,
-0.01818007417023182,
-0.048004187643527985,
-0.06126727908849716,
-0.07994109392166138,
-0.08980285376310349,
-0.0999017208814621,
0.08247362077236176,
-0.04319542646408081,
0.057706888765096664,
0.016595395281910896,
0.04125237837433815,
-0.07366332411766052,
0.009816361591219902,
-0.0719861090183258,
-0.03156896308064461,
0.010950104333460331,
0.035709448158741,
0.12341685593128204,
0.006558924913406372,
-0.0420885868370533,
-0.06969057768583298,
0.012206760235130787,
0.0353093296289444,
-0.016837846487760544,
-0.023652588948607445,
-0.015083451755344868,
0.04617678001523018,
0.04726400226354599,
-0.06884172558784485,
0.03223482519388199,
-0.026099367067217827,
0.049963466823101044,
0.038303226232528687,
-0.013280987739562988,
-0.026825541630387306,
-0.032085664570331573,
-0.0550449974834919,
0.0014546109596267343,
-0.027719389647245407,
-0.00611687358468771,
-0.05308991298079491,
0.04695703089237213,
-0.02083868533372879,
-0.07765518128871918,
-0.04538680985569954,
-0.07527025789022446,
0.05761463940143585,
-0.07718566060066223,
-0.0000806627722340636,
-0.04265280440449715,
0.023429138585925102,
-0.02849109284579754,
-0.13801002502441406,
-5.847332078956354e-33,
0.06841353327035904,
-0.05240914225578308,
-0.005434765480458736,
0.015711281448602676,
-0.05382123589515686,
-0.015782151371240616,
-0.022811340168118477,
-0.0013819456798955798,
-0.03029378317296505,
-0.01930263265967369,
-0.029136572033166885,
0.021921521052718163,
0.024739550426602364,
0.012396689504384995,
0.02708546258509159,
0.03935854509472847,
-0.02297879010438919,
-0.08323853462934494,
0.06355257332324982,
0.05509613826870918,
0.015888947993516922,
0.06621616333723068,
0.028769422322511673,
0.004846043884754181,
0.007055096328258514,
0.009058455005288124,
0.016320880502462387,
0.006622800137847662,
0.029085727408528328,
-0.05263344943523407,
-0.006287507247179747,
0.06674686819314957,
-0.07914271950721741,
0.017395231872797012,
0.02081112749874592,
-0.025237856432795525,
0.06009918451309204,
0.0504731647670269,
0.0027991647366434336,
-0.07274908572435379,
0.13711532950401306,
-0.0071637011133134365,
-0.043658215552568436,
0.015669485554099083,
0.051594704389572144,
-0.0027324811089783907,
0.005868388805538416,
0.03096284158527851,
-0.06791169196367264,
-0.005406233947724104,
-0.0314224511384964,
-0.08029097318649292,
0.011518931947648525,
0.05296088382601738,
-0.06059633940458298,
0.023093750700354576,
0.08221102505922318,
0.02040269784629345,
0.02396010234951973,
-0.012431265786290169,
0.05203760415315628,
-0.04206185042858124,
-0.10291274636983871,
-0.038192279636859894,
-0.02484123595058918,
-0.00019719835836440325,
-0.06355122476816177,
-0.018045058473944664,
-0.06785781681537628,
0.02181209996342659,
-0.03306261822581291,
0.0634412094950676,
-0.09048342704772949,
0.04711369797587395,
0.017671117559075356,
-0.020448455587029457,
0.02407735399901867,
-0.1301724761724472,
0.013528726063668728,
0.09118523448705673,
-0.03932484984397888,
0.02192460559308529,
0.010137656703591347,
0.035339802503585815,
-0.008013908751308918,
-0.0003152387507725507,
0.026388004422187805,
0.0680050328373909,
-0.01688988506793976,
0.0005329509731382132,
-0.04447690770030022,
0.02578835003077984,
-0.08848322182893753,
0.08407285064458847,
-0.02317759580910206,
-5.782447587421302e-8,
-0.047209303826093674,
-0.01710307039320469,
-0.02011028490960598,
-0.02604854106903076,
0.03645210340619087,
0.0326232835650444,
-0.013263234868645668,
0.004670044872909784,
0.012889080680906773,
0.00021173366985749453,
-0.025338876992464066,
-0.03485237807035446,
-0.010593345388770103,
-0.07250950485467911,
-0.03239239752292633,
0.049879200756549835,
-0.06811471283435822,
0.022134391590952873,
0.021449243649840355,
-0.036478620022535324,
0.031086748465895653,
0.08615618944168091,
-0.02942121960222721,
0.05049104243516922,
-0.021798590198159218,
-0.016472389921545982,
0.13735298812389374,
0.09499231725931168,
-0.04021734744310379,
-0.013299146667122841,
-0.004924556706100702,
0.03641965240240097,
0.04021887481212616,
0.008794959634542465,
-0.029681716114282608,
0.07249967753887177,
0.021276062354445457,
-0.006001354195177555,
0.07368387281894684,
0.03377429395914078,
-0.017886187881231308,
0.07278648018836975,
-0.01157308928668499,
-0.010257757268846035,
0.06403942406177521,
-0.008065910078585148,
-0.05194069445133209,
0.09755972027778625,
0.028790324926376343,
0.007527358364313841,
-0.004858939442783594,
-0.027014508843421936,
-0.028646720573306084,
0.04056517779827118,
-0.03769398853182793,
0.001685800845734775,
-0.043184783309698105,
-0.10411254316568375,
0.07787656784057617,
0.07849190384149551,
0.027527322992682457,
-0.012547456659376621,
0.1403266042470932,
-0.008052649907767773
] | 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()`][] \* [`String.prototype.toUpperCase()`][] \* All functionality described in the [ECMAScript Internationalization API Specification][ECMA-402] (aka ECMA-402): \* [`Intl`][] object \* Locale-sensitive methods like [`String.prototype.localeCompare()`][] and [`Date.prototype.toLocaleString()`][] \* The [WHATWG URL parser][]'s [internationalized domain names][] (IDNs) support \* [`require('node:buffer').transcode()`][] \* More accurate [REPL][] line editing \* [`require('node:util').TextDecoder`][] \* [`RegExp` Unicode Property Escapes][] Node.js and the underlying V8 engine use [International Components for Unicode (ICU)][ICU] to implement these features in native C/C++ code. The full ICU data set is provided by Node.js by default. However, due to the size of the ICU data file, several options are provided for customizing the ICU data set either when building or running Node.js. ## Options for building Node.js To control how ICU is used in Node.js, four `configure` options are available during compilation. Additional details on how to compile Node.js are documented in [BUILDING.md][]. \* `--with-intl=none`/`--without-intl` \* `--with-intl=system-icu` \* `--with-intl=small-icu` \* `--with-intl=full-icu` (default) An overview of available Node.js and JavaScript features for each `configure` option: | Feature | `none` | `system-icu` | `small-icu` | `full-icu` | | ---------------------------------------- | --------------------------------- | ---------------------------- | ---------------------- | ---------- | | [`String.prototype.normalize()`][] | none (function is no-op) | full | full | full | | `String.prototype.to\*Case()` | full | full | full | full | | [`Intl`][] | none (object does not exist) | partial/full (depends on OS) | partial (English-only) | full | | [`String.prototype.localeCompare()`][] | partial (not locale-aware) | full | full | full | | `String.prototype.toLocale\*Case()` | partial (not locale-aware) | full | full | full | | [`Number.prototype.toLocaleString()`][] | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full | | `Date.prototype.toLocale\*String()` | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full | | [Legacy URL Parser][] | partial (no IDN support) | full | full | full | | [WHATWG URL Parser][] | partial (no IDN support) | full | full | full | | [`require('node:buffer').transcode()`][] | none (function does not exist) | full | full | full | | [REPL][] | partial (inaccurate line editing) | full | full | full | | [`require('node:util').TextDecoder`][] | partial (basic encodings support) | partial/full (depends on OS) | partial (Unicode-only) | full | | [`RegExp` Unicode Property Escapes][] | none (invalid `RegExp` error) | full | full | full | The "(not locale-aware)" designation denotes that the function carries out its operation just like the non-`Locale` version of the function, if one exists. For example, under `none` mode, `Date.prototype.toLocaleString()`'s operation is identical to that of `Date.prototype.toString()`. ### Disable all internationalization features (`none`) If this option is chosen, ICU is disabled and most internationalization features mentioned above will be \*\*unavailable\*\* in the resulting `node` binary. ### Build with a pre-installed ICU (`system-icu`) Node.js can link against an ICU build already installed on the system. In fact, most Linux distributions already come with ICU installed, and this option would make it possible to reuse the same set of data used by other components in the OS. Functionalities that only require the ICU library itself, such as [`String.prototype.normalize()`][] and the [WHATWG URL parser][], are fully supported under `system-icu`. Features that 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 includes | 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.03535503149032593,
0.010736249387264252,
0.0030433519277721643,
-0.03485710173845291,
0.01473389845341444,
-0.023069867864251137,
-0.04095485433936119,
0.06876713037490845,
-0.018362080678343773,
0.05431981012225151,
0.011056678369641304,
-0.018502162769436836,
0.0008721552439965308,
0.030947133898735046,
0.013430698774755001,
-0.009007229469716549,
0.014735993929207325,
-0.04507219418883324,
0.004848821088671684,
0.01135886088013649,
0.0343167781829834,
0.010948273353278637,
0.11916548758745193,
-0.008992885239422321,
-0.10158292204141617,
0.0008515626541338861,
0.007320697419345379,
-0.004371402319520712,
-0.014344865456223488,
-0.00011139010894112289,
-0.038159262388944626,
0.04634286090731621,
-0.006925197783857584,
-0.06465023756027222,
0.03689735755324364,
-0.10575631260871887,
0.012534734793007374,
0.023984605446457863,
-0.03992263972759247,
-0.018239447847008705,
-0.07926683127880096,
0.01006960216909647,
-0.016650844365358353,
0.008649510331451893,
0.007616717834025621,
0.02686472237110138,
0.018168199807405472,
-0.09099896252155304,
0.007723640650510788,
0.043720345944166183,
0.030384644865989685,
-0.0009136723238043487,
0.004435131326317787,
0.0006082856561988592,
0.023443780839443207,
-0.021744536235928535,
0.003292769193649292,
-0.02608809620141983,
0.005592103116214275,
-0.05399711802601814,
0.146196186542511,
-0.05032242834568024,
-0.02577875182032585,
0.02500930428504944,
0.03767460957169533,
-0.024183128029108047,
-0.044031042605638504,
0.05275397002696991,
-0.04659781977534294,
-0.006718030199408531,
0.06262943148612976,
0.03398692607879639,
0.06150280684232712,
-0.018322771415114403,
0.007380901835858822,
0.06548193842172623,
0.08010672777891159,
-0.048603300005197525,
-0.1380104124546051,
0.07482995092868805,
0.04631762579083443,
-0.006677644327282906,
-0.016108036041259766,
0.06276875734329224,
0.04865146428346634,
-0.057663142681121826,
0.009369421750307083,
0.028362849727272987,
0.015037388540804386,
0.05387157201766968,
-0.08750786632299423,
-0.02378954365849495,
0.018953582271933556,
0.037160344421863556,
-0.00423102593049407,
0.05790846049785614,
-0.028397701680660248,
-0.01959104835987091,
-0.0009659107308834791,
-0.054311227053403854,
-0.09712643176317215,
-0.06398732215166092,
-0.009937230497598648,
0.10404016077518463,
-0.08910952508449554,
0.12076018750667572,
0.07164408266544342,
0.026371579617261887,
0.0306521225720644,
-0.05802100896835327,
0.029767407104372978,
-0.018633482977747917,
0.0008846131968311965,
0.021869754418730736,
5.4352184532374454e-33,
-0.006054167170077562,
0.008568879216909409,
-0.025996653363108635,
0.027437662705779076,
-0.046390730887651443,
-0.041043803095817566,
0.06095120683312416,
0.015257582999765873,
-0.15477198362350464,
-0.09196691960096359,
0.008642098866403103,
0.072489432990551,
-0.0021804177667945623,
-0.015140102244913578,
0.011518520303070545,
0.0124833257868886,
0.11651682108640671,
0.007252447307109833,
0.04679754748940468,
0.04211687669157982,
0.028067080304026604,
0.016750294715166092,
0.03642932325601578,
0.04512442648410797,
-0.012551048770546913,
0.009081820957362652,
0.010253873653709888,
-0.040679931640625,
0.016763342544436455,
0.003535935655236244,
0.01675177738070488,
-0.0685521811246872,
-0.0744999423623085,
0.06445519626140594,
0.05404131859540939,
-0.008936026133596897,
0.05928162857890129,
-0.04019467532634735,
-0.06824037432670593,
0.05705125257372856,
0.00945265032351017,
0.02273905836045742,
-0.0651417151093483,
-0.008183854632079601,
0.058637652546167374,
-0.01597156934440136,
-0.027853792533278465,
-0.07219868153333664,
0.05973818525671959,
0.026871493086218834,
-0.07623054832220078,
0.04759496822953224,
0.04690959304571152,
-0.03531382977962494,
0.0706753134727478,
0.0018115552375093102,
0.04056450352072716,
-0.047984328120946884,
-0.008840695954859257,
-0.06557009369134903,
-0.010390285402536392,
0.030109107494354248,
0.005330266896635294,
0.047088444232940674,
0.015451530925929546,
-0.004591732285916805,
0.026311002671718597,
0.015335658565163612,
-0.04714321717619896,
-0.01800253614783287,
-0.06598321348428726,
0.014359259977936745,
0.11365844309329987,
0.08892837166786194,
-0.011503230780363083,
0.011839990504086018,
-0.04554957523941994,
-0.018629111349582672,
-0.01835072971880436,
-0.07576539367437363,
-0.051641445606946945,
-0.05691089481115341,
-0.04132021963596344,
0.09077206999063492,
0.04646175354719162,
0.005390293896198273,
0.026196163147687912,
0.011606205254793167,
0.06915304809808731,
-0.011302179656922817,
0.021395493298768997,
-0.0535370334982872,
-0.0840444415807724,
-0.03467397019267082,
-0.05553648993372917,
-7.201409735607471e-33,
0.03784580156207085,
-0.065935418009758,
-0.04650019854307175,
0.07207976281642914,
-0.10477407276630402,
-0.09445585310459137,
0.028258733451366425,
0.05059351399540901,
0.0445563979446888,
-0.0364958792924881,
0.01915000192821026,
-0.02931625209748745,
0.01844004914164543,
-0.03192412853240967,
0.0955498069524765,
-0.001873711938969791,
-0.04743534326553345,
0.03345256671309471,
0.051613446325063705,
0.032285429537296295,
-0.005784566048532724,
-0.027170101180672646,
-0.07233338803052902,
0.029474470764398575,
0.04390296712517738,
-0.021501148119568825,
-0.0029819468036293983,
-0.03561044856905937,
-0.022815488278865814,
-0.0704873651266098,
-0.06230168044567108,
0.056065306067466736,
-0.04311950132250786,
0.1067681759595871,
-0.09945361316204071,
-0.01214166171848774,
0.01659911684691906,
0.08243946731090546,
0.08565769344568253,
-0.011703720316290855,
-0.047551896423101425,
0.0033734028693288565,
-0.07991474121809006,
0.012048229575157166,
-0.007317655254155397,
0.0862954631447792,
-0.08947338908910751,
0.10403720289468765,
-0.01499824970960617,
-0.001967550255358219,
0.022388722747564316,
-0.06573212891817093,
-0.04804294556379318,
-0.078156016767025,
-0.04304484650492668,
-0.03925261273980141,
0.016437377780675888,
-0.05118917301297188,
-0.01237322948873043,
-0.021084263920783997,
-0.000783383147791028,
-0.04824172332882881,
-0.015602750703692436,
-0.0517251193523407,
-0.03592759370803833,
-0.0488145686686039,
-0.07910245656967163,
0.020392868667840958,
0.023704294115304947,
-0.13488833606243134,
0.04027692601084709,
-0.10737992078065872,
-0.08198076486587524,
0.01092112809419632,
-0.007424063980579376,
0.015134226530790329,
0.07501286268234253,
-0.03863859921693802,
0.01393867377191782,
0.04476660490036011,
-0.019345298409461975,
0.09987209737300873,
0.006707716733217239,
0.028918512165546417,
0.07337674498558044,
0.10141671448945999,
-0.06916780769824982,
0.10331480205059052,
-0.07253049314022064,
-0.037072356790304184,
0.02595851942896843,
0.15507152676582336,
-0.07029464095830917,
0.031454574316740036,
-0.073814757168293,
-5.6400242698373404e-8,
-0.05886731296777725,
-0.00613396568223834,
-0.12157254666090012,
0.005603467579931021,
-0.03217238187789917,
-0.006691299844533205,
-0.011047203093767166,
-0.006737156771123409,
0.08513182401657104,
0.00231393170543015,
-0.040029048919677734,
0.010755900293588638,
-0.04233066365122795,
-0.03255607187747955,
-0.0349147766828537,
0.04714616388082504,
0.0009243210079148412,
0.1628793627023697,
-0.02182510867714882,
0.09553505480289459,
0.004278992768377066,
0.027884196490049362,
-0.023632055148482323,
-0.03837889805436134,
-0.01034513395279646,
-0.004656899720430374,
-0.01848248392343521,
0.06778691709041595,
0.0010123768588528037,
-0.027963625267148018,
-0.027607828378677368,
0.01565348543226719,
0.004605794791132212,
0.04866193234920502,
-0.016188623383641243,
0.02415286935865879,
-0.006961020175367594,
-0.050270263105630875,
-0.005671915132552385,
0.04195493459701538,
0.14208866655826569,
-0.001912876614369452,
-0.07361394912004471,
0.01839149370789528,
0.01789608784019947,
-0.06766270846128464,
0.0034313597716391087,
-0.006467745173722506,
0.06715717911720276,
-0.02705657109618187,
-0.0015725152334198356,
-0.01546544674783945,
-0.0380229577422142,
-0.02161451242864132,
0.022081756964325905,
0.07853250205516815,
-0.033963125199079514,
-0.11543232202529907,
0.03872329369187355,
0.07376997917890549,
0.05462244525551796,
-0.03208044543862343,
0.039392974227666855,
0.019351502880454063
] | 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 includes a subset of ICU data (typically only the English locale) within the `node` executable. Functionalities that only require the ICU library itself, such as [`String.prototype.normalize()`][] and the [WHATWG URL parser][], are fully supported under `small-icu`. Features that require ICU locale data in addition, such as [`Intl.DateTimeFormat`][], generally only work with the English locale: ```js const january = new Date(9e8); const english = new Intl.DateTimeFormat('en', { month: 'long' }); const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); console.log(english.format(january)); // Prints "January" console.log(spanish.format(january)); // Prints either "M01" or "January" on small-icu, depending on the user’s default locale // Should print "enero" ``` This mode provides a balance between features and binary size. #### Providing ICU data at runtime If the `small-icu` option is used, one can still provide additional locale data at runtime so that the JS methods would work for all ICU locales. Assuming the data file is stored at `/runtime/directory/with/dat/file`, it can be made available to ICU through either: \* The `--with-icu-default-data-dir` configure option: ```bash ./configure --with-icu-default-data-dir=/runtime/directory/with/dat/file --with-intl=small-icu ``` This only embeds the default data directory path into the binary. The actual data file is going to be loaded at runtime from this directory path. \* The [`NODE\_ICU\_DATA`][] environment variable: ```bash env NODE\_ICU\_DATA=/runtime/directory/with/dat/file node ``` \* The [`--icu-data-dir`][] CLI parameter: ```bash node --icu-data-dir=/runtime/directory/with/dat/file ``` When more than one of them is specified, the `--icu-data-dir` CLI parameter has the highest precedence, then the `NODE\_ICU\_DATA` environment variable, then the `--with-icu-default-data-dir` configure option. ICU is able to automatically find and load a variety of data formats, but the data must be appropriate for the ICU version, and the file correctly named. The most common name for the data file is `icudtX[bl].dat`, where `X` denotes the intended ICU version, and `b` or `l` indicates the system's endianness. Node.js would fail to load if the expected data file cannot be read from the specified directory. The name of the data file corresponding to the current Node.js version can be computed with: ```js `icudt${process.versions.icu.split('.')[0]}${os.endianness()[0].toLowerCase()}.dat`; ``` Check ["ICU Data"][] article in the ICU User Guide for other supported formats and more details on ICU data in general. The [full-icu][] npm module can greatly simplify ICU data installation by detecting the ICU version of the running `node` executable and downloading the appropriate data file. After installing the module through `npm i full-icu`, the data file will be available at `./node\_modules/full-icu`. This path can be then passed either to `NODE\_ICU\_DATA` or `--icu-data-dir` as shown above to enable full `Intl` support. ### Embed the entire ICU (`full-icu`) This option makes the resulting binary link against ICU statically and include a full set of ICU data. A binary created this way has no further external dependencies and supports all locales, but might be rather large. This is the default behavior if no `--with-intl` flag is passed. The official binaries are also built in this mode. ## Detecting internationalization support To verify that ICU is enabled at all (`system-icu`, `small-icu`, or `full-icu`), simply checking the existence of `Intl` should suffice: ```js 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.DateTimeFormat`][] can be a good distinguishing factor: | 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.0440351627767086,
0.029957203194499016,
-0.004309733863919973,
-0.051825664937496185,
-0.02977363020181656,
0.0028088893741369247,
-0.041777871549129486,
0.062141384929418564,
-0.059130579233169556,
0.007027159444987774,
-0.010265335440635681,
0.0027752963360399008,
-0.03623436018824577,
0.038514044135808945,
0.001125151407904923,
0.06425817310810089,
0.06421112269163132,
0.017499927431344986,
0.07606657594442368,
-0.03651212900876999,
-0.03690439835190773,
0.008722134865820408,
0.046489764004945755,
0.04338173568248749,
-0.06801313906908035,
-0.013049572706222534,
-0.02041003294289112,
0.0119865657761693,
0.05025136470794678,
0.014347918331623077,
-0.014717153273522854,
0.002938532503321767,
0.019240083172917366,
0.032240305095911026,
0.005387365352362394,
-0.13420669734477997,
0.06775079667568207,
-0.011155921034514904,
0.04542609304189682,
-0.026375707238912582,
-0.019927429035305977,
0.03181760385632515,
0.015556017868220806,
-0.10290967673063278,
-0.00633487431332469,
0.03230538219213486,
0.07176589965820312,
-0.0770377516746521,
0.019835390150547028,
-0.013159982860088348,
0.05650915578007698,
-0.0022799235302954912,
-0.02449413388967514,
0.0027863297145813704,
0.010411289520561695,
-0.007592884823679924,
-0.07352761924266815,
-0.038586605340242386,
-0.008672306314110756,
-0.00823934841901064,
0.14088594913482666,
-0.03716905415058136,
0.022344769909977913,
0.029820021241903305,
0.03869805857539177,
0.043074704706668854,
-0.029184134677052498,
-0.02362709678709507,
0.011986968107521534,
0.057920973747968674,
0.019542353227734566,
0.09912194311618805,
0.05750763416290283,
0.006869116332381964,
0.041223905980587006,
0.024771686643362045,
-0.054153382778167725,
0.030483344569802284,
-0.08690180629491806,
-0.026583360508084297,
0.037274882197380066,
0.09115638583898544,
-0.021007724106311798,
0.09134659916162491,
0.044848471879959106,
-0.016768891364336014,
0.04286620393395424,
-0.031601112335920334,
0.05406396463513374,
0.032670896500349045,
0.04864972457289696,
-0.0031417212449014187,
-0.017772110179066658,
-0.0035022643860429525,
0.028713900595903397,
0.026789972558617592,
0.055990636348724365,
0.01806797832250595,
-0.007950346916913986,
-0.012215184979140759,
-0.05894501134753227,
0.01942494325339794,
-0.05804990977048874,
0.07758551090955734,
-0.10898035764694214,
0.09912018477916718,
0.0531880259513855,
-0.02020225115120411,
-0.008789257146418095,
-0.06575507670640945,
0.04955155774950981,
0.001991639845073223,
-0.0013618930242955685,
0.08642839640378952,
6.1252182088067736e-33,
0.06968456506729126,
0.01818397268652916,
-0.008313547819852829,
-0.04747490957379341,
-0.05365820974111557,
-0.053205955773591995,
0.01571229286491871,
0.011620704084634781,
-0.049602705985307693,
-0.018965207040309906,
-0.03123910166323185,
0.005834679119288921,
-0.007752576842904091,
-0.058772843331098557,
-0.03400508314371109,
0.014570032246410847,
0.050128042697906494,
0.04102377966046333,
0.08351326733827591,
0.07880505174398422,
0.0660405233502388,
0.015232352539896965,
0.04112038016319275,
-0.03712516650557518,
0.06826557219028473,
0.0018257045885547996,
0.03236084058880806,
0.0036846743896603584,
-0.04040323942899704,
-0.02669689990580082,
0.05254508554935455,
-0.09562506526708603,
-0.06118476018309593,
0.05850677564740181,
0.06495602428913116,
0.006971727591007948,
0.02051124908030033,
-0.02871117927134037,
-0.14908815920352936,
0.04012468084692955,
0.051345519721508026,
0.06350607424974442,
-0.031058426946401596,
-0.04694724455475807,
0.015560279600322247,
-0.03559506684541702,
0.005186807364225388,
-0.08934202045202255,
0.027227114886045456,
-0.017882762476801872,
-0.11911262571811676,
0.05431593209505081,
-0.011876475997269154,
-0.09246660768985748,
0.04663647338747978,
-0.012402222491800785,
0.07980775833129883,
-0.03697386011481285,
0.034693822264671326,
-0.0394577831029892,
-0.023186424747109413,
0.01877208612859249,
-0.0051681590266525745,
-0.017778031527996063,
-0.03110613115131855,
-0.017916981130838394,
-0.04184660315513611,
0.022778240963816643,
-0.004764419049024582,
-0.01283201389014721,
-0.06003056839108467,
-0.009480786509811878,
0.03894985467195511,
0.003433390287682414,
-0.01811562106013298,
-0.004848112352192402,
-0.01993696764111519,
-0.08108915388584137,
0.023009922355413437,
-0.051505908370018005,
0.03530336543917656,
-0.10707418620586395,
0.004564354196190834,
0.14489683508872986,
0.04529079422354698,
-0.008586605079472065,
-0.018330419436097145,
-0.02336820773780346,
0.05395642668008804,
-0.07068260759115219,
0.004212637897580862,
-0.006952428258955479,
-0.04557473957538605,
0.019663922488689423,
-0.06670265644788742,
-6.169775322174692e-33,
0.02875617705285549,
-0.087082639336586,
-0.0019166752463206649,
0.08290479332208633,
-0.07330683618783951,
-0.0002629338705446571,
0.0672287717461586,
0.08991476148366928,
0.05309255048632622,
0.013579241000115871,
0.10820414870977402,
-0.045412223786115646,
0.05864260718226433,
-0.07778981328010559,
0.07794048637151718,
0.054194867610931396,
-0.004911347292363644,
-0.04714459925889969,
0.08140641450881958,
0.07494643330574036,
-0.004859854467213154,
0.006572696380317211,
-0.07822774350643158,
-0.046556416898965836,
0.04177163541316986,
0.02412211336195469,
0.028803512454032898,
-0.01667972281575203,
-0.03190602362155914,
-0.06739585101604462,
-0.04745311290025711,
-0.01932354085147381,
-0.07595020532608032,
-0.03627011179924011,
-0.07528781145811081,
0.027226952835917473,
-0.022469671443104744,
0.11691897362470627,
-0.017262443900108337,
-0.03870963677763939,
0.023641712963581085,
0.026946790516376495,
-0.07902663201093674,
0.062121715396642685,
-0.013256028294563293,
0.05607866123318672,
-0.057904839515686035,
0.03408157825469971,
-0.0015198643086478114,
-0.011717899702489376,
0.014354543760418892,
-0.1221427172422409,
0.011480382643640041,
-0.027669593691825867,
-0.0006964791100472212,
-0.009692896157503128,
0.018667086958885193,
-0.036316730082035065,
-0.0509779192507267,
-0.03610038384795189,
-0.03561723604798317,
-0.10427210479974747,
-0.006849342491477728,
-0.08748286217451096,
-0.013623107224702835,
-0.01821313053369522,
-0.0815509632229805,
-0.023777944967150688,
0.004423798993229866,
-0.044194843620061874,
0.03814375773072243,
-0.07657819986343384,
-0.037453792989254,
-0.03380579128861427,
-0.06425213068723679,
-0.001658471068367362,
0.07181648910045624,
-0.04259640723466873,
0.02374873496592045,
0.0374603308737278,
-0.04314890131354332,
0.07266818732023239,
-0.022221161052584648,
0.026153186336159706,
0.09356506168842316,
0.06993145495653152,
0.013267678208649158,
0.05808607488870621,
-0.028210557997226715,
-0.017478520050644875,
-0.005298955366015434,
0.1200135201215744,
-0.09815794974565506,
0.05857376754283905,
-0.06486281752586365,
-5.4962654871815175e-8,
-0.02631753496825695,
-0.00030246336245909333,
-0.1212334930896759,
0.004649246111512184,
-0.09082435071468353,
-0.06666450947523117,
0.03309277445077896,
-0.046142689883708954,
0.09460354596376419,
0.049099475145339966,
0.08735232055187225,
-0.026601385325193405,
-0.015946798026561737,
-0.029067672789096832,
0.015925267711281776,
0.04449739679694176,
-0.024574588984251022,
0.04552614688873291,
-0.032666441053152084,
0.006111329421401024,
-0.044272538274526596,
-0.031209001317620277,
0.07033400982618332,
-0.026132633909583092,
0.00805253442376852,
-0.002219386398792267,
-0.006414144299924374,
0.09800311177968979,
0.013773873448371887,
-0.010551334358751774,
-0.14164994657039642,
0.06778983771800995,
0.0322602204978466,
-0.011082134209573269,
-0.010155275464057922,
0.029392791911959648,
-0.06988219171762466,
0.022347742691636086,
0.022560888901352882,
0.04823794215917587,
0.10564519464969635,
0.020448505878448486,
-0.09843359142541885,
0.03335575759410858,
0.0627518817782402,
-0.03893866017460823,
-0.020197290927171707,
-0.00568540021777153,
0.09269500523805618,
-0.00565835926681757,
0.016205700114369392,
0.014288672246038914,
-0.01970333233475685,
-0.05726328119635582,
0.07029779255390167,
0.10516539216041565,
-0.05736329033970833,
-0.13540852069854736,
0.03915176913142204,
0.044255007058382034,
-0.007410203106701374,
-0.032188042998313904,
-0.027530917897820473,
-0.029101736843585968
] | 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.DateTimeFormat`][] can be a good distinguishing factor: ```js const hasFullICU = (() => { try { const january = new Date(9e8); const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); return spanish.format(january) === 'enero'; } catch (err) { return false; } })(); ``` For more verbose tests for `Intl` support, the following resources may be found to be helpful: \* [btest402][]: Generally used to check whether Node.js with `Intl` support is built correctly. \* [Test262][]: ECMAScript's official conformance test suite includes a section dedicated to ECMA-402. ["ICU Data"]: http://userguide.icu-project.org/icudata [BUILDING.md]: https://github.com/nodejs/node/blob/HEAD/BUILDING.md [ECMA-262]: https://tc39.github.io/ecma262/ [ECMA-402]: https://tc39.github.io/ecma402/ [ICU]: http://site.icu-project.org/ [Legacy URL parser]: url.md#legacy-url-api [REPL]: repl.md#repl [Test262]: https://github.com/tc39/test262/tree/HEAD/test/intl402 [WHATWG URL parser]: url.md#the-whatwg-url-api [`--icu-data-dir`]: cli.md#--icu-data-dirfile [`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Date/toLocaleString [`Intl.DateTimeFormat`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Intl/DateTimeFormat [`Intl`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Intl [`NODE\_ICU\_DATA`]: cli.md#node\_icu\_datafile [`Number.prototype.toLocaleString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Number/toLocaleString [`RegExp` Unicode Property Escapes]: https://github.com/tc39/proposal-regexp-unicode-property-escapes [`String.prototype.localeCompare()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/localeCompare [`String.prototype.normalize()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/normalize [`String.prototype.toLowerCase()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/toLowerCase [`String.prototype.toUpperCase()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/toUpperCase [`require('node:buffer').transcode()`]: buffer.md#buffertranscodesource-fromenc-toenc [`require('node:util').TextDecoder`]: util.md#class-utiltextdecoder [btest402]: https://github.com/srl295/btest402 [full-icu]: https://www.npmjs.com/package/full-icu [internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized\_domain\_name | 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.028150849044322968,
0.030626554042100906,
-0.052442751824855804,
0.002819414483383298,
-0.042641203850507736,
-0.0030882596038281918,
-0.046040330082178116,
0.06549511104822159,
-0.09155488759279251,
-0.015418102033436298,
0.04259154200553894,
-0.010721918195486069,
-0.03185282275080681,
0.056905172765254974,
-0.01011779997497797,
0.0035653722006827593,
0.032391488552093506,
-0.06251753866672516,
0.10720925778150558,
-0.01026631984859705,
-0.033956073224544525,
0.05787139758467674,
0.00805494375526905,
0.008841301314532757,
-0.05702538415789604,
0.006695595569908619,
-0.04047214984893799,
-0.07022697478532791,
-0.0067520178854465485,
0.05399691313505173,
-0.025921883061528206,
0.06818937510251999,
-0.01920005865395069,
0.00626422418281436,
0.06285172700881958,
-0.05981406942009926,
0.057577088475227356,
0.011118480935692787,
0.028130972757935524,
-0.007387979421764612,
-0.03494620695710182,
0.03616230562329292,
-0.010598896071314812,
-0.01722736284136772,
0.014415948651731014,
-0.011246263049542904,
0.06351463496685028,
-0.06461281329393387,
0.03611680120229721,
-0.03473459929227829,
0.012582560069859028,
-0.04322056472301483,
-0.02135220170021057,
0.04265638813376427,
0.03690960258245468,
-0.04062170535326004,
0.005883809179067612,
-0.010794172063469887,
0.0035645482130348682,
0.015306496061384678,
0.13830813765525818,
-0.04834260046482086,
0.024286851286888123,
0.10664448142051697,
-0.04619887098670006,
0.04630068689584732,
0.006239593960344791,
-0.04260663688182831,
-0.011166692711412907,
0.002772578736767173,
-0.02563960663974285,
0.11928427964448929,
0.04817214980721474,
0.016871849074959755,
0.02132834680378437,
0.027677904814481735,
0.0046701435931026936,
0.05288977175951004,
-0.04914155602455139,
0.03427276387810707,
0.01980905793607235,
0.14031416177749634,
-0.0010478479089215398,
0.05126412585377693,
0.046183981001377106,
0.023608407005667686,
0.03340265899896622,
0.0023744467180222273,
-0.004849824123084545,
0.03235718980431557,
-0.02750675193965435,
-0.00045065997983329,
0.0030226102098822594,
0.042962752282619476,
-0.030007272958755493,
0.03178871050477028,
0.0003309602616354823,
-0.0002582326123956591,
-0.006433400325477123,
0.082717165350914,
0.021440895274281502,
-0.036639392375946045,
-0.06664914637804031,
0.07611063867807388,
-0.10584891587495804,
0.05970549210906029,
0.0169230904430151,
0.049194712191820145,
0.010440568439662457,
0.0067719039507210255,
-0.0014595325337722898,
-0.025954067707061768,
0.008236883208155632,
0.12821023166179657,
4.203719878122138e-33,
-0.0296397153288126,
-0.024006221443414688,
-0.006337900646030903,
0.00022972140868660063,
-0.07196864485740662,
0.008876938372850418,
0.01281866617500782,
0.041922587901353836,
-0.07399127632379532,
-0.02259489893913269,
-0.02035011351108551,
0.000880479346960783,
-0.0545571967959404,
-0.05873914062976837,
-0.0054250615648925304,
0.04861949756741524,
0.11703374981880188,
-0.0177974421530962,
0.07053305953741074,
0.07847735285758972,
0.06594457477331161,
-0.059179406613111496,
0.011470293626189232,
-0.012415876612067223,
0.021573767066001892,
-0.056696344166994095,
-0.011567051522433758,
-0.006961640436202288,
-0.02230411022901535,
-0.016262458637356758,
0.05282554030418396,
-0.08392325043678284,
-0.08830646425485611,
0.06296127289533615,
0.035020653158426285,
-0.008232503198087215,
-0.001155328587628901,
0.01554231159389019,
-0.07205565273761749,
0.002639406593516469,
-0.00024552407558076084,
0.05842561274766922,
-0.02602192386984825,
-0.014540578238666058,
0.06385423243045807,
-0.023754769936203957,
-0.02388225868344307,
-0.07887840270996094,
0.03558477759361267,
-0.060535065829753876,
-0.047120120376348495,
0.05913704261183739,
-0.00997915305197239,
-0.0861220732331276,
0.05082029476761818,
0.04233628511428833,
0.1244882121682167,
0.013330717571079731,
0.014763333834707737,
-0.0922604575753212,
-0.0028638753574341536,
-0.00899118185043335,
0.02128581888973713,
0.002520398935303092,
-0.03274796903133392,
-0.03970203921198845,
-0.033258259296417236,
-0.01518512237817049,
0.03620829060673714,
-0.02991877682507038,
-0.07281989604234695,
-0.06257827579975128,
-0.0014314011204987764,
0.035503339022397995,
-0.01383983064442873,
-0.06670328974723816,
0.03968290984630585,
-0.03249851241707802,
0.021067753434181213,
-0.03867523744702339,
0.06127969175577164,
-0.05487361550331116,
0.028895709663629532,
0.10273004323244095,
0.03102550469338894,
0.012623501010239124,
-0.014486079104244709,
0.026178250089287758,
0.06581491976976395,
-0.0017650549998506904,
0.04203719273209572,
-0.035133469849824905,
-0.05513621121644974,
-0.0001755262928782031,
-0.006429177243262529,
-5.393727910757234e-33,
0.027784518897533417,
-0.06257136166095734,
0.022740816697478294,
0.056680697947740555,
-0.10353856533765793,
-0.08051349222660065,
-0.00553025770932436,
0.08111423254013062,
0.033670131117105484,
-0.07460495829582214,
0.12922944128513336,
-0.054247453808784485,
0.05408155545592308,
0.013854152522981167,
0.04052891209721565,
-0.002662568585947156,
-0.06241146847605705,
-0.004614124074578285,
0.028296131640672684,
0.0751550942659378,
-0.05951029807329178,
-0.014024236239492893,
-0.030871223658323288,
-0.037073202431201935,
-0.013470347970724106,
0.004751009866595268,
-0.06270363181829453,
-0.044451601803302765,
-0.07625246793031693,
-0.03749653697013855,
-0.05298556759953499,
-0.02334665134549141,
-0.03496308624744415,
0.018592659384012222,
-0.10073326528072357,
-0.019768722355365753,
0.015490609221160412,
0.017025982961058617,
-0.02777411788702011,
0.05796626955270767,
-0.017552517354488373,
0.05881010740995407,
-0.006530180107802153,
0.009474323131144047,
-0.07757667452096939,
0.053705036640167236,
0.017748359590768814,
0.003590300213545561,
0.023839188739657402,
-0.04187507554888725,
0.04271366447210312,
-0.11604991555213928,
-0.035522110760211945,
0.02367883175611496,
0.04185234010219574,
-0.04767433553934097,
-0.04770169407129288,
-0.11745395511388779,
-0.08975305408239365,
-0.015562433749437332,
-0.10165248811244965,
-0.0646139606833458,
0.0304579995572567,
-0.12493108958005905,
0.012942293658852577,
0.006101278122514486,
-0.04298611357808113,
0.021424129605293274,
0.10112682729959488,
-0.05077745392918587,
0.10586526989936829,
-0.022288570180535316,
-0.10988970100879669,
-0.002298155101016164,
-0.06471964716911316,
-0.021987350657582283,
-0.015631811693310738,
-0.06520241498947144,
0.043350785970687866,
0.003374625463038683,
-0.056830525398254395,
0.011813042685389519,
-0.09316354244947433,
0.026149172335863113,
-0.016418050974607468,
0.046919140964746475,
0.004245576448738575,
0.05182138830423355,
-0.03390653803944588,
-0.006042094435542822,
0.02006521075963974,
0.06690044701099396,
-0.11270058155059814,
0.033259280025959015,
-0.01906801387667656,
-5.193016860971511e-8,
-0.04321205988526344,
-0.0528399720788002,
-0.09151320159435272,
-0.025293653830885887,
-0.041127923876047134,
-0.06683038175106049,
0.02880343236029148,
-0.09989660978317261,
0.10825192183256149,
0.036298468708992004,
0.045519985258579254,
0.012681213207542896,
0.011878610588610172,
-0.08005251735448837,
0.01972149685025215,
0.012143025174736977,
-0.0046618604101240635,
0.11838976293802261,
-0.051062166690826416,
0.06788129359483719,
0.04782611131668091,
-0.013775717467069626,
0.05487868934869766,
0.016801659017801285,
-0.014825566671788692,
0.0023807776160538197,
-0.04391872137784958,
0.07547577470541,
0.08166719973087311,
0.038981515914201736,
-0.06697984039783478,
0.03941745311021805,
0.046046026051044464,
-0.015138220973312855,
-0.023097429424524307,
0.02553616836667061,
-0.05093371495604515,
0.03804922103881836,
0.03430645540356636,
0.08330876380205154,
0.18441691994667053,
0.06667543947696686,
-0.17524859309196472,
0.03005100041627884,
0.027628106996417046,
-0.06732933968305588,
-0.018916331231594086,
-0.03025151416659355,
0.014981311745941639,
-0.06815209239721298,
-0.052270710468292236,
0.0325157605111599,
0.020982295274734497,
0.07065178453922272,
0.04375302419066429,
0.049110956490039825,
-0.011806581169366837,
-0.0010469304397702217,
0.04342963546514511,
0.06964084506034851,
0.03048495016992092,
-0.0012296367203816772,
0.030246170237660408,
-0.0451468750834465
] | 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/promises'); ``` To use the callback and sync APIs: ```mjs import \* as readline from 'node:readline'; ``` ```cjs const readline = require('node:readline'); ``` The following simple example illustrates the basic use of the `node:readline` module. ```mjs import \* as readline from 'node:readline/promises'; import { stdin as input, stdout as output } from 'node:process'; const rl = readline.createInterface({ input, output }); const answer = await rl.question('What do you think of Node.js? '); console.log(`Thank you for your valuable feedback: ${answer}`); rl.close(); ``` ```cjs const readline = require('node:readline'); const { stdin: input, stdout: output } = require('node:process'); const rl = readline.createInterface({ input, output }); rl.question('What do you think of Node.js? ', (answer) => { // TODO: Log the answer in a database console.log(`Thank you for your valuable feedback: ${answer}`); rl.close(); }); ``` Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be received on the `input` stream. ## Class: `InterfaceConstructor` \* Extends: {EventEmitter} Instances of the `InterfaceConstructor` class are constructed using the `readlinePromises.createInterface()` or `readline.createInterface()` method. Every instance is associated with a single `input` [Readable][] stream and a single `output` [Writable][] stream. The `output` stream is used to print prompts for user input that arrives on, and is read from, the `input` stream. ### Event: `'close'` The `'close'` event is emitted when one of the following occur: \* The `rl.close()` method is called and the `InterfaceConstructor` instance has relinquished control over the `input` and `output` streams; \* The `input` stream receives its `'end'` event; \* The `input` stream receives `Ctrl`+`D` to signal end-of-transmission (EOT); \* The `input` stream receives `Ctrl`+`C` to signal `SIGINT` and there is no `'SIGINT'` event listener registered on the `InterfaceConstructor` instance. The listener function is called without passing any arguments. The `InterfaceConstructor` instance is finished once the `'close'` event is emitted. ### Event: `'error'` The `'error'` event is emitted when an error occurs on the `input` stream associated with the `node:readline` `Interface`. The listener function is called with an `Error` object passed as the single argument. ### Event: `'line'` The `'line'` event is emitted whenever the `input` stream receives an end-of-line input (`\n`, `\r`, or `\r\n`). This usually occurs when the user presses `Enter` or `Return`. The `'line'` event is also emitted if new data has been read from a stream and that stream ends without a final end-of-line marker. The listener function is called with a string containing the single line of received input. ```js rl.on('line', (input) => { console.log(`Received: ${input}`); }); ``` ### Event: `'history'` The `'history'` event is emitted whenever the history array has changed. The listener function is called with an array containing the history array. It will reflect all changes, added lines and removed lines due to `historySize` and `removeHistoryDuplicates`. The primary purpose is to allow a listener to persist the history. It is also possible for the listener to change the history object. This could be useful to prevent certain lines to be added to the history, like a password. ```js rl.on('history', (history) => { 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 without passing any | 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.040671560913324356,
0.006025872193276882,
0.0045329006388783455,
-0.057043857872486115,
0.05073033645749092,
-0.02951083332300186,
-0.07439646124839783,
0.013327610678970814,
-0.00009007308835862204,
-0.018389014527201653,
-0.0019164778059348464,
-0.07308675348758698,
0.0067221918143332005,
-0.06792452931404114,
-0.01119996514171362,
0.032968223094940186,
-0.030856775119900703,
0.007167750503867865,
-0.013408557511866093,
-0.06620101630687714,
0.04003128036856651,
-0.06480908393859863,
0.12128637731075287,
0.004178885370492935,
-0.1256418228149414,
-0.06836982816457748,
-0.04397983476519585,
0.028469927608966827,
0.07342472672462463,
-0.0899047926068306,
-0.03218461945652962,
0.06963078677654266,
-0.047649793326854706,
-0.07398116588592529,
0.003024154342710972,
-0.06884504854679108,
0.02727433294057846,
-0.09565138816833496,
0.009412250481545925,
-0.07588620483875275,
0.020318524911999702,
0.027963751927018166,
0.03718670457601547,
0.018619215115904808,
0.010315929539501667,
0.0056222849525511265,
-0.022530723363161087,
-0.036472138017416,
-0.02971668355166912,
0.06219249218702316,
0.02134615182876587,
0.07264705747365952,
0.02217620424926281,
-0.010376892052590847,
0.08757619559764862,
0.09181369096040726,
-0.01433510985225439,
-0.05758024379611015,
-0.01855916902422905,
-0.05403629690408707,
-0.03139781951904297,
-0.05302322283387184,
-0.059606995433568954,
0.0007257018005475402,
0.028209829702973366,
-0.03438098356127739,
0.05936749652028084,
-0.04914587363600731,
-0.018602056428790092,
-0.009966819547116756,
-0.01713361218571663,
-0.03060006909072399,
0.1248372495174408,
-0.003454283345490694,
0.005391211714595556,
0.05624546855688095,
0.03608892858028412,
-0.03618114814162254,
0.0008328846888616681,
-0.07446721196174622,
0.09551553428173065,
-0.013391919434070587,
0.04865171015262604,
0.033927708864212036,
0.016026515513658524,
-0.038937270641326904,
-0.008223211392760277,
0.021152354776859283,
0.06952168047428131,
0.06251295655965805,
0.02630915492773056,
0.034903790801763535,
-0.01965920440852642,
0.04027341306209564,
-0.025006607174873352,
-0.052347633987665176,
-0.06434372812509537,
0.013895988464355469,
0.003013146808370948,
-0.010539591312408447,
0.0443299375474453,
-0.010110165923833847,
-0.025702882558107376,
0.03372381627559662,
-0.012012585066258907,
0.10416284948587418,
0.10847747325897217,
0.08816389739513397,
0.03110327571630478,
-0.01732904650270939,
0.003876299597322941,
0.06326211988925934,
-0.06725598871707916,
0.10710055381059647,
2.8726290135013504e-33,
-0.035479847341775894,
-0.08601706475019455,
0.05304088443517685,
0.04188920557498932,
0.04585814103484154,
0.00043823191663250327,
0.016539083793759346,
-0.013799259439110756,
-0.1361600011587143,
-0.038721632212400436,
-0.012660377658903599,
-0.04885362088680267,
-0.012782207690179348,
-0.016922300681471825,
0.011177688837051392,
-0.03113100677728653,
0.05837630480527878,
-0.03333573415875435,
0.053276706486940384,
0.08072654157876968,
0.03590390831232071,
0.0140199214220047,
0.013958864845335484,
-0.04063619673252106,
0.028139939531683922,
-0.032227303832769394,
-0.0016477482859045267,
0.03836965933442116,
0.015147313475608826,
-0.010844669304788113,
0.019338343292474747,
-0.017421724274754524,
-0.01024719513952732,
-0.00852459017187357,
-0.025892548263072968,
-0.05831232666969299,
-0.015147203579545021,
-0.016312705352902412,
-0.10811837017536163,
-0.0676998570561409,
-0.0002266248338855803,
0.02220924198627472,
0.027260426431894302,
0.04523324966430664,
-0.0648631826043129,
-0.10058552026748657,
-0.11055352538824081,
0.032650548964738846,
-0.00912394467741251,
-0.037823423743247986,
-0.02030041255056858,
0.06977210938930511,
0.010142413899302483,
-0.10555179417133331,
0.08434084057807922,
-0.035270802676677704,
0.0022194543853402138,
0.037473414093256,
-0.020005272701382637,
0.07266419380903244,
0.0018630948616191745,
-0.011562609113752842,
0.0163328368216753,
0.01637406088411808,
0.05653278902173042,
0.05107741430401802,
-0.05814744904637337,
0.00022762989101465791,
0.03690999373793602,
0.015257633291184902,
-0.057311397045850754,
-0.018102331086993217,
-0.004115233663469553,
0.0318179577589035,
-0.0027229178231209517,
0.006151469424366951,
-0.12281008064746857,
-0.08829881995916367,
0.06722799688577652,
-0.02855530008673668,
0.06319988518953323,
-0.004625500645488501,
-0.04980520159006119,
0.1267324835062027,
0.01940220780670643,
-0.03348938375711441,
-0.033889807760715485,
-0.06712083518505096,
0.04624900966882706,
-0.007982995361089706,
-0.023858126252889633,
-0.021723974496126175,
0.06897240877151489,
-0.11004467308521271,
-0.07203555107116699,
-5.522371441117333e-33,
0.019839134067296982,
0.0018756866920739412,
-0.06348709017038345,
0.14025864005088806,
-0.058621786534786224,
-0.010418890975415707,
-0.029062403365969658,
0.00233273021876812,
0.04836751148104668,
0.0735967606306076,
-0.04329138994216919,
0.06356412172317505,
0.011935733258724213,
0.07477368414402008,
0.08600006997585297,
0.036795537918806076,
-0.035591255873441696,
-0.08213482797145844,
0.04502084106206894,
-0.026464469730854034,
-0.03144374117255211,
-0.039045996963977814,
0.012554237619042397,
0.0544525608420372,
-0.09749597311019897,
0.03140605241060257,
-0.05471070483326912,
0.007678088266402483,
-0.055663205683231354,
-0.062092844396829605,
-0.04669399559497833,
-0.015369834378361702,
-0.0768936276435852,
-0.004772785119712353,
-0.006429693195968866,
-0.02894909866154194,
0.003184974892064929,
0.09756043553352356,
-0.005674303043633699,
-0.02731621451675892,
0.149569571018219,
0.057196322828531265,
-0.028004785999655724,
-0.06862372905015945,
0.03016982600092888,
-0.013508341275155544,
-0.02084510587155819,
0.05719998851418495,
-0.026669107377529144,
0.00018728002032730728,
-0.03484300896525383,
-0.005110619589686394,
-0.02039708010852337,
0.0014724492793902755,
-0.013876911252737045,
-0.007758051156997681,
0.02193179726600647,
0.015486006624996662,
0.054400160908699036,
-0.028901217505335808,
-0.014000729657709599,
-0.12636733055114746,
-0.025389892980456352,
-0.009700605645775795,
0.050623275339603424,
-0.021791107952594757,
-0.01666555553674698,
-0.08624906092882156,
0.08754611015319824,
-0.023007458075881004,
0.06138644739985466,
0.007813806645572186,
-0.015042782761156559,
0.018946180120110512,
0.03742554038763046,
-0.006242613308131695,
-0.01771443895995617,
-0.1332423985004425,
-0.0059074354358017445,
0.09397169202566147,
-0.007817227393388748,
0.08111071586608887,
0.033099159598350525,
0.11420807987451553,
0.03687835484743118,
-0.006188820581883192,
0.0290939062833786,
0.02167007140815258,
0.05171975493431091,
0.026526015251874924,
0.04126754403114319,
0.038244880735874176,
-0.1477072387933731,
-0.00681034242734313,
-0.0036751385778188705,
-4.6503931372399165e-8,
-0.03897733986377716,
-0.049477994441986084,
-0.04989040642976761,
0.05144275352358818,
0.012238956987857819,
-0.02230643667280674,
-0.010696359910070896,
-0.06682734191417694,
0.04964187368750572,
0.010299758985638618,
-0.024395840242505074,
-0.064054936170578,
-0.018171070143580437,
-0.06338994204998016,
0.016180602833628654,
0.07532519847154617,
-0.0059975190088152885,
-0.04105905070900917,
-0.018937768414616585,
-0.04694778844714165,
0.020200636237859726,
0.04093753919005394,
-0.03846774995326996,
0.1127188578248024,
0.0023258512374013662,
0.0032926551066339016,
0.07729518413543701,
0.11369481682777405,
-0.0455331988632679,
-0.03863617032766342,
0.03729017451405525,
-0.011279379017651081,
0.11295203119516373,
0.02852041833102703,
-0.0072118970565497875,
-0.065090112388134,
0.03873647376894951,
0.014763048849999905,
0.050242021679878235,
0.05365999788045883,
0.024481847882270813,
0.060482483357191086,
-0.021163705736398697,
0.017299868166446686,
0.0042818458750844,
-0.057444874197244644,
-0.012805077247321606,
-0.02110205590724945,
0.013668558560311794,
0.007622275035828352,
-0.0272779930382967,
-0.00040093588177114725,
-0.051250066608190536,
-0.007304326165467501,
0.005049908999353647,
-0.04552561417222023,
0.016126563772559166,
-0.06101681664586067,
-0.03396891430020332,
0.01120082288980484,
0.03148315101861954,
-0.0030795573256909847,
0.0666363388299942,
-0.0712982639670372
] | 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 without passing any arguments. ```js rl.on('pause', () => { console.log('Readline paused.'); }); ``` ### Event: `'resume'` The `'resume'` event is emitted whenever the `input` stream is resumed. The listener function is called without passing any arguments. ```js rl.on('resume', () => { console.log('Readline resumed.'); }); ``` ### Event: `'SIGCONT'` The `'SIGCONT'` event is emitted when a Node.js process previously moved into the background using `Ctrl`+`Z` (i.e. `SIGTSTP`) is then brought back to the foreground using fg(1p). If the `input` stream was paused \_before\_ the `SIGTSTP` request, this event will not be emitted. The listener function is invoked without passing any arguments. ```js rl.on('SIGCONT', () => { // `prompt` will automatically resume the stream rl.prompt(); }); ``` The `'SIGCONT'` event is \_not\_ supported on Windows. ### Event: `'SIGINT'` The `'SIGINT'` event is emitted whenever the `input` stream receives a `Ctrl+C` input, known typically as `SIGINT`. If there are no `'SIGINT'` event listeners registered when the `input` stream receives a `SIGINT`, the `'pause'` event will be emitted. The listener function is invoked without passing any arguments. ```js rl.on('SIGINT', () => { rl.question('Are you sure you want to exit? ', (answer) => { if (answer.match(/^y(es)?$/i)) rl.pause(); }); }); ``` ### Event: `'SIGTSTP'` The `'SIGTSTP'` event is emitted when the `input` stream receives a `Ctrl`+`Z` input, typically known as `SIGTSTP`. If there are no `'SIGTSTP'` event listeners registered when the `input` stream receives a `SIGTSTP`, the Node.js process will be sent to the background. When the program is resumed using fg(1p), the `'pause'` and `'SIGCONT'` events will be emitted. These can be used to resume the `input` stream. The `'pause'` and `'SIGCONT'` events will not be emitted if the `input` was paused before the process was sent to the background. The listener function is invoked without passing any arguments. ```js rl.on('SIGTSTP', () => { // This will override SIGTSTP and prevent the program from going to the // background. console.log('Caught SIGTSTP.'); }); ``` The `'SIGTSTP'` event is \_not\_ supported on Windows. ### `rl.close()` The `rl.close()` method closes the `InterfaceConstructor` instance and relinquishes control over the `input` and `output` streams. When called, the `'close'` event will be emitted. Calling `rl.close()` does not immediately stop other events (including `'line'`) from being emitted by the `InterfaceConstructor` instance. ### `rl[Symbol.dispose]()` Alias for `rl.close()`. ### `rl.pause()` The `rl.pause()` method pauses the `input` stream, allowing it to be resumed later if necessary. Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `InterfaceConstructor` instance. ### `rl.prompt([preserveCursor])` \* `preserveCursor` {boolean} If `true`, prevents the cursor placement from being reset to `0`. The `rl.prompt()` method writes the `InterfaceConstructor` instances configured `prompt` to a new line in `output` in order to provide a user with a new location at which to provide input. When called, `rl.prompt()` will resume the `input` stream if it has been paused. If the `InterfaceConstructor` was created with `output` set to `null` or `undefined` the prompt is not written. ### `rl.resume()` The `rl.resume()` method resumes the `input` stream if it has been paused. ### `rl.setPrompt(prompt)` \* `prompt` {string} 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} \* `ctrl` {boolean} `true` to indicate | 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.023111935704946518,
-0.031017659232020378,
-0.03947989642620087,
-0.09096725285053253,
0.013669390231370926,
-0.07716593146324158,
-0.11505653709173203,
0.05376593768596649,
0.01915759965777397,
-0.046967655420303345,
-0.01051995437592268,
-0.08707106858491898,
0.0033324486576020718,
0.03245174139738083,
-0.05214414373040199,
0.06544625759124756,
-0.008507455699145794,
0.01571996696293354,
-0.09438340365886688,
-0.02959536202251911,
-0.04000310227274895,
-0.10788771510124207,
0.07828154414892197,
-0.04759792238473892,
-0.02480001002550125,
-0.036529820412397385,
0.003755462123081088,
0.003249596105888486,
-0.03640124574303627,
-0.09528960287570953,
-0.05585450679063797,
0.018319502472877502,
-0.022617345675826073,
-0.09772446006536484,
0.0051477826200425625,
-0.07274336367845535,
0.0746803805232048,
-0.03175479173660278,
0.024114059284329414,
-0.003229833673685789,
0.027930181473493576,
0.05014503002166748,
0.0028214065823704004,
-0.002861553570255637,
-0.001623953809030354,
0.019026925787329674,
-0.06893444061279297,
-0.09512007981538773,
-0.039259184151887894,
-0.07913569360971451,
0.05028487369418144,
-0.013867434114217758,
0.05091938376426697,
-0.012545401230454445,
0.028490686789155006,
0.0610535554587841,
0.0459231398999691,
-0.03674817830324173,
0.050477661192417145,
-0.036540720611810684,
-0.017819253727793694,
0.010524692945182323,
-0.11313119530677795,
0.008896187879145145,
0.04261469095945358,
-0.02151133306324482,
0.03242610767483711,
0.04869210347533226,
-0.09588312357664108,
-0.06259921193122864,
-0.02661641500890255,
0.02650667354464531,
0.1162065640091896,
-0.027151865884661674,
0.04400802403688431,
-0.019607948139309883,
0.03065074048936367,
-0.10006522387266159,
-0.014477015472948551,
-0.021722007542848587,
0.09267447143793106,
-0.03872477263212204,
0.06284245103597641,
0.007881397381424904,
-0.02584259584546089,
-0.01694353111088276,
-0.00022363575408235192,
0.060806699097156525,
0.10204828530550003,
-0.0038086327258497477,
0.03750927746295929,
0.03682670742273331,
-0.00989790353924036,
-0.07007621973752975,
0.012935343198478222,
-0.037744875997304916,
-0.003748597577214241,
0.027189940214157104,
0.019700171425938606,
0.003003160934895277,
0.07539336383342743,
-0.022394143044948578,
0.11327766627073288,
0.0738164633512497,
-0.004747326485812664,
0.05274083837866783,
0.04292040690779686,
0.133290633559227,
0.02312784269452095,
-0.05150522291660309,
-0.06538397818803787,
0.023823052644729614,
-0.0442853607237339,
0.0882965698838234,
2.3467545342587147e-33,
-0.03284177929162979,
-0.057763390243053436,
-0.12465719133615494,
0.024848703294992447,
-0.010586497373878956,
0.046867549419403076,
-0.018206380307674408,
0.03034687414765358,
-0.0494258888065815,
0.0016801436431705952,
-0.015953566879034042,
-0.010559122078120708,
0.010516038164496422,
-0.06772982329130173,
0.029610279947519302,
0.008172492496669292,
0.05056988447904587,
0.025633128359913826,
-0.00004801707109436393,
-0.006224776152521372,
0.00821930542588234,
-0.025188034400343895,
-0.006197808310389519,
0.14122642576694489,
0.012198345735669136,
0.03611285984516144,
-0.03735579922795296,
0.04174449294805527,
-0.03584964573383331,
0.0014665216440334916,
0.06243816763162613,
0.0009772753110155463,
-0.01644604653120041,
0.011928069405257702,
0.04565494507551193,
-0.04278283566236496,
-0.00816159974783659,
0.008332534693181515,
-0.03397291898727417,
-0.05867275595664978,
-0.02057669870555401,
-0.017624659463763237,
-0.10253757238388062,
-0.012348695658147335,
-0.03753845766186714,
-0.1604565978050232,
-0.07411928474903107,
0.03895194083452225,
0.026235077530145645,
0.010488023981451988,
-0.003498306032270193,
0.0884229987859726,
0.06821729987859726,
-0.01945449598133564,
0.043386321514844894,
0.05777245759963989,
-0.020257417112588882,
0.07135853171348572,
-0.08589137345552444,
0.058465175330638885,
0.031319595873355865,
0.014597087167203426,
0.06770245730876923,
0.043596331030130386,
0.04319506883621216,
0.0399618074297905,
-0.09192643314599991,
-0.043079424649477005,
0.02554912120103836,
-0.030648039653897285,
-0.0198130551725626,
0.009170587174594402,
0.05336520075798035,
0.026042530313134193,
0.029398581013083458,
0.0324820876121521,
-0.1389804184436798,
-0.02580658160150051,
0.03924223780632019,
0.06699252128601074,
0.06702900677919388,
-0.0041764872148633,
-0.004245793912559748,
0.061255134642124176,
0.08508125692605972,
-0.0004329509101808071,
-0.05427161976695061,
-0.013805322349071503,
-0.04713935777544975,
0.05303844437003136,
-0.02215588092803955,
0.052719034254550934,
0.04760270565748215,
-0.0770762488245964,
-0.03496859595179558,
-5.337018022511736e-33,
0.0025730046909302473,
0.04380498081445694,
-0.04007037356495857,
0.07647208869457245,
-0.03983898088335991,
-0.015443636104464531,
-0.02252182736992836,
0.054076697677373886,
-0.0340447798371315,
-0.0006919490406289697,
0.04559410363435745,
0.0560859814286232,
-0.03461376577615738,
0.0827849954366684,
-0.025060802698135376,
0.05523724481463432,
0.01709624007344246,
-0.02959158457815647,
-0.008154870010912418,
0.05436357483267784,
0.00585049856454134,
-0.09890099614858627,
0.042912449687719345,
0.021327314898371696,
-0.08575122058391571,
-0.0010756843257695436,
0.03355962410569191,
-0.02840437926352024,
-0.043663326650857925,
0.005554968025535345,
0.0007688581827096641,
0.044318314641714096,
-0.04100967198610306,
0.02860417030751705,
0.026225818321108818,
-0.06618096679449081,
0.04389515891671181,
0.06649702787399292,
-0.011163316667079926,
-0.018302474170923233,
0.14732711017131805,
0.05117008462548256,
-0.0008815068285912275,
-0.03829461708664894,
-0.006130370777100325,
0.010678890161216259,
-0.041378870606422424,
0.05103006958961487,
-0.03382408618927002,
-0.06102310121059418,
-0.06816421449184418,
-0.014146646484732628,
0.019425882026553154,
0.06436243653297424,
-0.0022521289065480232,
0.03557009622454643,
-0.003547852858901024,
-0.01614879071712494,
-0.029890460893511772,
0.0035271658562123775,
0.0011561114806681871,
-0.11684157699346542,
-0.044070109724998474,
-0.02897331677377224,
0.07502980530261993,
-0.014381426386535168,
0.03035748191177845,
0.04472028836607933,
0.08533540368080139,
-0.033643756061792374,
0.09609398245811462,
0.0006001937435939908,
-0.02115321345627308,
-0.03356766328215599,
-0.039589349180459976,
0.03863653168082237,
-0.05911221355199814,
-0.11095427721738815,
0.025950096547603607,
-0.020090999081730843,
0.026062186807394028,
0.03693142533302307,
-0.013867491856217384,
-0.03380158916115761,
0.03766970708966255,
0.07427304983139038,
-0.032212693244218826,
0.04465115815401077,
0.02405787631869316,
-0.08187643438577652,
0.02401966042816639,
0.10549952834844589,
-0.07612905651330948,
-0.009935596957802773,
0.010849103331565857,
-5.230099020536727e-8,
-0.03472589701414108,
-0.02834719978272915,
-0.026290807873010635,
-0.07845378667116165,
0.0010507089318707585,
-0.007481483742594719,
0.004095347598195076,
-0.08442191034555435,
-0.06828086823225021,
-0.004797428380697966,
-0.05891023948788643,
-0.0023931441828608513,
0.05960999056696892,
-0.028449175879359245,
-0.01980217732489109,
0.008558881469070911,
0.02739264816045761,
0.06222527101635933,
-0.015195969492197037,
-0.03620590642094612,
0.06474955379962921,
-0.012398303486406803,
-0.05318199843168259,
0.0419202484190464,
-0.0017037081997841597,
-0.06540049612522125,
0.03714008629322052,
0.04834594205021858,
0.036859337240457535,
-0.1538454294204712,
0.00001381088986818213,
0.045426465570926666,
0.059009648859500885,
-0.01933252438902855,
-0.055943187326192856,
-0.011520068161189556,
0.0588691271841526,
-0.04299212619662285,
0.06290651112794876,
-0.029273828491568565,
0.074777752161026,
-0.01733534224331379,
-0.03353559598326683,
0.027261527255177498,
-0.05105575919151306,
0.02222566120326519,
0.014154752716422081,
0.02788221277296543,
0.055399343371391296,
0.019412241876125336,
-0.09337576478719711,
-0.02945367433130741,
0.0046933176927268505,
-0.032740287482738495,
0.06300000101327896,
-0.035190779715776443,
-0.023724395781755447,
-0.07652464509010315,
-0.002314346143975854,
-0.00847598910331726,
0.075406014919281,
0.046691615134477615,
-0.09803206473588943,
-0.034457914531230927
] | 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} \* `ctrl` {boolean} `true` to indicate the `Ctrl` key. \* `meta` {boolean} `true` to indicate the `Meta` key. \* `shift` {boolean} `true` to indicate the `Shift` key. \* `name` {string} The name of the a key. The `rl.write()` method will write either `data` or a key sequence identified by `key` to the `output`. The `key` argument is supported only if `output` is a [TTY][] text terminal. See [TTY keybindings][] for a list of key combinations. If `key` is specified, `data` is ignored. When called, `rl.write()` will resume the `input` stream if it has been paused. If the `InterfaceConstructor` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. ```js rl.write('Delete this!'); // Simulate Ctrl+U to delete the line written previously rl.write(null, { ctrl: true, name: 'u' }); ``` The `rl.write()` method will write the data to the `readline` `Interface`'s `input` \_as if it were provided by the user\_. ### `rl[Symbol.asyncIterator]()` \* Returns: {AsyncIterator} Create an `AsyncIterator` object that iterates through each line in the input stream as a string. This method allows asynchronous iteration of `InterfaceConstructor` objects through `for await...of` loops. Errors in the input stream are not forwarded. If the loop is terminated with `break`, `throw`, or `return`, [`rl.close()`][] will be called. In other words, iterating over a `InterfaceConstructor` will always consume the input stream fully. Performance is not on par with the traditional `'line'` event API. Use `'line'` instead for performance-sensitive applications. ```js async function processLineByLine() { const rl = readline.createInterface({ // ... }); for await (const line of rl) { // Each line in the readline input will be successively available here as // `line`. } } ``` `readline.createInterface()` will start to consume the input stream once invoked. Having asynchronous operations between interface creation and asynchronous iteration may result in missed lines. ### `rl.line` \* Type: {string} The current input data being processed by node. This can be used when collecting input from a TTY stream to retrieve the current value that has been processed thus far, prior to the `line` event being emitted. Once the `line` event has been emitted, this property will be an empty string. Be aware that modifying the value during the instance runtime may have unintended consequences if `rl.cursor` is not also controlled. \*\*If not using a TTY stream for input, use the [`'line'`][] event.\*\* One possible use case would be as follows: ```js const values = ['lorem ipsum', 'dolor sit amet']; const rl = readline.createInterface(process.stdin); const showResults = debounce(() => { console.log( '\n', values.filter((val) => val.startsWith(rl.line)).join(' '), ); }, 300); process.stdin.on('keypress', (c, k) => { showResults(); }); ``` ### `rl.cursor` \* Type: {number|undefined} The cursor position relative to `rl.line`. This will track where the current cursor lands in the input string, when reading input from a TTY stream. The position of cursor determines the portion of the input string that will be modified as input is processed, as well as the column where the terminal caret will be rendered. ### `rl.getCursorPos()` \* Returns: {Object} \* `rows` {number} the row of the 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 | 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.024563590064644814,
0.055119749158620834,
-0.055102065205574036,
-0.05811498314142227,
-0.03251400589942932,
-0.021879922598600388,
-0.07034838944673538,
0.09095810353755951,
0.047932736575603485,
0.055920567363500595,
0.04597672075033188,
-0.007009358145296574,
0.003839370096102357,
0.08335933089256287,
0.014254963956773281,
0.0006980706239119172,
0.008874288760125637,
-0.03503356873989105,
0.02459484338760376,
0.007674441207200289,
0.04614652320742607,
0.013634571805596352,
0.05321475490927696,
0.013281150721013546,
-0.02370154857635498,
-0.02176515758037567,
-0.05132576823234558,
-0.01257163193076849,
-0.01802469789981842,
-0.062358785420656204,
-0.004344653338193893,
-0.043772172182798386,
-0.06117231771349907,
-0.10927589982748032,
0.024851221591234207,
-0.030205123126506805,
0.01366116851568222,
-0.010715587995946407,
0.05683145299553871,
-0.005824531894177198,
-0.01789199933409691,
0.02124052122235298,
0.038077209144830704,
-0.012528455816209316,
-0.06973771750926971,
0.021137753501534462,
-0.04449940472841263,
-0.07125484943389893,
-0.003205797867849469,
-0.08846648782491684,
0.068641297519207,
-0.05582857131958008,
0.06313467025756836,
-0.05083713307976723,
-0.014876972883939743,
0.11365704983472824,
0.013809656724333763,
-0.12308226525783539,
-0.029030798003077507,
-0.07633838802576065,
-0.04078681021928787,
-0.029966499656438828,
-0.04763827845454216,
0.06798188388347626,
-0.005424771457910538,
-0.0721413791179657,
0.031412750482559204,
-0.018578853458166122,
-0.03963405638933182,
-0.05211084336042404,
0.058966927230358124,
0.030911510810256004,
0.05934973061084747,
0.05030987039208412,
0.010661565698683262,
0.02021171897649765,
0.03622983768582344,
-0.006691314280033112,
-0.11001478880643845,
0.022110428661108017,
0.025321992114186287,
-0.08451412618160248,
0.07754217088222504,
0.018269885331392288,
-0.05309668555855751,
-0.019165612757205963,
0.0076074982061982155,
-0.0033174906857311726,
-0.0351119227707386,
0.023626968264579773,
0.0030319164507091045,
0.009398240596055984,
0.009876600466668606,
0.009522568434476852,
-0.03349436819553375,
-0.01417627464979887,
-0.04740985110402107,
0.017624063417315483,
0.024269241839647293,
0.050703033804893494,
0.012743012979626656,
-0.01042998768389225,
0.037173785269260406,
-0.052896153181791306,
0.05095110088586807,
0.0253827515989542,
0.029815146699547768,
0.0768914669752121,
-0.040561776608228683,
-0.06845545768737793,
0.00995627325028181,
0.059980396181344986,
-0.09244101494550705,
-0.031516820192337036,
1.5372124215050331e-33,
0.06791944056749344,
0.019281886518001556,
-0.020726650953292847,
0.025913475081324577,
0.007532298564910889,
0.11347341537475586,
0.08813239634037018,
0.05210978537797928,
0.025262735784053802,
-0.0019776406697928905,
0.0024765203706920147,
0.017079148441553116,
-0.025131594389677048,
-0.03654518723487854,
-0.061639685183763504,
0.030439205467700958,
0.027090996503829956,
0.04799643158912659,
-0.0397891029715538,
0.044970277696847916,
0.03272024542093277,
0.061146363615989685,
0.046900637447834015,
0.009303583763539791,
0.030570920556783676,
0.013322342187166214,
-0.04458294436335564,
-0.017232438549399376,
-0.025988398119807243,
0.035033680498600006,
-0.004754581488668919,
-0.045203205198049545,
-0.02083238586783409,
0.12124384939670563,
-0.027719059959053993,
-0.039139825850725174,
-0.017041150480508804,
-0.004279572516679764,
-0.004588348791003227,
0.015012968331575394,
-0.00264231045730412,
-0.06654664129018784,
-0.09473375976085663,
0.029577402397990227,
-0.07748118788003922,
-0.12992419302463531,
-0.08568967133760452,
0.09656156599521637,
0.01836417056620121,
0.08512373268604279,
0.02401774749159813,
0.0618208572268486,
0.010836731642484665,
0.0019605837296694517,
0.015034143812954426,
-0.053533971309661865,
-0.021597450599074364,
0.03762026131153107,
0.030936716124415398,
0.026662129908800125,
-0.0508362352848053,
0.07768949866294861,
0.050858937203884125,
0.0288385059684515,
0.029302343726158142,
0.08496952056884766,
0.004739735741168261,
-0.11840028315782547,
0.03927204757928848,
0.037069398909807205,
-0.09797202050685883,
0.01120587158948183,
-0.05835438519716263,
0.0030974603723734617,
-0.0037229149602353573,
0.004410129971802235,
-0.04446469619870186,
-0.08138774335384369,
0.03432822227478027,
0.056690335273742676,
0.03223613277077675,
0.04775676876306534,
-0.08635718375444412,
0.03763436898589134,
0.07377686351537704,
-0.0592513270676136,
0.005786956753581762,
-0.03772395849227905,
-0.020028745755553246,
-0.05120929703116417,
0.006284236442297697,
-0.05679287388920784,
0.022831857204437256,
0.03779278323054314,
0.008605440147221088,
-3.3021664042353225e-33,
0.10298918187618256,
-0.016133977100253105,
-0.012225323356688023,
0.08119718730449677,
-0.11898015439510345,
-0.10131029039621353,
0.007086115423589945,
-0.04325413331389427,
0.0034412010572850704,
-0.06295964866876602,
0.01692776195704937,
0.09310952574014664,
0.009152437560260296,
0.05980490893125534,
0.06371939182281494,
0.02442036010324955,
0.0005229751695878804,
-0.019247373566031456,
-0.02898852899670601,
-0.0146613959223032,
-0.07708868384361267,
-0.04948607459664345,
-0.019929150119423866,
0.09262477606534958,
-0.010139021091163158,
-0.06187234818935394,
0.052704691886901855,
0.009580498561263084,
-0.015030104666948318,
-0.0587957426905632,
0.059006743133068085,
0.12530702352523804,
-0.0140653345733881,
0.014662807807326317,
-0.07014113664627075,
0.02450012043118477,
0.07833092659711838,
0.03209831565618515,
-0.00731310760602355,
0.09409007430076599,
0.1577788144350052,
0.0009689078433439136,
-0.004532880149781704,
-0.03593345358967781,
-0.06040875241160393,
-0.0057061281986534595,
-0.0047647180035710335,
0.020194320008158684,
0.048118505626916885,
-0.030706685036420822,
0.09271994978189468,
-0.08668521046638489,
0.04114479199051857,
-0.021088384091854095,
-0.03505454957485199,
-0.03559819608926773,
-0.07731896638870239,
-0.023840991780161858,
0.016146447509527206,
-0.02916286699473858,
-0.01553378626704216,
-0.039169203490018845,
-0.006337431725114584,
0.004549629986286163,
-0.061097316443920135,
-0.08221070468425751,
0.018395954743027687,
0.00032882619416341186,
0.042573366314172745,
-0.01795952580869198,
0.09204388409852982,
-0.07585636526346207,
0.02461860328912735,
0.014028916135430336,
0.055215105414390564,
0.020618032664060593,
-0.09576297551393509,
-0.13371215760707855,
-0.03857149928808212,
0.059960026293992996,
0.05390206351876259,
0.023425698280334473,
0.008887242525815964,
0.013195973820984364,
-0.04904517903923988,
0.03809560090303421,
-0.03731118142604828,
0.16829003393650055,
-0.0013757453998550773,
-0.01258003432303667,
-0.002705902559682727,
0.05218581482768059,
-0.05864616855978966,
0.0530683770775795,
0.05180016905069351,
-4.914492635066381e-8,
0.020042330026626587,
-0.03453842177987099,
0.006297835148870945,
0.009798480197787285,
0.04705432429909706,
0.03629882261157036,
0.01689261384308338,
-0.10401127487421036,
0.013938999734818935,
-0.043664585798978806,
-0.03885043412446976,
0.010637735016644001,
-0.004994602873921394,
-0.045237187296152115,
-0.025004759430885315,
0.08132366836071014,
-0.006552248261868954,
0.022895701229572296,
0.00036048487527295947,
-0.03796369209885597,
0.04529862850904465,
-0.06077184900641441,
-0.029030393809080124,
0.0033507170155644417,
0.010528995655477047,
-0.017994746565818787,
0.02120102010667324,
0.07635226845741272,
-0.11078600585460663,
-0.0360872745513916,
0.046486746519804,
-0.03286121413111687,
0.0879829004406929,
0.057626161724328995,
-0.008707953616976738,
0.02822863683104515,
0.09005323797464371,
0.044827643781900406,
-0.002535519888624549,
0.03423303738236427,
0.01000998541712761,
0.03641384840011597,
-0.08898743242025375,
-0.022975213825702667,
-0.16466902196407318,
-0.004860758315771818,
0.03214765712618828,
0.00799713097512722,
0.015359250828623772,
-0.07947281002998352,
-0.0836120992898941,
0.0074674757197499275,
-0.04345805570483208,
0.012002340517938137,
-0.0699552521109581,
0.048598770052194595,
-0.041289664804935455,
0.015999995172023773,
-0.03595477715134621,
-0.01920081488788128,
-0.023332932963967323,
0.0696495994925499,
-0.011628100648522377,
-0.06030574440956116
] | 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: `readlinePromises.Interface` \* Extends: {readline.InterfaceConstructor} Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a single `input` [Readable][] stream and a single `output` [Writable][] stream. The `output` stream is used to print prompts for user input that arrives on, and is read from, the `input` stream. #### `rl.question(query[, options])` \* `query` {string} A statement or query to write to `output`, prepended to the prompt. \* `options` {Object} \* `signal` {AbortSignal} Optionally allows the `question()` to be canceled using an `AbortSignal`. \* Returns: {Promise} A promise that is fulfilled with the user's input in response to the `query`. The `rl.question()` method displays the `query` by writing it to the `output`, waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. When called, `rl.question()` will resume the `input` stream if it has been paused. If the `readlinePromises.Interface` was created with `output` set to `null` or `undefined` the `query` is not written. If the question is called after `rl.close()`, it returns a rejected promise. Example usage: ```mjs const answer = await rl.question('What is your favorite food? '); console.log(`Oh, so your favorite food is ${answer}`); ``` Using an `AbortSignal` to cancel a question. ```mjs const signal = AbortSignal.timeout(10\_000); signal.addEventListener('abort', () => { console.log('The food question timed out'); }, { once: true }); const answer = await rl.question('What is your favorite food? ', { signal }); console.log(`Oh, so your favorite food is ${answer}`); ``` ### Class: `readlinePromises.Readline` #### `new readlinePromises.Readline(stream[, options])` \* `stream` {stream.Writable} A [TTY][] stream. \* `options` {Object} \* `autoCommit` {boolean} If `true`, no need to call `rl.commit()`. #### `rl.clearLine(dir)` \* `dir` {integer} \* `-1`: to the left from cursor \* `1`: to the right from cursor \* `0`: the entire line \* Returns: this The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`. Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. #### `rl.clearScreenDown()` \* Returns: this The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated stream from the current position of the cursor down. Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. #### `rl.commit()` \* Returns: {Promise} The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. #### `rl.cursorTo(x[, y])` \* `x` {integer} \* `y` {integer} \* Returns: this The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`. Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. #### `rl.moveCursor(dx, dy)` \* `dx` {integer} \* `dy` {integer} \* Returns: this The `rl.moveCursor()` method adds to the internal list of pending action an action that moves 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 associated `stream`. | 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.01025877520442009,
-0.014735156670212746,
-0.023036913946270943,
-0.08154090493917465,
-0.08843771368265152,
-0.031217074021697044,
-0.027113622054457664,
0.06853865832090378,
0.05776509642601013,
0.019014304503798485,
0.03332914039492607,
-0.019350968301296234,
0.004151470027863979,
0.008011465892195702,
0.006478090770542622,
0.05258367955684662,
-0.0235554501414299,
-0.05151583254337311,
0.043387364596128464,
-0.03816819190979004,
0.05836087092757225,
-0.038663480430841446,
0.0013743193121626973,
-0.00036468470352701843,
-0.06774871051311493,
-0.055089909583330154,
-0.05944688990712166,
0.1008002758026123,
-0.03687834367156029,
-0.04246767237782478,
0.01026800088584423,
0.007825647480785847,
-0.08530522137880325,
-0.09566329419612885,
-0.03239572420716286,
-0.03779729828238487,
0.03325769677758217,
-0.08364135026931763,
0.05347742140293121,
-0.031845804303884506,
0.034154701977968216,
0.02647814340889454,
0.05412319302558899,
0.012644344009459019,
-0.02849384769797325,
0.0033311862498521805,
-0.029295625165104866,
-0.07194867730140686,
-0.04811803996562958,
-0.015646526589989662,
0.043283186852931976,
0.013312948867678642,
0.01627979427576065,
0.006928684189915657,
0.06237330660223961,
0.11692065745592117,
-0.027569908648729324,
-0.10635857284069061,
0.03942721337080002,
-0.08081334084272385,
-0.00905709620565176,
-0.00736128818243742,
0.024523388594388962,
-0.026638764888048172,
-0.004890537820756435,
-0.01200330164283514,
-0.01228332333266735,
-0.010917698964476585,
-0.029907504096627235,
-0.019261714071035385,
0.05246569588780403,
0.009268478490412235,
0.053187619894742966,
0.05279182642698288,
-0.02776244655251503,
0.08161593228578568,
0.03155622258782387,
-0.012080392800271511,
-0.11034053564071655,
-0.045087508857250214,
0.07363637536764145,
-0.08643876016139984,
0.07549837231636047,
0.032033465802669525,
-0.10535677522420883,
-0.046215884387493134,
0.032918427139520645,
-0.00184472999535501,
0.015290088951587677,
0.07566742599010468,
-0.030726514756679535,
-0.04697803035378456,
-0.007410750724375248,
0.0010257977992296219,
-0.025914648547768593,
-0.041856806725263596,
-0.0714595839381218,
0.02792002260684967,
-0.025433169677853584,
-0.013221639208495617,
0.019713183864951134,
-0.0050147054716944695,
0.02724725939333439,
-0.014057123102247715,
-0.0404437817633152,
0.09643684327602386,
0.010521050542593002,
0.10691356658935547,
0.05981511250138283,
-0.05788347125053406,
-0.02201971225440502,
0.08232075721025467,
-0.0379263311624527,
0.03845025599002838,
5.3889645872425115e-33,
0.011347317136824131,
-0.053204040974378586,
0.022541852667927742,
0.009758965112268925,
0.03298574313521385,
0.08534469455480576,
-0.018422218039631844,
0.12645545601844788,
-0.0024074420798569918,
-0.029394377022981644,
0.0018820385448634624,
-0.02602001279592514,
0.02120770514011383,
-0.011086244136095047,
0.032258640974760056,
-0.019134975969791412,
0.07447730749845505,
0.08007266372442245,
-0.06596580147743225,
0.09206090867519379,
0.03693685308098793,
0.08552056550979614,
-0.02781102992594242,
-0.04682979732751846,
0.0512564480304718,
0.07528392970561981,
-0.0515085831284523,
0.03850671276450157,
-0.03415251523256302,
0.014679229818284512,
-0.024639884009957314,
-0.04712916165590286,
-0.06917116791009903,
0.01912258192896843,
0.002677743788808584,
-0.025522712618112564,
0.02834656462073326,
-0.04969947785139084,
0.0010319672292098403,
-0.01573069952428341,
-0.047924529761075974,
-0.037244752049446106,
0.03267455846071243,
0.04776697978377342,
-0.06349416077136993,
-0.1118205338716507,
-0.07798050343990326,
0.05813182517886162,
-0.008476067334413528,
0.01442287489771843,
-0.027823353186249733,
0.06666552275419235,
0.03495583310723305,
-0.06328293681144714,
0.07176649570465088,
-0.08358819782733917,
0.021789630874991417,
0.05914252623915672,
0.041713278740644455,
0.020515143871307373,
-0.07323004305362701,
0.051751311868429184,
0.002020320389419794,
-0.012594370171427727,
0.002220167312771082,
0.07845653593540192,
-0.03132050856947899,
-0.06450293213129044,
0.08241647481918335,
0.009267836809158325,
-0.08959425985813141,
0.03249884024262428,
-0.01285397820174694,
0.009838768281042576,
0.00452422397211194,
-0.02763918600976467,
-0.07709153741598129,
-0.10017258673906326,
0.06555549055337906,
-0.0000010639131460266071,
0.047613147646188736,
0.000580723921302706,
-0.07525832951068878,
0.08058150857686996,
-0.01124219223856926,
-0.02715662680566311,
0.020655784755945206,
-0.07770919799804688,
0.005825687199831009,
-0.0923532173037529,
-0.008879031054675579,
-0.044393084943294525,
0.04538188502192497,
-0.10134835541248322,
-0.03747823089361191,
-7.310599201803446e-33,
0.0989074856042862,
-0.015389245934784412,
-0.05992380902171135,
0.043241169303655624,
-0.04261324927210808,
-0.04188324883580208,
0.05149569362401962,
0.014075461775064468,
0.03152308613061905,
-0.04017708823084831,
-0.0485256165266037,
0.12527363002300262,
0.041687168180942535,
0.013677690178155899,
0.04803567752242088,
0.05283565819263458,
-0.061394788324832916,
-0.05929335206747055,
0.023581037297844887,
-0.05327589064836502,
0.003909436520189047,
-0.0018346653087064624,
0.00786826852709055,
0.04461199417710304,
-0.03746351972222328,
-0.03386061266064644,
0.04986979067325592,
0.021101223304867744,
-0.03997150808572769,
0.007625324185937643,
-0.03138301894068718,
-0.04697832092642784,
-0.058436986058950424,
0.001327332342043519,
-0.05674070864915848,
-0.010473119094967842,
0.08618351817131042,
0.027467725798487663,
-0.05194195732474327,
0.037656307220458984,
0.16783387959003448,
-0.010604210197925568,
0.05217627063393593,
0.0020922161638736725,
-0.000177159090526402,
-0.03038140945136547,
-0.044816453009843826,
0.04960477724671364,
-0.012304860167205334,
-0.019071290269494057,
0.0314318910241127,
0.02556956559419632,
-0.008097787387669086,
0.010819860734045506,
-0.0317915640771389,
-0.04784673452377319,
0.006576064974069595,
-0.05842800810933113,
0.037960197776556015,
-0.048194922506809235,
-0.01081402599811554,
-0.011135443113744259,
-0.031818535178899765,
-0.02289901301264763,
0.07129281014204025,
-0.04829387739300728,
-0.039124082773923874,
-0.0671602264046669,
0.01341424323618412,
-0.06443048268556595,
0.07001214474439621,
-0.07310750335454941,
0.003314634785056114,
0.012322424910962582,
0.10485795885324478,
0.07481588423252106,
-0.01559525728225708,
-0.12836700677871704,
-0.006928060203790665,
0.08586867898702621,
0.010356963612139225,
-0.011111019179224968,
0.09145529568195343,
0.0757237896323204,
-0.007160266395658255,
-0.008790426887571812,
0.013768390752375126,
0.12341137230396271,
0.006398544646799564,
0.05794935300946236,
0.0014372438890859485,
0.038176268339157104,
-0.07158325612545013,
0.09505067765712738,
-0.000923950516153127,
-5.797677005148216e-8,
-0.053496234118938446,
0.008559172041714191,
-0.020913846790790558,
0.03913191333413124,
0.06322632730007172,
-0.01598193310201168,
-0.027101270854473114,
-0.04597269371151924,
0.016648540273308754,
-0.01149267889559269,
-0.027111347764730453,
-0.0048183235339820385,
0.012334054335951805,
-0.04101823642849922,
0.09370926767587662,
0.07740353792905807,
-0.009429125115275383,
-0.0467664934694767,
-0.11160939186811447,
-0.08755018562078476,
0.04163970798254013,
-0.027146294713020325,
-0.09915435314178467,
-0.018019603565335274,
0.002934907330200076,
0.027138428762555122,
0.0002568276831880212,
0.13899356126785278,
-0.07931199669837952,
-0.018506726250052452,
0.030483433976769447,
-0.010262430645525455,
0.054223597049713135,
0.06975188851356506,
-0.001213108655065298,
0.015473134815692902,
0.09266407042741776,
0.029414040967822075,
0.022319652140140533,
0.04400340095162392,
-0.03200056776404381,
-0.025934763252735138,
-0.08359783887863159,
0.01709078997373581,
-0.0182886254042387,
-0.029364177957177162,
0.014728935435414314,
-0.030987193807959557,
0.04590959846973419,
-0.018964560702443123,
-0.113711416721344,
-0.038232531398534775,
-0.0047752088867127895,
-0.007260156329721212,
-0.05315835401415825,
-0.008578655309975147,
-0.021187512204051018,
-0.04194408655166626,
-0.04009833186864853,
0.05734030902385712,
0.05623045563697815,
0.06105870008468628,
0.05267784371972084,
0.004285189788788557
] | 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 associated `stream`. ### `readlinePromises.createInterface(options)` \* `options` {Object} \* `input` {stream.Readable} The [Readable][] stream to listen to. This option is \_required\_. \* `output` {stream.Writable} The [Writable][] stream to write readline data to. \* `completer` {Function} An optional function used for Tab 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 only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. \*\*Default:\*\* `[]`. \* `historySize` {number} Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. \*\*Default:\*\* `30`. \* `removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. \*\*Default:\*\* `false`. \* `prompt` {string} The prompt string to use. \*\*Default:\*\* `'> '`. \* `crlfDelay` {number} If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds, both `\r` and `\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\r` followed by `\n` will always be considered a single newline (which may be reasonable for [reading files][] with `\r\n` line delimiter). \*\*Default:\*\* `100`. \* `escapeCodeTimeout` {number} The duration `readlinePromises` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence). \*\*Default:\*\* `500`. \* `tabSize` {integer} The number of spaces a tab is equal to (minimum 1). \*\*Default:\*\* `8`. \* `signal` {AbortSignal} Allows closing the interface using an AbortSignal. \* Returns: {readlinePromises.Interface} The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. ```mjs import { createInterface } from 'node:readline/promises'; import { stdin, stdout } from 'node:process'; const rl = createInterface({ input: stdin, output: stdout, }); ``` ```cjs const { createInterface } = require('node:readline/promises'); const rl = createInterface({ input: process.stdin, output: process.stdout, }); ``` Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event: ```js rl.on('line', (line) => { console.log(`Received: ${line}`); }); ``` If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property and emits a `'resize'` event on the `output` if or when the columns ever change ([`process.stdout`][] does this automatically when it is a TTY). #### Use of the `completer` function The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: \* An `Array` with matching entries 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 found return [hits.length ? hits : completions, | 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.022389208897948265,
-0.03124479204416275,
-0.025965720415115356,
-0.08711271733045578,
-0.06064950302243233,
-0.1051829382777214,
-0.04475776478648186,
-0.008364430628716946,
0.03581388294696808,
0.07495523244142532,
0.06099209561944008,
0.022701462730765343,
-0.027385547757148743,
0.011975082568824291,
-0.02675461396574974,
0.02391710691154003,
-0.025510508567094803,
-0.04114173352718353,
0.010886519216001034,
-0.057691220194101334,
-0.028699524700641632,
-0.019620882347226143,
0.05179528146982193,
-0.048001497983932495,
-0.04117252305150032,
-0.019255919381976128,
-0.018855687230825424,
0.07324463874101639,
0.01686602272093296,
-0.0627591460943222,
-0.026733560487627983,
-0.05343000963330269,
-0.052591048181056976,
-0.08908543735742569,
-0.08458453416824341,
-0.039035864174366,
0.029802091419696808,
-0.07870043069124222,
0.0714164599776268,
-0.027916831895709038,
0.022000370547175407,
-0.007129292469471693,
0.06757167726755142,
0.03725552558898926,
-0.07973983138799667,
-0.014991961419582367,
-0.029286706820130348,
-0.016961202025413513,
0.003270915476605296,
-0.06865391135215759,
-0.01635831780731678,
-0.06475009024143219,
0.010779140517115593,
-0.015101667493581772,
0.04993651807308197,
0.10417405515909195,
0.06493070721626282,
-0.030077457427978516,
-0.004808790981769562,
-0.12218360602855682,
-0.026599951088428497,
0.025424817577004433,
-0.08168500661849976,
0.03568591922521591,
0.017632756382226944,
-0.08801308274269104,
-0.0135465944185853,
-0.010058597661554813,
-0.07267952710390091,
-0.011355002410709858,
0.04215791076421738,
-0.006372492294758558,
0.07671567797660828,
0.038623444736003876,
-0.023632973432540894,
0.08784591406583786,
0.04408208280801773,
-0.013366656377911568,
-0.0740026906132698,
0.02256053313612938,
-0.007623475510627031,
-0.061169665306806564,
0.053343500941991806,
0.11808716505765915,
-0.04070676863193512,
-0.04393129423260689,
-0.005212495103478432,
0.07824181765317917,
0.05820145830512047,
0.0273978840559721,
0.026413625106215477,
0.02162518911063671,
0.009580249898135662,
0.011010889895260334,
-0.030993923544883728,
-0.016252370551228523,
-0.032136112451553345,
-0.03224983811378479,
0.006324459798634052,
0.0021033110097050667,
0.041933659464120865,
-0.037506911903619766,
0.11925435811281204,
-0.05355100333690643,
-0.0048945602029562,
0.0733574628829956,
0.08967475593090057,
0.1070825383067131,
-0.0007003610371612012,
-0.07176041603088379,
-0.002878292929381132,
0.07842724025249481,
-0.08355464786291122,
0.04404526203870773,
2.9179628714957735e-33,
0.04902123287320137,
-0.071158766746521,
-0.06802492588758469,
0.017424533143639565,
0.06340435892343521,
0.05189859867095947,
-0.03441149741411209,
0.0496087409555912,
-0.030291534960269928,
-0.020461848005652428,
-0.02652146853506565,
-0.02778637781739235,
-0.07033688575029373,
0.04083012789487839,
-0.06206879764795303,
-0.04389592260122299,
0.039677299559116364,
0.04903552308678627,
-0.04034431278705597,
0.08646390587091446,
0.08098426461219788,
0.07388696819543839,
-0.05989767611026764,
-0.05688745900988579,
-0.021558362990617752,
0.01583213172852993,
-0.04162338748574257,
0.04897752031683922,
-0.0666113942861557,
0.036943186074495316,
-0.046372756361961365,
0.012402037158608437,
0.023198725655674934,
0.0356256365776062,
-0.025088615715503693,
-0.01949198730289936,
-0.07195304334163666,
-0.03759504482150078,
0.032737087458372116,
-0.008225921541452408,
0.03841772675514221,
0.01298670656979084,
-0.1393871307373047,
0.01100106630474329,
-0.06804659217596054,
-0.11504541337490082,
-0.00016969401622191072,
0.08114679157733917,
0.04156400263309479,
0.04255027323961258,
0.04834812134504318,
0.07576679438352585,
0.013229912146925926,
-0.02156250551342964,
0.029409147799015045,
-0.031228812411427498,
-0.056768592447042465,
0.04429233446717262,
0.026782650500535965,
0.027400171384215355,
0.01294314581900835,
0.054736774414777756,
0.017018059268593788,
0.021003087982535362,
0.06211860850453377,
0.05990387499332428,
0.014016494154930115,
-0.042064111679792404,
0.08732521533966064,
-0.08003675937652588,
-0.12460074573755264,
0.03513467311859131,
0.001010993611998856,
0.011649712920188904,
0.035526297986507416,
-0.00951202493160963,
-0.04570906236767769,
-0.1139359250664711,
0.011185810901224613,
0.016672765836119652,
0.03849056735634804,
-0.009237857535481453,
-0.06170826032757759,
0.03234332799911499,
0.0480094738304615,
-0.032341040670871735,
0.06952740252017975,
-0.06986523419618607,
-0.05084491893649101,
-0.013989613391458988,
0.011197122745215893,
-0.058847635984420776,
0.05234947428107262,
-0.07299310714006424,
-0.009416330605745316,
-5.8760383856874036e-33,
0.06340651959180832,
-0.037363532930612564,
-0.03544729948043823,
0.06051581725478172,
-0.07774915546178818,
-0.024888012558221817,
0.006836640648543835,
0.006450346205383539,
0.07326719164848328,
-0.028296075761318207,
-0.05666808411478996,
0.07248558104038239,
0.0028545085806399584,
0.04604322090744972,
0.0248733963817358,
0.0001481910585425794,
-0.043088771402835846,
-0.017468543723225594,
-0.03791281580924988,
-0.019101278856396675,
0.01739976555109024,
-0.08388856053352356,
0.05983356758952141,
0.1076769009232521,
-0.005340270232409239,
-0.047831807285547256,
0.011655811220407486,
0.02297588810324669,
-0.008009582757949829,
-0.06844954192638397,
0.06019454076886177,
0.06537199765443802,
-0.06696529686450958,
-0.015247970819473267,
0.011247937567532063,
-0.04381547495722771,
0.022758208215236664,
0.10130397975444794,
-0.06440945714712143,
0.033131346106529236,
0.21553856134414673,
0.04627551510930061,
-0.007873223163187504,
-0.01725454442203045,
-0.0019122129306197166,
0.015285905450582504,
-0.050367165356874466,
0.0260310135781765,
0.021694453433156013,
-0.010822521522641182,
-0.0037623881362378597,
-0.0662410631775856,
0.05058080330491066,
0.039066072553396225,
0.059679314494132996,
-0.0028882650658488274,
0.10342089831829071,
-0.04772431403398514,
-0.01613287813961506,
-0.03994147107005119,
-0.06058923900127411,
-0.005492271389812231,
0.0022364677861332893,
-0.07620371133089066,
0.041789460927248,
-0.022167276591062546,
0.040832940489053726,
0.01915813609957695,
0.01682356558740139,
-0.007883545942604542,
0.06763521581888199,
-0.01346029806882143,
-0.02264297753572464,
-0.0025511933490633965,
0.11349775642156601,
0.03929048776626587,
-0.05214982479810715,
-0.12507085502147675,
-0.04226761683821678,
0.021506333723664284,
0.012622235342860222,
0.02211800031363964,
-0.01224761363118887,
-0.011174346320331097,
-0.07466618716716766,
0.011878237128257751,
-0.04288127273321152,
0.07849464565515518,
0.0054560499265789986,
0.00466352142393589,
0.050466276705265045,
0.03033590130507946,
-0.10667513310909271,
0.022943055257201195,
-0.022887984290719032,
-5.519759582739425e-8,
-0.03689012676477432,
0.0038348345551639795,
-0.0683513656258583,
0.04560861364006996,
0.0342060811817646,
-0.07509946823120117,
0.020084399729967117,
-0.036233074963092804,
-0.0019208858720958233,
-0.04137587919831276,
-0.015324839390814304,
-0.03127364441752434,
0.037886910140514374,
-0.05370548367500305,
-0.030945099890232086,
0.06350100040435791,
0.03240911662578583,
-0.0059128510765731335,
-0.0314512625336647,
-0.0054474095813930035,
0.02356482297182083,
-0.018083197996020317,
-0.02103673480451107,
0.00558424461632967,
-0.01899600774049759,
0.047836534678936005,
0.04414527863264084,
0.13044027984142303,
-0.06216435506939888,
-0.03659487143158913,
0.0925806388258934,
-0.029915163293480873,
0.10243848711252213,
0.03334122523665428,
-0.0593399815261364,
-0.03503932058811188,
0.15298578143119812,
-0.04156104102730751,
-0.020562583580613136,
0.025225888937711716,
0.02886497974395752,
0.006338557228446007,
-0.07579119503498077,
-0.0015227991389110684,
-0.06408645957708359,
-0.015606689266860485,
-0.04522062838077545,
-0.034478746354579926,
0.01742865890264511,
-0.05466274917125702,
-0.06942424178123474,
0.0358688086271286,
0.01843399368226528,
0.04925760626792908,
-0.015570662915706635,
0.012790895067155361,
-0.012217331677675247,
-0.03078419715166092,
-0.027414675801992416,
-0.017443953081965446,
0.014921188354492188,
0.07509204745292664,
0.029779741540551186,
0.019908059388399124
] | 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 found return [hits.length ? hits : completions, line]; } ``` The `completer` function can also return a {Promise}, or be asynchronous: ```js async function completer(linePartial) { await someAsyncWork(); return [['123'], linePartial]; } ``` ## Callback API ### Class: `readline.Interface` \* Extends: {readline.InterfaceConstructor} Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a single `input` [Readable][] stream and a single `output` [Writable][] stream. The `output` stream is used to print prompts for user input that arrives on, and is read from, the `input` stream. #### `rl.question(query[, options], callback)` \* `query` {string} A statement or query to write to `output`, prepended to the prompt. \* `options` {Object} \* `signal` {AbortSignal} Optionally allows the `question()` to be canceled using an `AbortController`. \* `callback` {Function} A callback function that is invoked with the user's input in response to the `query`. The `rl.question()` method displays the `query` by writing it to the `output`, waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. When called, `rl.question()` will resume the `input` stream if it has been paused. If the `readline.Interface` was created with `output` set to `null` or `undefined` the `query` is not written. The `callback` function passed to `rl.question()` does not follow the typical pattern of accepting an `Error` object or `null` as the first argument. The `callback` is called with the provided answer as the only argument. An error will be thrown if calling `rl.question()` after `rl.close()`. Example usage: ```js rl.question('What is your favorite food? ', (answer) => { console.log(`Oh, so your favorite food is ${answer}`); }); ``` Using an `AbortController` to cancel a question. ```js const ac = new AbortController(); const signal = ac.signal; rl.question('What is your favorite food? ', { signal }, (answer) => { console.log(`Oh, so your favorite food is ${answer}`); }); signal.addEventListener('abort', () => { console.log('The food question timed out'); }, { once: true }); setTimeout(() => ac.abort(), 10000); ``` ### `readline.clearLine(stream, dir[, callback])` \* `stream` {stream.Writable} \* `dir` {number} \* `-1`: to the left from cursor \* `1`: to the right from cursor \* `0`: the entire line \* `callback` {Function} Invoked once the operation completes. \* Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. The `readline.clearLine()` method clears current line of given [TTY][] stream in a specified direction identified by `dir`. ### `readline.clearScreenDown(stream[, callback])` \* `stream` {stream.Writable} \* `callback` {Function} Invoked once the operation completes. \* Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. The `readline.clearScreenDown()` method clears the given [TTY][] stream from the current position of the cursor down. ### `readline.createInterface(options)` \* `options` {Object} \* `input` {stream.Readable} The [Readable][] stream to listen to. This option is \_required\_. \* `output` {stream.Writable} The [Writable][] stream to write readline data to. \* `completer` {Function} An optional function used for Tab 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 only if `terminal` is | 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.006348812952637672,
0.01286850031465292,
-0.008925757370889187,
-0.02736971713602543,
0.0037984682712703943,
-0.015966871753335,
-0.13222981989383698,
0.03281533345580101,
0.05266899988055229,
0.028597796335816383,
-0.01387949101626873,
0.036938540637493134,
0.010475493967533112,
-0.05769318342208862,
-0.08323454111814499,
0.03395865112543106,
0.03260171040892601,
0.006925433408468962,
-0.04682552441954613,
-0.058266881853342056,
0.029120979830622673,
-0.09151917695999146,
0.06441624462604523,
-0.09380799531936646,
-0.04184211418032646,
0.06246894970536232,
-0.027496617287397385,
0.0027978294529020786,
0.0848551094532013,
-0.11189823597669601,
0.005892727058380842,
0.05557951703667641,
-0.07737275213003159,
-0.04743601754307747,
-0.08864663541316986,
-0.04043184965848923,
-0.00802602432668209,
0.018593382090330124,
0.0018783429404720664,
-0.04134978726506233,
0.04897551238536835,
0.08434335887432098,
0.05617279186844826,
-0.025629283860325813,
-0.039886124432086945,
-0.02692566253244877,
-0.004907224327325821,
0.028143245726823807,
-0.10222659260034561,
-0.03712814673781395,
-0.013363544829189777,
0.052165910601615906,
-0.01765293814241886,
0.03982073813676834,
0.04594732075929642,
0.05505393072962761,
0.04760541766881943,
-0.01639256440103054,
0.019514910876750946,
0.0014627903001382947,
0.0723169595003128,
-0.004418232943862677,
0.03600651025772095,
0.011387759819626808,
0.04213465005159378,
-0.05678795278072357,
0.022362882271409035,
-0.05686797946691513,
-0.09075705707073212,
-0.0007029921980574727,
0.04236545413732529,
-0.0026107318699359894,
0.12341045588254929,
-0.04587705060839653,
-0.01786547712981701,
0.013715662993490696,
-0.04759746789932251,
-0.0673234686255455,
-0.1120888814330101,
-0.06799943745136261,
0.013342843391001225,
-0.0011697281152009964,
0.057024996727705,
-0.0029231663793325424,
-0.023469118401408195,
0.04535801336169243,
-0.001174279721453786,
-0.008050376549363136,
-0.0024044092278927565,
0.08238649368286133,
-0.04888635128736496,
-0.010935689322650433,
0.0016403223853558302,
0.02206301875412464,
-0.027131695300340652,
-0.059361208230257034,
-0.003511329647153616,
-0.03271118924021721,
-0.03891725838184357,
0.03320953994989395,
0.06088247895240784,
0.01045278087258339,
0.022639863193035126,
0.10554724186658859,
-0.060673680156469345,
0.09140969812870026,
0.10086715221405029,
0.11505341529846191,
0.046074751764535904,
0.03998025879263878,
-0.013741272501647472,
0.00013230640615802258,
0.012569570913910866,
0.03148053586483002,
3.5830871462207866e-33,
0.03852777183055878,
0.0113553861156106,
0.009014273062348366,
0.011625769548118114,
0.009474989958107471,
0.019313868135213852,
-0.00619142921641469,
0.026905784383416176,
-0.012655101716518402,
0.0352628231048584,
-0.027231412008404732,
-0.015730464830994606,
-0.016531407833099365,
-0.0381183885037899,
-0.03390971198678017,
-0.04516102001070976,
0.12241967767477036,
-0.03239481896162033,
-0.11467624455690384,
0.06600868701934814,
-0.02626349776983261,
0.006042017601430416,
-0.016809502616524696,
0.03718012571334839,
0.05251390114426613,
-0.09231313318014145,
0.004625680390745401,
0.03490597382187843,
-0.033287473022937775,
-0.04443266987800598,
0.02285686321556568,
-0.02191619947552681,
-0.05265602469444275,
0.06872513890266418,
0.02397901564836502,
0.053479310125112534,
0.016831865534186363,
-0.0014897899236530066,
-0.09298816323280334,
-0.05114326253533363,
-0.023891853168606758,
0.021427655592560768,
-0.06833236664533615,
-0.028565850108861923,
-0.03923209384083748,
-0.13466769456863403,
-0.08394869416952133,
-0.011676806956529617,
0.06891343742609024,
0.03990840166807175,
0.024423854425549507,
0.11113156378269196,
-0.010871448554098606,
-0.06093630939722061,
0.08313624560832977,
0.0012427913025021553,
-0.0012437279801815748,
0.031682174652814865,
-0.020934754982590675,
0.09234550595283508,
-0.03938782215118408,
-0.09397724270820618,
-0.04189114645123482,
0.038369182497262955,
-0.04332127049565315,
0.058685459196567535,
-0.0052864933386445045,
0.009078371338546276,
0.011941896751523018,
-0.0173210296779871,
-0.056613121181726456,
-0.004156152252107859,
-0.02625279687345028,
0.023263897746801376,
0.06942562758922577,
-0.051190752536058426,
-0.09869630634784698,
-0.04918651282787323,
0.030674878507852554,
-0.0796743631362915,
0.005486907437443733,
-0.04630356654524803,
-0.05202994495630264,
0.07030075788497925,
-0.0015719906659796834,
0.06202636659145355,
0.009302530437707901,
-0.12474498152732849,
0.06690382957458496,
0.015869632363319397,
-0.031370341777801514,
-0.009066257625818253,
-0.040577471256256104,
-0.051878537982702255,
-0.027272814884781837,
-4.481945431966357e-33,
0.13325092196464539,
-0.04423701390624046,
0.010024651885032654,
0.005943974480032921,
0.004715954419225454,
-0.0344773530960083,
-0.001254825503565371,
0.007483598310500383,
0.003433661535382271,
0.035183727741241455,
0.028873855248093605,
0.0437326543033123,
0.07444120943546295,
-0.018666183575987816,
-0.04910876601934433,
0.07074572890996933,
0.03355034440755844,
-0.0791177749633789,
0.07187722623348236,
0.006523991469293833,
0.07118500769138336,
-0.06433827430009842,
0.07825656980276108,
-0.04979632422327995,
-0.08206751197576523,
0.06423235684633255,
-0.020943311974406242,
0.0036701285280287266,
-0.0257814209908247,
-0.06185414642095566,
0.013772335834801197,
-0.05781647935509682,
-0.05368487164378166,
-0.008386440575122833,
0.00837492011487484,
-0.02257264405488968,
0.032269783318042755,
0.1667926013469696,
0.020641101524233818,
-0.07131584733724594,
0.09892364591360092,
-0.03227789327502251,
0.018796700984239578,
0.020217331126332283,
0.009301271289587021,
-0.0772353857755661,
-0.013473971746861935,
0.0642099529504776,
-0.03309880197048187,
-0.02134612202644348,
-0.00713341636583209,
0.010228392668068409,
-0.04869936406612396,
0.07554522901773453,
-0.020845608785748482,
-0.035016532987356186,
0.023794908076524734,
-0.03870067000389099,
0.0563185028731823,
0.02624698169529438,
-0.03157545626163483,
-0.0423254631459713,
0.08037219196557999,
0.009892755188047886,
0.06352339684963226,
-0.08515774458646774,
-0.03110325336456299,
-0.021927541121840477,
0.10152778029441833,
0.018967995420098305,
-0.015205012634396553,
0.04204706847667694,
-0.039458632469177246,
0.0170935969799757,
0.07452639937400818,
-0.03950308635830879,
-0.02852221578359604,
-0.10089948773384094,
0.07810342311859131,
0.06598743051290512,
-0.010594879277050495,
0.01614556461572647,
-0.0041137803345918655,
0.018655959516763687,
0.04841095209121704,
0.0491497665643692,
-0.04103482887148857,
0.0631260946393013,
0.004325238522142172,
-0.048043202608823776,
0.037136346101760864,
0.043612040579319,
-0.07016986608505249,
0.008556371554732323,
0.004961451981216669,
-5.4398277882228285e-8,
-0.039209116250276566,
-0.011102219112217426,
-0.10078732669353485,
-0.027831953018903732,
0.023562824353575706,
-0.013652883470058441,
-0.02229207381606102,
0.019144121557474136,
-0.011406917124986649,
-0.04020674526691437,
-0.007751351222395897,
0.01830349676311016,
0.029990877956151962,
-0.016386868432164192,
-0.003941437695175409,
-0.044489793479442596,
0.06331103295087814,
0.03227679058909416,
-0.027335725724697113,
0.04555309936404228,
-0.016556868329644203,
0.02317352406680584,
-0.06345250457525253,
-0.011985530145466328,
0.02594103291630745,
0.05958371236920357,
0.017308944836258888,
0.08597026765346527,
-0.01605047658085823,
0.037324972450733185,
0.0037164983805269003,
0.046277519315481186,
0.08423024415969849,
-0.05834098532795906,
0.009189597330987453,
-0.022595049813389778,
0.10289763659238815,
-0.046258360147476196,
0.03594799339771271,
0.08698641508817673,
0.11221407353878021,
0.03561579808592796,
0.012217024341225624,
0.06088186055421829,
0.013967121951282024,
-0.08615956455469131,
0.0044220988638699055,
-0.028245026245713234,
0.05442136153578758,
-0.06525251269340515,
0.010142766870558262,
-0.07208192348480225,
-0.03336272016167641,
-0.001082737697288394,
-0.08714449405670166,
-0.02131262607872486,
0.013552326709032059,
-0.04125002771615982,
-0.019220221787691116,
0.030820315703749657,
0.044378235936164856,
-0.07803778350353241,
0.03844400867819786,
0.0171344131231308
] | 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 only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. \*\*Default:\*\* `[]`. \* `historySize` {number} Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. \*\*Default:\*\* `30`. \* `removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. \*\*Default:\*\* `false`. \* `prompt` {string} The prompt string to use. \*\*Default:\*\* `'> '`. \* `crlfDelay` {number} If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds, both `\r` and `\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\r` followed by `\n` will always be considered a single newline (which may be reasonable for [reading files][] with `\r\n` line delimiter). \*\*Default:\*\* `100`. \* `escapeCodeTimeout` {number} The duration `readline` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence). \*\*Default:\*\* `500`. \* `tabSize` {integer} The number of spaces a tab is equal to (minimum 1). \*\*Default:\*\* `8`. \* `signal` {AbortSignal} Allows closing the interface using an AbortSignal. Aborting the signal will internally call `close` on the interface. \* Returns: {readline.Interface} The `readline.createInterface()` method creates a new `readline.Interface` instance. ```mjs import { createInterface } from 'node:readline'; import { stdin, stdout } from 'node:process'; const rl = createInterface({ input: stdin, output: stdout, }); ``` ```cjs const { createInterface } = require('node:readline'); const rl = createInterface({ input: process.stdin, output: process.stdout, }); ``` Once the `readline.Interface` instance is created, the most common case is to listen for the `'line'` event: ```js rl.on('line', (line) => { console.log(`Received: ${line}`); }); ``` If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property and emits a `'resize'` event on the `output` if or when the columns ever change ([`process.stdout`][] does this automatically when it is a TTY). When creating a `readline.Interface` using `stdin` as input, the program will not terminate until it receives an [EOF character][]. To exit without waiting for user input, call `process.stdin.unref()`. #### Use of the `completer` function The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: \* An `Array` with matching entries 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 found return [hits.length ? hits : completions, 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` {Function} Invoked once the operation completes. \* Returns: {boolean} | 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.024685107171535492,
-0.10410328209400177,
-0.023408953100442886,
-0.05273767188191414,
-0.08457516878843307,
-0.04194248467683792,
-0.1241382583975792,
0.033157963305711746,
-0.02019381709396839,
0.014077533967792988,
0.036293208599090576,
0.036577627062797546,
-0.019331136718392372,
0.027934176847338676,
-0.04066047817468643,
0.03371918573975563,
0.01587832160294056,
-0.1145813837647438,
0.000807747186627239,
0.020871123299002647,
-0.010391276329755783,
0.008058397099375725,
-0.04528056085109711,
-0.06834648549556732,
0.03809028118848801,
-0.02262326516211033,
-0.04202432185411453,
0.00895614456385374,
0.03050481155514717,
-0.07121190428733826,
-0.05211166664958,
-0.0658583790063858,
0.027004346251487732,
-0.01124069094657898,
-0.07791373133659363,
-0.06295076757669449,
0.026364661753177643,
0.033341798931360245,
0.10650938749313354,
0.04583945870399475,
-0.012820619158446789,
0.051592499017715454,
0.001239930628798902,
-0.0334702730178833,
0.019940832629799843,
-0.036135297268629074,
-0.06131123751401901,
-0.06909539550542831,
0.005140827037394047,
-0.0820186659693718,
-0.05373597517609596,
0.010806340724229813,
0.020616892725229263,
0.037303682416677475,
0.03270847350358963,
0.08369895070791245,
0.11242745071649551,
-0.06935203075408936,
0.040094148367643356,
-0.06888049840927124,
-0.01133298221975565,
0.045588549226522446,
0.023991310968995094,
-0.010223215445876122,
-0.041668590158224106,
-0.07191362231969833,
-0.0015542547916993499,
0.012510552071034908,
-0.0638953223824501,
0.025883374735713005,
0.01031294371932745,
-0.060256652534008026,
0.05516296997666359,
-0.053620584309101105,
-0.05533098429441452,
0.06310124695301056,
0.021259520202875137,
-0.0040325080044567585,
-0.07965882122516632,
0.05677579715847969,
0.01647992618381977,
-0.016214337199926376,
0.06942068040370941,
0.041331660002470016,
-0.006519177928566933,
0.020105872303247452,
0.011382751166820526,
0.05815649405121803,
0.07210299372673035,
0.07301554828882217,
0.11536246538162231,
0.07241734117269516,
0.03494206815958023,
0.047577694058418274,
0.03392751142382622,
0.05633150786161423,
0.02762666530907154,
-0.0331106074154377,
-0.0277237705886364,
0.02534813992679119,
-0.03606569021940231,
-0.03167681396007538,
0.053426772356033325,
0.04110703989863396,
0.038797806948423386,
-0.021069707348942757,
0.11477841436862946,
0.10679931193590164,
-0.06161690503358841,
-0.055205028504133224,
0.06537134945392609,
0.03670797124505043,
-0.10165263712406158,
0.07746864855289459,
5.497392186162359e-33,
0.09848878532648087,
-0.011681586503982544,
-0.05006173998117447,
0.0038712976966053247,
-0.022907491773366928,
0.0807204321026802,
-0.06587135046720505,
0.06977789849042892,
0.006202200427651405,
-0.010817098431289196,
0.0017286674119532108,
-0.009831206873059273,
-0.05918867141008377,
0.05612725764513016,
-0.04731890931725502,
0.00041573206544853747,
0.05359216406941414,
-0.011264553293585777,
0.052334580570459366,
-0.001602131873369217,
-0.010183156467974186,
0.045485250651836395,
0.011718439869582653,
-0.11380234360694885,
0.07136630266904831,
-0.06160234287381172,
0.0277272816747427,
0.07178699225187302,
-0.06763935089111328,
-0.00860325712710619,
0.003989607561379671,
-0.035382431000471115,
-0.05003182217478752,
0.020944803953170776,
0.04792143404483795,
0.058831121772527695,
0.017267482355237007,
-0.0035015949979424477,
-0.015209143050014973,
-0.021428538486361504,
0.007467609364539385,
0.02284831739962101,
-0.03723708540201187,
-0.07307463884353638,
0.003228425048291683,
-0.1476239413022995,
-0.048342231661081314,
-0.005910960026085377,
-0.027380742132663727,
0.007435543928295374,
0.08307747542858124,
0.12237115949392319,
-0.027450449764728546,
-0.023019179701805115,
-0.02022561989724636,
-0.016334157437086105,
0.005919056013226509,
-0.030618563294410706,
0.02825898304581642,
0.08977563679218292,
0.02675051987171173,
0.006348294205963612,
0.05477004870772362,
0.06383286416530609,
0.02456260286271572,
0.08366300910711288,
0.05189485102891922,
0.020129438489675522,
0.013024219311773777,
-0.04201457276940346,
-0.09550515562295914,
-0.010310938581824303,
0.06241404265165329,
-0.030922893434762955,
-0.007528957910835743,
-0.011361365206539631,
0.019951412454247475,
-0.017803898081183434,
-0.01836630515754223,
-0.02042553201317787,
0.06151076778769493,
-0.10005111247301102,
-0.038058988749980927,
0.0030225745867937803,
0.08794879168272018,
-0.020562423393130302,
0.07947900146245956,
-0.03548054024577141,
-0.003017503535374999,
0.02055315114557743,
0.05057249218225479,
-0.02771713212132454,
0.0557066835463047,
0.006211831700056791,
-0.06685122102499008,
-7.103062000745925e-33,
0.10196324437856674,
0.022361425682902336,
-0.04093248397111893,
-0.017607685178518295,
-0.07692545652389526,
-0.061472710222005844,
-0.0111625287681818,
0.023798538371920586,
-0.03214113786816597,
-0.1092849001288414,
0.010565782897174358,
0.024404816329479218,
0.03549700230360031,
-0.00002208369187428616,
-0.02796384133398533,
0.0824606716632843,
-0.005819408688694239,
-0.05779791250824928,
-0.05380649119615555,
0.018752960488200188,
0.03288307413458824,
-0.09153012186288834,
-0.07861118018627167,
0.049912936985492706,
-0.012776494957506657,
-0.057033952325582504,
0.011205689050257206,
0.0030264691449701786,
-0.02109447866678238,
0.011059008538722992,
0.030811086297035217,
0.055182669311761856,
-0.05411091446876526,
-0.04509877786040306,
-0.03555479645729065,
-0.02610582672059536,
0.00010781460878206417,
0.08706676214933395,
0.01911861076951027,
0.08741980791091919,
0.15253891050815582,
0.0525641143321991,
-0.08529694378376007,
-0.02468225173652172,
-0.03467676416039467,
0.0017154855886474252,
-0.0806032046675682,
0.03952934220433235,
0.04555928334593773,
0.027142193168401718,
0.024708662182092667,
-0.03532099723815918,
0.030571451410651207,
0.014005019329488277,
0.03520622476935387,
0.013148989528417587,
0.021844245493412018,
0.05388801172375679,
-0.0340561680495739,
-0.02203357219696045,
-0.06322328001260757,
-0.01395566388964653,
-0.09031582623720169,
-0.049532923847436905,
-0.012724289670586586,
-0.05031253769993782,
0.006101129110902548,
0.036677636206150055,
0.03470961004495621,
-0.04372803866863251,
0.1039193794131279,
-0.029398951679468155,
-0.06974770128726959,
0.010099642910063267,
0.02059885486960411,
-0.006909701507538557,
0.035118404775857925,
-0.060061998665332794,
0.012253385968506336,
0.08437129110097885,
-0.04861561581492424,
0.06615389883518219,
-0.005038509611040354,
-0.003201079089194536,
-0.04544386267662048,
0.06381967663764954,
-0.0923473909497261,
0.13338957726955414,
-0.021440837532281876,
0.016265926882624626,
0.046128325164318085,
0.005282564554363489,
-0.05009158328175545,
-0.00005607311686617322,
-0.05747346580028534,
-5.2622155521930836e-8,
-0.011697984300553799,
-0.02954639121890068,
-0.044184040278196335,
0.11548064649105072,
0.012466228567063808,
-0.04801687225699425,
0.002320305211469531,
0.030323147773742676,
-0.025964850559830666,
-0.12157214432954788,
-0.013233126141130924,
0.06637576222419739,
-0.09772311896085739,
-0.06099362298846245,
-0.009876864962279797,
0.01714932546019554,
0.033302463591098785,
-0.050454530864953995,
-0.03538840264081955,
-0.0453212596476078,
-0.0541895292699337,
-0.005511246155947447,
-0.0599842332303524,
0.01016831211745739,
-0.05290886387228966,
0.060134146362543106,
0.01421309169381857,
0.10002650320529938,
-0.040364429354667664,
0.08121363818645477,
0.09142345935106277,
0.03495326265692711,
-0.027383243665099144,
-0.12161049246788025,
0.014190448448061943,
-0.042718950659036636,
0.045098062604665756,
-0.07089335471391678,
-0.02442692592740059,
-0.0430074967443943,
0.0594676211476326,
0.018601136282086372,
-0.001754686702042818,
-0.00010243570432066917,
-0.09854432195425034,
-0.03772220388054848,
0.018123414367437363,
0.005875390954315662,
0.006267229560762644,
-0.11484390497207642,
-0.006747894920408726,
0.02466389536857605,
0.036872491240501404,
0.056967608630657196,
0.01772897131741047,
-0.018631508573889732,
0.06178920716047287,
0.04566621035337448,
0.016566278412938118,
0.029560860246419907,
0.05870708078145981,
0.0025336185935884714,
-0.02886199578642845,
-0.0327988937497139
] | 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` {Function} Invoked once the operation completes. \* Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. The `readline.cursorTo()` method moves cursor to the specified position in a given [TTY][] `stream`. ### `readline.moveCursor(stream, dx, dy[, callback])` \* `stream` {stream.Writable} \* `dx` {number} \* `dy` {number} \* `callback` {Function} Invoked once the operation completes. \* Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. The `readline.moveCursor()` method moves the cursor \_relative\_ to its current position in a given [TTY][] `stream`. ## `readline.emitKeypressEvents(stream[, interface])` \* `stream` {stream.Readable} \* `interface` {readline.InterfaceConstructor} The `readline.emitKeypressEvents()` method causes the given [Readable][] stream to begin emitting `'keypress'` events corresponding to received input. Optionally, `interface` specifies a `readline.Interface` instance for which autocompletion is disabled when copy-pasted input is detected. If the `stream` is a [TTY][], then it must be in raw mode. This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop the `input` from emitting `'keypress'` events. ```js readline.emitKeypressEvents(process.stdin); if (process.stdin.isTTY) process.stdin.setRawMode(true); ``` ## Example: Tiny CLI The following example illustrates the use of `readline.Interface` class to implement a small command-line interface: ```mjs import { createInterface } from 'node:readline'; import { exit, stdin, stdout } from 'node:process'; const rl = createInterface({ input: stdin, output: stdout, prompt: 'OHAI> ', }); rl.prompt(); rl.on('line', (line) => { switch (line.trim()) { case 'hello': console.log('world!'); break; default: console.log(`Say what? I might have heard '${line.trim()}'`); break; } rl.prompt(); }).on('close', () => { console.log('Have a great day!'); exit(0); }); ``` ```cjs const { createInterface } = require('node:readline'); const rl = createInterface({ input: process.stdin, output: process.stdout, prompt: 'OHAI> ', }); rl.prompt(); rl.on('line', (line) => { switch (line.trim()) { case 'hello': console.log('world!'); break; default: console.log(`Say what? I might have heard '${line.trim()}'`); break; } rl.prompt(); }).on('close', () => { console.log('Have a great day!'); process.exit(0); }); ``` ## Example: Read file stream line-by-Line A common use case for `readline` is to consume an input file one line at a time. The easiest way to do so is leveraging the [`fs.ReadStream`][] API as well as a `for await...of` loop: ```mjs import { createReadStream } from 'node:fs'; import { createInterface } from 'node:readline'; async function processLineByLine() { const fileStream = createReadStream('input.txt'); const rl = createInterface({ input: fileStream, crlfDelay: Infinity, }); // Note: we use the crlfDelay option to recognize all instances of CR LF // ('\r\n') in input.txt as a 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(); ``` ```cjs const { createReadStream } = require('node:fs'); const { createInterface } = require('node:readline'); async function processLineByLine() { const fileStream = createReadStream('input.txt'); const rl = createInterface({ input: fileStream, crlfDelay: Infinity, }); // Note: we use the crlfDelay option to recognize all instances of CR LF // ('\r\n') in input.txt as a 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 } from 'node:readline'; | 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.03019350953400135,
-0.03627467900514603,
-0.03709092736244202,
-0.06987782567739487,
-0.03772367909550667,
-0.03806227818131447,
-0.07765180617570877,
0.044778011739254,
-0.003548520850017667,
-0.022154569625854492,
0.0018497182754799724,
0.017726970836520195,
-0.00954578910022974,
0.00922046136111021,
-0.038367073982954025,
0.027785154059529305,
-0.0176195427775383,
-0.06217961758375168,
-0.022766822949051857,
-0.05890752002596855,
-0.023931434378027916,
-0.0743272602558136,
0.0983830913901329,
-0.03555767238140106,
-0.04403276368975639,
-0.11637730151414871,
0.011112651787698269,
0.0779525637626648,
0.002727745333686471,
-0.09880901128053665,
0.007840286009013653,
-0.012831003405153751,
-0.016362594440579414,
-0.07260072976350784,
-0.033298060297966,
-0.03545408323407173,
0.06904598325490952,
-0.03528678044676781,
0.06082921475172043,
-0.059193745255470276,
0.07287770509719849,
0.0558924600481987,
0.08535514026880264,
0.08043084293603897,
-0.020800217986106873,
-0.007313746493309736,
-0.05332690104842186,
-0.03383583948016167,
-0.024361612275242805,
-0.0348091684281826,
0.012632773257791996,
0.07730985432863235,
-0.06265381723642349,
-0.002320102648809552,
0.041707564145326614,
0.05802623927593231,
0.03423672169446945,
0.044322311878204346,
0.0475715808570385,
-0.034168947488069534,
0.035102713853120804,
-0.0709773600101471,
-0.06627317517995834,
0.027747128158807755,
0.0416584387421608,
-0.020362282171845436,
0.009851532056927681,
-0.005465414375066757,
-0.0451335534453392,
-0.01772378757596016,
-0.008829580619931221,
0.005294368136674166,
0.031450919806957245,
-0.03802292048931122,
-0.018493983894586563,
0.03164677321910858,
0.09785427898168564,
-0.0355428047478199,
0.011540502309799194,
-0.03649839386343956,
-0.006862352602183819,
-0.07268233597278595,
0.09239766001701355,
0.06634801626205444,
-0.043010905385017395,
-0.011210514232516289,
-0.0486878901720047,
0.027833543717861176,
0.07377146929502487,
0.04236573725938797,
-0.004498378373682499,
0.04357212409377098,
-0.015534736216068268,
0.05519065260887146,
-0.0745919868350029,
-0.07189557701349258,
-0.01784929819405079,
0.0013857021695002913,
-0.03524138405919075,
0.05768628418445587,
0.0677562952041626,
-0.019923465326428413,
0.011020050384104252,
0.014942425303161144,
0.009242198430001736,
0.11011649668216705,
0.07800696790218353,
0.10736357420682907,
0.052801698446273804,
-0.031798671931028366,
0.009667922742664814,
0.06016594171524048,
0.018203452229499817,
0.10738712549209595,
1.3102639516245973e-33,
-0.05294303596019745,
-0.09767050296068192,
-0.012016922235488892,
0.012310831807553768,
0.01587078347802162,
0.0016560557996854186,
-0.03406994044780731,
0.0545896477997303,
-0.09210412949323654,
0.0008733549038879573,
-0.0507613867521286,
-0.10446909070014954,
-0.005744844675064087,
0.03465520590543747,
-0.0015073439572006464,
-0.05911106988787651,
0.11242444813251495,
-0.008828983642160892,
-0.0481242835521698,
0.062434155493974686,
0.1199469044804573,
0.020507272332906723,
-0.02753712423145771,
-0.02868826687335968,
-0.042982809245586395,
-0.018589163199067116,
-0.09002549946308136,
0.009759578853845596,
-0.06329946219921112,
0.023078961297869682,
-0.07088108360767365,
0.005491940304636955,
-0.006914038211107254,
0.030967487022280693,
0.008008884266018867,
-0.04010039567947388,
-0.019274603575468063,
-0.06546173244714737,
-0.003716988954693079,
-0.01947706565260887,
-0.05322154238820076,
-0.005999624263495207,
-0.09296875447034836,
-0.023132286965847015,
-0.0773410052061081,
-0.088774673640728,
-0.06314706802368164,
0.031991928815841675,
0.03391837328672409,
0.028638890013098717,
0.0018796001095324755,
0.036223918199539185,
0.019586997106671333,
-0.037018146365880966,
0.07113027572631836,
-0.035025518387556076,
0.01801336370408535,
-0.01978466846048832,
-0.010846266523003578,
0.04219519719481468,
0.013858792372047901,
0.05999892204999924,
-0.015076528303325176,
0.013347739353775978,
0.003270200453698635,
0.019881391897797585,
0.036690063774585724,
0.013240285217761993,
0.06299430131912231,
-0.1136266440153122,
-0.07881688326597214,
0.006530579645186663,
0.012501350603997707,
0.015330254100263119,
0.05838727951049805,
0.04764767363667488,
-0.06266798824071884,
-0.0928189679980278,
-0.021391605958342552,
-0.029447659850120544,
0.05975916609168053,
0.02210337296128273,
-0.012182025238871574,
0.0757208988070488,
0.08291629701852798,
0.04786960780620575,
0.016425354406237602,
-0.057690754532814026,
-0.006941878702491522,
0.03262287750840187,
-0.02170039713382721,
-0.045960940420627594,
-0.007971473038196564,
-0.07425875216722488,
-0.05392172560095787,
-4.965418176935902e-33,
-0.007879899814724922,
-0.0013568252325057983,
0.01511753723025322,
0.05195974186062813,
-0.04103049263358116,
0.007979295216500759,
-0.041371505707502365,
-0.0002610951487440616,
0.07170718908309937,
-0.024681657552719116,
-0.09044365584850311,
0.0737868994474411,
-0.031764693558216095,
0.013011607341468334,
0.025357065722346306,
0.09231729805469513,
-0.020968401804566383,
-0.022310225293040276,
-0.043505776673555374,
-0.07378049194812775,
0.017727212980389595,
-0.10002611577510834,
0.036293212324380875,
0.05902956426143646,
-0.022943222895264626,
-0.038299236446619034,
0.030297739431262016,
-0.019567230716347694,
-0.0035263383761048317,
-0.017341626808047295,
0.020354462787508965,
0.022453809157013893,
-0.04935968294739723,
0.043938882648944855,
0.03517397865653038,
-0.030705008655786514,
0.0709637850522995,
0.10718226432800293,
-0.0026416450273245573,
0.028909603133797646,
0.21533869206905365,
0.022206049412488937,
0.07582271099090576,
-0.036584075540304184,
0.02444845251739025,
0.014231915585696697,
-0.06275826692581177,
0.053617820143699646,
-0.053981512784957886,
0.01439219992607832,
0.03691820800304413,
0.049059413373470306,
0.025934146717190742,
0.16357411444187164,
0.005773625336587429,
-0.041108716279268265,
0.081028513610363,
-0.04746232554316521,
0.024358119815587997,
-0.022250410169363022,
-0.02912609651684761,
-0.06515742093324661,
-0.01284634880721569,
-0.052545081824064255,
0.0436430461704731,
-0.030686022713780403,
0.04061272740364075,
0.03906956687569618,
0.030929893255233765,
-0.04346558079123497,
0.051790717989206314,
0.00458119623363018,
-0.029037535190582275,
0.008035214617848396,
0.01199821475893259,
0.03428050875663757,
-0.020627373829483986,
-0.10649459809064865,
-0.021261300891637802,
0.09916990250349045,
0.036504387855529785,
0.07433982193470001,
-0.007452418562024832,
-0.007032001856714487,
0.01765943132340908,
0.02957582287490368,
0.028114445507526398,
0.011946314945816994,
-0.016594327986240387,
-0.06144380196928978,
0.05913437157869339,
0.024634845554828644,
-0.13147155940532684,
-0.001920128590427339,
0.008915023878216743,
-4.875852255281643e-8,
-0.02838439680635929,
-0.04054829105734825,
-0.06066276133060455,
-0.0032664714381098747,
0.041440993547439575,
-0.09644567966461182,
-0.008053355850279331,
-0.003644757904112339,
0.046232495456933975,
-0.057562872767448425,
0.02835017442703247,
-0.02936742641031742,
0.08116656541824341,
-0.04644187167286873,
0.008552374318242073,
0.053347259759902954,
0.07974682748317719,
-0.06908868253231049,
0.005965481046587229,
0.00642651692032814,
0.02172878384590149,
-0.040639519691467285,
-0.10402102023363113,
0.014755255542695522,
-0.03921240568161011,
0.0036880529951304197,
0.025260580703616142,
0.08143747597932816,
-0.011068278923630714,
-0.10329363495111465,
0.05155571177601814,
0.038600750267505646,
0.05908302962779999,
0.05646856501698494,
-0.029626332223415375,
-0.03170332312583923,
0.15543465316295624,
-0.023463649675250053,
0.04902533441781998,
0.028061632066965103,
0.024809684604406357,
0.004271044861525297,
-0.023467427119612694,
0.01237434335052967,
-0.022946076467633247,
-0.025433694943785667,
-0.05608862265944481,
-0.03214156627655029,
-0.011059224605560303,
-0.008921271190047264,
-0.07116082310676575,
0.02567453123629093,
0.05301082506775856,
-0.018206490203738213,
0.01632891222834587,
-0.05256693437695503,
-0.021912042051553726,
-0.0501689575612545,
-0.060389578342437744,
0.052287932485342026,
0.04726948216557503,
0.05499492585659027,
0.0448654405772686,
-0.030710691586136818
] | 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 } from 'node:readline'; const rl = createInterface({ input: createReadStream('sample.txt'), crlfDelay: Infinity, }); rl.on('line', (line) => { console.log(`Line from file: ${line}`); }); ``` ```cjs const { createReadStream } = require('node:fs'); const { createInterface } = require('node:readline'); const rl = createInterface({ input: createReadStream('sample.txt'), crlfDelay: Infinity, }); rl.on('line', (line) => { console.log(`Line from file: ${line}`); }); ``` Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: ```mjs import { once } from 'node:events'; import { createReadStream } from 'node:fs'; import { createInterface } from 'node:readline'; (async function processLineByLine() { try { const rl = createInterface({ input: createReadStream('big-file.txt'), crlfDelay: Infinity, }); rl.on('line', (line) => { // Process the line. }); await once(rl, 'close'); console.log('File processed.'); } catch (err) { console.error(err); } })(); ``` ```cjs const { once } = require('node:events'); const { createReadStream } = require('node:fs'); const { createInterface } = require('node:readline'); (async function processLineByLine() { try { const rl = createInterface({ input: createReadStream('big-file.txt'), crlfDelay: Infinity, }); rl.on('line', (line) => { // Process the line. }); await once(rl, 'close'); console.log('File processed.'); } catch (err) { console.error(err); } })(); ``` ## TTY keybindings | Keybindings | Description | Notes | | --- | --- | --- | | `Ctrl`+`Shift`+`Backspace` | Delete line left | Doesn't work on Linux, Mac and Windows | | `Ctrl`+`Shift`+`Delete` | Delete line right | Doesn't work on Mac | | `Ctrl`+`C` | Emit `SIGINT` or close the readline instance | | | `Ctrl`+`H` | Delete left | | | `Ctrl`+`D` | Delete right or close the readline instance in case the current line is empty / EOF | Doesn't work on Windows | | `Ctrl`+`U` | Delete from the current position to the line start | | | `Ctrl`+`K` | Delete from the current position to the end of line | | | `Ctrl`+`Y` | Yank (Recall) the previously deleted text | Only works with text deleted by `Ctrl`+`U` or `Ctrl`+`K` | | `Meta`+`Y` | Cycle among previously deleted texts | Only available when the last keystroke is `Ctrl`+`Y` or `Meta`+`Y` | | `Ctrl`+`A` | Go to start of line | | | `Ctrl`+`E` | Go to end of line | | | `Ctrl`+`B` | Back one character | | | `Ctrl`+`F` | Forward one character | | | `Ctrl`+`L` | Clear screen | | | `Ctrl`+`N` | Next history item | | | `Ctrl`+`P` | Previous history item | | | `Ctrl`+`-` | Undo previous change | Any keystroke that emits key code `0x1F` will do this action. In many terminals, for example `xterm`, this is bound to `Ctrl`+`-`. | | `Ctrl`+`6` | Redo previous change | Many terminals don't have a default redo keystroke. We choose key code `0x1E` to perform redo. In `xterm`, it is bound to `Ctrl`+`6` by default. | | `Ctrl`+`Z` | Moves running process into background. Type `fg` and press `Enter` to return. | Doesn't work on Windows | | `Ctrl`+`W` or `Ctrl` +`Backspace` | Delete backward to a word boundary | `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 | | 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.047076787799596786,
0.004741256590932608,
-0.006710416171699762,
-0.15158723294734955,
-0.021336952224373817,
-0.03625381737947464,
-0.10068544745445251,
0.08522780239582062,
-0.010055681690573692,
-0.0012646137038245797,
0.04938378930091858,
-0.052316587418317795,
-0.016048269346356392,
0.02738032303750515,
-0.01448278222233057,
-0.0018144178902730346,
0.014665771275758743,
0.03248026967048645,
-0.045668553560972214,
-0.04582873731851578,
0.05481342971324921,
-0.019298702478408813,
0.06898726522922516,
-0.005464665591716766,
-0.06574342399835587,
-0.0018480790313333273,
-0.02982388436794281,
0.03927817940711975,
0.04453280568122864,
-0.08784545212984085,
-0.01999896578490734,
0.15462727844715118,
-0.08415459841489792,
-0.07352233678102493,
-0.01274691242724657,
0.025295045226812363,
0.07482752203941345,
-0.06886928528547287,
0.02503346838057041,
-0.04476608335971832,
0.031069740653038025,
0.009914493188261986,
0.016210755333304405,
0.04935115575790405,
-0.04537123069167137,
-0.010714136064052582,
-0.06665786355733871,
-0.03113384172320366,
-0.047250233590602875,
0.022933287546038628,
-0.03726769611239433,
0.012224380858242512,
0.01360168494284153,
-0.10086219012737274,
0.14428183436393738,
0.09401372820138931,
0.06923308223485947,
-0.0975034236907959,
0.02076800726354122,
-0.06839372962713242,
-0.027332227677106857,
-0.006727841217070818,
-0.09714712202548981,
-0.049355849623680115,
0.03932251036167145,
-0.03668472543358803,
0.06510588526725769,
0.004483460448682308,
-0.03696229308843613,
0.05894079804420471,
-0.08946169167757034,
-0.018223104998469353,
0.13531027734279633,
-0.0042922161519527435,
-0.01817738451063633,
0.026883697137236595,
-0.018237542361021042,
-0.08055682480335236,
0.022879350930452347,
-0.047450847923755646,
0.0564756914973259,
-0.0044154091738164425,
0.08070139586925507,
-0.040276892483234406,
0.0406302772462368,
0.010888054035604,
-0.013498992659151554,
0.01956881582736969,
0.0215507410466671,
-0.010706587694585323,
0.06998290866613388,
-0.016721105203032494,
0.012037488631904125,
-0.007437257561832666,
-0.013024524785578251,
-0.06768922507762909,
-0.06634564697742462,
0.06331001967191696,
-0.019602669402956963,
-0.016605449840426445,
0.013788753189146519,
0.026767143979668617,
0.02213418111205101,
0.01876869797706604,
0.010591026395559311,
0.06696510314941406,
0.1323450654745102,
0.07540450245141983,
0.023759640753269196,
-0.07536373287439346,
0.022198976948857307,
0.0916823148727417,
-0.07205547392368317,
0.15813800692558289,
4.469103890867593e-33,
-0.030803382396697998,
-0.0325479730963707,
0.01619911566376686,
0.05473702773451805,
0.03458917513489723,
0.04472116753458977,
-0.009304994717240334,
0.02562759630382061,
-0.09291573613882065,
0.002302657812833786,
-0.03835611417889595,
-0.11339225620031357,
-0.0028795956168323755,
-0.10821103304624557,
-0.0026707048527896404,
-0.04733094573020935,
0.03589062765240669,
-0.08964163064956665,
0.041010890156030655,
0.07333289086818695,
-0.07398482412099838,
-0.00040190937579609454,
0.02090296894311905,
0.011983788572251797,
-0.027019724249839783,
-0.049883563071489334,
-0.0008099568076431751,
0.00813960563391447,
-0.008935467340052128,
-0.03789682313799858,
0.0585019588470459,
-0.03462257981300354,
0.05620381608605385,
0.0024090101942420006,
-0.0638926699757576,
-0.037715546786785126,
-0.019404323771595955,
0.0020801459904760122,
-0.10771991312503815,
-0.05153399705886841,
-0.020708872005343437,
0.028833704069256783,
0.018421117216348648,
0.028053265064954758,
-0.07313862442970276,
-0.05795913189649582,
-0.07761204242706299,
0.04049781709909439,
-0.006731824949383736,
0.009011511690914631,
-0.00908966176211834,
0.12112925946712494,
0.061721086502075195,
-0.07408052682876587,
0.10558290034532547,
0.02545865625143051,
-0.007765636779367924,
0.006432889495044947,
0.01644732803106308,
0.018045412376523018,
-0.005568404216319323,
-0.04216136410832405,
0.029884889721870422,
0.08314520865678787,
0.07070811092853546,
-0.007948764599859715,
-0.025418158620595932,
-0.014492819085717201,
0.05426401644945145,
0.016071803867816925,
-0.07122242450714111,
-0.02371014468371868,
-0.010980894789099693,
-0.017049143090844154,
0.04363154619932175,
0.03861702233552933,
-0.06084735691547394,
-0.030684543773531914,
0.04793618619441986,
-0.005505514331161976,
0.03870019316673279,
-0.0037064016796648502,
0.03459637239575386,
0.027693673968315125,
0.06761696189641953,
-0.016740906983613968,
-0.04406125470995903,
-0.07481846213340759,
0.10551544278860092,
-0.004862445872277021,
-0.02583411894738674,
-0.04644085839390755,
0.00024418625980615616,
-0.09145837277173996,
0.006643664091825485,
-5.726497504505562e-33,
0.07002374529838562,
0.014807467348873615,
0.009296705946326256,
0.06739167124032974,
0.013215254060924053,
0.009999556466937065,
-0.034379664808511734,
0.009249499998986721,
0.04555870220065117,
0.1060837134718895,
-0.04003932327032089,
0.0568932481110096,
0.006614251993596554,
0.09156758338212967,
0.03931834548711777,
-0.0011584883322939277,
-0.006004029884934425,
-0.026431169360876083,
0.0642053633928299,
-0.015430029481649399,
-0.01888798549771309,
-0.06639841198921204,
0.0881456583738327,
0.049863267689943314,
-0.03587346524000168,
0.01968402974307537,
0.023717600852251053,
0.031881265342235565,
-0.09086353331804276,
-0.061009250581264496,
-0.08739832788705826,
-0.0020025570411235094,
-0.025320470333099365,
0.06281475722789764,
0.0004538720240816474,
-0.016404010355472565,
0.005644325632601976,
0.11833277344703674,
0.015137828886508942,
0.024752482771873474,
0.07451789081096649,
0.04705420136451721,
-0.04710254445672035,
-0.11294332146644592,
-0.009759780019521713,
-0.034105539321899414,
-0.05759461969137192,
0.10162046551704407,
-0.01632574573159218,
-0.02018103562295437,
-0.12743590772151947,
0.004235327243804932,
-0.04082309454679489,
0.029382172971963882,
-0.012345309369266033,
-0.05039053410291672,
-0.022885188460350037,
-0.019392328336834908,
0.04512876272201538,
-0.01806729845702648,
-0.033461637794971466,
-0.06520948559045792,
-0.025952938944101334,
-0.004223580472171307,
0.09932103008031845,
-0.06710778921842575,
-0.012293593026697636,
-0.015885207802057266,
0.07359271496534348,
0.015906084328889847,
0.061116546392440796,
0.06882187724113464,
-0.07416455447673798,
0.025256652384996414,
-0.0008956241072155535,
0.019739573821425438,
-0.03383167088031769,
-0.08597764372825623,
-0.019043883308768272,
0.07730057835578918,
0.03957265615463257,
0.0014310342958196998,
0.022201301530003548,
0.05855090171098709,
0.02750035747885704,
0.02543436922132969,
0.029389334842562675,
0.0335221141576767,
0.03819211572408676,
-0.03915669396519661,
0.007939063012599945,
0.04802168533205986,
-0.08497902750968933,
-0.009287373162806034,
0.028879858553409576,
-4.97225762785547e-8,
-0.04709882289171219,
-0.07693176716566086,
-0.07316482067108154,
0.002798117697238922,
0.06122090294957161,
0.0030131267849355936,
-0.007308945059776306,
-0.08552119880914688,
0.006422460079193115,
0.014747667126357555,
-0.07656130939722061,
-0.05207011476159096,
0.031363651156425476,
0.011262563057243824,
-0.030689625069499016,
0.027400916442275047,
0.02964729629456997,
-0.0051147607155144215,
-0.014212124980986118,
-0.03423776850104332,
0.05913835018873215,
0.031963374465703964,
0.02014015056192875,
0.06349887698888779,
0.004173680674284697,
-0.01898110657930374,
0.03170600160956383,
0.05333074927330017,
-0.04473648592829704,
-0.02291412092745304,
-0.03486454859375954,
-0.04150300472974777,
0.10515156388282776,
0.0324685275554657,
-0.0007703684386797249,
-0.08058217167854309,
0.08455443382263184,
0.016035448759794235,
0.017736731097102165,
0.014204086735844612,
0.03552987053990364,
0.06793070584535599,
0.0054844883270561695,
-0.02059095725417137,
-0.025670034810900688,
-0.06907901167869568,
-0.0477638840675354,
-0.003952110651880503,
0.0405755378305912,
0.02555203065276146,
-0.02780848741531372,
-0.015787441283464432,
-0.024195009842514992,
-0.0577869713306427,
-0.0178330410271883,
-0.022614173591136932,
0.06603270024061203,
-0.02239764668047428,
-0.050070635974407196,
-0.033268701285123825,
0.04067326709628105,
-0.021101268008351326,
0.022879742085933685,
-0.0654100701212883
] | 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 Mac | | `Meta`+`D` or `Meta` +`Delete` | Delete word right | `Meta`+`Delete` Doesn't work on windows | | `Meta`+`Backspace` | Delete word left | Doesn't work on Mac | [EOF character]: https://en.wikipedia.org/wiki/End-of-file#EOF\_character [Readable]: stream.md#readable-streams [TTY]: tty.md [TTY keybindings]: #tty-keybindings [Writable]: stream.md#writable-streams [`'SIGCONT'`]: #event-sigcont [`'SIGTSTP'`]: #event-sigtstp [`'line'`]: #event-line [`fs.ReadStream`]: fs.md#class-fsreadstream [`process.stdin`]: process.md#processstdin [`process.stdout`]: process.md#processstdout [`rl.close()`]: #rlclose [reading files]: #example-read-file-stream-line-by-line | 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.0023890535812824965,
0.051716361194849014,
0.010322894901037216,
-0.06598316133022308,
0.0096378643065691,
-0.02284012921154499,
-0.0044210683554410934,
0.014617923647165298,
0.0396660640835762,
0.07595083117485046,
0.024061324074864388,
0.027430757880210876,
0.061476849019527435,
-0.05532329902052879,
-0.034737396985292435,
-0.003716637147590518,
-0.026771876960992813,
-0.07180048525333405,
-0.01984207145869732,
-0.02624743990600109,
-0.006188442464917898,
0.024859974160790443,
0.07991283386945724,
0.0011667496291920543,
-0.031901974231004715,
-0.12675423920154572,
-0.08684740215539932,
-0.08919967710971832,
0.002828543074429035,
0.023576918989419937,
0.08229120075702667,
0.015073370188474655,
0.00211628177203238,
-0.07472733408212662,
-0.021602490916848183,
-0.018556660041213036,
0.08445993810892105,
-0.03210442140698433,
0.0002890127361752093,
-0.02970762737095356,
0.14478784799575806,
0.03595289587974548,
0.009905239567160606,
-0.029375484213232994,
0.006089288741350174,
0.04878444969654083,
-0.022719774395227432,
-0.008728517219424248,
0.0031113082077354193,
-0.07443845272064209,
-0.01296662911772728,
-0.022884786128997803,
0.05084375664591789,
-0.08117420971393585,
-0.007849820889532566,
-0.016512198373675346,
0.0034944440703839064,
-0.046234771609306335,
-0.06646066159009933,
-0.05864469334483147,
0.018822411075234413,
-0.01905188523232937,
0.07630905508995056,
0.09706925600767136,
-0.018876124173402786,
-0.07082147151231766,
-0.01929450035095215,
0.014951030723750591,
0.0060865911655128,
-0.003255335846915841,
0.04284941777586937,
0.05645786225795746,
0.06509295105934143,
-0.12032438814640045,
-0.057339008897542953,
0.0363723561167717,
0.04390381649136543,
0.028661029413342476,
-0.10260755568742752,
0.07896073162555695,
-0.00791860930621624,
-0.010588925331830978,
-0.07071416825056076,
0.017988065257668495,
0.09052440524101257,
-0.0647607296705246,
0.04203428700566292,
-0.0006283169495873153,
0.006314626894891262,
-0.00047165766591206193,
0.009077010676264763,
0.038744036108255386,
0.07424314320087433,
0.03089164011180401,
-0.042648572474718094,
-0.027704017236828804,
-0.022313203662633896,
-0.04003217816352844,
-0.008862133137881756,
-0.022567816078662872,
-0.015202141366899014,
-0.004935009870678186,
0.03302564471960068,
-0.03345685824751854,
-0.014740094542503357,
0.14023135602474213,
0.04145948961377144,
-0.02923048660159111,
-0.06600898504257202,
-0.08613485842943192,
0.053146809339523315,
0.039689794182777405,
-0.052956558763980865,
0.052072107791900635,
3.253606365260869e-33,
0.008608692325651646,
-0.07238303869962692,
-0.008401254191994667,
0.050220973789691925,
0.13939347863197327,
0.023836225271224976,
-0.03991056606173515,
0.0541553795337677,
-0.07580851763486862,
-0.009315243922173977,
0.035174399614334106,
-0.070419542491436,
-0.032243553549051285,
-0.017898596823215485,
0.08384153246879578,
-0.03820653259754181,
0.06745729595422745,
0.006589747034013271,
-0.06037256121635437,
0.0003733894263859838,
0.07091604918241501,
0.06671861559152603,
-0.017017913982272148,
-0.06498770415782928,
-0.04460836946964264,
0.0369475819170475,
-0.009340493939816952,
-0.05005421116948128,
0.034997884184122086,
0.04339911788702011,
-0.08962814509868622,
-0.012333626858890057,
0.013250462710857391,
-0.020898569375276566,
-0.09133043140172958,
0.005804097279906273,
-0.051350586116313934,
0.02409624308347702,
-0.030642226338386536,
-0.00845711026340723,
-0.08636783063411713,
-0.015739822760224342,
-0.0679197832942009,
-0.053959302604198456,
0.00748423021286726,
-0.14732037484645844,
-0.013142464682459831,
0.06731860339641571,
-0.020599404349923134,
0.04520121216773987,
0.08618191629648209,
0.05242536962032318,
-0.02712508849799633,
-0.003725142916664481,
0.0075452993623912334,
-0.041572440415620804,
-0.014473121613264084,
0.07864239811897278,
-0.024434277787804604,
0.06566391885280609,
0.0399424210190773,
0.08461569994688034,
0.11180607974529266,
0.060235846787691116,
0.016775747761130333,
0.004042260814458132,
0.03348442539572716,
0.005414486862719059,
-0.014466737397015095,
0.004825368523597717,
-0.067914217710495,
-0.0021026988979429007,
-0.03430148586630821,
0.0197710283100605,
-0.04880655184388161,
-0.055360130965709686,
-0.04324734956026077,
-0.123006671667099,
-0.002516842680051923,
0.015397799201309681,
-0.06065605953335762,
0.0036335138138383627,
-0.08624479174613953,
0.06552669405937195,
0.027104757726192474,
-0.05078137293457985,
-0.006426822394132614,
-0.04809392988681793,
0.027433237060904503,
0.008979309350252151,
0.019678110256791115,
0.0005881624529138207,
0.0654292181134224,
0.01208373624831438,
-0.08956043422222137,
-5.3410150706465165e-33,
-0.00226377765648067,
0.02296636812388897,
-0.014642229303717613,
0.04233665391802788,
-0.13632817566394806,
-0.007746059447526932,
0.009323829784989357,
0.03558692708611488,
0.02017424814403057,
-0.08064199239015579,
-0.06093112751841545,
0.07706882804632187,
-0.027700910344719887,
-0.01351179089397192,
0.036200493574142456,
0.036773037165403366,
-0.002913430333137512,
-0.020267479121685028,
-0.04274250939488411,
0.002251409227028489,
-0.009227382019162178,
-0.06207970902323723,
-0.02902202494442463,
0.12280935049057007,
0.00018411685596220195,
-0.007395989261567593,
0.008725984022021294,
0.06391824781894684,
-0.012876511551439762,
0.01947561837732792,
-0.005191015545278788,
0.12836138904094696,
-0.05660706013441086,
-0.017153151333332062,
-0.02573908306658268,
-0.01017365325242281,
-0.08693362027406693,
0.1061946228146553,
0.04377257451415062,
0.029671723023056984,
0.12460430711507797,
0.0009441496804356575,
-0.015860162675380707,
0.01824471727013588,
-0.03350193798542023,
0.07885926961898804,
-0.08624498546123505,
0.01675109565258026,
0.05500573664903641,
0.001159869134426117,
0.12263622134923935,
-0.043973006308078766,
-0.04378001019358635,
-0.055328890681266785,
-0.043097782880067825,
-0.0029988891910761595,
-0.0035184230655431747,
-0.06600798666477203,
-0.08045940846204758,
-0.04187289997935295,
-0.027632402256131172,
-0.04745398089289665,
0.011514331214129925,
-0.062117524445056915,
0.073886439204216,
-0.06039586663246155,
-0.05173022672533989,
0.013639380224049091,
-0.028864452615380287,
-0.06273524463176727,
0.04981280118227005,
0.0924951434135437,
-0.0026916342321783304,
0.025518015027046204,
0.04917193576693535,
0.05352051556110382,
0.06238056719303131,
-0.0579816959798336,
-0.032041195780038834,
0.08618486672639847,
0.029563313350081444,
0.08285227417945862,
0.01920783333480358,
-0.00026583706494420767,
-0.098579540848732,
0.08259817957878113,
-0.08978278189897537,
0.06380656361579895,
-0.04397762194275856,
-0.01260961964726448,
0.03032844513654709,
-0.026627765968441963,
0.02174285613000393,
0.010492362082004547,
0.000984271289780736,
-3.892663968940724e-8,
-0.062011782079935074,
-0.007784200832247734,
-0.06903446465730667,
-0.005639762617647648,
-0.0887736976146698,
-0.007649144623428583,
-0.006139235105365515,
0.004550755023956299,
-0.007481373380869627,
-0.06648750603199005,
-0.005433720536530018,
0.0034589464776217937,
-0.08118237555027008,
-0.01821758784353733,
-0.05294689163565636,
-0.01468293834477663,
0.033246636390686035,
0.041110482066869736,
0.00016187310393434018,
-0.026501307263970375,
-0.022447753697633743,
0.014752546325325966,
-0.027431616559624672,
-0.010196525603532791,
-0.07084169238805771,
0.009181289002299309,
-0.03159089386463165,
0.07028809934854507,
0.01180868037045002,
-0.0012959487503394485,
0.06653212010860443,
-0.020513322204351425,
-0.020655233412981033,
0.06528863310813904,
-0.015720851719379425,
-0.049011196941137314,
0.02250724472105503,
0.007936503738164902,
-0.06479606032371521,
0.03964459151029587,
0.0325414314866066,
-0.009503046981990337,
-0.04916922003030777,
-0.02428523078560829,
-0.13422934710979462,
0.011326087638735771,
0.05064276605844498,
0.10776025056838989,
-0.022262675687670708,
-0.05946151539683342,
0.0682586207985878,
0.014048281125724316,
0.01797032542526722,
-0.007845081388950348,
0.02812228724360466,
0.05359283834695816,
0.04080105945467949,
-0.026159625500440598,
-0.028598904609680176,
-0.04395393282175064,
0.07534601539373398,
0.03078366629779339,
-0.01200132630765438,
0.004167626611888409
] | 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 punycode-based URL encoding, see [`url.domainToASCII`][] or, more generally, the [WHATWG URL API][]. The `punycode` module is a bundled version of the [Punycode.js][] module. It can be accessed using: ```js const punycode = require('node:punycode'); ``` [Punycode][] is a character encoding scheme defined by RFC 3492 that is primarily intended for use in Internationalized Domain Names. Because host names in URLs are limited to ASCII characters only, Domain Names that contain non-ASCII characters must be converted into ASCII using the Punycode scheme. For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. The `punycode` module provides a simple implementation of the Punycode standard. The `punycode` module is a third-party dependency used by Node.js and made available to developers as a convenience. Fixes or other modifications to the module must be directed to the [Punycode.js][] project. ## `punycode.decode(string)` \* `string` {string} The `punycode.decode()` method converts a [Punycode][] string of ASCII-only characters to the equivalent string of Unicode codepoints. ```js punycode.decode('maana-pta'); // 'mañana' punycode.decode('--dqo34k'); // '☃-⌘' ``` ## `punycode.encode(string)` \* `string` {string} The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode][] string of ASCII-only characters. ```js punycode.encode('mañana'); // 'maana-pta' punycode.encode('☃-⌘'); // '--dqo34k' ``` ## `punycode.toASCII(domain)` \* `domain` {string} The `punycode.toASCII()` method converts a Unicode string representing an Internationalized Domain Name to [Punycode][]. Only the non-ASCII parts of the domain name will be converted. Calling `punycode.toASCII()` on a string that already only contains ASCII characters will have no effect. ```js // encode domain names punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' punycode.toASCII('example.com'); // 'example.com' ``` ## `punycode.toUnicode(domain)` \* `domain` {string} The `punycode.toUnicode()` method converts a string representing a domain name containing [Punycode][] encoded characters into Unicode. Only the [Punycode][] encoded parts of the domain name are be converted. ```js // decode domain names punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' punycode.toUnicode('example.com'); // 'example.com' ``` ## `punycode.ucs2` ### `punycode.ucs2.decode(string)` \* `string` {string} The `punycode.ucs2.decode()` method returns an array containing the numeric codepoint values of each Unicode symbol in the string. ```js punycode.ucs2.decode('abc'); // [0x61, 0x62, 0x63] // surrogate pair for U+1D306 tetragram for centre: punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] ``` ### `punycode.ucs2.encode(codePoints)` \* `codePoints` {integer\[]} The `punycode.ucs2.encode()` method returns a string based on an array of numeric code point values. ```js punycode.ucs2.encode([0x61, 0x62, 0x63]); // 'abc' punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06' ``` ## `punycode.version` \* Type: {string} Returns a string identifying the current [Punycode.js][] version number. [Punycode]: https://tools.ietf.org/html/rfc3492 [Punycode.js]: https://github.com/bestiejs/punycode.js [WHATWG URL API]: url.md#the-whatwg-url-api [`url.domainToASCII`]: url.md#urldomaintoasciidomain | 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.056917767971754074,
0.09148625284433365,
0.047363076359033585,
-0.008446118794381618,
0.01768467202782631,
0.01275088544934988,
-0.05874452739953995,
0.13088881969451904,
0.03809730336070061,
0.06272700428962708,
-0.010455918498337269,
-0.0006872950471006334,
-0.06803230941295624,
-0.0498756542801857,
0.049577441066503525,
0.010378073900938034,
-0.0016507471445947886,
-0.002658289857208729,
-0.03078518994152546,
-0.011494900099933147,
-0.023936046287417412,
-0.03782012313604355,
0.04017248377203941,
0.02867947891354561,
-0.04962071776390076,
0.01580400951206684,
-0.019849255681037903,
0.009847261942923069,
0.07887353003025055,
-0.046289581805467606,
-0.010716354474425316,
-0.026261717081069946,
-0.0076379659585654736,
-0.0987367033958435,
0.006609360687434673,
-0.08887708187103271,
0.02677900716662407,
0.027988744899630547,
-0.01884397305548191,
-0.005481820087879896,
-0.036217182874679565,
-0.02676294557750225,
0.06420553475618362,
-0.08663062751293182,
0.04558974504470825,
0.0815095603466034,
0.03085356391966343,
-0.054192814975976944,
-0.034407757222652435,
0.05441665276885033,
-0.0007647473248653114,
0.04112660884857178,
-0.035631097853183746,
-0.0030530367512255907,
-0.03374100103974342,
-0.0413576178252697,
0.0025397504214197397,
-0.0591784231364727,
-0.02257218211889267,
-0.036703262478113174,
0.04646383225917816,
-0.014819540083408356,
0.08935398608446121,
-0.012503063306212425,
0.03337396681308746,
0.05166148766875267,
-0.026754627004265785,
0.03483152016997337,
-0.0830196887254715,
0.021117348223924637,
0.10405094921588898,
0.04316126927733421,
0.06941504031419754,
-0.033899467438459396,
-0.01968621276319027,
0.014115883968770504,
-0.027559036388993263,
-0.04117681458592415,
-0.11693209409713745,
0.07011672109365463,
0.06811396032571793,
-0.027259040623903275,
-0.01919873245060444,
0.060043592005968094,
0.07937135547399521,
-0.09254954755306244,
0.004647923167794943,
0.01168300025165081,
-0.020551610738039017,
0.05911849066615105,
-0.09380093961954117,
0.02605028823018074,
0.004208384081721306,
0.03351922705769539,
0.04245166480541229,
0.08465767651796341,
-0.03604724258184433,
-0.025601500645279884,
0.038891978561878204,
-0.0026393283624202013,
-0.11486028134822845,
-0.06602712720632553,
-0.009677539579570293,
-0.01562877744436264,
-0.06958945095539093,
0.1314944475889206,
0.11116700619459152,
0.05225364863872528,
0.029423298314213753,
-0.07568053901195526,
0.028444183990359306,
-0.018625900149345398,
-0.07279284298419952,
0.0573636069893837,
7.277455403898042e-33,
-0.019282184541225433,
0.09910713881254196,
-0.009902281686663628,
0.024411462247371674,
-0.03555147349834442,
-0.026646843180060387,
-0.05377514660358429,
-0.01673770137131214,
-0.10409753024578094,
-0.08310078829526901,
-0.010172571986913681,
0.027906887233257294,
0.01261705718934536,
0.01522834226489067,
-0.01093476451933384,
0.039317548274993896,
0.07081523537635803,
-0.0500887930393219,
0.0931086540222168,
0.006336359307169914,
-0.029576238244771957,
0.04994044825434685,
0.02316250279545784,
0.03576609119772911,
-0.0063155232928693295,
0.06361902505159378,
0.02290245331823826,
-0.04453938454389572,
-0.0589580200612545,
0.04385633394122124,
0.001559638767503202,
-0.011944709345698357,
-0.0067325071431696415,
-0.03757769614458084,
0.08542381227016449,
0.01708751730620861,
-0.0028652618639171124,
0.018323233351111412,
-0.13632820546627045,
0.007591277826577425,
-0.027026407420635223,
0.012021766975522041,
-0.12445759028196335,
0.06871657818555832,
-0.01448073796927929,
-0.06339060515165329,
0.009281737729907036,
-0.009883636608719826,
-0.005292920861393213,
0.05984875187277794,
-0.0962175503373146,
0.04993738234043121,
-0.005898628383874893,
0.01231194008141756,
0.01618093065917492,
-0.05424954369664192,
0.09852273017168045,
-0.1276158094406128,
-0.030287304893136024,
-0.0214890968054533,
0.06703083962202072,
0.03296075016260147,
0.023176459595561028,
-0.022791029885411263,
0.000595162040553987,
0.019728517159819603,
-0.03399590402841568,
-0.03163890913128853,
-0.06512724608182907,
0.03017434850335121,
-0.020927773788571358,
0.03575988858938217,
0.009262241423130035,
0.021485235542058945,
-0.13989737629890442,
-0.009064432233572006,
-0.08899807184934616,
0.015165276825428009,
-0.012018661946058273,
-0.01804158091545105,
-0.023779552429914474,
-0.12127434462308884,
-0.08857109397649765,
0.035878926515579224,
0.03948875889182091,
-0.03905726969242096,
-0.019477376714348793,
-0.025220734998583794,
0.01936591975390911,
0.026166146621108055,
0.10195688903331757,
0.0011301682097837329,
-0.01829824224114418,
-0.013402454555034637,
-0.03210688754916191,
-8.294360873115018e-33,
-0.057604480534791946,
0.07560329884290695,
-0.1399441510438919,
0.14306539297103882,
-0.07695340365171432,
-0.061578016728162766,
0.09165886789560318,
0.011345039121806622,
0.04557475075125694,
-0.030084682628512383,
-0.038304489105939865,
0.019400548189878464,
0.0441875196993351,
-0.05134270712733269,
0.10171078890562057,
0.09485764801502228,
-0.056447919458150864,
0.047624748200178146,
0.017568785697221756,
-0.022302618250250816,
0.011653483845293522,
0.05532022938132286,
-0.09866205602884293,
0.07963079959154129,
0.010806809179484844,
0.02681294083595276,
0.00014263195043895394,
-0.09306995570659637,
-0.004241438582539558,
-0.023375798016786575,
-0.024850884452462196,
0.01340726763010025,
-0.07083525508642197,
0.03696594759821892,
-0.006038979161530733,
-0.031086653470993042,
0.009419968351721764,
0.07255280762910843,
0.03573548421263695,
-0.08545953780412674,
0.03474600985646248,
0.0035748127847909927,
-0.030224835500121117,
0.05787912756204605,
0.019220637157559395,
0.008836078457534313,
-0.061661746352910995,
0.04687691852450371,
0.0561472587287426,
0.06797716021537781,
0.015551256947219372,
-0.07203920930624008,
0.03591958060860634,
-0.06149878725409508,
-0.0495147630572319,
-0.04108726233243942,
-0.04970884323120117,
0.03157965466380119,
-0.021314196288585663,
0.024258319288492203,
-0.03589390590786934,
-0.035135433077812195,
0.008261548355221748,
0.0020932299084961414,
-0.005290766712278128,
-0.07330160588026047,
-0.10423657298088074,
0.019172627478837967,
0.05727975815534592,
-0.0902220755815506,
-0.008825952187180519,
-0.02666776441037655,
-0.003342042677104473,
0.031482942402362823,
-0.03284629061818123,
0.010502657853066921,
0.0866369679570198,
-0.01899862289428711,
-0.010523613542318344,
0.02101358212530613,
-0.02478853240609169,
0.06283343583345413,
0.029239049181342125,
0.05388440564274788,
0.09161007404327393,
0.005712567362934351,
-0.06558804214000702,
0.08631536364555359,
-0.06361600011587143,
-0.011228498071432114,
0.05054537206888199,
0.10666777938604355,
-0.10928063094615936,
-0.007680234499275684,
-0.010970423929393291,
-5.5248889907488774e-8,
-0.04793856292963028,
-0.010418488644063473,
-0.14362530410289764,
-0.025791490450501442,
0.004411619156599045,
-0.020854836329817772,
0.052632663398981094,
0.0005731215933337808,
0.058815546333789825,
0.047520775347948074,
0.046946555376052856,
0.015421166084706783,
-0.01569378562271595,
-0.013514375314116478,
-0.048802897334098816,
0.06360570341348648,
-0.03129405155777931,
0.08900603652000427,
-0.018927402794361115,
0.015327087603509426,
-0.05606815591454506,
-0.0030447475146502256,
-0.05109334737062454,
-0.027066566050052643,
-0.005184868350625038,
-0.07169412076473236,
-0.009905879385769367,
0.0814206451177597,
-0.04148176312446594,
0.0011018270161002874,
-0.028309235349297523,
0.058122605085372925,
-0.047481849789619446,
-0.05156409367918968,
-0.07906070351600647,
0.04707709699869156,
-0.008483615703880787,
-0.014716739766299725,
0.06183463707566261,
0.030547382310032845,
0.018146149814128876,
0.003702915506437421,
-0.027513131499290466,
0.015058322809636593,
-0.03530362248420715,
0.007883965037763119,
0.07923007756471634,
-0.022621162235736847,
0.04477718099951744,
0.0496407188475132,
-0.03596670553088188,
-0.018753375858068466,
-0.06110119819641113,
0.003001235658302903,
0.004274762701243162,
-0.016047630459070206,
0.006474487017840147,
-0.03677055239677429,
0.01714247092604637,
0.02315264195203781,
0.05910723656415939,
-0.0011408583959564567,
0.07410145550966263,
-0.05856679752469063
] | 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 Timeline][] \* [User Timing][] \* [Resource Timing][] ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((items) => { console.log(items.getEntries()[0].duration); performance.clearMarks(); }); obs.observe({ type: 'measure' }); performance.measure('Start to Now'); performance.mark('A'); doSomeLongRunningProcess(() => { performance.measure('A to Now', 'A'); performance.mark('B'); performance.measure('A to B', 'A', 'B'); }); ``` ```cjs const { PerformanceObserver, performance } = require('node:perf\_hooks'); const obs = new PerformanceObserver((items) => { console.log(items.getEntries()[0].duration); }); obs.observe({ type: 'measure' }); performance.measure('Start to Now'); performance.mark('A'); (async function doSomeLongRunningProcess() { await new Promise((r) => setTimeout(r, 5000)); performance.measure('A to Now', 'A'); performance.mark('B'); performance.measure('A to B', 'A', 'B'); })(); ``` ## `perf\_hooks.performance` An object that can be used to collect performance metrics from the current Node.js instance. It is similar to [`window.performance`][] in browsers. ### `performance.clearMarks([name])` \* `name` {string} If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. If `name` is provided, removes only the named mark. ### `performance.clearMeasures([name])` \* `name` {string} If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. If `name` is provided, removes only the named measure. ### `performance.clearResourceTimings([name])` \* `name` {string} If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. If `name` is provided, removes only the named resource. ### `performance.eventLoopUtilization([utilization1[, utilization2]])` \* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`. \* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. \* Returns: {Object} \* `idle` {number} \* `active` {number} \* `utilization` {number} This is an alias of [`perf\_hooks.eventLoopUtilization()`][]. \_This property is an extension by Node.js. It is not available in Web browsers.\_ ### `performance.getEntries()` \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. If you are only interested in performance entries of certain types or that have certain names, see `performance.getEntriesByType()` and `performance.getEntriesByName()`. ### `performance.getEntriesByName(name[, type])` \* `name` {string} \* `type` {string} \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. ### `performance.getEntriesByType(type)` \* `type` {string} \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. ### `performance.mark(name[, options])` \* `name` {string} \* `options` {Object} \* `detail` {any} Additional optional detail to include with the mark. \* `startTime` {number} An optional timestamp to be used as the mark time. \*\*Default\*\*: `performance.now()`. Creates a new `PerformanceMark` entry in the Performance Timeline. A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, and whose `performanceEntry.duration` is always `0`. Performance marks are used to mark specific significant moments in the Performance Timeline. The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. ### `performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode, bodyInfo, responseStatus[, deliveryType])` \* `timingInfo` {Object} [Fetch Timing Info][] \* `requestedUrl` {string} The resource url \* `initiatorType` {string} The initiator name, e.g: '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 Node.js. It is not | 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.04212798923254013,
-0.0020407799165695906,
0.021871352568268776,
0.04429861903190613,
0.06445374339818954,
-0.020691141486167908,
-0.06982056051492691,
0.026690484955906868,
-0.06910872459411621,
0.07424009591341019,
0.014760362915694714,
-0.034164734184741974,
0.039029307663440704,
-0.07502691447734833,
0.0007262821309268475,
0.048621486872434616,
-0.007680264301598072,
-0.00858835969120264,
-0.10842623561620712,
-0.04074905440211296,
0.055755484849214554,
-0.01715865731239319,
0.058683112263679504,
0.010095763020217419,
-0.09143543243408203,
-0.002964957384392619,
-0.0380023792386055,
0.05605717748403549,
0.07639146596193314,
-0.01917952299118042,
-0.0401197113096714,
0.013129489496350288,
-0.012601031921803951,
-0.08123159408569336,
-0.026667460799217224,
-0.10319003462791443,
0.048370927572250366,
-0.022048519924283028,
-0.04095256328582764,
0.008264286443591118,
-0.08184515684843063,
0.020962875336408615,
0.07703296840190887,
0.02369682490825653,
-0.015215415507555008,
-0.02171921543776989,
0.026698270812630653,
0.015890635550022125,
-0.06331349909305573,
0.01164646353572607,
-0.0013788623036816716,
0.09369145333766937,
0.05748836323618889,
0.021927719935774803,
0.00361528224311769,
0.021447984501719475,
0.004195160698145628,
-0.07990790903568268,
0.02709040977060795,
0.008459746837615967,
-0.043302856385707855,
-0.06805810332298279,
-0.04609636962413788,
-0.044001635164022446,
-0.007362790871411562,
-0.03221042454242706,
-0.002497414592653513,
-0.012567995116114616,
-0.04436358064413071,
-0.0783960297703743,
0.04761539399623871,
0.06632643193006516,
0.04148666933178902,
0.05868380889296532,
0.004897660110145807,
-0.022643722593784332,
-0.020160643383860588,
-0.06282346695661545,
0.06405652314424515,
-0.06241481378674507,
0.04960029944777489,
-0.021432725712656975,
0.03610389307141304,
0.02944248542189598,
-0.01570606417953968,
0.0016461459454149008,
0.03892526775598526,
0.05245538800954819,
0.038554053753614426,
-0.004125586710870266,
0.037592869251966476,
0.040821611881256104,
-0.018579743802547455,
0.020714376121759415,
0.09141537547111511,
-0.05653972178697586,
0.039667870849370956,
0.045708004385232925,
0.06476457417011261,
-0.021635986864566803,
0.014328091405332088,
0.05253739655017853,
0.03240746632218361,
0.009630080312490463,
0.0054649063386023045,
0.10341710597276688,
0.12060492485761642,
0.11330599337816238,
0.014412002637982368,
-0.013149036094546318,
-0.08413200080394745,
0.05386364459991455,
0.02967015467584133,
0.06776318699121475,
4.174247296011146e-33,
-0.046415552496910095,
-0.10510791838169098,
0.017982086166739464,
-0.002245704410597682,
-0.022955935448408127,
0.043157029896974564,
-0.035267528146505356,
-0.007254427298903465,
-0.00826609879732132,
-0.01005062647163868,
-0.031148526817560196,
0.018929963931441307,
-0.02746836468577385,
-0.05223850533366203,
0.07576238363981247,
-0.07976346462965012,
0.0638899952173233,
0.03199423477053642,
0.07074273377656937,
0.04238307103514671,
0.09033650904893875,
-0.10470565408468246,
-0.07474043220281601,
0.0307883620262146,
0.07506460696458817,
0.009222235530614853,
0.05290375277400017,
0.09211687743663788,
-0.08334594964981079,
-0.01358928345143795,
0.04753904417157173,
0.043503906577825546,
-0.10566616803407669,
-0.005592736415565014,
0.006388597656041384,
-0.05648761987686157,
-0.0036537100095301867,
0.05906307324767113,
-0.0011594136012718081,
0.01412924099713564,
-0.04695628955960274,
0.045760199427604675,
-0.024946145713329315,
-0.06769212335348129,
-0.12017179280519485,
-0.1043035238981247,
-0.06903476268053055,
-0.00830024667084217,
0.03461885079741478,
0.024084707722067833,
-0.02990875579416752,
0.027204129844903946,
0.03849470615386963,
-0.052756696939468384,
0.0073713879100978374,
-0.0010997072095051408,
0.08548583835363388,
0.019104866310954094,
-0.04477265477180481,
0.09746498614549637,
-0.014495907351374626,
-0.04959999397397041,
-0.06080486252903938,
-0.08467134833335876,
-0.049690086394548416,
0.04171016812324524,
-0.025384793058037758,
0.017103072255849838,
-0.018705902621150017,
-0.005654618144035339,
-0.0017449037404730916,
-0.0034157573245465755,
0.0802883729338646,
-0.03403554856777191,
0.0297713540494442,
-0.020964454859495163,
-0.03188566118478775,
0.008240913040935993,
-0.09860130399465561,
-0.07664614915847778,
0.07857304066419601,
-0.0032035470940172672,
-0.0032658828422427177,
-0.029403449967503548,
0.058042094111442566,
-0.02039572410285473,
-0.057402268052101135,
-0.03139069303870201,
-0.03457069396972656,
0.03910711780190468,
-0.04740363359451294,
0.049208078533411026,
0.03365926817059517,
-0.008508517406880856,
-0.13416112959384918,
-3.897271806940629e-33,
0.01913618855178356,
-0.025434434413909912,
-0.006421281956136227,
0.07461278140544891,
0.06760930269956589,
-0.065408855676651,
-0.05223388597369194,
0.030393928289413452,
-0.018960071727633476,
0.009621687233448029,
0.010901648551225662,
-0.07013344764709473,
-0.07358574867248535,
-0.0057248384691774845,
0.024121848866343498,
0.07886672019958496,
-0.008988237008452415,
-0.06146958842873573,
0.07219982892274857,
-0.015043430030345917,
0.0268473532050848,
0.025775404646992683,
0.000751421379391104,
-0.07596014440059662,
-0.03867582976818085,
0.01935768313705921,
0.012271089479327202,
-0.028782475739717484,
-0.04456442594528198,
-0.11081168055534363,
-0.03430325910449028,
-0.015597944147884846,
-0.029592586681246758,
0.038399163633584976,
0.05590486153960228,
-0.047053806483745575,
0.02738737128674984,
-0.020150061696767807,
-0.009959953837096691,
0.013269235379993916,
0.11260966956615448,
0.040629882365465164,
-0.08406922221183777,
-0.022949356585741043,
0.04409177228808403,
0.10004577040672302,
-0.07446052879095078,
0.002215286251157522,
-0.030883563682436943,
0.056441713124513626,
0.018779776990413666,
-0.025436637923121452,
0.020124154165387154,
0.05380629748106003,
-0.0157969668507576,
-0.058000579476356506,
-0.02246721275150776,
-0.1311250478029251,
0.028674045577645302,
0.05157725140452385,
-0.009009215049445629,
-0.10479044914245605,
-0.0008698375895619392,
0.012382768094539642,
0.07221007347106934,
0.06327610462903976,
-0.02850574068725109,
-0.05223400518298149,
0.03495381027460098,
0.07191623002290726,
-0.0025249754544347525,
0.03328237682580948,
-0.05161014944314957,
0.006896483711898327,
-0.0494578592479229,
-0.023151172325015068,
-0.0027452462818473577,
-0.06096320599317551,
0.002055023331195116,
0.04754279926419258,
-0.05002688616514206,
0.06836787611246109,
-0.006726115010678768,
-0.06100143864750862,
-0.055475864559412,
0.09256240725517273,
-0.007314478978514671,
0.037182942032814026,
0.0009397080866619945,
-0.003886657999828458,
0.024216169491410255,
0.04842287302017212,
-0.12371758371591568,
-0.02927333116531372,
0.0021477362606674433,
-4.741003678532252e-8,
-0.07681857794523239,
-0.03910844027996063,
-0.033163487911224365,
0.04589730128645897,
-0.020260218530893326,
0.02624993957579136,
0.017230339348316193,
0.026227012276649475,
0.06057021766901016,
-0.019784215837717056,
0.15678559243679047,
-0.03391321748495102,
0.03628400340676308,
-0.03879924491047859,
0.03950205072760582,
0.004604593850672245,
-0.004866762552410364,
0.038213517516851425,
-0.009240231476724148,
0.005056447349488735,
0.024742908775806427,
0.05445577949285507,
0.05919661000370979,
-0.005101227667182684,
-0.0033114049583673477,
-0.017916493117809296,
0.03988635540008545,
0.07928428053855896,
0.015408835373818874,
0.00786749366670847,
-0.07169269025325775,
0.01893714629113674,
0.05610348656773567,
-0.04519156739115715,
0.02963421121239662,
-0.011334024369716644,
-0.07028146833181381,
0.007409671321511269,
0.06533899158239365,
0.13581623136997223,
0.04540811851620674,
0.0856097936630249,
-0.08532048016786575,
0.08941837400197983,
0.08853285759687424,
-0.0691511407494545,
-0.07683317363262177,
0.037491872906684875,
0.050624992698431015,
-0.03244666010141373,
0.025618799030780792,
-0.05585382133722305,
-0.0715402215719223,
0.0005856006173416972,
-0.04443497583270073,
-0.04666672646999359,
0.037850119173526764,
-0.046325042843818665,
-0.020814955234527588,
0.07154949009418488,
0.03847416490316391,
-0.039687711745500565,
-0.03000015579164028,
0.034817662090063095
] | 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 Node.js. It is not available in Web browsers.\_ Creates a new `PerformanceResourceTiming` entry in the Resource Timeline. A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`. Performance resources are used to mark moments in the Resource Timeline. The created `PerformanceMark` entry is put in the global Resource Timeline and can be queried with `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearResourceTimings`. ### `performance.measure(name[, startMarkOrOptions[, endMark]])` \* `name` {string} \* `startMarkOrOptions` {string|Object} Optional. \* `detail` {any} Additional optional detail to include with the measure. \* `duration` {number} Duration between start and end times. \* `end` {number|string} Timestamp to be used as the end time, or a string identifying a previously recorded mark. \* `start` {number|string} Timestamp to be used as the start time, or a string identifying a previously recorded mark. \* `endMark` {string} Optional. Must be omitted if `startMarkOrOptions` is an {Object}. Creates a new `PerformanceMeasure` entry in the Performance Timeline. A `PerformanceMeasure` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'measure'`, and whose `performanceEntry.duration` measures the number of milliseconds elapsed since `startMark` and `endMark`. The `startMark` argument may identify any \_existing\_ `PerformanceMark` in the Performance Timeline, or \_may\_ identify any of the timestamp properties provided by the `PerformanceNodeTiming` class. If the named `startMark` does not exist, an error is thrown. The optional `endMark` argument must identify any \_existing\_ `PerformanceMark` in the Performance Timeline or any of the timestamp properties provided by the `PerformanceNodeTiming` class. `endMark` will be `performance.now()` if no parameter is passed, otherwise if the named `endMark` does not exist, an error will be thrown. The created `PerformanceMeasure` entry is put in the global Performance Timeline and can be queried with `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMeasures`. ### `performance.nodeTiming` \* Type: {PerformanceNodeTiming} \_This property is an extension by Node.js. It is not available in Web browsers.\_ An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. ### `performance.now()` \* Returns: {number} Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. ### `performance.setResourceTimingBufferSize(maxSize)` Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. By default the max buffer size is set to 250. ### `performance.timeOrigin` \* Type: {number} The [`timeOrigin`][] specifies the high resolution millisecond timestamp at which the current `node` process began, measured in Unix time. ### `performance.timerify(fn[, options])` \* `fn` {Function} \* `options` {Object} \* `histogram` {RecordableHistogram} A histogram object created using `perf\_hooks.createHistogram()` that will record runtime durations in nanoseconds. This is an alias of [`perf\_hooks.timerify()`][]. \_This property is an extension by Node.js. It is not available in Web browsers.\_ ### `performance.toJSON()` An object which is JSON representation of the `performance` object. It is similar to [`window.performance.toJSON`][] in browsers. #### Event: `'resourcetimingbufferfull'` The `'resourcetimingbufferfull'` event is fired when the global performance resource timing buffer is full. 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 directly. ### `performanceEntry.duration` \* Type: {number} The total | 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.07740665227174759,
0.0007838797173462808,
-0.022303937003016472,
0.0823681578040123,
-0.0395948588848114,
-0.028397126123309135,
-0.06928097456693649,
0.09183254837989807,
0.020172296091914177,
0.06382301449775696,
-0.005847751162946224,
-0.0005137040861882269,
-0.0074962470680475235,
-0.12022967636585236,
-0.0400591716170311,
0.06814923882484436,
0.004858477506786585,
0.026627926155924797,
-0.058001261204481125,
-0.10475543886423111,
0.03184322640299797,
-0.02693578228354454,
0.12144550681114197,
0.006545057520270348,
-0.12507429718971252,
0.03949343040585518,
0.012420371174812317,
0.08237770199775696,
0.07808162271976471,
-0.04362114146351814,
-0.02383606694638729,
0.0867152288556099,
-0.017843859270215034,
-0.0629832074046135,
-0.004708435386419296,
-0.12964843213558197,
-0.04886495694518089,
0.0010484205558896065,
0.004735616035759449,
-0.020178353413939476,
-0.0178420040756464,
0.030026208609342575,
0.09006056189537048,
0.013318353332579136,
0.016992803663015366,
-0.05262688919901848,
0.04220551252365112,
0.025097345933318138,
-0.10530145466327667,
0.014159600250422955,
-0.05723085254430771,
-0.014142148196697235,
-0.05413815379142761,
0.06241947412490845,
-0.016486387699842453,
0.058347560465335846,
-0.04866756126284599,
-0.044341519474983215,
0.020672833546996117,
-0.013587582856416702,
-0.02828402630984783,
0.031461216509342194,
0.0012166519882157445,
-0.017838789150118828,
-0.014044392853975296,
0.008266400545835495,
-0.09090642631053925,
0.011491628363728523,
-0.11261634528636932,
0.006216767244040966,
0.046772267669439316,
0.03094477392733097,
0.02280781976878643,
0.023720374330878258,
-0.007499668747186661,
0.051835495978593826,
-0.010468740016222,
-0.05531878024339676,
-0.010660266503691673,
-0.03068680502474308,
0.05002111569046974,
-0.07766561210155487,
0.04220934584736824,
0.05863874405622482,
-0.006649590563029051,
0.02018064074218273,
0.009494167752563953,
0.08121226727962494,
-0.007964848540723324,
0.029099904000759125,
0.04058206081390381,
-0.018606066703796387,
-0.024501938372850418,
-0.030153006315231323,
0.09032288938760757,
-0.05337854102253914,
0.04819205775856972,
-0.019153891131281853,
0.06471304595470428,
-0.04215703904628754,
-0.03760458901524544,
-0.038357872515916824,
0.020314574241638184,
-0.0179242305457592,
-0.005830776412039995,
0.051904793828725815,
0.1102902814745903,
0.17186839878559113,
0.01789058931171894,
0.006966559216380119,
-0.008979124017059803,
0.003219800302758813,
-0.04679103568196297,
0.05447026714682579,
4.391076412569933e-33,
0.010601744055747986,
-0.08569736778736115,
0.004099345300346613,
-0.002942631021142006,
-0.023409221321344376,
0.028353633359074593,
-0.019956860691308975,
0.009794764220714569,
0.00901113636791706,
-0.023922240361571312,
-0.03641776740550995,
-0.004012776538729668,
-0.056242749094963074,
0.029081689193844795,
-0.02401670813560486,
0.017406513914465904,
0.07218112051486969,
0.07719259709119797,
0.10971953719854355,
0.028252433985471725,
0.027379805222153664,
0.0180980134755373,
-0.06320309638977051,
0.01236188318580389,
0.06881629675626755,
0.03418712317943573,
0.03545252978801727,
0.06087125465273857,
-0.16379408538341522,
-0.025577398017048836,
0.06629233807325363,
-0.013544324785470963,
-0.035332463681697845,
0.023121798411011696,
0.07243970036506653,
0.003844832768663764,
0.04662232846021652,
0.025341039523482323,
-0.06558708101511002,
0.009435874409973621,
-0.0054892790503799915,
0.053843218833208084,
-0.05454632639884949,
-0.055726759135723114,
-0.0885484516620636,
-0.11107039451599121,
-0.027424180880188942,
-0.018164293840527534,
0.042547088116407394,
-0.01801115833222866,
-0.03799673542380333,
0.04227597638964653,
0.10923074930906296,
-0.06098717078566551,
-0.01820485107600689,
-0.04889357462525368,
0.0386136993765831,
-0.019492626190185547,
-0.01178132463246584,
0.01086884643882513,
0.02114826999604702,
-0.043698884546756744,
-0.01427572313696146,
-0.08324822783470154,
-0.0030144057236611843,
0.05045603588223457,
0.03540093079209328,
0.029428793117403984,
0.015516703017055988,
0.014573009684681892,
-0.008851361460983753,
0.039800822734832764,
0.07698241621255875,
-0.02767583169043064,
0.04155030474066734,
-0.0368233397603035,
-0.02979404479265213,
0.0457574836909771,
-0.09018344432115555,
-0.008245211094617844,
0.04498567804694176,
-0.012095054611563683,
-0.05897292122244835,
0.07123488932847977,
0.01766807585954666,
0.0386323407292366,
0.013839996419847012,
-0.0048355101607739925,
0.07782476395368576,
0.05782606452703476,
-0.023936109617352486,
-0.06584163010120392,
-0.026638977229595184,
-0.036260005086660385,
-0.10560300946235657,
-4.8144336417544566e-33,
0.02171456813812256,
-0.03293992578983307,
-0.0921085923910141,
0.005819505080580711,
-0.004534407053142786,
-0.07743502408266068,
0.009459497407078743,
0.018367433920502663,
-0.007555196061730385,
0.01292518898844719,
0.019447093829512596,
-0.06826657056808472,
0.009045889601111412,
-0.01714865304529667,
-0.00832818541675806,
0.11746428161859512,
-0.027251064777374268,
-0.08365599811077118,
0.02108835056424141,
-0.014365609735250473,
0.009570101276040077,
0.013464681804180145,
0.002321103122085333,
-0.015727652236819267,
-0.046574030071496964,
-0.01607942394912243,
-0.0156225161626935,
-0.04889228567481041,
-0.06612230837345123,
-0.11285509914159775,
0.0007942216470837593,
-0.018363628536462784,
-0.06995794177055359,
-0.005432774778455496,
-0.032773301005363464,
-0.05680011957883835,
-0.010130546055734158,
-0.010448453016579151,
0.01543383952230215,
0.0001349035883322358,
0.07324709743261337,
-0.0048263901844620705,
-0.05066795274615288,
0.05360179394483566,
0.04566440358757973,
-0.0324823223054409,
-0.04289015382528305,
-0.010195658542215824,
-0.0038162830751389265,
0.05847391486167908,
0.05511930212378502,
-0.04621269926428795,
-0.02730521187186241,
0.02594681829214096,
0.03069702535867691,
-0.027387168258428574,
-0.023468216881155968,
-0.036979466676712036,
0.04748984053730965,
0.007831081748008728,
0.043370477855205536,
-0.0686233714222908,
-0.11582867801189423,
0.04372458532452583,
0.02057703211903572,
0.02554589882493019,
-0.041942913085222244,
-0.09752781689167023,
0.06297557055950165,
0.006646642927080393,
-0.01784711889922619,
0.002342376159504056,
0.021141156554222107,
0.02664302848279476,
-0.00734243169426918,
0.015994127839803696,
0.01021848525851965,
-0.04767629876732826,
-0.02475486882030964,
0.1228700503706932,
-0.10296355187892914,
0.05909818410873413,
-0.006193029228597879,
0.0022857263684272766,
-0.005319592077285051,
-0.008895670995116234,
-0.043375272303819656,
0.10950092226266861,
-0.015139840543270111,
-0.04039059951901436,
0.042624086141586304,
-0.020893843844532967,
-0.1371886283159256,
-0.0020129189360886812,
-0.043390464037656784,
-5.451341067441717e-8,
-0.06007014214992523,
0.033895622938871384,
-0.061327140778303146,
0.07806222140789032,
-0.012730985879898071,
0.030514083802700043,
0.061568811535835266,
0.050164490938186646,
0.0478016622364521,
-0.0364391915500164,
0.07500869780778885,
-0.014472895301878452,
0.03648282214999199,
-0.04529133811593056,
0.0846492275595665,
-0.01752331666648388,
0.007943774573504925,
0.032801732420921326,
-0.0488584004342556,
-0.06999333202838898,
0.015099604614078999,
0.012127096764743328,
0.0189378559589386,
-0.03597639873623848,
0.09292013943195343,
0.008614064194262028,
0.022483713924884796,
0.09510914236307144,
-0.016988901421427727,
-0.003718926105648279,
-0.02978537790477276,
-0.005540116690099239,
0.0418047234416008,
-0.07671990245580673,
0.054214172065258026,
0.031732652336359024,
-0.009224334731698036,
0.04255522042512894,
0.0599215105175972,
0.10318485647439957,
0.054243303835392,
0.061753783375024796,
-0.02512378618121147,
0.1249312087893486,
0.04160585254430771,
-0.048109542578458786,
-0.041773103177547455,
0.06775085628032684,
0.07000381499528885,
-0.03518761694431305,
-0.009936683811247349,
-0.09519268572330475,
-0.07418468594551086,
0.0027877865359187126,
-0.07716406136751175,
-0.03293004631996155,
0.03558571636676788,
-0.07400690019130707,
0.025241682305932045,
0.042165905237197876,
0.10686511546373367,
-0.04122910648584366,
-0.01689610444009304,
-0.01508976612240076
] | 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 directly. ### `performanceEntry.duration` \* Type: {number} The total number of milliseconds elapsed for this entry. This value will not be meaningful for all Performance Entry types. ### `performanceEntry.entryType` \* Type: {string} The type of the performance entry. It may be one of: \* `'dns'` (Node.js only) \* `'function'` (Node.js only) \* `'gc'` (Node.js only) \* `'http2'` (Node.js only) \* `'http'` (Node.js only) \* `'mark'` (available on the Web) \* `'measure'` (available on the Web) \* `'net'` (Node.js only) \* `'node'` (Node.js only) \* `'resource'` (available on the Web) ### `performanceEntry.name` \* Type: {string} The name of the performance entry. ### `performanceEntry.startTime` \* Type: {number} The high resolution millisecond timestamp marking the starting time of the Performance Entry. ## Class: `PerformanceMark` \* Extends: {PerformanceEntry} Exposes marks created via the `Performance.mark()` method. ### `performanceMark.detail` \* Type: {any} Additional detail specified when creating with `Performance.mark()` method. ## Class: `PerformanceMeasure` \* Extends: {PerformanceEntry} Exposes measures created via the `Performance.measure()` method. The constructor of this class is not exposed to users directly. ### `performanceMeasure.detail` \* Type: {any} Additional detail specified when creating with `Performance.measure()` method. ## Class: `PerformanceNodeEntry` \* Extends: {PerformanceEntry} \_This class is an extension by Node.js. It is not available in Web browsers.\_ Provides detailed Node.js timing data. The constructor of this class is not exposed to users directly. ### `performanceNodeEntry.detail` \* Type: {any} Additional detail specific to the `entryType`. ### `performanceNodeEntry.flags` > Stability: 0 - Deprecated: Use `performanceNodeEntry.detail` instead. \* Type: {number} When `performanceEntry.entryType` is equal to `'gc'`, the `performance.flags` property contains additional information about garbage collection operation. The value may be one of: \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_NO` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_CONSTRUCT\_RETAINED` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_FORCED` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_SYNCHRONOUS\_PHANTOM\_PROCESSING` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_ALL\_AVAILABLE\_GARBAGE` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_ALL\_EXTERNAL\_MEMORY` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_SCHEDULE\_IDLE` ### `performanceNodeEntry.kind` > Stability: 0 - Deprecated: Use `performanceNodeEntry.detail` instead. \* Type: {number} When `performanceEntry.entryType` is equal to `'gc'`, the `performance.kind` property identifies the type of garbage collection operation that occurred. The value may be one of: \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_MAJOR` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_MINOR` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_INCREMENTAL` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_WEAKCB` ### Garbage Collection ('gc') Details When `performanceEntry.type` is equal to `'gc'`, the `performanceNodeEntry.detail` property will be an {Object} with two properties: \* `kind` {number} One of: \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_MAJOR` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_MINOR` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_INCREMENTAL` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_WEAKCB` \* `flags` {number} One of: \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_NO` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_CONSTRUCT\_RETAINED` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_FORCED` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_SYNCHRONOUS\_PHANTOM\_PROCESSING` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_ALL\_AVAILABLE\_GARBAGE` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_ALL\_EXTERNAL\_MEMORY` \* `perf\_hooks.constants.NODE\_PERFORMANCE\_GC\_FLAGS\_SCHEDULE\_IDLE` ### HTTP ('http') Details When `performanceEntry.type` is equal to `'http'`, the `performanceNodeEntry.detail` property will be an {Object} containing additional information. If `performanceEntry.name` is equal to `HttpClient`, the `detail` will contain the following properties: `req`, `res`. And the `req` property will be an {Object} containing `method`, `url`, `headers`, the `res` property will be an {Object} containing `statusCode`, `statusMessage`, `headers`. If `performanceEntry.name` is equal to `HttpRequest`, the `detail` will contain the following properties: `req`, `res`. And the `req` property will be an {Object} containing `method`, `url`, `headers`, the `res` property will be an {Object} containing `statusCode`, `statusMessage`, `headers`. This could add additional memory overhead and should only be used for diagnostic purposes, not left turned on in production by default. ### HTTP/2 ('http2') Details When `performanceEntry.type` is equal to `'http2'`, the `performanceNodeEntry.detail` property will be an {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 this `Http2Stream`. \* `id` {number} The identifier of | 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.06472302228212357,
-0.013336271047592163,
-0.05211736634373665,
0.06253885477781296,
0.01850440539419651,
-0.04355563223361969,
-0.07954739034175873,
0.08232183754444122,
-0.017918651923537254,
0.06779730319976807,
-0.030602609738707542,
-0.013015761971473694,
-0.0018862539436668158,
-0.07983791828155518,
-0.04865282401442528,
0.05516500771045685,
0.009337794966995716,
0.012779086828231812,
-0.05826751887798309,
-0.09077634662389755,
0.016515398398041725,
-0.004086973611265421,
0.09484049677848816,
-0.03496643900871277,
-0.041834719479084015,
0.020302629098296165,
-0.013942682184278965,
0.12439708411693573,
0.07112942636013031,
0.003268796019256115,
-0.026148471981287003,
-0.0016839004820212722,
-0.0159014742821455,
-0.06570176035165787,
-0.04534055292606354,
-0.09881182014942169,
-0.02714848704636097,
-0.004507779609411955,
0.0026318517047911882,
-0.002834579674527049,
-0.09280230849981308,
-0.013928879983723164,
0.026242246851325035,
-0.015143576078116894,
0.06335607171058655,
-0.029850708320736885,
0.05637411028146744,
-0.008016674779355526,
-0.052653826773166656,
0.0176711343228817,
-0.026531511917710304,
0.027137434110045433,
0.002002682304009795,
0.05963226035237312,
0.001665285206399858,
-0.011747057549655437,
0.05354216322302818,
0.021155716851353645,
0.1271781176328659,
-0.09931883215904236,
-0.006738484837114811,
0.0006053954712115228,
-0.030026672407984734,
-0.058647219091653824,
0.03287333622574806,
-0.025161949917674065,
-0.08215098083019257,
0.0662456750869751,
-0.09792473912239075,
-0.00838532391935587,
0.006950435694307089,
0.010453126393258572,
0.05852549150586128,
0.02443038858473301,
-0.024022886529564857,
0.020443370565772057,
-0.011511779390275478,
-0.06453534960746765,
0.013090014457702637,
-0.004389252979308367,
0.053854092955589294,
-0.047906119376420975,
0.05486103147268295,
0.014044009149074554,
0.032599348574876785,
-0.0015424973098561168,
0.009974033571779728,
0.05884341523051262,
0.022884003818035126,
0.044655609875917435,
0.07935122400522232,
0.011245246045291424,
-0.005537046119570732,
-0.030393879860639572,
0.1431548148393631,
-0.047125402837991714,
0.05420312657952309,
0.08034782856702805,
0.03979716822504997,
-0.024333743378520012,
0.006286026909947395,
-0.008005611598491669,
0.10783054679632187,
0.020628446713089943,
-0.0074396394193172455,
0.08072730898857117,
0.1516326367855072,
0.13276435434818268,
0.005884560290724039,
-0.06790151447057724,
-0.064415842294693,
0.05954067409038544,
-0.024011293426156044,
0.035226937383413315,
8.55493711396561e-33,
-0.033928513526916504,
-0.0730053186416626,
-0.02137429267168045,
-0.04603295400738716,
-0.014991099946200848,
0.03776702284812927,
-0.014893615618348122,
0.017561325803399086,
-0.06647279858589172,
-0.035775408148765564,
-0.04199525713920593,
-0.061174117028713226,
-0.0018959988374263048,
-0.01435003150254488,
0.0053664944134652615,
-0.029432829469442368,
0.09120264649391174,
0.04963081330060959,
0.1023639664053917,
0.03612348809838295,
0.06042289361357689,
-0.029056645929813385,
-0.05805385857820511,
0.019791223108768463,
0.007417637389153242,
-0.008116188459098339,
0.01618587225675583,
0.011703995056450367,
-0.06865183264017105,
-0.024469321593642235,
0.059257134795188904,
0.02370326593518257,
-0.056445468217134476,
0.01542567741125822,
0.0987352505326271,
-0.05349138751626015,
0.033693403005599976,
0.03729318454861641,
-0.008478621020913124,
-0.02057141251862049,
-0.057304080575704575,
0.03899562731385231,
-0.11515738070011139,
-0.02326538972556591,
-0.09841591119766235,
-0.06862630695104599,
-0.04944731667637825,
-0.04803400859236717,
-0.01313246600329876,
0.059188105165958405,
-0.017589932307600975,
0.06617363542318344,
0.07535062730312347,
-0.018894681707024574,
0.009260332211852074,
-0.04110652208328247,
0.0801992416381836,
0.02773614041507244,
-0.03599078208208084,
0.09362480044364929,
0.006716378964483738,
-0.03872311860322952,
-0.02496723085641861,
-0.028991565108299255,
0.013248130679130554,
-0.009286169894039631,
-0.015116077847778797,
0.03449385613203049,
-0.00514123123139143,
0.00008015625644475222,
0.0059535447508096695,
0.003947257064282894,
0.11101068556308746,
0.014126574620604515,
0.04031665623188019,
-0.07560152560472488,
-0.029472820460796356,
0.025818727910518646,
-0.09094172716140747,
-0.0237263310700655,
0.07772904634475708,
0.00025403444305993617,
0.0021740051452070475,
-0.018710244446992874,
0.018153835088014603,
-0.04506457597017288,
-0.04460492357611656,
-0.006863639689981937,
0.01860138215124607,
0.06334269046783447,
0.01929537020623684,
0.018624957650899887,
0.011453378014266491,
-0.05181262642145157,
-0.1081927940249443,
-8.132011144271044e-33,
0.02129773423075676,
-0.016636323183774948,
-0.030191857367753983,
0.08596158772706985,
0.06517026573419571,
-0.062417350709438324,
-0.021149037405848503,
0.09345033764839172,
-0.01975410431623459,
-0.029955124482512474,
0.06373390555381775,
-0.001440300839021802,
-0.01154100801795721,
-0.03740658611059189,
-0.08032364398241043,
0.10159678012132645,
-0.009032785892486572,
-0.04837249591946602,
0.063503198325634,
0.0003258712822571397,
0.007545883301645517,
-0.02342035062611103,
0.053516194224357605,
-0.015857378020882607,
-0.029679907485842705,
-0.019000060856342316,
0.007762708235532045,
-0.00836886279284954,
-0.07165704667568207,
-0.09972789138555527,
-0.06476124376058578,
0.033399470150470734,
-0.0664418488740921,
-0.04558173567056656,
0.03267481178045273,
-0.04937274381518364,
0.02255125716328621,
0.03216354548931122,
0.001010510022751987,
0.010622917674481869,
0.08804547041654587,
-0.014819614589214325,
-0.028056662529706955,
-0.036584869027137756,
0.025790780782699585,
0.023392125964164734,
-0.09271574020385742,
-0.02036946266889572,
-0.03698926046490669,
0.07348852604627609,
0.019569432362914085,
-0.03202245384454727,
0.028857577592134476,
0.053327374160289764,
0.05558197945356369,
-0.03717999905347824,
0.018917497247457504,
-0.047447409480810165,
0.06334086507558823,
0.05549134686589241,
0.04185260087251663,
-0.08338156342506409,
-0.0892307236790657,
-0.005177801009267569,
0.10009882599115372,
-0.015376938506960869,
-0.03983129560947418,
0.009216581471264362,
0.04371693357825279,
0.023158440366387367,
-0.02510225586593151,
-0.0038769450038671494,
-0.028810804709792137,
0.04698216915130615,
-0.08043129742145538,
-0.03242851793766022,
0.05125479772686958,
-0.06885489076375961,
-0.014433622360229492,
0.12412222474813461,
-0.05881248787045479,
0.1349567472934723,
-0.03954387083649635,
-0.03581102564930916,
-0.013774283230304718,
0.08722323924303055,
-0.0548817478120327,
0.0802871584892273,
-0.0446542426943779,
0.024125656113028526,
0.009067000821232796,
0.020219916477799416,
-0.10384730249643326,
-0.009874236769974232,
-0.06696832180023193,
-6.056672674503716e-8,
-0.029707977548241615,
-0.0015116115100681782,
-0.05840585008263588,
0.019868183881044388,
0.01837174966931343,
-0.03356355428695679,
0.0078001562505960464,
0.08048225194215775,
0.07245396077632904,
0.009238939732313156,
0.09629922360181808,
0.01842069998383522,
0.07186122238636017,
-0.04631740227341652,
0.044640447944402695,
-0.043583523482084274,
-0.01152191124856472,
0.011137782596051693,
-0.05176105350255966,
-0.07139137387275696,
0.055856358259916306,
0.006658982019871473,
-0.01868734508752823,
-0.0348968580365181,
-0.017688920721411705,
-0.06767469644546509,
0.05416331812739372,
0.05974156782031059,
-0.020143212750554085,
-0.06909731030464172,
-0.13998816907405853,
0.001982875633984804,
0.001606525038369,
-0.07620835304260254,
-0.008200068026781082,
-0.01231892965734005,
-0.08534468710422516,
-0.01868114434182644,
0.0578547939658165,
0.10961464792490005,
0.02311292476952076,
0.011718862690031528,
-0.02874390035867691,
0.07321593165397644,
0.04626419022679329,
-0.02292030304670334,
-0.033189453184604645,
0.10458028316497803,
0.05407913774251938,
0.016431232914328575,
-0.0009555005235597491,
-0.013110536150634289,
-0.028569413349032402,
-0.04327503591775894,
-0.013589872047305107,
-0.031508587300777435,
0.028538843616843224,
-0.03920159861445427,
0.0012877314584329724,
0.04375011846423149,
0.05757155269384384,
-0.053090278059244156,
-0.022358059883117676,
0.009422854520380497
] | 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 this `Http2Stream`. \* `id` {number} The identifier of the associated `Http2Stream` \* `timeToFirstByte` {number} The number of milliseconds elapsed between the `PerformanceEntry` `startTime` and the reception of the first `DATA` frame. \* `timeToFirstByteSent` {number} The number of milliseconds elapsed between the `PerformanceEntry` `startTime` and sending of the first `DATA` frame. \* `timeToFirstHeader` {number} The number of milliseconds elapsed between the `PerformanceEntry` `startTime` and the reception of the first header. If `performanceEntry.name` is equal to `Http2Session`, the `detail` will contain the following properties: \* `bytesRead` {number} The number of bytes received for this `Http2Session`. \* `bytesWritten` {number} The number of bytes sent for this `Http2Session`. \* `framesReceived` {number} The number of HTTP/2 frames received by the `Http2Session`. \* `framesSent` {number} The number of HTTP/2 frames sent by the `Http2Session`. \* `maxConcurrentStreams` {number} The maximum number of streams concurrently open during the lifetime of the `Http2Session`. \* `pingRTT` {number} The number of milliseconds elapsed since the transmission of a `PING` frame and the reception of its acknowledgment. Only present if a `PING` frame has been sent on the `Http2Session`. \* `streamAverageDuration` {number} The average duration (in milliseconds) for all `Http2Stream` instances. \* `streamCount` {number} The number of `Http2Stream` instances processed by the `Http2Session`. \* `type` {string} Either `'server'` or `'client'` to identify the type of `Http2Session`. ### Timerify ('function') Details When `performanceEntry.type` is equal to `'function'`, the `performanceNodeEntry.detail` property will be an {Array} listing the input arguments to the timed function. ### Net ('net') Details When `performanceEntry.type` is equal to `'net'`, the `performanceNodeEntry.detail` property will be an {Object} containing additional information. If `performanceEntry.name` is equal to `connect`, the `detail` will contain the following properties: `host`, `port`. ### DNS ('dns') Details When `performanceEntry.type` is equal to `'dns'`, the `performanceNodeEntry.detail` property will be an {Object} containing additional information. If `performanceEntry.name` is equal to `lookup`, the `detail` will contain the following properties: `hostname`, `family`, `hints`, `verbatim`, `addresses`. If `performanceEntry.name` is equal to `lookupService`, the `detail` will contain the following properties: `host`, `port`, `hostname`, `service`. If `performanceEntry.name` is equal to `queryxxx` or `getHostByAddr`, the `detail` will contain the following properties: `host`, `ttl`, `result`. The value of `result` is same as the result of `queryxxx` or `getHostByAddr`. ## Class: `PerformanceNodeTiming` \* Extends: {PerformanceEntry} \_This property is an extension by Node.js. It is not available in Web browsers.\_ Provides timing details for Node.js itself. The constructor of this class is not exposed to users. ### `performanceNodeTiming.bootstrapComplete` \* Type: {number} The high resolution millisecond timestamp at which the Node.js process completed bootstrapping. If bootstrapping has not yet finished, the property has the value of -1. ### `performanceNodeTiming.environment` \* Type: {number} The high resolution millisecond timestamp at which the Node.js environment was initialized. ### `performanceNodeTiming.idleTime` \* Type: {number} The high resolution millisecond timestamp of the amount of time the event loop has been idle within the event loop's event provider (e.g. `epoll\_wait`). This does not take CPU usage into consideration. If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of 0. ### `performanceNodeTiming.loopExit` \* Type: {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 | 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.054392602294683456,
0.012120584957301617,
-0.09315566718578339,
0.07006484270095825,
-0.05793093889951706,
-0.06914108246564865,
-0.045351725071668625,
0.1018281951546669,
-0.002321542240679264,
-0.00002325636705791112,
-0.042007215321063995,
0.008914181031286716,
0.07579436898231506,
-0.06413672864437103,
0.04713212698698044,
0.03574371710419655,
-0.03131620213389397,
0.03688686713576317,
-0.05345599725842476,
-0.07206602394580841,
0.025323854759335518,
-0.03528900071978569,
0.03186263516545296,
0.07371265441179276,
-0.05971395596861839,
-0.02217133156955242,
-0.020588839426636696,
0.07326483726501465,
-0.011973533779382706,
-0.04222600907087326,
0.023823797702789307,
-0.03867074474692345,
0.090318463742733,
-0.037571981549263,
0.029677128419280052,
-0.14109502732753754,
-0.05737488716840744,
-0.09312376379966736,
0.030069880187511444,
-0.025198571383953094,
0.037509605288505554,
0.0355105996131897,
0.04682578891515732,
-0.045751046389341354,
0.0542675219476223,
-0.07981866598129272,
0.027604559436440468,
-0.06284911930561066,
-0.05802608281373978,
-0.01841285265982151,
0.03109736740589142,
0.0350981242954731,
-0.11108237504959106,
0.029759008437395096,
-0.03122946247458458,
0.06531213968992233,
-0.06678511947393417,
-0.07714879512786865,
0.08247993886470795,
-0.06757090985774994,
-0.006487519480288029,
-0.034017182886600494,
-0.057689495384693146,
-0.02515724115073681,
0.10086694359779358,
-0.01734064891934395,
-0.10427237302064896,
-0.0027462132275104523,
-0.05762745812535286,
-0.051286421716213226,
-0.02487298846244812,
0.0004468647239264101,
0.032416608184576035,
0.06446775048971176,
0.0773170217871666,
-0.06800297647714615,
0.03456396237015724,
-0.045810896903276443,
0.05691378191113472,
0.05804011970758438,
0.05392308160662651,
0.031022606417536736,
0.10792452841997147,
0.003027602331712842,
0.027027973905205727,
0.0530393086373806,
0.02342088147997856,
0.013298030942678452,
0.00011341480421833694,
0.012515340000391006,
0.029171500355005264,
0.028743432834744453,
-0.10222563147544861,
-0.038408536463975906,
0.11481829732656479,
0.05552638694643974,
-0.019660554826259613,
0.07038232684135437,
0.014903689734637737,
0.008068402297794819,
-0.006632179953157902,
0.0155152203515172,
0.049223292618989944,
-0.027436217293143272,
0.03479484096169472,
0.06224038079380989,
0.010304508730769157,
0.05035332590341568,
-0.044573165476322174,
0.03374931588768959,
-0.09442996233701706,
-0.016098903492093086,
-0.01478801853954792,
0.053281523287296295,
4.028349345290899e-33,
-0.03265320137143135,
-0.0994889885187149,
-0.05136578530073166,
0.014130698516964912,
-0.05182351544499397,
0.018873246386647224,
-0.03181469067931175,
0.060963645577430725,
0.03625538572669029,
0.00562853692099452,
-0.08897116035223007,
-0.05076703429222107,
-0.005269699729979038,
0.051718778908252716,
0.017987411469221115,
-0.012527598068118095,
0.025517567992210388,
0.03444335609674454,
0.04538831487298012,
0.03283946216106415,
0.06112705171108246,
0.00037712298217229545,
-0.05168658867478371,
-0.0046661668457090855,
0.029020918533205986,
-0.010298962704837322,
0.0035533099435269833,
-0.01465626247227192,
-0.10718178749084473,
0.010445580817759037,
0.0696917176246643,
-0.051005735993385315,
-0.10712406039237976,
0.00032006637775339186,
0.11795217543840408,
-0.05275040119886398,
0.04840533435344696,
-0.00011837687634397298,
-0.02087099850177765,
0.002614301396533847,
-0.035232312977313995,
0.013448441401124,
-0.04841214418411255,
-0.0038641607388854027,
-0.11358568072319031,
-0.13789179921150208,
-0.09118752926588058,
-0.011423162184655666,
0.011579410172998905,
0.02028828300535679,
0.0001607631566002965,
0.05095453932881355,
0.14543946087360382,
0.03217754140496254,
0.0326872356235981,
0.01430425327271223,
0.054269939661026,
0.046795643866062164,
-0.033276963979005814,
0.06378345936536789,
-0.05354594439268112,
0.003305592807009816,
-0.009609526954591274,
-0.07020475715398788,
0.05033973604440689,
0.005867479834705591,
0.0741732195019722,
0.0072968462482094765,
0.06433944404125214,
0.0003685485862661153,
-0.004257823806256056,
0.0011276114964857697,
0.08929450809955597,
0.005708846729248762,
0.07418633997440338,
0.02007729932665825,
0.040274716913700104,
-0.005829933565109968,
-0.05904132127761841,
-0.018783943727612495,
0.036790359765291214,
0.07868612557649612,
0.06324442476034164,
-0.01877628080546856,
-0.028086133301258087,
0.021927401423454285,
0.024180101230740547,
0.0008968275506049395,
-0.05928972736001015,
0.03212958946824074,
0.021594984456896782,
0.019157493487000465,
-0.018815098330378532,
-0.013243746012449265,
-0.028952129185199738,
-4.650679564503235e-33,
0.03887287154793739,
0.009904470294713974,
-0.0095094358548522,
0.03302137926220894,
0.029132461175322533,
-0.04456477239727974,
0.025772636756300926,
-0.006416912656277418,
-0.019653737545013428,
-0.010332009755074978,
0.060854461044073105,
-0.05647668242454529,
-0.030341094359755516,
-0.036559466272592545,
-0.02344343811273575,
-0.007234635762870312,
-0.006402858067303896,
-0.09826187789440155,
0.006017436273396015,
-0.017862068489193916,
0.013805526308715343,
-0.02388570085167885,
0.0036075336392968893,
-0.06175930052995682,
8.094809231806721e-7,
-0.012860793620347977,
0.031009400263428688,
-0.007982879877090454,
-0.08411390334367752,
-0.08347316831350327,
0.05773421376943588,
-0.03469885140657425,
-0.048400651663541794,
-0.0007409209501929581,
-0.025717120617628098,
-0.06642839312553406,
0.08124475926160812,
0.0106634721159935,
0.0025207342114299536,
0.05178435891866684,
0.06615596264600754,
0.08849195390939713,
-0.0033264346420764923,
-0.01987420581281185,
0.04080386832356453,
-0.03805167227983475,
-0.08219616860151291,
0.03155068680644035,
-0.02439999207854271,
-0.01211054902523756,
0.03222886845469475,
0.04343237355351448,
0.030998805537819862,
0.06526868045330048,
0.044667910784482956,
-0.01504866499453783,
0.04937147721648216,
-0.028011348098516464,
-0.0018090084195137024,
0.05029425770044327,
0.056107521057128906,
-0.03517407178878784,
-0.02405485510826111,
0.07006234675645828,
0.02787085622549057,
0.011970187537372112,
-0.05431392416357994,
-0.07590006291866302,
-0.022907476872205734,
0.02461712621152401,
0.002813091268762946,
-0.07043714821338654,
-0.040924087166786194,
-0.0023971430491656065,
-0.012468796223402023,
-0.02228689379990101,
0.04592052474617958,
0.01136818714439869,
-0.017046114429831505,
0.07853250950574875,
-0.021252380684018135,
0.10001944750547409,
-0.06593886762857437,
-0.0532693937420845,
-0.01411338523030281,
-0.011858542449772358,
0.04797442629933357,
-0.018812401220202446,
-0.05477968230843544,
-0.06560022383928299,
-0.0012890531215816736,
0.1008358970284462,
-0.1426677107810974,
0.00909248273819685,
0.009783423505723476,
-4.694407707006576e-8,
-0.06586117297410965,
-0.08972162753343582,
-0.03488176688551903,
0.043582797050476074,
-0.008230301551520824,
0.060114189982414246,
-0.06246704235672951,
0.0010994502808898687,
0.05263078212738037,
-0.1077076643705368,
0.096649669110775,
-0.022517558187246323,
-0.0006642773514613509,
-0.06196929141879082,
0.07219038158655167,
-0.03272290155291557,
0.025302741676568985,
-0.09032700210809708,
-0.02569529600441456,
-0.03603748977184296,
0.07846216857433319,
-0.04529955983161926,
-0.027225393801927567,
-0.021270733326673508,
0.006404845975339413,
0.003842640668153763,
0.11934928596019745,
0.07498515397310257,
-0.03874773532152176,
-0.026085512712597847,
-0.058172594755887985,
0.05654073506593704,
0.044172924011945724,
-0.02782793901860714,
0.02804405614733696,
0.025022383779287338,
-0.07282022386789322,
0.03601926937699318,
-0.008878937922418118,
0.05092623829841614,
0.12099583446979523,
-0.0011070738546550274,
-0.03739124909043312,
0.07727039605379105,
0.12454646080732346,
-0.02522910013794899,
0.003988251555711031,
0.045993439853191376,
-0.026702040806412697,
-0.06462327390909195,
0.02042234316468239,
0.010943598113954067,
0.0028451394755393267,
0.0027083305176347494,
-0.09200318157672882,
-0.0018956584390252829,
0.00808191392570734,
-0.043568409979343414,
-0.012807470746338367,
0.04889022186398506,
0.0560898594558239,
0.0695701315999031,
0.013521277345716953,
0.004409768618643284
] | 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 millisecond timestamp at which the Node.js event loop started. If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1. ### `performanceNodeTiming.nodeStart` \* Type: {number} The high resolution millisecond timestamp at which the Node.js process was initialized. ### `performanceNodeTiming.uvMetricsInfo` \* Returns: {Object} \* `loopCount` {number} Number of event loop iterations. \* `events` {number} Number of events that have been processed by the event handler. \* `eventsWaiting` {number} Number of events that were waiting to be processed when the event provider was called. This is a wrapper to the `uv\_metrics\_info` function. It returns the current set of event loop metrics. It is recommended to use this property inside a function whose execution was scheduled using `setImmediate` to avoid collecting metrics before finishing all operations scheduled during the current loop iteration. ```cjs const { performance } = require('node:perf\_hooks'); setImmediate(() => { console.log(performance.nodeTiming.uvMetricsInfo); }); ``` ```mjs import { performance } from 'node:perf\_hooks'; setImmediate(() => { console.log(performance.nodeTiming.uvMetricsInfo); }); ``` ### `performanceNodeTiming.v8Start` \* Type: {number} The high resolution millisecond timestamp at which the V8 platform was initialized. ## Class: `PerformanceResourceTiming` \* Extends: {PerformanceEntry} Provides detailed network timing data regarding the loading of an application's resources. The constructor of this class is not exposed to users directly. ### `performanceResourceTiming.workerStart` \* Type: {number} The high resolution millisecond timestamp at immediately before dispatching the `fetch` request. If the resource is not intercepted by a worker the property will always return 0. ### `performanceResourceTiming.redirectStart` \* Type: {number} The high resolution millisecond timestamp that represents the start time of the fetch which initiates the redirect. ### `performanceResourceTiming.redirectEnd` \* Type: {number} The high resolution millisecond timestamp that will be created immediately after receiving the last byte of the response of the last redirect. ### `performanceResourceTiming.fetchStart` \* Type: {number} The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. ### `performanceResourceTiming.domainLookupStart` \* Type: {number} The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup for the resource. ### `performanceResourceTiming.domainLookupEnd` \* Type: {number} The high resolution millisecond timestamp representing the time immediately after the Node.js finished the domain name lookup for the resource. ### `performanceResourceTiming.connectStart` \* Type: {number} The high resolution millisecond timestamp representing the time immediately before Node.js starts to establish the connection to the server to retrieve the resource. ### `performanceResourceTiming.connectEnd` \* Type: {number} The high resolution millisecond timestamp representing the time immediately after Node.js finishes establishing the connection to the server to retrieve the resource. ### `performanceResourceTiming.secureConnectionStart` \* Type: {number} The high resolution millisecond timestamp representing the time immediately before Node.js starts the handshake process to secure the current connection. ### `performanceResourceTiming.requestStart` \* Type: {number} The high resolution millisecond timestamp representing the time immediately before Node.js receives the first byte of the response from the server. ### `performanceResourceTiming.responseEnd` \* Type: {number} The high resolution millisecond timestamp representing the time immediately after Node.js receives the last byte of the resource or immediately before the transport connection is closed, 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 the size (in octets) received from the fetch (HTTP or cache), | 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.07782778143882751,
-0.004590492695569992,
-0.014232443645596504,
-0.033054664731025696,
-0.04125157743692398,
-0.023402588441967964,
-0.06792064011096954,
0.0187312513589859,
-0.030554194003343582,
-0.011181220412254333,
-0.0434967540204525,
0.005485898349434137,
0.05729931965470314,
-0.09347327798604965,
-0.022216269746422768,
0.08671029657125473,
0.039067111909389496,
0.004624413792043924,
-0.04759862646460533,
-0.03589626029133797,
0.0395488403737545,
0.05198110267519951,
0.09278450161218643,
0.03153866156935692,
-0.07884616404771805,
-0.04004673287272453,
0.07490205764770508,
0.12123061716556549,
0.02523493953049183,
-0.017604200169444084,
-0.05415720120072365,
0.06200028210878372,
0.019052589312195778,
-0.11759091168642044,
-0.015578603371977806,
-0.12341464310884476,
0.02395787462592125,
0.009967152029275894,
0.033399101346731186,
-0.014340062625706196,
-0.06554698199033737,
0.07999369502067566,
0.06685268878936768,
0.04827897995710373,
0.02258269488811493,
0.03245791420340538,
0.03498394787311554,
0.025916507467627525,
-0.0823569968342781,
-0.02455090545117855,
-0.054371681064367294,
0.12362261116504669,
-0.0010302338050678372,
0.03740175813436508,
-0.0844617709517479,
0.0306738018989563,
0.05821002647280693,
0.016321364790201187,
0.05737542361021042,
-0.024878641590476036,
0.019614050164818764,
-0.04756287857890129,
-0.012883550487458706,
-0.020497454330325127,
0.01944584958255291,
-0.0033427742309868336,
-0.04841987043619156,
-0.033904217183589935,
-0.08080792427062988,
-0.020381370559334755,
0.026451531797647476,
0.028602922335267067,
0.0662940964102745,
0.010849464684724808,
0.05561455711722374,
0.06183302775025368,
0.06146962195634842,
-0.1502274125814438,
0.004247169476002455,
-0.08804003149271011,
0.06260712444782257,
-0.0005897104274481535,
0.09858553856611252,
0.025278644636273384,
0.03359922394156456,
-0.01902175135910511,
-0.007960427552461624,
0.0032605824526399374,
-0.03629736602306366,
-0.02938590757548809,
0.005733170546591282,
0.03791891783475876,
-0.04261506348848343,
-0.01251395232975483,
-0.010516677051782608,
-0.050942327827215195,
0.05038302391767502,
0.05147726833820343,
0.053394027054309845,
0.024161584675312042,
-0.04062654450535774,
0.038588061928749084,
0.00954464077949524,
0.04666702821850777,
0.008946673944592476,
0.06921124458312988,
0.05776424705982208,
0.11780640482902527,
0.04117602854967117,
-0.00022592986351810396,
-0.06703352183103561,
-0.017889998853206635,
0.007858052849769592,
0.054129306226968765,
4.9887947188119265e-33,
-0.035944614559412,
-0.08124831318855286,
0.013675594702363014,
0.01813443936407566,
0.04519977793097496,
0.06456217914819717,
-0.015603211708366871,
-0.013400226831436157,
-0.03436128422617912,
0.03905127942562103,
-0.05516611039638519,
0.022181009873747826,
-0.052935462445020676,
-0.060959186404943466,
0.040975503623485565,
-0.03865945339202881,
0.13322153687477112,
-0.0135993342846632,
-0.05858243256807327,
-0.02539970725774765,
0.06667519360780716,
-0.051362331956624985,
-0.03740045800805092,
0.06303846091032028,
0.008472650311887264,
0.06578335165977478,
-0.004947286564856768,
0.05551944300532341,
-0.08267615735530853,
0.008540642447769642,
0.03518158942461014,
0.021396687254309654,
-0.022746378555893898,
0.01841726340353489,
0.052407827228307724,
-0.054587338119745255,
0.020344018936157227,
0.007440668996423483,
-0.01702592894434929,
0.022722750902175903,
-0.08234670758247375,
0.0301788542419672,
-0.08868946880102158,
-0.037413738667964935,
-0.0982271283864975,
-0.10500796884298325,
0.01931903511285782,
-0.03606279194355011,
0.0008624207112006843,
0.0063385856337845325,
-0.03983485698699951,
0.03941084444522858,
0.05041836202144623,
-0.09666592627763748,
0.04669345170259476,
0.00856152456253767,
0.10995688289403915,
0.009980215691030025,
-0.08088143169879913,
0.05870743468403816,
0.024864761158823967,
-0.03075246885418892,
-0.014986049383878708,
-0.03985075652599335,
-0.016877980902791023,
0.016082031652331352,
0.006339370738714933,
-0.026022575795650482,
-0.012937018647789955,
-0.014108913950622082,
0.0025832117535173893,
0.07101798802614212,
0.03176966682076454,
-0.07508779317140579,
0.04847784340381622,
-0.0208045095205307,
0.006791896652430296,
0.029286900535225868,
-0.06525614112615585,
0.024567347019910812,
0.01974307931959629,
0.009058651514351368,
-0.010529580526053905,
-0.0037098031025379896,
0.03347788006067276,
0.04399805888533592,
-0.05293978378176689,
0.0016768052009865642,
-0.04065747186541557,
0.0044649639166891575,
0.0603301115334034,
-0.036051440984010696,
-0.0014265731442719698,
-0.07512269914150238,
-0.12988939881324768,
-6.470333799316597e-33,
-0.019558154046535492,
-0.00877548847347498,
-0.05220073089003563,
0.05257781594991684,
-0.015743020921945572,
-0.06683661788702011,
-0.009312504902482033,
-0.011767986230552197,
-0.037974655628204346,
-0.04169546440243721,
0.07071947306394577,
-0.03197607770562172,
-0.07968878000974655,
0.011036784388124943,
-0.007931581698358059,
0.045834433287382126,
-0.013359231874346733,
-0.0644979327917099,
0.08309214562177658,
-0.026887349784374237,
0.055319249629974365,
0.01628817617893219,
-0.012877718545496464,
0.014601049944758415,
-0.0686994418501854,
-0.04694732651114464,
0.008888877928256989,
-0.045790113508701324,
-0.003827644046396017,
-0.12236686050891876,
-0.03651086986064911,
-0.011964589357376099,
0.0389019176363945,
0.1249220222234726,
0.001276915310882032,
-0.05016133561730385,
0.0420592725276947,
-0.04704948514699936,
-0.005268664564937353,
-0.009031801484525204,
0.08023300021886826,
-0.02415727637708187,
-0.02754335105419159,
-0.020654475316405296,
0.009375089779496193,
0.04995255544781685,
-0.014804360456764698,
0.04707857966423035,
-0.014295347966253757,
-0.040753163397312164,
-0.006592096295207739,
-0.058292753994464874,
0.0048806993290781975,
0.13815748691558838,
-0.05912040174007416,
-0.02137867920100689,
-0.05016123875975609,
0.0036271149292588234,
0.047686971724033356,
0.0797724798321724,
0.02911405824124813,
-0.05802733451128006,
-0.005761310458183289,
0.06924130767583847,
0.01911199651658535,
0.056071046739816666,
-0.08245377242565155,
-0.0868288055062294,
0.0001251372304977849,
-0.03551248088479042,
0.03915078192949295,
-0.011025949381291866,
-0.07000426203012466,
-0.0342087559401989,
-0.12855075299739838,
-0.006337509956210852,
-0.04788421466946602,
-0.02829940803349018,
0.028943102806806564,
-0.007175663951784372,
-0.07485507428646088,
0.12285971641540527,
-0.07224158197641373,
0.02311256341636181,
0.01266541238874197,
0.05643456429243088,
0.008692841976881027,
0.04887273907661438,
-0.008371444419026375,
-0.002807836513966322,
-0.029604611918330193,
0.05442109331488609,
-0.12307684868574142,
0.02851438894867897,
-0.040703631937503815,
-5.402811709132038e-8,
-0.1396331787109375,
0.010621566325426102,
-0.09650497138500214,
-0.017253583297133446,
0.04412093386054039,
0.04417933523654938,
0.017157956957817078,
0.06242925673723221,
0.09059315919876099,
-0.011633401736617088,
0.06648121029138565,
-0.013753033243119717,
0.04146844893693924,
0.005869027227163315,
0.06598281115293503,
-0.03788311034440994,
0.029958872124552727,
-0.004553449805825949,
0.026238052174448967,
0.012536044232547283,
0.018146922811865807,
-0.026344332844018936,
0.03982984647154808,
-0.03811096400022507,
-0.04210875555872917,
-0.0447099469602108,
0.0233673844486475,
0.14114297926425934,
0.027626531198620796,
-0.04356908053159714,
-0.06744962930679321,
0.007162273395806551,
0.04259686544537544,
0.025671668350696564,
-0.041363008320331573,
0.03814929351210594,
-0.05178758502006531,
0.045065078884363174,
0.11048446595668793,
0.034995559602975845,
0.04504496604204178,
0.049670856446027756,
-0.07390229403972626,
0.08727240562438965,
-0.041259195655584335,
0.021655842661857605,
-0.022253992035984993,
-0.017160313203930855,
0.02234232798218727,
0.006594743113964796,
0.002387755084782839,
-0.03209707885980606,
-0.018003031611442566,
-0.010182219557464123,
-0.07947131246328354,
-0.028499271720647812,
0.019710848107933998,
-0.07739381492137909,
-0.025065170601010323,
0.10873794555664062,
0.010491322726011276,
-0.05997578054666519,
-0.04268620163202286,
-0.005417094565927982
] | 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 the size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings. ### `performanceResourceTiming.decodedBodySize` \* Type: {number} A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after removing any applied content-codings. ### `performanceResourceTiming.toJSON()` Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object ## Class: `PerformanceObserver` ### `PerformanceObserver.supportedEntryTypes` \* Type: {string\[]} Get supported types. ### `new PerformanceObserver(callback)` \* `callback` {Function} \* `list` {PerformanceObserverEntryList} \* `observer` {PerformanceObserver} `PerformanceObserver` objects provide notifications when new `PerformanceEntry` instances have been added to the Performance Timeline. ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((list, observer) => { console.log(list.getEntries()); performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['mark'], buffered: true }); performance.mark('test'); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((list, observer) => { console.log(list.getEntries()); performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['mark'], buffered: true }); performance.mark('test'); ``` Because `PerformanceObserver` instances introduce their own additional performance overhead, instances should not be left subscribed to notifications indefinitely. Users should disconnect observers as soon as they are no longer needed. The `callback` is invoked when a `PerformanceObserver` is notified about new `PerformanceEntry` instances. The callback receives a `PerformanceObserverEntryList` instance and a reference to the `PerformanceObserver`. ### `performanceObserver.disconnect()` Disconnects the `PerformanceObserver` instance from all notifications. ### `performanceObserver.observe(options)` \* `options` {Object} \* `type` {string} A single {PerformanceEntry} type. Must not be given if `entryTypes` is already specified. \* `entryTypes` {string\[]} An array of strings identifying the types of {PerformanceEntry} instances the observer is interested in. If not provided an error will be thrown. \* `buffered` {boolean} If true, the observer callback is called with a list global `PerformanceEntry` buffered entries. If false, only `PerformanceEntry`s created after the time point are sent to the observer callback. \*\*Default:\*\* `false`. Subscribes the {PerformanceObserver} instance to notifications of new {PerformanceEntry} instances identified either by `options.entryTypes` or `options.type`: ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((list, observer) => { // Called once asynchronously. `list` contains three items. }); obs.observe({ type: 'mark' }); for (let n = 0; n < 3; n++) performance.mark(`test${n}`); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((list, observer) => { // Called once asynchronously. `list` contains three items. }); obs.observe({ type: 'mark' }); for (let n = 0; n < 3; n++) performance.mark(`test${n}`); ``` ### `performanceObserver.takeRecords()` \* Returns: {PerformanceEntry\[]} Current list of entries stored in the performance observer, emptying it out. ## Class: `PerformanceObserverEntryList` The `PerformanceObserverEntryList` class is used to provide access to the `PerformanceEntry` instances passed to a `PerformanceObserver`. The constructor of this class is not exposed to users. ### `performanceObserverEntryList.getEntries()` \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntries()); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 81.465639, \* duration: 0, \* detail: null \* }, \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 81.860064, \* duration: 0, \* detail: null \* } \* ] \*/ performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ type: 'mark' }); performance.mark('test'); performance.mark('meow'); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntries()); /\*\* \* [ \* PerformanceEntry { \* | 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.015766773372888565,
0.010313617065548897,
-0.026057465001940727,
0.11542044579982758,
0.01956545002758503,
-0.08682585507631302,
-0.030389267951250076,
0.1210266500711441,
0.006364090368151665,
0.04127398133277893,
-0.023937402293086052,
0.0440559908747673,
0.014143673703074455,
-0.07712259888648987,
-0.005076947622001171,
0.04562080651521683,
-0.017197800800204277,
0.0023814626038074493,
-0.038299210369586945,
-0.03464343398809433,
0.06301779299974442,
0.0038597232196480036,
0.1104055717587471,
0.054610468447208405,
-0.08555823564529419,
0.026876967400312424,
0.003539352910593152,
0.05693933367729187,
0.05063663795590401,
-0.05156094208359718,
-0.033622387796640396,
0.02707277424633503,
0.013429488055408001,
-0.09138524532318115,
-0.00803731195628643,
-0.1245274692773819,
-0.07305960357189178,
0.041351549327373505,
0.024113362655043602,
-0.03246418386697769,
0.10715853422880173,
-0.011555771343410015,
-0.02565181255340576,
-0.06261753290891647,
0.06954047828912735,
-0.06692412495613098,
0.05101437121629715,
-0.018933050334453583,
-0.0526956208050251,
0.031942859292030334,
0.013518265448510647,
0.01173886377364397,
-0.0776694044470787,
0.05016818270087242,
-0.04150959476828575,
-0.01898794062435627,
-0.06734982877969742,
-0.0387466698884964,
-0.010555053129792213,
-0.05646425113081932,
0.008562683127820492,
0.06613478809595108,
0.027942653745412827,
-0.011547693982720375,
0.014431801624596119,
-0.037758804857730865,
-0.07232122123241425,
-0.00938689336180687,
-0.08104929327964783,
-0.011070750653743744,
0.0479249469935894,
-0.03820815682411194,
0.04962444677948952,
0.0015747559955343604,
0.055822424590587616,
0.021124210208654404,
0.03932839632034302,
-0.06357748806476593,
-0.014929352328181267,
0.013312239199876785,
0.07975830137729645,
-0.06691482663154602,
0.016433333978056908,
-0.036977916955947876,
-0.03553132712841034,
-0.03407876193523407,
0.025913706049323082,
0.06551657617092133,
0.0214814692735672,
0.08372434228658676,
0.01785297505557537,
-0.01552506536245346,
-0.05902913212776184,
0.0061792368069291115,
0.1293400377035141,
-0.0006238369387574494,
0.03806664049625397,
0.027573836967349052,
0.09576791524887085,
-0.05160728469491005,
0.020744984969496727,
-0.005850424058735371,
0.004342537838965654,
-0.05415123701095581,
0.015786437317728996,
0.008974766358733177,
0.044055212289094925,
0.11120574176311493,
-0.03204375132918358,
0.0378059484064579,
-0.038013022392988205,
-0.019735807552933693,
0.030943717807531357,
0.017904013395309448,
5.362167356805594e-33,
-0.017351362854242325,
0.009572191163897514,
0.05570904165506363,
0.025823114439845085,
-0.046523235738277435,
0.0062843370251357555,
0.023146631196141243,
0.026553818956017494,
0.03874395415186882,
-0.01765216700732708,
-0.09035313874483109,
0.04106718301773071,
0.00002456590300425887,
0.07050716876983643,
0.007620878051966429,
-0.012317376211285591,
0.004662849009037018,
0.1098765954375267,
0.05167652294039726,
0.044733304530382156,
0.04546012729406357,
0.056750986725091934,
-0.019512895494699478,
0.021619725972414017,
0.043152328580617905,
0.004679327830672264,
-0.02118906006217003,
0.002718527102842927,
-0.22050781548023224,
-0.00037875690031796694,
0.009907885454595089,
-0.009922412224113941,
-0.03152264654636383,
0.034741029143333435,
0.0742165669798851,
-0.048873934894800186,
0.025568168610334396,
-0.03839516267180443,
-0.042710382491350174,
-0.027708102017641068,
0.057482000440359116,
-0.0234817061573267,
-0.06223668158054352,
-0.031733136624097824,
-0.08504136651754379,
-0.11276799440383911,
0.01261833868920803,
-0.07575038820505142,
0.008610527031123638,
-0.017580045387148857,
0.03666495159268379,
0.043602682650089264,
0.13707098364830017,
-0.02414427138864994,
0.036343734711408615,
-0.062449682503938675,
0.08411271870136261,
0.0007477669860236347,
0.06666100025177002,
0.014306404627859592,
-0.023921320214867592,
-0.028981832787394524,
0.007017119321972132,
-0.02154221385717392,
0.05395961180329323,
-0.0017011999152600765,
-0.02662523463368416,
-0.06218718737363815,
-0.0688580796122551,
-0.034148503094911575,
0.016811883077025414,
0.07738464325666428,
0.0621444508433342,
0.028501588851213455,
0.00033461672137491405,
-0.05325339734554291,
-0.02863362431526184,
0.04934759810566902,
-0.06322746723890305,
0.0057447790168225765,
0.05441853776574135,
0.04579930379986763,
-0.020120374858379364,
0.0077571445144712925,
-0.03533327206969261,
0.03906205669045448,
0.036819275468587875,
-0.08545815199613571,
0.011251825839281082,
0.03072049655020237,
-0.012230828404426575,
-0.036841925233602524,
-0.06713081896305084,
-0.07052763551473618,
-0.05041927099227905,
-4.760204413931178e-33,
0.00395548902451992,
0.00013591619790531695,
-0.0717645213007927,
0.03656572103500366,
-0.04327637702226639,
-0.06743396818637848,
0.04701133817434311,
0.09362275153398514,
0.014165413565933704,
-0.021148214116692543,
0.007428888231515884,
-0.056738149374723434,
-0.017592813819646835,
-0.06438671052455902,
-0.01243345346301794,
0.06270108371973038,
-0.05797462910413742,
-0.09949346631765366,
0.008997333236038685,
-0.044194407761096954,
0.02043120376765728,
-0.001913333428092301,
0.04525725170969963,
-0.007766507565975189,
-0.04513910040259361,
-0.03555922955274582,
0.02360803447663784,
-0.01552579179406166,
-0.027216173708438873,
-0.08185844868421555,
0.03785457834601402,
-0.02512872777879238,
-0.020649293437600136,
0.004638240206986666,
-0.005074004177004099,
-0.08474898338317871,
0.045204855501651764,
0.05978407338261604,
0.00032298307633027434,
0.05094390735030174,
0.033930934965610504,
-0.02610543556511402,
-0.06127626448869705,
0.06948956102132797,
0.05782728269696236,
-0.05417804419994354,
-0.05366457998752594,
-0.0650734230875969,
0.020382611081004143,
0.016247428953647614,
0.10352242738008499,
0.029413748532533646,
-0.0312826931476593,
0.04227304458618164,
0.030402569100260735,
-0.027968550100922585,
0.006513381376862526,
-0.01804947853088379,
0.004463226068764925,
-0.030617710202932358,
0.020968696102499962,
-0.08653965592384338,
-0.039090950042009354,
0.009040788747370243,
0.007604215759783983,
-0.003543536877259612,
-0.04015059024095535,
-0.10422865301370621,
-0.02035352773964405,
0.015923408791422844,
0.01950887218117714,
-0.053878091275691986,
0.04059375077486038,
0.02502046339213848,
-0.016603512689471245,
-0.07388850301504135,
0.02825433388352394,
-0.006541808135807514,
0.06646234542131424,
0.09751472622156143,
-0.1034858226776123,
0.04190368205308914,
0.0014094933867454529,
0.04956474155187607,
0.10258539766073227,
-0.02303428389132023,
-0.018141815438866615,
0.061112407594919205,
-0.1052219346165657,
-0.054229721426963806,
-0.002299784915521741,
0.04821612313389778,
-0.013440065085887909,
0.021461838856339455,
0.004620453342795372,
-4.426599176099444e-8,
-0.07672056555747986,
-0.08663561195135117,
-0.04189889878034592,
0.07585778087377548,
-0.021719738841056824,
0.07907365262508392,
-0.003866784507408738,
0.026955923065543175,
0.040091339498758316,
-0.034856051206588745,
0.04568018391728401,
0.018684521317481995,
0.01247990969568491,
0.005021420307457447,
0.061068352311849594,
-0.006002713926136494,
-0.005528020206838846,
-0.008441687561571598,
-0.054584354162216187,
-0.0648912861943245,
0.024170881137251854,
0.032404616475105286,
-0.0213258508592844,
-0.06876752525568008,
0.10583864152431488,
-0.007254999130964279,
0.06981881707906723,
0.14644011855125427,
-0.08907477557659149,
-0.04318173602223396,
-0.026611605659127235,
-0.013231940567493439,
0.01809636317193508,
-0.020573360845446587,
0.032129064202308655,
0.018661608919501305,
-0.018715033307671547,
0.028037840500473976,
0.07301861047744751,
0.07697805762290955,
0.07056441903114319,
0.03225554898381233,
-0.05546613037586212,
0.08221951872110367,
0.08911773562431335,
-0.007628054358065128,
-0.06478725373744965,
0.06915885210037231,
-0.04553653672337532,
-0.027920197695493698,
0.05506841838359833,
-0.05976865068078041,
-0.09199182689189911,
0.01727277785539627,
-0.0782833993434906,
-0.03425648435950279,
0.005237068515270948,
-0.05911752209067345,
0.02951018512248993,
0.07125237584114075,
0.08944395184516907,
0.04443880170583725,
-0.004505322314798832,
-0.049947019666433334
] | 0.089864 |
'mark', \* startTime: 81.860064, \* duration: 0, \* detail: null \* } \* ] \*/ performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ type: 'mark' }); performance.mark('test'); performance.mark('meow'); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntries()); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 81.465639, \* duration: 0, \* detail: null \* }, \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 81.860064, \* duration: 0, \* detail: null \* } \* ] \*/ performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ type: 'mark' }); performance.mark('test'); performance.mark('meow'); ``` ### `performanceObserverEntryList.getEntriesByName(name[, type])` \* `name` {string} \* `type` {string} \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntriesByName('meow')); /\*\* \* [ \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 98.545991, \* duration: 0, \* detail: null \* } \* ] \*/ console.log(perfObserverList.getEntriesByName('nope')); // [] console.log(perfObserverList.getEntriesByName('test', 'mark')); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 63.518931, \* duration: 0, \* detail: null \* } \* ] \*/ console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['mark', 'measure'] }); performance.mark('test'); performance.mark('meow'); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntriesByName('meow')); /\*\* \* [ \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 98.545991, \* duration: 0, \* detail: null \* } \* ] \*/ console.log(perfObserverList.getEntriesByName('nope')); // [] console.log(perfObserverList.getEntriesByName('test', 'mark')); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 63.518931, \* duration: 0, \* detail: null \* } \* ] \*/ console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['mark', 'measure'] }); performance.mark('test'); performance.mark('meow'); ``` ### `performanceObserverEntryList.getEntriesByType(type)` \* `type` {string} \* Returns: {PerformanceEntry\[]} Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntriesByType('mark')); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 55.897834, \* duration: 0, \* detail: null \* }, \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 56.350146, \* duration: 0, \* detail: null \* } \* ] \*/ performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ type: 'mark' }); performance.mark('test'); performance.mark('meow'); ``` ```cjs const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { console.log(perfObserverList.getEntriesByType('mark')); /\*\* \* [ \* PerformanceEntry { \* name: 'test', \* entryType: 'mark', \* startTime: 55.897834, \* duration: 0, \* detail: null \* }, \* PerformanceEntry { \* name: 'meow', \* entryType: 'mark', \* startTime: 56.350146, \* duration: 0, \* detail: null \* } \* ] \*/ performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ type: 'mark' }); performance.mark('test'); performance.mark('meow'); ``` ## `perf\_hooks.createHistogram([options])` \* `options` {Object} \* `lowest` {number|bigint} The lowest discernible value. Must be an integer value greater than 0. \*\*Default:\*\* `1`. \* `highest` {number|bigint} The highest recordable value. Must be an integer value that is equal to or greater than two times `lowest`. \*\*Default:\*\* `Number.MAX\_SAFE\_INTEGER`. \* `figures` {number} The number of accuracy digits. Must be a number between `1` and `5`. \*\*Default:\*\* `3`. \* Returns: {RecordableHistogram} Returns a {RecordableHistogram}. ## `perf\_hooks.eventLoopUtilization([utilization1[, utilization2]])` \* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`. \* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. \* Returns: {Object} \* `idle` {number} \* `active` | https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md | main | nodejs | [
0.03726703301072121,
0.05084995552897453,
-0.017237521708011627,
0.06921125203371048,
0.012265387922525406,
-0.029078073799610138,
0.028627092018723488,
0.05309818685054779,
0.07213272899389267,
-0.033654097467660904,
-0.0837315022945404,
-0.08701100945472717,
-0.08660094439983368,
-0.0029423958621919155,
-0.05188383907079697,
0.03710233420133591,
0.0575408861041069,
-0.052441418170928955,
0.01957194320857525,
-0.05456952750682831,
-0.0218470748513937,
-0.10029413551092148,
-0.002557629719376564,
0.022432401776313782,
-0.04928186908364296,
0.011516557075083256,
-0.04365907236933708,
0.031224051490426064,
0.037861377000808716,
-0.015257212333381176,
0.022421687841415405,
-0.16657327115535736,
-0.045164804905653,
0.03372024744749069,
0.06017559394240379,
0.06356748938560486,
-0.0073371571488678455,
-0.09022825956344604,
0.012599332258105278,
0.003210347145795822,
0.06472910195589066,
0.022491643205285072,
-0.07598615437746048,
0.013689808547496796,
0.06571577489376068,
0.009522685781121254,
-0.04314251244068146,
-0.014282607473433018,
-0.059185247868299484,
-0.003284647362306714,
-0.033591292798519135,
0.015367682091891766,
-0.004043216817080975,
-0.1139320358633995,
0.05221550911664963,
0.04966322332620621,
-0.013753949664533138,
-0.026790564879775047,
0.020361769944429398,
-0.012864463962614536,
0.009210256859660149,
-0.026582179591059685,
0.02450604736804962,
-0.006324042100459337,
0.05617371201515198,
0.016253197565674782,
0.010961877182126045,
-0.0010813830886036158,
-0.0073045664466917515,
-0.046092864125967026,
-0.07982766628265381,
0.06174306571483612,
0.04805348441004753,
-0.04625346139073372,
-0.022082140669226646,
-0.020463313907384872,
-0.06922876089811325,
-0.0013533467426896095,
0.010647092014551163,
-0.038721129298210144,
-0.01840842328965664,
-0.11690197139978409,
-0.05925442650914192,
0.04102190583944321,
0.059912730008363724,
0.057079069316387177,
0.06306479871273041,
-0.03644894063472748,
-0.046387262642383575,
0.0029333755373954773,
-0.09368587285280228,
0.036625806242227554,
-0.08054163306951523,
0.04730236157774925,
-0.01666361279785633,
0.01982591673731804,
0.0054023307748138905,
0.028443753719329834,
0.011605189181864262,
0.05388958379626274,
0.03191535547375679,
0.004645520355552435,
-0.038608368486166,
0.045609429478645325,
0.011848256923258305,
-0.0025624383706599474,
-0.03187883272767067,
0.04107037931680679,
-0.05364460498094559,
0.030433734878897667,
0.0010363804176449776,
0.07688876986503601,
-0.048132747411727905,
0.026313118636608124,
0.021924421191215515,
0.030210869386792183,
0.024100448936223984,
0.04173288866877556,
0.09472142159938812,
0.08932500332593918,
0.11704052984714508,
-0.017173925414681435,
-0.04714178293943405,
-0.06470360606908798,
-0.023835439234972,
0.03175485134124756,
0.1302308440208435,
2.785391353294005e-33,
-0.023175973445177078,
-0.11327918618917465,
-0.05186859518289566,
-0.02895059809088707,
0.02407653257250786,
0.03400508314371109,
-0.08287666738033295,
0.03515451401472092,
-0.019269971176981926,
-0.006392209324985743,
0.023544037714600563,
-0.10243846476078033,
-0.005060202907770872,
-0.07334645837545395,
0.10536942631006241,
-0.04555567726492882,
0.0841449648141861,
0.018363358452916145,
0.003537168726325035,
0.02398834563791752,
0.036087729036808014,
-0.01528762374073267,
-0.10136471688747406,
-0.014435396529734135,
0.01346293929964304,
0.03180629760026932,
0.023417869582772255,
0.0316549614071846,
-0.10069647431373596,
-0.02121712826192379,
0.05599900335073471,
0.06656642258167267,
-0.038159504532814026,
0.04563062638044357,
-0.017552193254232407,
-0.028503330424427986,
0.021582920104265213,
0.04066929221153259,
-0.007900770753622055,
-0.018571296706795692,
-0.024473650380969048,
0.0028408924117684364,
-0.06615101546049118,
-0.07250390946865082,
-0.08934259414672852,
-0.1053789034485817,
-0.03525969758629799,
0.023554418236017227,
-0.010175076313316822,
0.006966336164623499,
-0.030584722757339478,
0.06605818122625351,
0.02146642841398716,
-0.08762131631374359,
-0.0061668818816542625,
0.01905413344502449,
0.04711712896823883,
-0.020995106548070908,
-0.024863654747605324,
0.061154093593358994,
-0.04828270524740219,
0.04453470557928085,
-0.029426414519548416,
-0.0755523145198822,
-0.009097826667129993,
0.032926518470048904,
-0.007243646774441004,
-0.029860885813832283,
0.008911102078855038,
0.005971922539174557,
-0.03003491647541523,
-0.02652813121676445,
0.09021857380867004,
-0.054525021463632584,
0.02760094590485096,
0.014741036109626293,
-0.07809215039014816,
0.04900689795613289,
-0.053271181881427765,
-0.0882929190993309,
0.1163024827837944,
-0.04309006407856941,
-0.006937202997505665,
-0.01537555456161499,
0.10721277445554733,
-0.03982101008296013,
-0.04590962454676628,
-0.03196869418025017,
-0.022291632369160652,
0.046138811856508255,
-0.00031230933382175863,
-0.020156724378466606,
0.011051565408706665,
-0.014475063420832157,
-0.12724947929382324,
-4.127493477575128e-33,
0.04824905842542648,
0.03011840395629406,
-0.04426933452486992,
0.04643939062952995,
0.06876973062753677,
-0.019669407978653908,
-0.0033260569907724857,
0.03952233865857124,
-0.0337301641702652,
0.0390748605132103,
0.015433545224368572,
-0.029194826260209084,
-0.063099205493927,
0.05211634933948517,
-0.046632032841444016,
0.08406957983970642,
-0.03806992247700691,
0.02869170531630516,
-0.000005091757884656545,
-0.05847358703613281,
0.015398254618048668,
0.04134943708777428,
0.05431410297751427,
-0.016447216272354126,
-0.036465320736169815,
0.00393236568197608,
0.05822889134287834,
0.00014526337326969951,
-0.09471017122268677,
-0.09346050769090652,
-0.01058665569871664,
0.05477689206600189,
-0.04441653564572334,
0.0608154833316803,
0.03784981369972229,
-0.032566413283348083,
0.033072490245103836,
0.037662144750356674,
-0.013110388070344925,
-0.017896384000778198,
0.09278156608343124,
0.004140968434512615,
-0.07780137658119202,
-0.0006100134924054146,
-0.027497539296746254,
0.08583279699087143,
-0.04126248508691788,
-0.0037468764930963516,
-0.009730758145451546,
0.0549226775765419,
-0.047299597412347794,
-0.07855860888957977,
0.07042956352233887,
0.023388931527733803,
-0.03868350759148598,
0.017767619341611862,
-0.010422680526971817,
-0.12404944747686386,
0.03708294406533241,
0.06436890363693237,
0.01451678853482008,
-0.07220793515443802,
0.0008727729436941445,
0.06715347617864609,
0.1540401726961136,
-0.05098159983754158,
-0.06229839846491814,
-0.011881980113685131,
0.05264134705066681,
-0.010483739897608757,
-0.0019822849426418543,
0.07330010831356049,
-0.04059045389294624,
-0.002103337785229087,
-0.0000560814150958322,
0.017908340319991112,
0.028498418629169464,
-0.08086937665939331,
0.04826825484633446,
0.08157097548246384,
-0.06151558831334114,
-0.0020762754138559103,
0.02561878226697445,
-0.06923725455999374,
-0.056222591549158096,
0.06609798967838287,
-0.023313365876674652,
0.07875336706638336,
-0.026223978027701378,
-0.03597544878721237,
0.022345729172229767,
0.11727797985076904,
-0.0689721331000328,
-0.04019967094063759,
0.005178228951990604,
-4.970464217990411e-8,
-0.06329894065856934,
-0.03217168152332306,
-0.024838607758283615,
0.046796709299087524,
-0.0026498278602957726,
-0.03355342894792557,
0.006278321612626314,
-0.037872157990932465,
0.005483430344611406,
-0.03790339455008507,
0.06720578670501709,
-0.024455636739730835,
0.04390411823987961,
-0.016407836228609085,
-0.014481035061180592,
-0.04819857329130173,
-0.02619488537311554,
-0.00044174902723170817,
-0.004332548473030329,
0.04085267335176468,
-0.028435910120606422,
0.013326609507203102,
0.046624068170785904,
-0.0168090108782053,
0.020983057096600533,
-0.05003633350133896,
0.05810590088367462,
0.11248179525136948,
0.022726237773895264,
0.08516928553581238,
-0.04218585789203644,
0.04249615594744682,
0.05072304978966713,
-0.051619354635477066,
-0.02195306494832039,
-0.014323312789201736,
0.021320929750800133,
-0.0007722502923570573,
0.06648510694503784,
0.12874799966812134,
0.11442414671182632,
0.047257691621780396,
-0.04383362829685211,
0.07040131092071533,
0.05779268592596054,
-0.05683507025241852,
-0.07781024277210236,
0.02211274392902851,
0.08654849976301193,
-0.026627585291862488,
0.033870380371809006,
-0.02213355526328087,
-0.06067636236548424,
-0.02436637319624424,
-0.017105747014284134,
-0.0630824863910675,
0.02278665453195572,
0.008704082109034061,
-0.007993183098733425,
0.07125084847211838,
0.10859330743551254,
-0.006809585727751255,
-0.036342721432447433,
0.017846889793872833
] | 0.062908 |
a number between `1` and `5`. \*\*Default:\*\* `3`. \* Returns: {RecordableHistogram} Returns a {RecordableHistogram}. ## `perf\_hooks.eventLoopUtilization([utilization1[, utilization2]])` \* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`. \* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. \* Returns: {Object} \* `idle` {number} \* `active` {number} \* `utilization` {number} The `eventLoopUtilization()` function returns an object that contains the cumulative duration of time the event loop has been both idle and active as a high resolution milliseconds timer. The `utilization` value is the calculated Event Loop Utilization (ELU). If bootstrapping has not yet finished on the main thread the properties have the value of `0`. The ELU is immediately available on [Worker threads][] since bootstrap happens within the event loop. Both `utilization1` and `utilization2` are optional parameters. If `utilization1` is passed, then the delta between the current call's `active` and `idle` times, as well as the corresponding `utilization` value are calculated and returned (similar to [`process.hrtime()`][]). If `utilization1` and `utilization2` are both passed, then the delta is calculated between the two arguments. This is a convenience option because, unlike [`process.hrtime()`][], calculating the ELU is more complex than a single subtraction. ELU is similar to CPU utilization, except that it only measures event loop statistics and not CPU usage. It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. `epoll\_wait`). No other CPU idle time is taken into consideration. The following is an example of how a mostly idle process will have a high ELU. ```mjs import { eventLoopUtilization } from 'node:perf\_hooks'; import { spawnSync } from 'node:child\_process'; setImmediate(() => { const elu = eventLoopUtilization(); spawnSync('sleep', ['5']); console.log(eventLoopUtilization(elu).utilization); }); ``` ```cjs 'use strict'; const { eventLoopUtilization } = require('node:perf\_hooks'); const { spawnSync } = require('node:child\_process'); setImmediate(() => { const elu = eventLoopUtilization(); spawnSync('sleep', ['5']); console.log(eventLoopUtilization(elu).utilization); }); ``` Although the CPU is mostly idle while running this script, the value of `utilization` is `1`. This is because the call to [`child\_process.spawnSync()`][] blocks the event loop from proceeding. Passing in a user-defined object instead of the result of a previous call to `eventLoopUtilization()` will lead to undefined behavior. The return values are not guaranteed to reflect any correct state of the event loop. ## `perf\_hooks.monitorEventLoopDelay([options])` \* `options` {Object} \* `resolution` {number} The sampling rate in milliseconds. Must be greater than zero. \*\*Default:\*\* `10`. \* Returns: {IntervalHistogram} \_This property is an extension by Node.js. It is not available in Web browsers.\_ Creates an `IntervalHistogram` object that samples and reports the event loop delay over time. The delays will be reported in nanoseconds. Using a timer to detect approximate event loop delay works because the execution of timers is tied specifically to the lifecycle of the libuv event loop. That is, a delay in the loop will cause a delay in the execution of the timer, and those delays are specifically what this API is intended to detect. ```mjs import { monitorEventLoopDelay } from 'node:perf\_hooks'; const h = monitorEventLoopDelay({ resolution: 20 }); h.enable(); // Do something. h.disable(); console.log(h.min); console.log(h.max); console.log(h.mean); console.log(h.stddev); console.log(h.percentiles); console.log(h.percentile(50)); console.log(h.percentile(99)); ``` ```cjs const { monitorEventLoopDelay } = require('node:perf\_hooks'); const h = monitorEventLoopDelay({ resolution: 20 }); h.enable(); // Do something. h.disable(); console.log(h.min); console.log(h.max); console.log(h.mean); console.log(h.stddev); console.log(h.percentiles); console.log(h.percentile(50)); console.log(h.percentile(99)); ``` ## `perf\_hooks.timerify(fn[, options])` \* `fn` {Function} \* `options` {Object} \* `histogram` {RecordableHistogram} A histogram object created using `perf\_hooks.createHistogram()` that will record runtime durations in nanoseconds. \_This property is an extension by Node.js. It is not available in Web browsers.\_ Wraps a function within a new function that measures the running time of the wrapped function. A `PerformanceObserver` must be subscribed to | https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md | main | nodejs | [
-0.02445300482213497,
0.009450284764170647,
-0.04451795294880867,
0.04118023440241814,
0.0002586794726084918,
-0.054726939648389816,
0.11565841734409332,
0.021811801940202713,
0.041197266429662704,
-0.015911614522337914,
0.009487802162766457,
-0.011785009875893593,
-0.017795247957110405,
-0.056492336094379425,
-0.027019619941711426,
0.019459163770079613,
-0.04080980643630028,
-0.057000782340765,
-0.08592668920755386,
-0.03481568396091461,
0.08650530874729156,
-0.022774018347263336,
-0.08559314161539078,
-0.00945721659809351,
-0.050154268741607666,
-0.006224203389137983,
-0.10084530711174011,
0.006218859925866127,
0.10041739791631699,
0.039891548454761505,
-0.07123791426420212,
-0.022499918937683105,
0.007284555118530989,
-0.022340741008520126,
0.047187335789203644,
0.0071822842583060265,
-0.016045454889535904,
-0.08353248238563538,
-0.1075667217373848,
0.054171498864889145,
0.08040747791528702,
-0.022212380543351173,
-0.0645848885178566,
-0.05599745362997055,
-0.01785586029291153,
0.023488294333219528,
-0.06449168920516968,
-0.03756821155548096,
-0.12080118805170059,
0.049822889268398285,
0.027298729866743088,
0.06769385188817978,
0.014566143974661827,
-0.010285158641636372,
0.052804574370384216,
-0.03256642073392868,
0.09274739027023315,
-0.07493235170841217,
-0.010045681148767471,
-0.06398297101259232,
-0.03887619450688362,
-0.01372435875236988,
-0.0651458203792572,
0.028489304706454277,
0.05001678317785263,
-0.011830530129373074,
0.019854748621582985,
-0.040379054844379425,
0.0544903539121151,
0.0015685453545302153,
-0.08277524262666702,
0.040917664766311646,
-0.05174398049712181,
0.008503206074237823,
0.022716522216796875,
0.045564159750938416,
0.03631108999252319,
0.022377165034413338,
-0.01184319518506527,
-0.13257181644439697,
0.006241486873477697,
-0.0376305989921093,
0.0389275886118412,
-0.016645053401589394,
0.020779786631464958,
-0.03830096498131752,
-0.00236335676163435,
0.021830838173627853,
0.041846003383398056,
0.058536652475595474,
-0.04965215176343918,
0.06485006213188171,
-0.011660424992442131,
0.04471062123775482,
-0.03429820388555527,
0.10435612499713898,
0.02163577266037464,
-0.01334102638065815,
-0.005546699743717909,
0.040184468030929565,
-0.04175844416022301,
0.06875703483819962,
0.042187731713056564,
0.012301970273256302,
0.008466584607958794,
-0.03734126314520836,
-0.10615766793489456,
-0.040352579206228256,
-0.06842067092657089,
0.0028322520665824413,
0.05512716993689537,
-0.017326144501566887,
0.031447991728782654,
-0.0330422967672348,
0.04215117543935776,
0.0975644588470459,
-0.0026308679953217506,
0.06050591915845871,
0.019765635952353477,
0.07047586143016815,
0.11501683294773102,
0.008794179186224937,
0.01932125724852085,
-0.022126460447907448,
0.005558516830205917,
-0.020174387842416763,
0.014295256696641445,
6.105411863679387e-33,
0.007922851480543613,
-0.14814601838588715,
-0.03531378135085106,
0.01754489168524742,
-0.006309879012405872,
0.012789995409548283,
-0.028797108680009842,
0.014842941425740719,
0.044844795018434525,
0.043668415397405624,
-0.08992650359869003,
0.12198428809642792,
-0.0008763560326769948,
-0.004325137939304113,
0.03838468715548515,
0.009739132598042488,
0.08405864238739014,
0.027150224894285202,
0.030411511659622192,
0.03670492768287659,
0.03683851286768913,
-0.018008099868893623,
-0.05724768713116646,
0.032288044691085815,
0.09933537244796753,
0.121802918612957,
-0.016322821378707886,
0.006115213967859745,
-0.09411290287971497,
0.038218043744564056,
0.03776159510016441,
0.00976611115038395,
-0.045692991465330124,
-0.054328564554452896,
0.03834821656346321,
-0.07195568829774857,
0.056352272629737854,
0.009562092833220959,
-0.013493053615093231,
-0.009072099812328815,
-0.05636031553149223,
0.018085114657878876,
-0.04914324730634689,
-0.10251077264547348,
-0.06076210364699364,
-0.12827104330062866,
0.007827527821063995,
0.05906504765152931,
0.017348380759358406,
0.040227167308330536,
0.05267539620399475,
0.013113519176840782,
0.09241928160190582,
-0.06708253920078278,
-0.05254372954368591,
0.015087857842445374,
0.0384022481739521,
0.05415317043662071,
0.038655269891023636,
0.11238586902618408,
0.020299283787608147,
0.02478763647377491,
0.05127399414777756,
0.021376270800828934,
-0.0005131803336553276,
0.09284015744924545,
-0.013011314906179905,
-0.05978155508637428,
0.07410343736410141,
0.02713998220860958,
-0.013719089329242706,
0.06462074816226959,
0.030927253887057304,
0.0028347030747681856,
0.02663649432361126,
-0.04136351868510246,
0.048712462186813354,
-0.028578532859683037,
-0.10261237621307373,
0.045951858162879944,
0.015829920768737793,
-0.01625739596784115,
-0.036383505910634995,
0.000349787442246452,
-0.012249411083757877,
-0.0081972386687994,
-0.0008831489249132574,
-0.0068928697146475315,
-0.06664147973060608,
-0.007875735871493816,
0.01757124438881874,
-0.018655095249414444,
0.011072344146668911,
-0.0720338225364685,
-0.13819122314453125,
-7.190639268618062e-33,
0.1020396277308464,
0.02754574827849865,
-0.014803891070187092,
0.03307173401117325,
0.03581371530890465,
-0.01221685390919447,
0.018689628690481186,
-0.008946689777076244,
-0.06015733629465103,
0.002346952212974429,
0.0071046738885343075,
-0.007152778096497059,
-0.04870976135134697,
-0.0025630819145590067,
0.029141847044229507,
0.04431759566068649,
-0.05376970022916794,
-0.015730932354927063,
-0.038584817200899124,
0.05028971657156944,
0.045951612293720245,
0.0089579401537776,
-0.014785455539822578,
-0.01233204361051321,
-0.037170153111219406,
-0.07489696145057678,
-0.025650599971413612,
-0.03278404474258423,
-0.003965933807194233,
-0.09072646498680115,
-0.02418411336839199,
-0.024938594549894333,
-0.04452817514538765,
0.06172936037182808,
-0.03723309934139252,
-0.044273000210523605,
0.05666676163673401,
0.05764946714043617,
0.02595854178071022,
-0.03747189790010452,
0.12400723248720169,
0.024083981290459633,
-0.044231023639440536,
-0.007552466355264187,
-0.015503031201660633,
0.020755594596266747,
-0.029345354065299034,
-0.010057524777948856,
0.025211147964000702,
-0.027742283418774605,
0.009850370697677135,
-0.04102490842342377,
0.010642243549227715,
0.1500827670097351,
-0.028031116351485252,
0.05164916813373566,
0.015758659690618515,
-0.11004357039928436,
-0.08174200356006622,
0.046814512461423874,
0.011433826759457588,
-0.03257963806390762,
0.010014217346906662,
0.01898343116044998,
0.06619581580162048,
0.042191650718450546,
0.0036043175496160984,
-0.08303333073854446,
-0.06196657940745354,
-0.056416455656290054,
0.0889241173863411,
0.013009531423449516,
-0.02603297494351864,
-0.027281461283564568,
-0.08267084509134293,
0.10720016062259674,
0.0005728579126298428,
-0.1062011644244194,
0.04786166176199913,
-0.013723858632147312,
-0.13588771224021912,
-0.030880875885486603,
0.0192252304404974,
-0.01780105009675026,
-0.1081182211637497,
0.0740470290184021,
0.04271255433559418,
0.055962204933166504,
0.030993247404694557,
-0.02712566964328289,
-0.035759102553129196,
0.03075692057609558,
-0.038324832916259766,
0.07199428230524063,
0.0017873994074761868,
-6.216444603523996e-8,
-0.03175974637269974,
-0.0066063133999705315,
-0.0018468271009624004,
0.031119944527745247,
0.04706545174121857,
0.006972037255764008,
0.03982124850153923,
0.032837897539138794,
-0.014431849122047424,
-0.03921745344996452,
0.09622273594141006,
-0.005047808401286602,
0.013361158780753613,
-0.02523898519575596,
0.031071797013282776,
0.050192900002002716,
0.02745356783270836,
-0.0230867937207222,
-0.07097554206848145,
-0.02242327481508255,
0.010309327393770218,
-0.05570047348737717,
0.015359916724264622,
-0.009817654266953468,
-0.0458296462893486,
-0.02914203517138958,
0.051327064633369446,
0.1222243681550026,
0.05881787836551666,
-0.06794590502977371,
-0.032565806061029434,
-0.0305793434381485,
-0.022072428837418556,
-0.0035180174745619297,
-0.046629566699266434,
0.015329033136367798,
-0.0303995031863451,
-0.025054845958948135,
0.05356919765472412,
-0.028218338266015053,
0.0719851404428482,
-0.05244768038392067,
-0.04797644540667534,
0.05930180102586746,
0.04932102933526039,
0.009520375169813633,
-0.15104876458644867,
0.004382198676466942,
0.032089315354824066,
-0.020445330068469048,
-0.04221862927079201,
-0.034247010946273804,
-0.0158996544778347,
0.062278587371110916,
-0.01999613828957081,
0.013868500478565693,
0.05055782571434975,
-0.02539944089949131,
0.062209602445364,
0.06868497282266617,
0.013484185561537743,
-0.010298742912709713,
-0.06479956954717636,
-0.055014513432979584
] | 0.169848 |
{RecordableHistogram} A histogram object created using `perf\_hooks.createHistogram()` that will record runtime durations in nanoseconds. \_This property is an extension by Node.js. It is not available in Web browsers.\_ Wraps a function within a new function that measures the running time of the wrapped function. A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. ```mjs import { timerify, performance, PerformanceObserver } from 'node:perf\_hooks'; function someFunction() { console.log('hello world'); } const wrapped = timerify(someFunction); const obs = new PerformanceObserver((list) => { console.log(list.getEntries()[0].duration); performance.clearMarks(); performance.clearMeasures(); obs.disconnect(); }); obs.observe({ entryTypes: ['function'] }); // A performance timeline entry will be created wrapped(); ``` ```cjs const { timerify, performance, PerformanceObserver, } = require('node:perf\_hooks'); function someFunction() { console.log('hello world'); } const wrapped = timerify(someFunction); const obs = new PerformanceObserver((list) => { console.log(list.getEntries()[0].duration); performance.clearMarks(); performance.clearMeasures(); obs.disconnect(); }); obs.observe({ entryTypes: ['function'] }); // A performance timeline entry will be created wrapped(); ``` If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported once the finally handler is invoked. ## Class: `Histogram` ### `histogram.count` \* Type: {number} The number of samples recorded by the histogram. ### `histogram.countBigInt` \* Type: {bigint} The number of samples recorded by the histogram. ### `histogram.exceeds` \* Type: {number} The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. ### `histogram.exceedsBigInt` \* Type: {bigint} The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. ### `histogram.max` \* Type: {number} The maximum recorded event loop delay. ### `histogram.maxBigInt` \* Type: {bigint} The maximum recorded event loop delay. ### `histogram.mean` \* Type: {number} The mean of the recorded event loop delays. ### `histogram.min` \* Type: {number} The minimum recorded event loop delay. ### `histogram.minBigInt` \* Type: {bigint} The minimum recorded event loop delay. ### `histogram.percentile(percentile)` \* `percentile` {number} A percentile value in the range (0, 100]. \* Returns: {number} Returns the value at the given percentile. ### `histogram.percentileBigInt(percentile)` \* `percentile` {number} A percentile value in the range (0, 100]. \* Returns: {bigint} Returns the value at the given percentile. ### `histogram.percentiles` \* Type: {Map} Returns a `Map` object detailing the accumulated percentile distribution. ### `histogram.percentilesBigInt` \* Type: {Map} Returns a `Map` object detailing the accumulated percentile distribution. ### `histogram.reset()` Resets the collected histogram data. ### `histogram.stddev` \* Type: {number} The standard deviation of the recorded event loop delays. ## Class: `IntervalHistogram extends Histogram` A `Histogram` that is periodically updated on a given interval. ### `histogram.disable()` \* Returns: {boolean} Disables the update interval timer. Returns `true` if the timer was stopped, `false` if it was already stopped. ### `histogram.enable()` \* Returns: {boolean} Enables the update interval timer. Returns `true` if the timer was started, `false` if it was already started. ### `histogram[Symbol.dispose]()` Disables the update interval timer when the histogram is disposed. ```js const { monitorEventLoopDelay } = require('node:perf\_hooks'); { using hist = monitorEventLoopDelay({ resolution: 20 }); hist.enable(); // The histogram will be disabled when the block is exited. } ``` ### Cloning an `IntervalHistogram` {IntervalHistogram} instances can be cloned via {MessagePort}. On the receiving end, the histogram is cloned as a plain {Histogram} object that does not implement the `enable()` and `disable()` methods. ## Class: `RecordableHistogram extends Histogram` ### `histogram.add(other)` \* `other` {RecordableHistogram} Adds the values from `other` to this histogram. ### `histogram.record(val)` \* `val` {number|bigint} The amount to record in the histogram. ### `histogram.recordDelta()` Calculates the amount of time (in nanoseconds) that has passed since the previous call to `recordDelta()` and records that amount in the histogram. ## Examples ### Measuring | https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md | main | nodejs | [
0.0421147383749485,
0.05917924642562866,
-0.04541796073317528,
0.03880685195326805,
0.01666177064180374,
-0.011446364223957062,
0.03897390514612198,
0.045476049184799194,
0.020849505439400673,
-0.020836832001805305,
-0.06340207159519196,
-0.03541329503059387,
-0.011793744750320911,
-0.029821032658219337,
-0.020937485620379448,
-0.01034877635538578,
0.009024283848702908,
0.03837703540921211,
0.007870234549045563,
-0.06947614252567291,
0.07133038341999054,
-0.030157508328557014,
0.043257374316453934,
0.0124446339905262,
-0.0627407357096672,
-0.032751936465501785,
-0.058592066168785095,
0.005734118167310953,
0.05089375004172325,
0.0022674710489809513,
0.032887570559978485,
-0.12008560448884964,
-0.02342105843126774,
0.03880992904305458,
-0.04292400926351547,
0.07941529899835587,
0.0035457925405353308,
-0.0264471136033535,
0.0030853324569761753,
-0.02604854106903076,
0.0807306319475174,
0.06342475116252899,
-0.050330109894275665,
-0.0013443444622680545,
0.027780674397945404,
0.03350929543375969,
-0.06438588351011276,
-0.05527930706739426,
-0.12593984603881836,
0.041296619921922684,
-0.014259628020226955,
0.028888065367937088,
0.008783258497714996,
-0.07358235865831375,
0.024680083617568016,
0.017556078732013702,
0.002520682057365775,
-0.020229915156960487,
0.0060436176136136055,
0.025093765929341316,
-0.039611201733350754,
-0.0472533255815506,
0.03934362158179283,
0.0022531235590577126,
0.0689522922039032,
0.021854616701602936,
0.012038184329867363,
0.09660615772008896,
0.03288181498646736,
-0.011839513666927814,
-0.03636156767606735,
0.05879431217908859,
0.009531522169709206,
-0.028004107996821404,
-0.08106550574302673,
-0.04239507019519806,
-0.03347378969192505,
0.03173644095659256,
-0.036396756768226624,
-0.008975410833954811,
-0.01662399433553219,
-0.07236406952142715,
0.0016645458526909351,
0.025696970522403717,
0.055653978139162064,
0.0655287653207779,
0.0318482480943203,
0.022539235651493073,
-0.020969092845916748,
-0.028830410912632942,
-0.1096537709236145,
0.007113765459507704,
-0.12680360674858093,
0.02218257449567318,
-0.08154528588056564,
0.0009544463246129453,
0.03254613280296326,
0.027285723015666008,
0.015459026210010052,
0.02400028146803379,
0.036212027072906494,
0.025836892426013947,
-0.056424371898174286,
0.05130689963698387,
0.05052751302719116,
-0.01720321550965309,
-0.07856660336256027,
0.03200795501470566,
-0.005189970601350069,
0.07242054492235184,
0.018489619717001915,
0.08435072004795074,
0.020213985815644264,
-0.043537039309740067,
0.07421102374792099,
0.0531131885945797,
-0.01911858096718788,
0.004319290164858103,
0.09723737090826035,
0.10113813728094101,
0.1339460164308548,
0.02813711203634739,
-0.05129072070121765,
-0.071977898478508,
0.03009963221848011,
0.04182105511426926,
0.11544091999530792,
2.0593852874040287e-33,
-0.029469728469848633,
-0.08285380899906158,
-0.031936164945364,
0.018167415633797646,
0.03570520877838135,
0.06108446791768074,
-0.06037994474172592,
0.0006994145223870873,
-0.03521110489964485,
0.012628466822206974,
-0.06690353155136108,
0.05590568482875824,
-0.008563810959458351,
-0.03363689035177231,
0.0270896814763546,
0.004751204047352076,
0.07176196575164795,
-0.02494114451110363,
0.07457790523767471,
-0.030049137771129608,
-0.022349977865815163,
-0.050540897995233536,
-0.008045077323913574,
0.033287663012742996,
0.03533321991562843,
0.004947125446051359,
0.041325893253088,
0.05665405094623566,
-0.026461634784936905,
0.00015214024460874498,
0.04865751042962074,
0.05010541155934334,
-0.0699608251452446,
-0.027742944657802582,
0.04137564077973366,
-0.10421591997146606,
-0.03179166093468666,
0.04637353867292404,
-0.054252997040748596,
-0.012894799001514912,
-0.007731317076832056,
0.011184695176780224,
-0.08057110011577606,
-0.07247862219810486,
-0.09013071656227112,
-0.0931534618139267,
-0.04270956665277481,
0.045178476721048355,
0.06256648153066635,
0.004720326047390699,
0.016114884987473488,
0.0469648614525795,
0.02472156286239624,
-0.1325862854719162,
0.0429508201777935,
0.050981614738702774,
0.09124838560819626,
0.001995908096432686,
-0.02059902809560299,
0.10283219069242477,
0.0005302004283294082,
-0.010300828143954277,
0.03158824145793915,
-0.05324603617191315,
-0.014432182535529137,
0.04622870311141014,
-0.012690234929323196,
0.04474743828177452,
0.020584063604474068,
-0.035696811974048615,
0.016303639858961105,
0.0075792837888002396,
0.04541242867708206,
-0.0014833910390734673,
0.012598221190273762,
-0.005947694182395935,
-0.0158452820032835,
0.001494387281127274,
-0.08237169682979584,
-0.03802371025085449,
0.11889122426509857,
-0.08067002147436142,
-0.055535800755023956,
0.011109095998108387,
0.06384658068418503,
-0.014846728183329105,
-0.021998651325702667,
-0.03034120425581932,
-0.036364153027534485,
0.07787800580263138,
-0.030771929770708084,
0.015888771042227745,
-0.005482062231749296,
-0.012931037694215775,
-0.14127524197101593,
-4.182771099422546e-33,
-0.0033889194019138813,
0.04104199260473251,
-0.053830165416002274,
0.037558313459157944,
0.03411305695772171,
-0.03803982958197594,
-0.03814969211816788,
0.12689208984375,
-0.03538627550005913,
0.056845154613256454,
0.008834224194288254,
-0.048013556748628616,
-0.018165351822972298,
-0.004769235849380493,
-0.04749356210231781,
0.06606592237949371,
-0.009467648342251778,
-0.009944068267941475,
-0.02663111314177513,
-0.01982332393527031,
0.002905268920585513,
0.006509694736450911,
0.022776981815695763,
-0.036623816937208176,
-0.048308126628398895,
0.03409680351614952,
0.016169490292668343,
0.001437836093828082,
-0.026442257687449455,
-0.12751969695091248,
-0.04401247203350067,
-0.006784431170672178,
-0.061663128435611725,
0.016777943819761276,
0.028106795623898506,
-0.09616273641586304,
0.05548518896102905,
0.041568461805582047,
0.01967557519674301,
-0.026008928194642067,
0.06811972707509995,
0.032266002148389816,
-0.0639418363571167,
-0.09440334141254425,
-0.03158106654882431,
0.07937055081129074,
-0.09242118895053864,
0.027735060080885887,
0.05292326211929321,
0.03498096391558647,
-0.06428702920675278,
-0.07625945657491684,
0.04832353815436363,
0.03507216274738312,
-0.04705069959163666,
-0.007236930541694164,
-0.03612035885453224,
-0.10373620688915253,
0.09146905690431595,
0.06161240115761757,
0.015042704530060291,
-0.13731200993061066,
0.0027045742608606815,
-0.02044462412595749,
0.05112432315945625,
0.021119918674230576,
-0.0201416052877903,
-0.09238114953041077,
0.04340043663978577,
0.04480447992682457,
0.0028187923599034548,
0.021318458020687103,
-0.06785009801387787,
-0.03845977410674095,
-0.07451235502958298,
0.08705494552850723,
-0.04448974132537842,
-0.12120942026376724,
-0.03464064374566078,
0.01813536323606968,
0.0020244240295141935,
0.0025464382488280535,
0.03325728699564934,
-0.13210608065128326,
-0.04211055487394333,
0.05466807633638382,
0.00874234363436699,
0.02490067295730114,
0.03533980995416641,
-0.01743123307824135,
0.027581380680203438,
0.10286986082792282,
-0.1330094337463379,
0.011181024834513664,
-0.027997499331831932,
-5.3221754114929354e-8,
-0.08171293139457703,
-0.06291033327579498,
-0.010493054986000061,
-0.02080722153186798,
0.036098700016736984,
0.04583446681499481,
0.015118842013180256,
0.013404455035924911,
0.043121933937072754,
-0.03323332965373993,
0.135344460606575,
-0.03214754909276962,
0.011845187284052372,
-0.022882038727402687,
0.012339380569756031,
-0.0690968930721283,
0.02905479446053505,
-0.01941176876425743,
-0.00689071835950017,
0.020720666274428368,
0.00539864506572485,
0.016875311732292175,
0.0700434148311615,
-0.02536189742386341,
-0.05244559422135353,
-0.04692485183477402,
0.004519464913755655,
0.05774606764316559,
0.013806510716676712,
-0.0073952083475887775,
-0.08336319029331207,
0.05867309495806694,
0.05675119906663895,
-0.0013802343746647239,
-0.060149259865283966,
-0.0014906536089256406,
-0.05251311883330345,
-0.020724769681692123,
0.05330507457256317,
0.08456823229789734,
0.09414125978946686,
0.0011101188138127327,
-0.08236120641231537,
0.09982126951217651,
0.03640545904636383,
-0.05521933361887932,
0.013268694281578064,
-0.005628556944429874,
0.036150120198726654,
0.06138605624437332,
0.0483764111995697,
-0.03492521867156029,
-0.009144541807472706,
-0.05120585858821869,
-0.024074651300907135,
-0.02419974096119404,
0.024212367832660675,
-0.07778331637382507,
-0.03660665825009346,
0.051270291209220886,
-0.01858133263885975,
-0.048698339611291885,
0.011135363951325417,
0.0108041325584054
] | 0.144303 |
{RecordableHistogram} Adds the values from `other` to this histogram. ### `histogram.record(val)` \* `val` {number|bigint} The amount to record in the histogram. ### `histogram.recordDelta()` Calculates the amount of time (in nanoseconds) that has passed since the previous call to `recordDelta()` and records that amount in the histogram. ## Examples ### Measuring the duration of async operations The following example uses the [Async Hooks][] and Performance APIs to measure the actual duration of a Timeout operation (including the amount of time it took to execute the callback). ```mjs import { createHook } from 'node:async\_hooks'; import { performance, PerformanceObserver } from 'node:perf\_hooks'; const set = new Set(); const hook = createHook({ init(id, type) { if (type === 'Timeout') { performance.mark(`Timeout-${id}-Init`); set.add(id); } }, destroy(id) { if (set.has(id)) { set.delete(id); performance.mark(`Timeout-${id}-Destroy`); performance.measure(`Timeout-${id}`, `Timeout-${id}-Init`, `Timeout-${id}-Destroy`); } }, }); hook.enable(); const obs = new PerformanceObserver((list, observer) => { console.log(list.getEntries()[0]); performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['measure'], buffered: true }); setTimeout(() => {}, 1000); ``` ```cjs 'use strict'; const async\_hooks = require('node:async\_hooks'); const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const set = new Set(); const hook = async\_hooks.createHook({ init(id, type) { if (type === 'Timeout') { performance.mark(`Timeout-${id}-Init`); set.add(id); } }, destroy(id) { if (set.has(id)) { set.delete(id); performance.mark(`Timeout-${id}-Destroy`); performance.measure(`Timeout-${id}`, `Timeout-${id}-Init`, `Timeout-${id}-Destroy`); } }, }); hook.enable(); const obs = new PerformanceObserver((list, observer) => { console.log(list.getEntries()[0]); performance.clearMarks(); performance.clearMeasures(); observer.disconnect(); }); obs.observe({ entryTypes: ['measure'] }); setTimeout(() => {}, 1000); ``` ### Measuring how long it takes to load dependencies The following example measures the duration of `require()` operations to load dependencies: ```mjs import { performance, PerformanceObserver } from 'node:perf\_hooks'; // Activate the observer const obs = new PerformanceObserver((list) => { const entries = list.getEntries(); entries.forEach((entry) => { console.log(`import('${entry[0]}')`, entry.duration); }); performance.clearMarks(); performance.clearMeasures(); obs.disconnect(); }); obs.observe({ entryTypes: ['function'], buffered: true }); const timedImport = performance.timerify(async (module) => { return await import(module); }); await timedImport('some-module'); ``` ```cjs 'use strict'; const { performance, PerformanceObserver, } = require('node:perf\_hooks'); const mod = require('node:module'); // Monkey patch the require function mod.Module.prototype.require = performance.timerify(mod.Module.prototype.require); require = performance.timerify(require); // Activate the observer const obs = new PerformanceObserver((list) => { const entries = list.getEntries(); entries.forEach((entry) => { console.log(`require('${entry[0]}')`, entry.duration); }); performance.clearMarks(); performance.clearMeasures(); obs.disconnect(); }); obs.observe({ entryTypes: ['function'] }); require('some-module'); ``` ### Measuring how long one HTTP round-trip takes The following example is used to trace the time spent by HTTP client (`OutgoingMessage`) and HTTP request (`IncomingMessage`). For HTTP client, it means the time interval between starting the request and receiving the response, and for HTTP request, it means the time interval between receiving the request and sending the response: ```mjs import { PerformanceObserver } from 'node:perf\_hooks'; import { createServer, get } from 'node:http'; const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['http'] }); const PORT = 8080; createServer((req, res) => { res.end('ok'); }).listen(PORT, () => { get(`http://127.0.0.1:${PORT}`); }); ``` ```cjs 'use strict'; const { PerformanceObserver } = require('node:perf\_hooks'); const http = require('node:http'); const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['http'] }); const PORT = 8080; http.createServer((req, res) => { res.end('ok'); }).listen(PORT, () => { http.get(`http://127.0.0.1:${PORT}`); }); ``` ### Measuring how long the `net.connect` (only for TCP) takes when the connection is successful ```mjs import { PerformanceObserver } from 'node:perf\_hooks'; import { connect, createServer } from 'node:net'; const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['net'] }); const PORT = 8080; createServer((socket) => { socket.destroy(); }).listen(PORT, () => { connect(PORT); }); ``` ```cjs 'use strict'; const { PerformanceObserver } = require('node:perf\_hooks'); const net = require('node:net'); const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ | https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md | main | nodejs | [
0.00607991311699152,
0.10013846307992935,
-0.08275890350341797,
0.08371997624635696,
-0.06647796183824539,
-0.016961848363280296,
0.009137812070548534,
0.032321661710739136,
0.02340538613498211,
-0.07180912792682648,
-0.08620372414588928,
0.017174014821648598,
0.006113703828305006,
-0.08800949156284332,
-0.052084583789110184,
-0.03954201936721802,
-0.011700153350830078,
0.009371699765324593,
-0.05803558975458145,
-0.12085732817649841,
0.036354366689920425,
-0.0174686498939991,
0.04376878961920738,
0.00353367836214602,
-0.0035781252663582563,
-0.04178706184029579,
-0.09543460607528687,
-0.05289758741855621,
0.058183569461107254,
-0.0020568305626511574,
0.0036362423561513424,
-0.08661708235740662,
-0.040216341614723206,
0.04334612563252449,
-0.06083574518561363,
0.05981889367103577,
-0.012016416527330875,
0.0016426137881353498,
-0.01091106329113245,
0.009937399998307228,
0.09296407550573349,
0.06612811237573624,
-0.08017697185277939,
-0.026360023766756058,
0.008771940134465694,
0.025406476110219955,
-0.06604024767875671,
-0.09032715857028961,
-0.08044169843196869,
0.0733683630824089,
-0.0165652334690094,
0.08781357109546661,
-0.020378299057483673,
0.01853804476559162,
0.002966236090287566,
0.03273741528391838,
0.042569179087877274,
0.019716955721378326,
-0.024573994800448418,
0.012779290787875652,
-0.007651126477867365,
-0.03317546471953392,
0.0194854736328125,
-0.011018132790923119,
0.026770321652293205,
-0.011976473964750767,
0.04013063758611679,
0.0692039504647255,
0.03261939808726311,
0.05411355942487717,
0.026564041152596474,
0.07804781198501587,
0.00731467641890049,
0.010882098227739334,
-0.03900584205985069,
-0.030979901552200317,
-0.034035827964544296,
0.03519448637962341,
-0.03354683145880699,
-0.04158681258559227,
-0.02604035846889019,
-0.06792110949754715,
-0.05362857133150101,
-0.015452267602086067,
-0.000616743927821517,
0.02309834025800228,
0.04327256232500076,
0.01924646459519863,
-0.006776168942451477,
-0.018231533467769623,
-0.04907515272498131,
0.013107254169881344,
-0.13385725021362305,
-0.024588800966739655,
-0.013613519258797169,
0.06395935267210007,
0.06207437068223953,
0.04180624336004257,
0.012195533141493797,
-0.004451934713870287,
0.02769436314702034,
0.017018258571624756,
-0.055385950952768326,
0.03502611443400383,
0.08766618371009827,
-0.022553516551852226,
-0.00023588346084579825,
-0.040898505598306656,
-0.03778417408466339,
0.04756822809576988,
0.057134438306093216,
0.05103086680173874,
0.055763550102710724,
0.008819501847028732,
0.09477455168962479,
0.1080232784152031,
-0.009854625910520554,
0.009411460720002651,
0.05271317809820175,
0.026463933289051056,
0.11338667571544647,
0.01744643971323967,
-0.006977141834795475,
-0.042342036962509155,
-0.017107367515563965,
-0.003696592291817069,
0.06910152733325958,
4.415264780231994e-33,
-0.02141178958117962,
-0.050357844680547714,
-0.007245676126331091,
-0.039862245321273804,
0.01702970266342163,
0.011624403297901154,
-0.07494475692510605,
-0.030910596251487732,
-0.028891056776046753,
-0.008048025891184807,
-0.08395475894212723,
0.043740082532167435,
0.016708964481949806,
-0.051273833960294724,
-0.007878902368247509,
0.004530294332653284,
0.04095471277832985,
-0.056221093982458115,
0.03738079592585564,
-0.008092273026704788,
0.0258758794516325,
-0.04272879660129547,
-0.03831637278199196,
0.09521445631980896,
0.027218446135520935,
-0.03579123318195343,
-0.006814103107899427,
0.039119377732276917,
-0.09375018626451492,
0.01834113709628582,
0.0010588675504550338,
0.08269774168729782,
-0.06983771920204163,
-0.02652144804596901,
0.05270322412252426,
-0.10250925272703171,
-0.022533433511853218,
0.024421662092208862,
-0.0103327427059412,
-0.037498485296964645,
-0.019749371334910393,
0.036988865584135056,
-0.11963087320327759,
-0.02870171144604683,
-0.15064315497875214,
-0.09734353423118591,
0.023983024060726166,
0.026527905836701393,
0.020233191549777985,
-0.010036641731858253,
0.031127333641052246,
0.009782630950212479,
0.045024994760751724,
-0.06762493401765823,
0.013665207661688328,
0.025989005342125893,
0.1137465238571167,
-0.0250169038772583,
0.031611159443855286,
0.20083150267601013,
0.05918579548597336,
-0.013887757435441017,
0.038639988750219345,
0.027706041932106018,
-0.023279979825019836,
0.06889951974153519,
-0.0416409932076931,
0.0762372612953186,
-0.013439889997243881,
-0.05958438664674759,
-0.0013433877611532807,
-0.01120068971067667,
-0.007702337112277746,
-0.008044660091400146,
0.028744271025061607,
-0.06700543314218521,
-0.0486086867749691,
-0.007447754964232445,
-0.1261192262172699,
-0.05043836683034897,
0.08196938782930374,
-0.04988716170191765,
-0.05829431116580963,
-0.01413979846984148,
0.056961540132761,
0.03611195087432861,
0.02547631599009037,
-0.04331028833985329,
-0.04860500246286392,
0.04444141685962677,
-0.030318619683384895,
0.0011155623942613602,
0.06165530905127525,
-0.10015629231929779,
-0.07530158758163452,
-6.009713031869022e-33,
-0.015367588959634304,
0.01383286714553833,
-0.02161804959177971,
0.07888081669807434,
0.061821453273296356,
-0.002056335099041462,
0.043950993567705154,
0.08744041621685028,
-0.008167813532054424,
0.039316680282354355,
-0.048556361347436905,
-0.03812002018094063,
-0.025912506505846977,
-0.002441016724333167,
-0.026109904050827026,
-0.009559879079461098,
0.018001198768615723,
-0.04659130051732063,
0.006834571249783039,
0.012948401272296906,
0.049799639731645584,
-0.014660723507404327,
0.028638944029808044,
0.02288941666483879,
-0.0984015092253685,
0.02542557194828987,
-0.038304705172777176,
0.01132477167993784,
-0.001128198578953743,
-0.14314958453178406,
0.0010974938049912453,
-0.07600531727075577,
-0.01600046642124653,
0.015912756323814392,
0.015323559753596783,
-0.08506561070680618,
0.05639469996094704,
0.036932144314050674,
-0.0031059659086167812,
0.00510556623339653,
0.1029711589217186,
0.010838030837476254,
-0.0703827291727066,
-0.026246843859553337,
0.006845368538051844,
0.07069104164838791,
-0.10554446280002594,
0.05517233535647392,
-0.007718950510025024,
-0.02041085809469223,
-0.0023054343182593584,
-0.02434704080224037,
-0.021118292585015297,
0.12823587656021118,
-0.014194067567586899,
0.001381853362545371,
-0.001864339574240148,
-0.040811944752931595,
0.08256671577692032,
0.0855262354016304,
-0.015399052761495113,
-0.0983065813779831,
0.07601171731948853,
0.018109207972884178,
0.03820900619029999,
0.018788324669003487,
0.02084573172032833,
-0.073040671646595,
0.014449255540966988,
0.09068021923303604,
0.024211816489696503,
0.04397079721093178,
-0.017602112144231796,
-0.012186387553811073,
-0.0398983433842659,
0.06604811549186707,
-0.10294736176729202,
-0.09904993325471878,
0.006165570113807917,
0.012959196232259274,
-0.06222406402230263,
0.005625560879707336,
0.048774708062410355,
-0.007136560045182705,
-0.04097632318735123,
0.05141499638557434,
0.01360328122973442,
0.06269533932209015,
0.00828626099973917,
-0.0008155613322742283,
0.05217817798256874,
0.057898011058568954,
-0.1554061323404312,
0.01457152608782053,
0.023996682837605476,
-5.423094862067046e-8,
-0.06116725876927376,
-0.06685405969619751,
-0.0011153258383274078,
0.03524269163608551,
0.018692491576075554,
-0.03918822109699249,
-0.0007366562495008111,
0.03293922170996666,
0.04089798405766487,
-0.04200900346040726,
0.11119459569454193,
-0.05184224992990494,
0.03733108937740326,
-0.02186804823577404,
-0.043568000197410583,
-0.009038562886416912,
0.039911672472953796,
-0.029635736718773842,
0.02738281525671482,
0.03836195543408394,
-0.011030376888811588,
-0.005499972030520439,
0.014978148974478245,
-0.023357797414064407,
-0.03400995954871178,
-0.006423470098525286,
0.05112273618578911,
0.06743751466274261,
0.012087901122868061,
-0.09906314313411713,
-0.02807011269032955,
-0.0032193311490118504,
0.030873805284500122,
0.03971618041396141,
-0.052050311118364334,
-0.07039067149162292,
-0.013580184429883957,
0.018030868843197823,
0.10845628380775452,
0.03819628432393074,
0.01974181830883026,
0.004119067918509245,
-0.05278642475605011,
0.0690004751086235,
0.038736000657081604,
-0.00592483626678586,
-0.013940038159489632,
0.029426932334899902,
-0.0004028771072626114,
0.04873371869325638,
0.040408406406641006,
-0.07233139127492905,
0.0455356240272522,
-0.06651385873556137,
0.005105284508317709,
-0.07703811675310135,
0.009382721967995167,
-0.06929153949022293,
0.010548715479671955,
0.06491664052009583,
-0.019139982759952545,
-0.07418300211429596,
-0.031548451632261276,
0.014162504114210606
] | 0.07888 |
{ console.log(item); }); }); obs.observe({ entryTypes: ['net'] }); const PORT = 8080; createServer((socket) => { socket.destroy(); }).listen(PORT, () => { connect(PORT); }); ``` ```cjs 'use strict'; const { PerformanceObserver } = require('node:perf\_hooks'); const net = require('node:net'); const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['net'] }); const PORT = 8080; net.createServer((socket) => { socket.destroy(); }).listen(PORT, () => { net.connect(PORT); }); ``` ### Measuring how long the DNS takes when the request is successful ```mjs import { PerformanceObserver } from 'node:perf\_hooks'; import { lookup, promises } from 'node:dns'; const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['dns'] }); lookup('localhost', () => {}); promises.resolve('localhost'); ``` ```cjs 'use strict'; const { PerformanceObserver } = require('node:perf\_hooks'); const dns = require('node:dns'); const obs = new PerformanceObserver((items) => { items.getEntries().forEach((item) => { console.log(item); }); }); obs.observe({ entryTypes: ['dns'] }); dns.lookup('localhost', () => {}); dns.promises.resolve('localhost'); ``` [Async Hooks]: async\_hooks.md [Fetch Response Body Info]: https://fetch.spec.whatwg.org/#response-body-info [Fetch Timing Info]: https://fetch.spec.whatwg.org/#fetch-timing-info [High Resolution Time]: https://www.w3.org/TR/hr-time-2 [Performance Timeline]: https://w3c.github.io/performance-timeline/ [Resource Timing]: https://www.w3.org/TR/resource-timing-2/ [User Timing]: https://www.w3.org/TR/user-timing/ [Web Performance APIs]: https://w3c.github.io/perf-timing-primer/ [Worker threads]: worker\_threads.md#worker-threads [`'exit'`]: process.md#event-exit [`child\_process.spawnSync()`]: child\_process.md#child\_processspawnsynccommand-args-options [`perf\_hooks.eventLoopUtilization()`]: #perf\_hookseventlooputilizationutilization1-utilization2 [`perf\_hooks.timerify()`]: #perf\_hookstimerifyfn-options [`process.hrtime()`]: process.md#processhrtimetime [`timeOrigin`]: https://w3c.github.io/hr-time/#dom-performance-timeorigin [`window.performance.toJSON`]: https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON [`window.performance`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/performance | https://github.com/nodejs/node/blob/main//doc/api/perf_hooks.md | main | nodejs | [
-0.03481829911470413,
0.059721820056438446,
-0.037207022309303284,
0.052334945648908615,
-0.03006690926849842,
-0.06855729222297668,
0.064482681453228,
-0.014217235147953033,
0.0713295266032219,
0.022315166890621185,
-0.04648972675204277,
-0.003562884172424674,
-0.06587335467338562,
-0.025970537215471268,
0.01007317379117012,
0.017849138006567955,
0.016040192916989326,
-0.04222962260246277,
-0.014651511795818806,
-0.08117099851369858,
0.0020215543918311596,
-0.028523333370685577,
0.015184901654720306,
-0.04834019020199776,
-0.09551472961902618,
0.014528402127325535,
-0.016484033316373825,
0.009501277469098568,
0.0910225510597229,
-0.0035491224844008684,
0.023530853912234306,
-0.05558113753795624,
-0.10283171385526657,
0.079027459025383,
-0.027478933334350586,
0.021134549751877785,
-0.0246158167719841,
-0.06774904578924179,
-0.058306433260440826,
-0.00013990336447022855,
0.13201409578323364,
0.09122804552316666,
-0.007358849048614502,
-0.04115713760256767,
0.046789564192295074,
-0.030606970191001892,
-0.0680452510714531,
0.004608135670423508,
-0.018970686942338943,
-0.06927653402090073,
-0.03740621730685234,
-0.006917925551533699,
-0.02348707988858223,
-0.010870641097426414,
0.05551443621516228,
0.021032260730862617,
-0.06637521088123322,
-0.03236376494169235,
-0.03086826205253601,
0.0025103276129812002,
0.07217131555080414,
-0.060812514275312424,
0.01874539814889431,
-0.044097498059272766,
0.02073049172759056,
0.03474830836057663,
0.02699514664709568,
0.06166059523820877,
-0.0027197985909879208,
0.03463410213589668,
-0.059295404702425,
0.031286634504795074,
-0.07302595674991608,
0.013474125415086746,
-0.01989450491964817,
-0.01043168269097805,
0.002361102495342493,
-0.06531867384910583,
-0.07909882068634033,
-0.02946004830300808,
-0.061337586492300034,
-0.04735909029841423,
-0.09223848581314087,
0.03952430188655853,
-0.010458022356033325,
0.05496115982532501,
0.012043504044413567,
-0.03075205162167549,
-0.002626818371936679,
-0.0019746427424252033,
-0.11531829833984375,
0.031690213829278946,
-0.04441485553979874,
0.03815854713320732,
0.04061602056026459,
0.06612890958786011,
0.009145011194050312,
0.005427519325166941,
-0.040462568402290344,
0.07713985443115234,
0.030770165845751762,
0.019382372498512268,
-0.01800946332514286,
0.0028929137624800205,
-0.012062246911227703,
-0.04316801577806473,
-0.02654009871184826,
0.042544156312942505,
-0.038423068821430206,
0.06340792030096054,
-0.03033839911222458,
0.09644471853971481,
-0.0026825268287211657,
0.03572234511375427,
-0.05030079931020737,
-0.01098146103322506,
0.06742212921380997,
0.020455729216337204,
0.040982864797115326,
0.08055633306503296,
0.08166801929473877,
-0.006993674207478762,
-0.012584876269102097,
-0.031902510672807693,
0.006792260799556971,
0.025469155982136726,
0.07613157480955124,
2.76337562980005e-33,
0.007622025441378355,
-0.08929064124822617,
-0.021756287664175034,
-0.00978046003729105,
0.024448445066809654,
0.033001672476530075,
0.03620406240224838,
0.05069657787680626,
-0.023408357053995132,
0.05628682300448418,
-0.07562465965747833,
-0.004027124959975481,
0.02702418901026249,
-0.06893683224916458,
0.08488719910383224,
-0.00427189189940691,
0.08169320970773697,
0.0332724004983902,
0.06696760654449463,
0.04678508639335632,
0.027216190472245216,
-0.09019099175930023,
-0.04614942520856857,
-0.008617321029305458,
0.0314171127974987,
-0.04186907038092613,
-0.03819343447685242,
0.06235912814736366,
-0.1064378097653389,
-0.023785004392266273,
0.11357903480529785,
0.03012409806251526,
-0.03601669892668724,
0.04419005289673805,
0.018126877024769783,
-0.06399635225534439,
0.077521912753582,
0.03334598243236542,
-0.04041190817952156,
-0.0913057029247284,
0.03260878100991249,
-0.021331122145056725,
-0.08893603831529617,
0.060484323650598526,
-0.06078016757965088,
-0.07654416561126709,
-0.09646093845367432,
-0.006076800171285868,
0.022244222462177277,
0.04291849955916405,
0.00820104405283928,
0.027963193133473396,
0.021992595866322517,
-0.04492687061429024,
0.025527317076921463,
0.019053271040320396,
0.0157773420214653,
0.06611491739749908,
-0.022923070937395096,
0.07920775562524796,
-0.020928334444761276,
0.00031991719151847064,
-0.05405912548303604,
-0.03573060408234596,
0.04351145029067993,
0.04585401713848114,
-0.026062380522489548,
-0.019777853041887283,
0.005029686260968447,
-0.03661077842116356,
-0.013898098841309547,
0.02642766758799553,
0.028335517272353172,
0.0052777803502976894,
0.004228085745126009,
0.009424126707017422,
-0.07144511491060257,
0.02588687092065811,
0.00031417087302543223,
-0.07293113321065903,
0.013584578409790993,
0.028203798457980156,
-0.039394356310367584,
0.07935408502817154,
0.05591966584324837,
0.016207432374358177,
-0.018395883962512016,
-0.06613507866859436,
0.06222890317440033,
0.034684278070926666,
-0.03413621708750725,
0.02933073230087757,
0.033139917999506,
-0.07865319401025772,
-0.08820132911205292,
-3.991097929313341e-33,
-0.03610517829656601,
0.002436609473079443,
-0.09337194263935089,
0.000012721712664642837,
0.025357535108923912,
-0.05514184385538101,
-0.049138545989990234,
0.02809935063123703,
-0.05769332870841026,
-0.008602394722402096,
0.06075529009103775,
-0.02484719082713127,
0.02759154513478279,
0.026431869715452194,
0.040264081209897995,
-0.006712128408253193,
-0.05990579351782799,
-0.03976068273186684,
0.08850717544555664,
-0.007225047331303358,
-0.024112055078148842,
0.07722298800945282,
0.09253902733325958,
-0.041047900915145874,
-0.08462077379226685,
0.003967187833040953,
0.010743762366473675,
0.02140224538743496,
-0.09324432164430618,
-0.08100694417953491,
-0.0048781028017401695,
0.026756545528769493,
-0.027686897665262222,
0.08458007127046585,
0.014360707253217697,
-0.007853759452700615,
0.07577710598707199,
0.07304786890745163,
0.04900803789496422,
-0.0038774108979851007,
0.048635903745889664,
-0.04339873418211937,
-0.10411678999662399,
-0.0031692965421825647,
-0.023080840706825256,
-0.006512689404189587,
-0.033800262957811356,
0.04411274194717407,
-0.0230450090020895,
0.03432317078113556,
0.018952960148453712,
-0.01916659064590931,
0.04164688289165497,
0.06491895020008087,
-0.004317823331803083,
0.05114371329545975,
0.03929877653717995,
-0.1266428828239441,
0.09190047532320023,
0.06140349060297012,
0.042992692440748215,
-0.19969294965267181,
-0.0028432991821318865,
0.10109143704175949,
0.1182217076420784,
-0.018762731924653053,
-0.07194162905216217,
-0.009919545613229275,
0.06312212347984314,
-0.006208145059645176,
0.0009229707648046315,
0.08516386896371841,
-0.03572298586368561,
-0.0008808043785393238,
0.014743234030902386,
-0.034283868968486786,
0.012891273945569992,
-0.05176896974444389,
0.02197341062128544,
0.09387023001909256,
-0.10213018953800201,
0.09367577731609344,
-0.039583586156368256,
-0.08319895714521408,
0.015021092258393764,
0.007730063050985336,
-0.010173593647778034,
0.004592187702655792,
0.0012595554580911994,
0.012670695781707764,
-0.016942908987402916,
0.007639221381396055,
-0.08686638623476028,
0.001136888051405549,
-0.018174104392528534,
-4.7761226085185626e-8,
-0.096806600689888,
-0.003467324422672391,
-0.04538517817854881,
0.08021576702594757,
0.04530002176761627,
0.03707541152834892,
-0.043128177523612976,
-0.0420086532831192,
0.01808522827923298,
-0.027005717158317566,
0.0010333898244425654,
-0.014918086118996143,
0.015115082263946533,
0.005477513652294874,
0.08225962519645691,
-0.07878325879573822,
0.016387782990932465,
-0.03549642860889435,
-0.03021293319761753,
0.009838419035077095,
0.02024970017373562,
-0.00014189619105309248,
0.04433353617787361,
0.017268337309360504,
0.02048080414533615,
-0.07017434388399124,
0.13235437870025635,
0.06440673023462296,
-0.038055941462516785,
0.08628185093402863,
-0.0973823294043541,
0.02905752696096897,
0.06391684710979462,
0.03535434603691101,
-0.02590639889240265,
-0.010007994249463081,
-0.07710754126310349,
0.004798600450158119,
0.02949221432209015,
0.0515168160200119,
0.03051462024450302,
0.0006111388793215156,
-0.09313537180423737,
0.08285540342330933,
0.09483499079942703,
-0.013982758857309818,
0.014290917664766312,
0.04095073789358139,
0.09889665991067886,
-0.04130658134818077,
-0.011825843714177608,
-0.0571022629737854,
-0.020741993561387062,
-0.06270861625671387,
-0.07864963263273239,
-0.03182968497276306,
0.012288874946534634,
-0.08233189582824707,
-0.022320637479424477,
0.07196766138076782,
0.040252018719911575,
0.042207926511764526,
-0.0496286079287529,
-0.008662132546305656
] | 0.082233 |
# Trace events > Stability: 1 - Experimental The `node:trace\_events` module provides a mechanism to centralize tracing information generated by V8, Node.js core, and userspace code. Tracing can be enabled with the `--trace-event-categories` command-line flag or by using the `node:trace\_events` module. The `--trace-event-categories` flag accepts a list of comma-separated category names. The available categories are: \* `node`: An empty placeholder. \* `node.async\_hooks`: Enables capture of detailed [`async\_hooks`][] trace data. The [`async\_hooks`][] events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. \* `node.bootstrap`: Enables capture of Node.js bootstrap milestones. \* `node.console`: Enables capture of `console.time()` and `console.count()` output. \* `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node\_api`. \* `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node\_api`. \* `node.dns.native`: Enables capture of trace data for DNS queries. \* `node.net.native`: Enables capture of trace data for network. \* `node.environment`: Enables capture of Node.js Environment milestones. \* `node.fs.sync`: Enables capture of trace data for file system sync methods. \* `node.fs\_dir.sync`: Enables capture of trace data for file system sync directory methods. \* `node.fs.async`: Enables capture of trace data for file system async methods. \* `node.fs\_dir.async`: Enables capture of trace data for file system async directory methods. \* `node.perf`: Enables capture of [Performance API][] measurements. \* `node.perf.usertiming`: Enables capture of only Performance API User Timing measures and marks. \* `node.perf.timerify`: Enables capture of only Performance API timerify measurements. \* `node.promises.rejections`: Enables capture of trace data tracking the number of unhandled Promise rejections and handled-after-rejections. \* `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. \* `v8`: The [V8][] events are GC, compiling, and execution related. \* `node.http`: Enables capture of trace data for http request / response. \* `node.module\_timer`: Enables capture of trace data for CJS Module loading. By default the `node`, `node.async\_hooks`, and `v8` categories are enabled. ```bash node --trace-event-categories v8,node,node.async\_hooks server.js ``` Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag \_may\_ still be used and will enable the `node`, `node.async\_hooks`, and `v8` trace event categories by default. ```bash node --trace-events-enabled # is equivalent to node --trace-event-categories v8,node,node.async\_hooks ``` Alternatively, trace events may be enabled using the `node:trace\_events` module: ```mjs import { createTracing } from 'node:trace\_events'; const tracing = createTracing({ categories: ['node.perf'] }); tracing.enable(); // Enable trace event capture for the 'node.perf' category // do work tracing.disable(); // Disable trace event capture for the 'node.perf' category ``` ```cjs const { createTracing } = require('node:trace\_events'); const tracing = createTracing({ categories: ['node.perf'] }); tracing.enable(); // Enable trace event capture for the 'node.perf' category // do work tracing.disable(); // Disable trace event capture for the 'node.perf' category ``` Running Node.js with tracing enabled will produce log files that can be opened in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. The logging file is by default called `node\_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can be specified with `--trace-event-file-pattern` that accepts a template string that supports `${rotation}` and `${pid}`: ```bash node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js ``` To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers in your code, such as: ```js process.on('SIGINT', function onSigint() { console.info('Received SIGINT.'); process.exit(130); // Or applicable exit code depending on OS and signal }); ``` The tracing system uses the same time source as the one used by `process.hrtime()`. However the trace-event timestamps are expressed in microseconds, unlike `process.hrtime()` which returns nanoseconds. The | https://github.com/nodejs/node/blob/main//doc/api/tracing.md | main | nodejs | [
-0.024928158149123192,
-0.03699924424290657,
-0.042380187660455704,
0.09445595741271973,
0.13107484579086304,
-0.05670994892716408,
0.010744395665824413,
-0.025131162256002426,
0.03689618408679962,
-0.03737763315439224,
-0.03337825462222099,
0.005009045358747244,
-0.06276539713144302,
-0.07049287855625153,
-0.03277305141091347,
0.027751922607421875,
-0.06095629557967186,
0.048586271703243256,
-0.050983890891075134,
-0.09310664236545563,
-0.02226891927421093,
-0.08534873276948929,
0.014911781065165997,
0.013549148105084896,
-0.043940890580415726,
0.0034120192285627127,
-0.025136183947324753,
-0.02160850539803505,
0.034345537424087524,
-0.03814246878027916,
-0.015618895180523396,
-0.060445066541433334,
-0.06911248713731766,
-0.000708947831299156,
0.0026194783858954906,
0.04508218541741371,
0.017821570858359337,
-0.038786351680755615,
-0.023678243160247803,
-0.058492954820394516,
0.07392916083335876,
0.05563480034470558,
0.014454196207225323,
-0.057215362787246704,
0.01209594588726759,
-0.09674480557441711,
-0.09689649939537048,
-0.023746930062770844,
-0.10640198737382889,
0.029570475220680237,
0.02883322723209858,
-0.027443701401352882,
0.00912146270275116,
-0.004375393968075514,
-0.015705445781350136,
0.05883367732167244,
0.06391465663909912,
-0.07954039424657822,
0.00003967737211496569,
-0.023794271051883698,
-0.011575480923056602,
-0.023395130410790443,
-0.004969341214746237,
0.023088639602065086,
0.042167603969573975,
0.06582541763782501,
0.007902028039097786,
-0.0033872711937874556,
0.08502611517906189,
0.05831068381667137,
-0.048108723014593124,
0.0362999401986599,
-0.0441003181040287,
-0.02133413590490818,
-0.023121792823076248,
0.016747625544667244,
-0.05081259459257126,
0.05781945958733559,
-0.06363803148269653,
-0.04070834070444107,
-0.018528973683714867,
-0.003292647423222661,
0.03574078157544136,
0.06132471188902855,
0.016406923532485962,
0.12056072056293488,
-0.06775373965501785,
0.007558085490018129,
-0.011836477555334568,
0.036766909062862396,
-0.0828947126865387,
-0.009506353177130222,
0.03675684332847595,
0.04681890457868576,
-0.05776695907115936,
0.06606974452733994,
0.07997450977563858,
0.07386479526758194,
0.02649569697678089,
-0.000259180786088109,
-0.020339496433734894,
0.03537043184041977,
0.0012753005139529705,
0.012706823647022247,
0.0160391703248024,
0.019330881536006927,
-0.04036813974380493,
-0.07229303568601608,
-0.047810379415750504,
0.003161478554829955,
-0.0009623116930015385,
0.023044077679514885,
-0.005792072508484125,
0.008959965780377388,
0.0807700976729393,
0.03767162561416626,
0.05337543040513992,
0.04028628394007683,
0.057452745735645294,
0.09820739924907684,
0.17864380776882172,
0.04199787974357605,
0.0017668147338554263,
-0.017413172870874405,
0.09679065644741058,
0.008701050654053688,
0.009088398888707161,
1.5042311724278291e-33,
0.08219988644123077,
-0.03778712451457977,
-0.03677257522940636,
0.05834125354886055,
0.0203995443880558,
0.05062549561262131,
-0.007757586892694235,
-0.034629128873348236,
-0.027765797451138496,
0.09094827622175217,
-0.0005436516948975623,
0.042249396443367004,
-0.03553060442209244,
-0.07253314554691315,
0.06332217901945114,
-0.0120844142511487,
0.039275601506233215,
-0.010518464259803295,
0.004148085601627827,
0.015103353187441826,
-0.03414921462535858,
-0.04179811105132103,
-0.06591791659593582,
0.036293357610702515,
0.12249402701854706,
0.04584311693906784,
-0.023808972910046577,
0.12287182360887527,
-0.04738454520702362,
0.00609640683978796,
0.03792232275009155,
0.00473238667473197,
-0.004667348228394985,
0.029615292325615883,
0.011292117647826672,
-0.04270845651626587,
-0.055202044546604156,
-0.01802484691143036,
-0.07823014259338379,
0.018263263627886772,
0.003592779627069831,
-0.026866551488637924,
-0.09395676106214523,
-0.058865804225206375,
-0.06460458785295486,
-0.1060735434293747,
-0.07579386234283447,
0.00935765914618969,
0.07958555966615677,
-0.07457203418016434,
-0.001372211379930377,
0.059927552938461304,
0.040657028555870056,
-0.1012180745601654,
0.0724649503827095,
0.025050338357686996,
0.031284209340810776,
-0.03421424329280853,
-0.009930944070219994,
0.12821662425994873,
0.07019728422164917,
-0.03190933167934418,
-0.01707572489976883,
0.012556111440062523,
-0.013267934322357178,
0.053220152854919434,
-0.017044002190232277,
-0.03271433711051941,
0.02137664519250393,
0.05544712021946907,
-0.05886742100119591,
0.05718667432665825,
0.05789168179035187,
-0.004577194340527058,
0.06240890920162201,
-0.008916947059333324,
-0.11660312861204147,
-0.013234853744506836,
-0.04957849532365799,
-0.01098698005080223,
0.011754738166928291,
-0.11354614049196243,
-0.03660353645682335,
0.061798155307769775,
0.02935071289539337,
-0.004026720765978098,
-0.05123487114906311,
-0.02197178266942501,
-0.04233873263001442,
0.04539536312222481,
0.017439542338252068,
0.00043969342368654907,
0.02826877124607563,
-0.038476940244436264,
-0.09966332465410233,
-4.31997847347037e-33,
-0.027467031031847,
0.018173620104789734,
-0.05014202743768692,
0.06632549315690994,
-0.06091781333088875,
-0.04128043353557587,
-0.0401248000562191,
-0.030620038509368896,
-0.01202799566090107,
0.025578586384654045,
-0.03269567713141441,
0.03291838988661766,
-0.07685478031635284,
0.04585238918662071,
0.07483669370412827,
0.08133556693792343,
-0.05237628519535065,
-0.044528353959321976,
0.05844675004482269,
-0.051894091069698334,
0.023484541103243828,
-0.008734374307096004,
-0.0026849014684557915,
0.0027876023668795824,
-0.037132181227207184,
-0.0776316374540329,
0.05709642916917801,
-0.05427102744579315,
0.006811139639467001,
-0.06252474337816238,
-0.0383315272629261,
0.03742028772830963,
-0.021274523809552193,
0.053254447877407074,
0.029639001935720444,
-0.0876132920384407,
0.005910118110477924,
0.015113859437406063,
0.029408294707536697,
-0.03597380965948105,
0.060674913227558136,
0.04135264828801155,
-0.06202356517314911,
-0.04241932928562164,
-0.03237680345773697,
0.020987439900636673,
-0.08178196102380753,
0.0944397896528244,
-0.0028568883426487446,
0.0032958583906292915,
0.01355329342186451,
-0.056259285658597946,
0.03751562535762787,
0.04709192365407944,
0.00029652551165781915,
0.08910783380270004,
0.044701579958200455,
-0.07004246115684509,
0.01664702408015728,
0.04270587116479874,
-0.030241630971431732,
-0.07292985916137695,
-0.05214054882526398,
0.021391330286860466,
0.06445571035146713,
-0.01969437301158905,
-0.03564295172691345,
-0.05030326545238495,
-0.021431658416986465,
0.04940130189061165,
0.029915323480963707,
-0.0445687398314476,
-0.09352867305278778,
0.006151994224637747,
-0.019570685923099518,
0.0029241731390357018,
-0.015346414409577847,
-0.17739997804164886,
0.008049299009144306,
-0.003583672922104597,
-0.05776694416999817,
-0.01804105006158352,
0.03762250021100044,
-0.024897990748286247,
0.03724832460284233,
0.04750511422753334,
-0.038719505071640015,
0.1262231171131134,
0.047501228749752045,
0.01558852568268776,
0.03448782116174698,
-0.0018953816033899784,
-0.09464114159345627,
-0.05411701649427414,
-0.05453997477889061,
-5.3281524969861493e-8,
-0.08432082086801529,
0.017976917326450348,
-0.08822537213563919,
0.009500031359493732,
0.07976865768432617,
0.039056841284036636,
0.052637919783592224,
0.028548037633299828,
0.006443102844059467,
0.024297956377267838,
-0.02589154988527298,
0.03405606746673584,
-0.0020286072976887226,
-0.0035441629588603973,
0.04516790434718132,
0.01646692305803299,
-0.01906224526464939,
0.07148583978414536,
-0.04397670179605484,
-0.024724585935473442,
0.010415088385343552,
0.02284575067460537,
-0.0702345222234726,
0.026455963030457497,
-0.06368657946586609,
-0.06431511044502258,
0.05838947370648384,
0.17594823241233826,
0.040532976388931274,
-0.03913382813334465,
-0.04810231551527977,
0.006793720182031393,
0.035378314554691315,
-0.043500322848558426,
-0.023527266457676888,
0.0472603365778923,
0.007610361557453871,
-0.06523604691028595,
0.09009522199630737,
0.05652501806616783,
0.04836098104715347,
0.021708128973841667,
-0.021503066644072533,
0.029189422726631165,
-0.023091398179531097,
-0.019053583964705467,
-0.06257051974534988,
-0.006464347708970308,
0.03449186310172081,
0.04704179987311363,
-0.06148720160126686,
-0.060837000608444214,
-0.0231140349060297,
0.06448288261890411,
-0.011513860896229744,
-0.019142214208841324,
0.04609408974647522,
-0.05268186330795288,
0.02035101316869259,
0.03406945988535881,
0.0518459677696228,
-0.03218957409262657,
0.04741030931472778,
-0.02949712984263897
] | 0.117817 |
such as: ```js process.on('SIGINT', function onSigint() { console.info('Received SIGINT.'); process.exit(130); // Or applicable exit code depending on OS and signal }); ``` The tracing system uses the same time source as the one used by `process.hrtime()`. However the trace-event timestamps are expressed in microseconds, unlike `process.hrtime()` which returns nanoseconds. The features from this module are not available in [`Worker`][] threads. ## The `node:trace\_events` module ### `Tracing` object The `Tracing` object is used to enable or disable tracing for sets of categories. Instances are created using the `trace\_events.createTracing()` method. When created, the `Tracing` object is disabled. Calling the `tracing.enable()` method adds the categories to the set of enabled trace event categories. Calling `tracing.disable()` will remove the categories from the set of enabled trace event categories. #### `tracing.categories` \* Type: {string} A comma-separated list of the trace event categories covered by this `Tracing` object. #### `tracing.disable()` Disables this `Tracing` object. Only trace event categories \_not\_ covered by other enabled `Tracing` objects and \_not\_ specified by the `--trace-event-categories` flag will be disabled. ```mjs import { createTracing, getEnabledCategories } from 'node:trace\_events'; const t1 = createTracing({ categories: ['node', 'v8'] }); const t2 = createTracing({ categories: ['node.perf', 'node'] }); t1.enable(); t2.enable(); // Prints 'node,node.perf,v8' console.log(getEnabledCategories()); t2.disable(); // Will only disable emission of the 'node.perf' category // Prints 'node,v8' console.log(getEnabledCategories()); ``` ```cjs const { createTracing, getEnabledCategories } = require('node:trace\_events'); const t1 = createTracing({ categories: ['node', 'v8'] }); const t2 = createTracing({ categories: ['node.perf', 'node'] }); t1.enable(); t2.enable(); // Prints 'node,node.perf,v8' console.log(getEnabledCategories()); t2.disable(); // Will only disable emission of the 'node.perf' category // Prints 'node,v8' console.log(getEnabledCategories()); ``` #### `tracing.enable()` Enables this `Tracing` object for the set of categories covered by the `Tracing` object. #### `tracing.enabled` \* Type: {boolean} `true` only if the `Tracing` object has been enabled. ### `trace\_events.createTracing(options)` \* `options` {Object} \* `categories` {string\[]} An array of trace category names. Values included in the array are coerced to a string when possible. An error will be thrown if the value cannot be coerced. \* Returns: {Tracing}. Creates and returns a `Tracing` object for the given set of `categories`. ```mjs import { createTracing } from 'node:trace\_events'; const categories = ['node.perf', 'node.async\_hooks']; const tracing = createTracing({ categories }); tracing.enable(); // do stuff tracing.disable(); ``` ```cjs const { createTracing } = require('node:trace\_events'); const categories = ['node.perf', 'node.async\_hooks']; const tracing = createTracing({ categories }); tracing.enable(); // do stuff tracing.disable(); ``` ### `trace\_events.getEnabledCategories()` \* Returns: {string} Returns a comma-separated list of all currently-enabled trace event categories. The current set of enabled trace event categories is determined by the \_union\_ of all currently-enabled `Tracing` objects and any categories enabled using the `--trace-event-categories` flag. Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async\_hooks,node.perf'` to the console. ```mjs import { createTracing, getEnabledCategories } from 'node:trace\_events'; const t1 = createTracing({ categories: ['node.async\_hooks'] }); const t2 = createTracing({ categories: ['node.perf'] }); const t3 = createTracing({ categories: ['v8'] }); t1.enable(); t2.enable(); console.log(getEnabledCategories()); ``` ```cjs const { createTracing, getEnabledCategories } = require('node:trace\_events'); const t1 = createTracing({ categories: ['node.async\_hooks'] }); const t2 = createTracing({ categories: ['node.perf'] }); const t3 = createTracing({ categories: ['v8'] }); t1.enable(); t2.enable(); console.log(getEnabledCategories()); ``` ## Examples ### Collect trace events data by inspector ```mjs import { Session } from 'node:inspector'; const session = new Session(); session.connect(); function post(message, data) { return new Promise((resolve, reject) => { session.post(message, data, (err, result) => { if (err) reject(new Error(JSON.stringify(err))); else resolve(result); }); }); } async function collect() { const data = []; session.on('NodeTracing.dataCollected', (chunk) => data.push(chunk)); session.on('NodeTracing.tracingComplete', () => { // done }); const traceConfig = { includedCategories: ['v8'] }; await post('NodeTracing.start', { traceConfig }); // do something setTimeout(() => { post('NodeTracing.stop').then(() => { | https://github.com/nodejs/node/blob/main//doc/api/tracing.md | main | nodejs | [
-0.03266077861189842,
-0.0029365750961005688,
-0.027211805805563927,
0.06720510125160217,
0.096824049949646,
-0.09187020361423492,
0.021688057109713554,
-0.003383174305781722,
0.09982020407915115,
-0.04416052997112274,
-0.012294868007302284,
0.0031007195357233286,
-0.11183861643075943,
-0.04315583407878876,
-0.010116061195731163,
-0.040790922939777374,
0.01410061027854681,
-0.0011981019051745534,
-0.02533329464495182,
-0.07859811931848526,
0.05633510276675224,
-0.06879650056362152,
-0.010661273263394833,
0.011446717195212841,
-0.009301605634391308,
-0.07591502368450165,
0.008054595440626144,
0.02113381028175354,
0.06150731444358826,
0.018391573801636696,
-0.001755359349772334,
-0.02866395190358162,
-0.07746745645999908,
-0.0014410990988835692,
0.0012279810616746545,
0.08532983809709549,
0.050344690680503845,
-0.003117647720500827,
-0.043240152299404144,
-0.05356264486908913,
0.04655615985393524,
0.020823204889893532,
-0.02265176549553871,
-0.036920201033353806,
-0.02812059409916401,
-0.05533366650342941,
-0.03932589665055275,
-0.05513396114110947,
-0.13392332196235657,
0.0343158021569252,
-0.012420868501067162,
0.05178112909197807,
-0.007978766225278378,
-0.00815192423760891,
0.0315488837659359,
0.0836024060845375,
0.07778379321098328,
-0.020407021045684814,
-0.014337833970785141,
-0.0303607527166605,
-0.08035194873809814,
-0.02719762921333313,
-0.04084766283631325,
0.008454576134681702,
0.07660603523254395,
0.0045331791043281555,
0.03670962527394295,
-0.04682759568095207,
0.09383644163608551,
-0.004639302846044302,
-0.03463515639305115,
0.05022868141531944,
-0.06544279307126999,
0.010168627835810184,
-0.017042841762304306,
-0.05024561658501625,
-0.03757574409246445,
0.01583775319159031,
-0.02102738618850708,
-0.05353417992591858,
-0.0038341598119586706,
-0.005116408225148916,
0.023538315668702126,
0.038900770246982574,
0.0347641184926033,
0.04791297763586044,
-0.0038161904085427523,
0.09775345027446747,
0.04100579395890236,
0.008630176074802876,
-0.06432754546403885,
0.011287836357951164,
0.013699354603886604,
0.035215478390455246,
0.01746964082121849,
-0.02694527804851532,
0.06879881769418716,
0.15888018906116486,
0.020703479647636414,
-0.011806951835751534,
-0.019548950716853142,
0.039526376873254776,
-0.04894312843680382,
0.07071835547685623,
0.031063389033079147,
0.02299518510699272,
-0.08629629015922546,
0.013629927299916744,
-0.02480684407055378,
0.01570723205804825,
0.05135609582066536,
0.01332754734903574,
-0.010819285176694393,
0.013088962063193321,
0.07232428342103958,
0.06270066648721695,
0.038935184478759766,
0.0184429083019495,
0.035490721464157104,
0.13851800560951233,
0.09129352867603302,
0.08003555983304977,
-0.031891852617263794,
-0.0866759717464447,
0.01762380637228489,
0.04076802730560303,
0.03717339411377907,
1.2913295845332312e-33,
0.015966875478625298,
-0.04150066152215004,
-0.027013733983039856,
-0.07689627259969711,
0.02318030409514904,
0.059451714158058167,
-0.05366853252053261,
-0.007389962673187256,
0.0997738391160965,
0.047183673828840256,
-0.0658859983086586,
-0.03481191024184227,
-0.0472455769777298,
-0.10958016663789749,
0.0224575437605381,
0.007423840928822756,
0.11122418940067291,
0.021454421803355217,
0.036596354097127914,
0.0355200469493866,
0.013912290334701538,
-0.03839316591620445,
-0.07797864824533463,
0.0028536911122500896,
0.08066514879465103,
0.024425620213150978,
-0.016669757664203644,
0.06556826829910278,
-0.049818623811006546,
0.009337445721030235,
0.0071466220542788506,
0.029506918042898178,
-0.06898204982280731,
0.05812384560704231,
0.08686091005802155,
-0.02247229404747486,
-0.030440978705883026,
0.01660803146660328,
-0.019736357033252716,
0.004452226683497429,
-0.026448456570506096,
-0.010923252440989017,
-0.07491449266672134,
-0.07606007903814316,
-0.04248003289103508,
-0.06760478764772415,
-0.06919638067483902,
-0.016746949404478073,
0.06274337321519852,
0.023029273375868797,
0.019053328782320023,
0.05965973809361458,
0.10760678350925446,
-0.10094950348138809,
0.0440383106470108,
-0.002644950756803155,
0.11726696044206619,
-0.01865214668214321,
-0.023342004045844078,
0.11097069084644318,
0.08464880287647247,
-0.002475529443472624,
-0.002857759827747941,
0.02308197319507599,
0.005852011498063803,
0.004213300067931414,
0.013252506963908672,
0.004054930526763201,
0.04357462376356125,
0.10131383687257767,
-0.058662399649620056,
0.0959407165646553,
0.03517826646566391,
-0.0004920423380099237,
0.05121360346674919,
-0.030837656930088997,
0.018196819350123405,
0.009755564853549004,
-0.07438904792070389,
-0.011277991347014904,
0.006751221138983965,
-0.021033840253949165,
-0.03677060082554817,
-0.038392309099435806,
0.05354839935898781,
-0.039104606956243515,
-0.051871418952941895,
0.031394101679325104,
-0.017200015485286713,
-0.01040840893983841,
0.0013708851765841246,
-0.0034041828475892544,
0.015005907043814659,
-0.011202223598957062,
-0.1552170217037201,
-2.7314938352828494e-33,
-0.04202292487025261,
-0.03133082017302513,
-0.02783316560089588,
0.054336562752723694,
-0.04462351277470589,
-0.037254806607961655,
-0.030901098623871803,
0.043644342571496964,
-0.0005458282539620996,
0.06699322909116745,
0.043874263763427734,
-0.07901263982057571,
-0.10173723846673965,
-0.028720129281282425,
0.045218151062726974,
0.07872873544692993,
-0.002983748447149992,
-0.03624846041202545,
0.037730105221271515,
-0.03628576919436455,
-0.004882178734987974,
0.006770412437617779,
0.013673163019120693,
-0.06903677433729172,
0.000807496951892972,
-0.07685929536819458,
0.03017660789191723,
-0.044548504054546356,
-0.021788112819194794,
-0.07350712269544601,
-0.06352070719003677,
0.027352632954716682,
-0.02415735274553299,
0.020380502566695213,
0.019282344728708267,
-0.04227869212627411,
-0.006441024132072926,
0.01360374316573143,
0.04895515739917755,
-0.035963691771030426,
0.06784354150295258,
0.05945271998643875,
-0.09318296611309052,
0.0003430030483286828,
-0.07366981357336044,
0.10007070004940033,
-0.06271683424711227,
-0.015506493858993053,
-0.011357768438756466,
-0.03487180173397064,
0.05377660691738129,
-0.07459397614002228,
0.12709538638591766,
0.032832980155944824,
0.002528444165363908,
0.02279757894575596,
0.05388214811682701,
-0.09258575737476349,
0.023378433659672737,
0.011988788843154907,
0.040432158857584,
-0.05529950186610222,
-0.021365759894251823,
-0.006303231231868267,
0.08096715807914734,
0.03582151606678963,
0.01041115541011095,
-0.030986519530415535,
-0.005393577739596367,
-0.028134318068623543,
0.027918903157114983,
0.01859041303396225,
-0.11770729720592499,
0.01745024137198925,
-0.10273242741823196,
0.026715168729424477,
-0.004924674518406391,
-0.09337116032838821,
-0.041273925453424454,
-0.0034049819223582745,
-0.022608567029237747,
-0.002349753864109516,
0.008837651461362839,
-0.03328859806060791,
0.02383156307041645,
0.035316288471221924,
-0.034174274653196335,
0.07736838608980179,
0.027845829725265503,
-0.018694525584578514,
0.009953202679753304,
0.04222717508673668,
-0.0951835885643959,
0.051733363419771194,
-0.06849341839551926,
-5.22936787206163e-8,
-0.007783892564475536,
-0.014708816073834896,
-0.06886360794305801,
-0.02576385997235775,
0.05002067610621452,
0.012082260102033615,
0.025447703897953033,
0.048115599900484085,
0.0577675960958004,
0.05299986153841019,
-0.00679940078407526,
-0.025156565010547638,
0.01629919558763504,
-0.007683571428060532,
0.13811172544956207,
-0.04996492713689804,
-0.02616577036678791,
0.013888102024793625,
-0.048333048820495605,
-0.0675525888800621,
0.02750856801867485,
-0.006232292391359806,
-0.0448482446372509,
0.04709808528423309,
-0.09031519293785095,
-0.04133274406194687,
0.06431137025356293,
0.11435382813215256,
0.07599617540836334,
-0.024277392774820328,
-0.06467027962207794,
0.047753676772117615,
-0.007990329526364803,
0.01542280986905098,
-0.06369813531637192,
0.006450522691011429,
-0.04765927791595459,
-0.05392170324921608,
0.026586590334773064,
0.10952718555927277,
0.00295667489990592,
-0.014240855351090431,
-0.07472603023052216,
0.02844155952334404,
0.03802994638681412,
-0.07213978469371796,
-0.08660998940467834,
-0.002296464517712593,
-0.0235005971044302,
0.06742020696401596,
-0.04918891564011574,
0.030417969450354576,
-0.005913384258747101,
0.001974159851670265,
0.010927258059382439,
0.0199908334761858,
0.06138686463236809,
-0.10611274093389511,
-0.01579330675303936,
-0.010243931785225868,
0.07346415519714355,
0.006601244211196899,
0.022532686591148376,
-0.007888772524893284
] | 0.120725 |
{ if (err) reject(new Error(JSON.stringify(err))); else resolve(result); }); }); } async function collect() { const data = []; session.on('NodeTracing.dataCollected', (chunk) => data.push(chunk)); session.on('NodeTracing.tracingComplete', () => { // done }); const traceConfig = { includedCategories: ['v8'] }; await post('NodeTracing.start', { traceConfig }); // do something setTimeout(() => { post('NodeTracing.stop').then(() => { session.disconnect(); console.log(data); }); }, 1000); } collect(); ``` ```cjs 'use strict'; const { Session } = require('node:inspector'); const session = new Session(); session.connect(); function post(message, data) { return new Promise((resolve, reject) => { session.post(message, data, (err, result) => { if (err) reject(new Error(JSON.stringify(err))); else resolve(result); }); }); } async function collect() { const data = []; session.on('NodeTracing.dataCollected', (chunk) => data.push(chunk)); session.on('NodeTracing.tracingComplete', () => { // done }); const traceConfig = { includedCategories: ['v8'] }; await post('NodeTracing.start', { traceConfig }); // do something setTimeout(() => { post('NodeTracing.stop').then(() => { session.disconnect(); console.log(data); }); }, 1000); } collect(); ``` [Performance API]: perf\_hooks.md [V8]: v8.md [`Worker`]: worker\_threads.md#class-worker [`async\_hooks`]: async\_hooks.md | https://github.com/nodejs/node/blob/main//doc/api/tracing.md | main | nodejs | [
-0.054968565702438354,
0.10063812881708145,
-0.018843749538064003,
0.063177190721035,
0.025982175022363663,
-0.04963124915957451,
-0.007521739229559898,
0.007615464273840189,
0.020468777045607567,
-0.037823788821697235,
0.002761753275990486,
-0.04475710168480873,
-0.0628911703824997,
-0.04707373306155205,
0.014507835730910301,
-0.012191537767648697,
-0.025707567110657692,
-0.002857569372281432,
0.00007148161239456385,
-0.09974080324172974,
-0.022623086348176003,
0.002313952660188079,
0.014369328506290913,
0.03424729406833649,
-0.0023179708514362574,
-0.03338175639510155,
-0.06003318354487419,
-0.0788838192820549,
0.026947058737277985,
0.013766280375421047,
-0.023013245314359665,
-0.031997084617614746,
-0.09311046451330185,
-0.01268331054598093,
-0.010414529591798782,
0.0530984029173851,
-0.046623703092336655,
-0.06777250021696091,
0.0102683799341321,
-0.04261845722794533,
0.03518889099359512,
0.08737679570913315,
-0.08468803763389587,
-0.04922826960682869,
0.08694789558649063,
-0.08870292454957962,
-0.07492640614509583,
0.011327731423079967,
-0.0008893348276615143,
0.01384181808680296,
0.005881138611584902,
0.029186854138970375,
-0.03202153742313385,
0.03500010818243027,
-0.049365099519491196,
0.06175163388252258,
-0.019037025049328804,
0.023288287222385406,
0.013120440766215324,
0.021499071270227432,
0.02057722397148609,
-0.05946006625890732,
0.009430501610040665,
-0.030470773577690125,
0.05639433115720749,
-0.021068140864372253,
0.018572011962532997,
0.025077948346734047,
0.03921801596879959,
0.07607678323984146,
0.03009653650224209,
0.016805047169327736,
-0.052501458674669266,
0.023679113015532494,
-0.03763706982135773,
0.0010861128102988005,
-0.0358048751950264,
-0.027453694492578506,
-0.060121286660432816,
0.053765375167131424,
-0.017986144870519638,
-0.01653612218797207,
-0.011445126496255398,
-0.0021912732627242804,
-0.07783615589141846,
0.08325950056314468,
-0.02126770094037056,
0.036133892834186554,
-0.09906795620918274,
-0.025439847260713577,
-0.07291336357593536,
0.027767328545451164,
-0.07892528176307678,
0.032866012305021286,
-0.037034131586551666,
0.056915104389190674,
0.0205660630017519,
0.07628557831048965,
0.054965849965810776,
0.04426223039627075,
0.009781399741768837,
0.004863759037107229,
0.005259651690721512,
0.04917516931891441,
-0.06899791210889816,
-0.06904648244380951,
-0.020590487867593765,
-0.03538797050714493,
0.007822406478226185,
0.03917168453335762,
-0.008910932578146458,
0.06745941191911697,
-0.029308144003152847,
0.053788285702466965,
0.014993146061897278,
0.03625309094786644,
0.10678031295537949,
0.006762671750038862,
0.04932656139135361,
0.13545072078704834,
0.13053645193576813,
-0.01277302484959364,
0.009793369099497795,
0.0026097761001437902,
0.05955924466252327,
-0.0823080986738205,
0.08973827213048935,
2.7650861577514887e-33,
0.08632216602563858,
-0.06968848407268524,
0.010433775372803211,
0.03313646838068962,
0.07003070414066315,
0.039309971034526825,
-0.0062005724757909775,
0.015046898275613785,
-0.049484383314847946,
0.01603797823190689,
-0.0783071219921112,
-0.04678429290652275,
0.049202725291252136,
-0.04853362590074539,
0.0012332816841080785,
-0.06767445057630539,
0.07667135447263718,
-0.021436266601085663,
0.04891827702522278,
-0.01486592460423708,
0.024087976664304733,
-0.1081404834985733,
0.021648742258548737,
0.031397607177495956,
0.06077864021062851,
-0.031294550746679306,
-0.052439864724874496,
0.10322130471467972,
0.0038683118764311075,
-0.017101513221859932,
0.03528361767530441,
0.04157533869147301,
-0.01665584184229374,
0.1059420183300972,
0.058245699852705,
-0.03549480438232422,
-0.01798534020781517,
-0.01030097994953394,
-0.06782884150743484,
-0.0614723302423954,
0.01217907015234232,
0.06977984309196472,
-0.07993259280920029,
-0.001355951651930809,
-0.0951748862862587,
-0.07297395169734955,
-0.021655192598700523,
-0.08809179067611694,
0.03887232765555382,
-0.032435350120067596,
-0.03967749699950218,
0.07369481772184372,
-0.01423253770917654,
0.015334644354879856,
0.056738678365945816,
0.023936348035931587,
0.011541117914021015,
-0.03789369761943817,
-0.04975944012403488,
0.04832635447382927,
0.02911273017525673,
-0.042596347630023956,
-0.006559566128998995,
-0.008184356614947319,
0.0017989386105909944,
0.03314070403575897,
-0.11348956823348999,
0.054283175617456436,
0.006002419162541628,
-0.07289067655801773,
-0.07113673537969589,
0.010803301818668842,
0.046602360904216766,
-0.004463069140911102,
0.05806363746523857,
-0.015522503294050694,
-0.09873345494270325,
0.038470230996608734,
-0.04896782338619232,
-0.08802859485149384,
0.040960364043712616,
-0.052195191383361816,
-0.05670846253633499,
0.06391484290361404,
0.037768539041280746,
0.05416964367032051,
-0.02169910818338394,
-0.016091173514723778,
0.0406845323741436,
0.0921325758099556,
-0.08070416003465652,
0.04337470233440399,
0.019692135974764824,
-0.03318928927183151,
-0.007998058572411537,
-4.744496135984346e-33,
-0.007164958398789167,
-0.0015837324317544699,
-0.033697593957185745,
0.007267913781106472,
0.04637988284230232,
-0.03725037723779678,
-0.006272738333791494,
-0.025201475247740746,
0.012893586419522762,
0.04710448160767555,
-0.0021724319085478783,
0.003615122986957431,
-0.00629101786762476,
0.042796481400728226,
-0.07180583477020264,
0.0295969620347023,
-0.004715500865131617,
-0.03867607191205025,
-0.015375225804746151,
-0.002357790945097804,
0.018734276294708252,
-0.062385525554418564,
0.014944636262953281,
-0.0736151784658432,
-0.05110684037208557,
-0.03500363230705261,
-0.011362232267856598,
-0.033813152462244034,
-0.04116504639387131,
-0.05190100520849228,
-0.012388071045279503,
0.04004092141985893,
-0.03499777615070343,
0.06591490656137466,
0.07300025969743729,
-0.08473923057317734,
0.03341025859117508,
0.09132462739944458,
-0.013492493890225887,
-0.010907478630542755,
0.11143415421247482,
0.0006316694198176265,
-0.10969729721546173,
-0.013186453841626644,
0.055643316358327866,
-0.07489065825939178,
-0.012757152318954468,
0.08116166293621063,
-0.04787382110953331,
0.03146671876311302,
-0.01006537489593029,
-0.04535071924328804,
0.007126489654183388,
0.04545192793011665,
-0.0013891943963244557,
0.0007913564913906157,
0.09285641461610794,
-0.06120161712169647,
0.03253473341464996,
0.0005568269407376647,
-0.041421350091695786,
-0.08239561319351196,
0.0015787340234965086,
0.06674221158027649,
0.13698258996009827,
-0.0975552424788475,
0.008793226443231106,
0.06557813286781311,
0.11457853764295578,
0.06984122842550278,
-0.05171506479382515,
0.05366993322968483,
0.02608778513967991,
0.03144438937306404,
0.07620714604854584,
-0.06736581772565842,
-0.07454971224069595,
-0.15133701264858246,
0.08283922076225281,
0.07202767580747604,
-0.02508976310491562,
0.022068990394473076,
0.006842934526503086,
0.00462711276486516,
0.1018921509385109,
0.039799515157938004,
-0.023633578792214394,
0.10539542883634567,
-0.0440402626991272,
-0.02994653396308422,
0.058388255536556244,
-0.008235529065132141,
-0.0368351936340332,
-0.016431374475359917,
-0.023234115913510323,
-5.407670045087798e-8,
-0.07173845171928406,
-0.021901795640587807,
-0.08082723617553711,
0.04794611781835556,
0.0842655673623085,
-0.002479872666299343,
0.014350947923958302,
-0.013921122066676617,
0.010980641469359398,
-0.012576276436448097,
-0.03825816512107849,
0.002844247268512845,
0.038148242980241776,
-0.05005141347646713,
-0.02270694635808468,
-0.09346915781497955,
0.005462410394102335,
-0.004146657418459654,
-0.014045008458197117,
0.005544307641685009,
-0.010867918841540813,
-0.021348968148231506,
-0.048474907875061035,
0.029993556439876556,
0.040001530200242996,
-0.042340103536844254,
0.09163256734609604,
0.1381382793188095,
-0.057925786823034286,
0.00434893136844039,
-0.09544485807418823,
0.02140047959983349,
0.024590494111180305,
-0.00560523709282279,
0.0016312822699546814,
-0.0104244789108634,
0.08902677893638611,
0.0006779951509088278,
0.003023756667971611,
0.061847835779190063,
0.10566122084856033,
0.04899887368083,
0.006958999205380678,
0.008211149834096432,
0.005320344585925341,
-0.034121766686439514,
-0.013457021676003933,
0.07764460146427155,
0.08387183398008347,
0.01439227070659399,
-0.012528675608336926,
-0.06500967592000961,
-0.026499969884753227,
0.010460670106112957,
0.01540151983499527,
-0.05936025083065033,
-0.006698933895677328,
-0.05167871341109276,
-0.037528470158576965,
0.0011030063033103943,
0.06228752061724663,
-0.07824710756540298,
-0.035003263503313065,
-0.03656061366200447
] | 0.044359 |
# Modules: ECMAScript modules > Stability: 2 - Stable ## Introduction ECMAScript modules are [the official standard format][] to package JavaScript code for reuse. Modules are defined using a variety of [`import`][] and [`export`][] statements. The following example of an ES module exports a function: ```js // addTwo.mjs function addTwo(num) { return num + 2; } export { addTwo }; ``` The following example of an ES module imports the function from `addTwo.mjs`: ```js // app.mjs import { addTwo } from './addTwo.mjs'; // Prints: 6 console.log(addTwo(4)); ``` Node.js fully supports ECMAScript modules as they are currently specified and provides interoperability between them and its original module format, [CommonJS][]. ## Enabling Node.js has two module systems: [CommonJS][] modules and ECMAScript modules. Authors can tell Node.js to interpret JavaScript as an ES module via the `.mjs` file extension, the `package.json` [`"type"`][] field with a value `"module"`, or the [`--input-type`][] flag with a value of `"module"`. These are explicit markers of code being intended to run as an ES module. Inversely, authors can explicitly tell Node.js to interpret JavaScript as CommonJS via the `.cjs` file extension, the `package.json` [`"type"`][] field with a value `"commonjs"`, or the [`--input-type`][] flag with a value of `"commonjs"`. When code lacks explicit markers for either module system, Node.js will inspect the source code of a module to look for ES module syntax. If such syntax is found, Node.js will run the code as an ES module; otherwise it will run the module as CommonJS. See [Determining module system][] for more details. ## Packages This section was moved to [Modules: Packages](packages.md). ## `import` Specifiers ### Terminology The \_specifier\_ of an `import` statement is the string after the `from` keyword, e.g. `'node:path'` in `import { sep } from 'node:path'`. Specifiers are also used in `export from` statements, and as the argument to an `import()` expression. There are three types of specifiers: \* \_Relative specifiers\_ like `'./startup.js'` or `'../config.mjs'`. They refer to a path relative to the location of the importing file. \_The file extension is always necessary for these.\_ \* \_Bare specifiers\_ like `'some-package'` or `'some-package/shuffle'`. They can refer to the main entry point of a package by the package name, or a specific feature module within a package prefixed by the package name as per the examples respectively. \_Including the file extension is only necessary for packages without an [`"exports"`][] field.\_ \* \_Absolute specifiers\_ like `'file:///opt/nodejs/config.js'`. They refer directly and explicitly to a full path. Bare specifier resolutions are handled by the [Node.js module resolution and loading algorithm][]. All other specifier resolutions are always only resolved with the standard relative [URL][] resolution semantics. Like in CommonJS, module files within packages can be accessed by appending a path to the package name unless the package's [`package.json`][] contains an [`"exports"`][] field, in which case files within packages can only be accessed via the paths defined in [`"exports"`][]. For details on these package resolution rules that apply to bare specifiers in the Node.js module resolution, see the [packages documentation](packages.md). ### Mandatory file extensions A file extension must be provided when using the `import` keyword to resolve relative or absolute specifiers. Directory indexes (e.g. `'./startup/index.js'`) must also be fully specified. This behavior matches how `import` behaves in browser environments, assuming a typically configured server. ### URLs ES modules are resolved and cached as URLs. This means that special characters must be [percent-encoded][], such as `#` with `%23` and `?` with `%3F`. `file:`, `node:`, and `data:` URL schemes are supported. A specifier like `'https://example.com/app.js'` is not supported natively in Node.js unless using a [custom HTTPS loader][]. #### `file:` URLs Modules are loaded multiple times | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.0665920153260231,
-0.04415314272046089,
0.0037456948775798082,
0.06553501635789871,
0.10172631591558456,
-0.014361746609210968,
-0.0065137119963765144,
0.061716120690107346,
0.03310055658221245,
-0.03638715669512749,
0.015803011134266853,
0.03983728215098381,
-0.01201145350933075,
-0.008792451582849026,
0.09710308909416199,
0.04665347561240196,
-0.035088926553726196,
0.030123917385935783,
-0.0025150778237730265,
-0.033869367092847824,
0.08760532736778259,
0.026920398697257042,
0.01659230701625347,
-0.03498070687055588,
-0.015836235135793686,
-0.003575196722522378,
-0.015735913068056107,
0.0191339161247015,
0.030981965363025665,
-0.05791175737977028,
0.02504299022257328,
0.018729165196418762,
-0.016868624836206436,
0.024005090817809105,
-0.07333024591207504,
0.13391131162643433,
-0.009354661218822002,
-0.09484308212995529,
-0.021244218572974205,
-0.053918566554784775,
-0.047500062733888626,
0.1013503298163414,
0.016636664047837257,
-0.07646350562572479,
0.019757360219955444,
-0.05847170203924179,
-0.08069967478513718,
-0.028421800583600998,
-0.10402493923902512,
0.029072923585772514,
0.05989202484488487,
0.005627193953841925,
-0.1182100921869278,
-0.03123810701072216,
0.034152161329984665,
0.017558595165610313,
-0.05324262008070946,
-0.023511141538619995,
0.004801174160093069,
0.06563237309455872,
-0.004473590757697821,
0.0342290885746479,
0.06441684067249298,
0.04948543384671211,
0.05901620537042618,
-0.026851890608668327,
-0.006731018424034119,
0.03590799868106842,
-0.04184546321630478,
0.028471866622567177,
-0.09223799407482147,
-0.007263354491442442,
0.001031107152812183,
0.035239141434431076,
-0.03526117280125618,
-0.09919079393148422,
0.005277168937027454,
0.04801138862967491,
-0.01573779247701168,
0.07641910016536713,
-0.07168793678283691,
-0.002408411120995879,
-0.06980906426906586,
0.029051320627331734,
0.0156467966735363,
0.0691574439406395,
-0.029141291975975037,
0.021379580721259117,
0.04664399474859238,
0.0912143737077713,
-0.05511298030614853,
-0.12044893205165863,
0.011338271200656891,
0.11274813115596771,
0.02021818421781063,
-0.030220696702599525,
-0.017066361382603645,
0.11318057030439377,
-0.04846808314323425,
-0.02503197081387043,
0.002736361464485526,
0.06488149613142014,
0.02578236535191536,
-0.015761781483888626,
0.04561122506856918,
-0.054022885859012604,
0.018263572826981544,
-0.0065167853608727455,
0.0031774272210896015,
-0.02651560865342617,
-0.017017899081110954,
0.01900992915034294,
-0.01727593131363392,
-0.09146057069301605,
-0.05730663239955902,
-0.00012143688945798203,
0.033286962658166885,
-0.0516737625002861,
0.08707315474748611,
0.10345254093408585,
0.1026172786951065,
0.042345643043518066,
0.09545695781707764,
-0.04235490784049034,
0.07917177677154541,
0.012674957513809204,
0.018049387261271477,
2.888243986584086e-33,
-0.033399906009435654,
-0.0569288395345211,
-0.056301482021808624,
0.10421926528215408,
0.012983055785298347,
0.060491081327199936,
-0.0005642934120260179,
0.0023130965419113636,
-0.11721937358379364,
-0.033393487334251404,
-0.03685833513736725,
0.13800759613513947,
0.014159433543682098,
0.06660953909158707,
0.01952824555337429,
0.021019838750362396,
0.11535593867301941,
-0.0322536863386631,
0.05730119347572327,
0.024212120100855827,
0.0045057982206344604,
0.047363895922899246,
0.046727877110242844,
0.0747520849108696,
0.047268934547901154,
0.08149834722280502,
-0.00719453115016222,
0.014005541801452637,
-0.012913069687783718,
0.032153669744729996,
-0.04605313017964363,
0.037895988672971725,
-0.03886355459690094,
0.012289559468626976,
0.026095561683177948,
0.0024246578104794025,
-0.01630556769669056,
-0.02253037691116333,
-0.04839769005775452,
-0.010646093636751175,
-0.05339325964450836,
0.07547540962696075,
-0.08550439774990082,
-0.02539663016796112,
-0.03164098411798477,
-0.13231909275054932,
-0.03698679432272911,
0.008002719841897488,
0.05472323298454285,
-0.02948557212948799,
-0.12012432515621185,
0.03797492757439613,
0.09973694384098053,
-0.03746725991368294,
0.059879790991544724,
0.018834685906767845,
0.03067954257130623,
-0.012385545298457146,
-0.010697898454964161,
0.004107585176825523,
0.004171093925833702,
0.008879470638930798,
0.013510488905012608,
0.04645119979977608,
0.027066996321082115,
0.019136538729071617,
-0.015722278505563736,
-0.015586711466312408,
-0.0193959791213274,
0.02324012853205204,
0.031190913170576096,
0.021306341513991356,
-0.02245204709470272,
0.01721571758389473,
0.03169950097799301,
-0.05646545812487602,
-0.04428563266992569,
-0.028723755851387978,
-0.014270776882767677,
-0.012490826658904552,
0.007406084798276424,
0.00525116641074419,
-0.044882915914058685,
-0.015020986087620258,
0.04572393372654915,
-0.029450470581650734,
-0.08428341150283813,
0.01885361783206463,
0.10809975862503052,
0.0430891215801239,
0.008069613948464394,
-0.01830906793475151,
-0.04345398768782616,
-0.0690460279583931,
-0.062164951115846634,
-4.8129694166037136e-33,
0.009818651713430882,
0.09012079983949661,
-0.08982530236244202,
0.09178072214126587,
-0.1208631694316864,
-0.050191979855298996,
-0.026031455025076866,
0.02165384404361248,
0.018236367031931877,
0.006229455582797527,
-0.04800781235098839,
-0.01656690053641796,
0.048719704151153564,
-0.017941201105713844,
0.030590340495109558,
0.05039718374609947,
-0.09785536676645279,
0.022783083841204643,
0.03667646273970604,
-0.06846305727958679,
0.008742397651076317,
0.04278787598013878,
0.02869461663067341,
-0.00796966627240181,
0.025092005729675293,
0.031003734096884727,
-0.0926273837685585,
-0.013847428373992443,
-0.07213952392339706,
-0.05704963579773903,
-0.03409162163734436,
0.0035321346949785948,
-0.012454037554562092,
-0.0004746204358525574,
-0.019664090126752853,
-0.025219451636075974,
0.038126762956380844,
0.06690401583909988,
0.029410095885396004,
-0.07264816015958786,
0.06031353026628494,
0.055006373673677444,
0.019510162994265556,
0.013024917803704739,
-0.00827084667980671,
0.009281650185585022,
0.000144177523907274,
0.06100521236658096,
0.09724145382642746,
-0.0966927781701088,
-0.05196573957800865,
-0.1167430728673935,
-0.052458491176366806,
-0.03696363791823387,
-0.06332632899284363,
-0.05214964598417282,
-0.025812877342104912,
0.0040603033266961575,
0.04098198190331459,
0.007570332381874323,
0.03881427273154259,
-0.11153895407915115,
0.01342316810041666,
-0.10713399201631546,
-0.05601772665977478,
-0.012287698686122894,
-0.07373008131980896,
-0.02739562839269638,
0.05320584401488304,
-0.0000463945725641679,
-0.021429862827062607,
-0.05090991407632828,
-0.047956712543964386,
-0.03080080822110176,
-0.06462785601615906,
0.0030544474720954895,
-0.02774377353489399,
-0.07141109555959702,
0.022789593786001205,
0.011210029013454914,
0.015514667145907879,
0.01699971780180931,
0.0015559851890429854,
-0.03967118635773659,
0.029967255890369415,
-0.04859796538949013,
-0.0015938098076730967,
0.043446220457553864,
-0.04477604851126671,
-0.005353438667953014,
-0.017734888941049576,
0.05667710676789284,
-0.09534449130296707,
0.0012231830041855574,
-0.05978836864233017,
-4.8968143318006696e-8,
-0.0667017474770546,
-0.07143945246934891,
-0.10609961301088333,
-0.05480197072029114,
0.03487921506166458,
-0.0074109588749706745,
0.02972806990146637,
0.015399003401398659,
0.07881035655736923,
0.019907526671886444,
0.04534122347831726,
0.035909056663513184,
0.00781009066849947,
-0.021377261728048325,
0.0245659202337265,
0.08296351134777069,
-0.003837493248283863,
0.0683048665523529,
-0.028986334800720215,
0.010625625029206276,
0.019024182111024857,
0.033729419112205505,
0.05424109473824501,
0.09564665704965591,
-0.0012363260611891747,
0.0019730129279196262,
0.043469350785017014,
0.05416667461395264,
0.010129209607839584,
-0.02183479070663452,
-0.10785745084285736,
0.04090651869773865,
0.017928142100572586,
0.024342525750398636,
-0.08299171924591064,
-0.02996068447828293,
0.029988890513777733,
-0.009586062282323837,
0.05219697952270508,
0.04972192645072937,
0.0010180679382756352,
-0.025413762778043747,
-0.08117705583572388,
0.05703657865524292,
-0.011022143997251987,
-0.0037764557637274265,
-0.010974884033203125,
-0.008572523482143879,
-0.08414759486913681,
-0.0704764872789383,
0.006873132195323706,
-0.030864674597978592,
-0.049603983759880066,
0.04737255722284317,
0.006136428564786911,
-0.0035726255737245083,
-0.012133422307670116,
-0.07378100603818893,
0.04262029379606247,
-0.010730873793363571,
-0.016309315338730812,
-0.002470639068633318,
0.11642859131097794,
-0.10449033975601196
] | 0.216856 |
URLs. This means that special characters must be [percent-encoded][], such as `#` with `%23` and `?` with `%3F`. `file:`, `node:`, and `data:` URL schemes are supported. A specifier like `'https://example.com/app.js'` is not supported natively in Node.js unless using a [custom HTTPS loader][]. #### `file:` URLs Modules are loaded multiple times if the `import` specifier used to resolve them has a different query or fragment. ```js import './foo.mjs?query=1'; // loads ./foo.mjs with query of "?query=1" import './foo.mjs?query=2'; // loads ./foo.mjs with query of "?query=2" ``` The volume root may be referenced via `/`, `//`, or `file:///`. Given the differences between [URL][] and path resolution (such as percent encoding details), it is recommended to use [url.pathToFileURL][] when importing a path. #### `data:` imports [`data:` URLs][] are supported for importing with the following MIME types: \* `text/javascript` for ES modules \* `application/json` for JSON \* `application/wasm` for Wasm ```js import 'data:text/javascript,console.log("hello!");'; import \_ from 'data:application/json,"world!"' with { type: 'json' }; ``` `data:` URLs only resolve [bare specifiers][Terminology] for builtin modules and [absolute specifiers][Terminology]. Resolving [relative specifiers][Terminology] does not work because `data:` is not a [special scheme][]. For example, attempting to load `./foo` from `data:text/javascript,import "./foo";` fails to resolve because there is no concept of relative resolution for `data:` URLs. #### `node:` imports `node:` URLs are supported as an alternative means to load Node.js builtin modules. This URL scheme allows for builtin modules to be referenced by valid absolute URL strings. ```js import fs from 'node:fs/promises'; ``` ## Import attributes [Import attributes][Import Attributes MDN] are an inline syntax for module import statements to pass on more information alongside the module specifier. ```js import fooData from './foo.json' with { type: 'json' }; const { default: barData } = await import('./bar.json', { with: { type: 'json' } }); ``` Node.js only supports the `type` attribute, for which it supports the following values: | Attribute `type` | Needed for | | ---------------- | ---------------- | | `'json'` | [JSON modules][] | The `type: 'json'` attribute is mandatory when importing JSON modules. ## Built-in modules [Built-in modules][] provide named exports of their public API. A default export is also provided which is the value of the CommonJS exports. The default export can be used for, among other things, modifying the named exports. Named exports of built-in modules are updated only by calling [`module.syncBuiltinESMExports()`][]. ```js import EventEmitter from 'node:events'; const e = new EventEmitter(); ``` ```js import { readFile } from 'node:fs'; readFile('./foo.txt', (err, source) => { if (err) { console.error(err); } else { console.log(source); } }); ``` ```js import fs, { readFileSync } from 'node:fs'; import { syncBuiltinESMExports } from 'node:module'; import { Buffer } from 'node:buffer'; fs.readFileSync = () => Buffer.from('Hello, ESM'); syncBuiltinESMExports(); fs.readFileSync === readFileSync; ``` > When importing built-in modules, all the named exports (i.e. properties of the module exports object) > are populated even if they are not individually accessed. > This can make initial imports of built-in modules slightly slower compared to loading them with > `require()` or `process.getBuiltinModule()`, where the module exports object is evaluated immediately, > but some of its properties may only be initialized when first accessed individually. ## `import()` expressions [Dynamic `import()`][] provides an asynchronous way to import modules. It is supported in both CommonJS and ES modules, and can be used to load both CommonJS and ES modules. ## `import.meta` \* Type: {Object} The `import.meta` meta property is an `Object` that contains the following properties. It is only supported in ES modules. ### `import.meta.dirname` \* Type: {string} The directory name of the current module. This is the same as the [`path.dirname()`][] of the [`import.meta.filename`][]. > \*\*Caveat\*\*: only present | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.06722032278776169,
-0.00645886454731226,
0.033604029566049576,
-0.008563525974750519,
-0.012873119674623013,
-0.06453264504671097,
-0.048421479761600494,
0.0984102189540863,
0.0803031250834465,
-0.031364209949970245,
-0.04834486171603203,
0.031744588166475296,
0.04539492726325989,
0.02639778144657612,
0.027957016602158546,
0.03150574862957001,
-0.03955892100930214,
0.10384678840637207,
-0.0031418241560459137,
-0.012260591611266136,
0.11380881816148758,
0.10084613412618637,
0.08030986785888672,
-0.03488233685493469,
0.02097722515463829,
-0.059870779514312744,
-0.0364920012652874,
0.03225218132138252,
0.05416160821914673,
-0.030816838145256042,
0.09476450085639954,
0.05604776740074158,
-0.08469241112470627,
0.04672529548406601,
-0.0024590338580310345,
0.08681701868772507,
-0.02167331427335739,
-0.15025727450847626,
-0.031057335436344147,
-0.025759411975741386,
0.10920235514640808,
0.0690828412771225,
-0.019339723512530327,
-0.034574028104543686,
-0.05849273130297661,
0.005845190491527319,
-0.05308493226766586,
0.028548024594783783,
-0.09147310256958008,
-0.0011905531864613295,
-0.06352925300598145,
-0.07029492408037186,
-0.07553550601005554,
0.023247769102454185,
-0.028868742287158966,
0.017704948782920837,
-0.0814596563577652,
0.06917788833379745,
0.038022011518478394,
0.03745284304022789,
-0.030845502391457558,
-0.01831546053290367,
0.08508308231830597,
-0.029111376032233238,
0.027544742450118065,
0.010268469341099262,
-0.04948773235082626,
0.05114617943763733,
0.0027209576219320297,
0.00410638190805912,
-0.026518994942307472,
0.00653168186545372,
-0.0748082771897316,
0.00005230976967141032,
-0.04855799674987793,
-0.049297090619802475,
-0.01434612087905407,
0.004064139910042286,
-0.04289451986551285,
-0.02114837057888508,
-0.03913386911153793,
-0.13582780957221985,
0.008597319945693016,
0.06821148842573166,
0.03150760009884834,
-0.005894558969885111,
-0.014552191831171513,
-0.031621452420949936,
0.04385685548186302,
-0.0005261583719402552,
-0.04331911727786064,
-0.11770757287740707,
-0.018668534234166145,
0.03585679829120636,
0.07521417737007141,
0.0535007044672966,
0.012670045718550682,
0.06705142557621002,
-0.0027189920656383038,
-0.01710435561835766,
0.006847571115940809,
-0.03062857687473297,
0.05752362683415413,
-0.04962097853422165,
0.06354622542858124,
0.012478421442210674,
0.040140941739082336,
0.0683073177933693,
0.026192571967840195,
-0.012549110688269138,
-0.00009751807374414057,
0.0009012236259877682,
0.026877962052822113,
-0.08291598409414291,
-0.0306767039000988,
-0.05159782990813255,
0.07360254973173141,
-0.04757245257496834,
-0.03245930373668671,
0.08885999023914337,
0.027604877948760986,
-0.0048713767901062965,
-0.013465341180562973,
-0.040729861706495285,
0.04465794190764427,
-0.02946755848824978,
0.007194885052740574,
1.277487679374818e-33,
-0.015308824367821217,
-0.011569522321224213,
0.01179071981459856,
0.021848753094673157,
0.019855674356222153,
-0.0016992314485833049,
0.07311177998781204,
0.023212723433971405,
-0.06724028289318085,
-0.02235042303800583,
-0.10571456700563431,
0.058597005903720856,
-0.029990486800670624,
-0.08330931514501572,
-0.058440037071704865,
0.027219900861382484,
0.029571691527962685,
-0.005092515144497156,
0.04396665468811989,
0.006011025980114937,
-0.0011383801465854049,
0.027297211810946465,
0.021816032007336617,
0.03307046368718147,
-0.009521695785224438,
0.0008983051520772278,
0.05493275448679924,
-0.049782827496528625,
-0.016270264983177185,
-0.02413712628185749,
0.01403872948139906,
0.01538701169192791,
-0.04313476011157036,
-0.028583550825715065,
0.059897150844335556,
-0.0004756450070999563,
0.06338337808847427,
0.03345616161823273,
-0.2008974701166153,
-0.017784422263503075,
-0.02798985317349434,
0.03541261702775955,
0.00861047487705946,
0.020751388743519783,
-0.09792336821556091,
-0.061277274042367935,
-0.09300035238265991,
-0.05803963169455528,
0.028038183227181435,
0.023377884179353714,
-0.04687785357236862,
0.02400771714746952,
0.089976005256176,
-0.055813249200582504,
0.03948686644434929,
-0.028208699077367783,
-0.020783159881830215,
-0.051990240812301636,
-0.060587551444768906,
-0.025952721014618874,
-0.00010561120143393055,
0.002540234476327896,
-0.009646306745707989,
0.027153924107551575,
-0.007733829319477081,
0.02801009826362133,
0.041229479014873505,
0.09305319935083389,
-0.01601923257112503,
0.10644805431365967,
-0.0025011992547661066,
0.0196547769010067,
0.043245770037174225,
0.004284956492483616,
-0.01443551853299141,
-0.057166557759046555,
-0.04470499977469444,
0.02764013409614563,
0.021222464740276337,
-0.015548894181847572,
-0.0036945499014109373,
-0.09382738918066025,
-0.037622030824422836,
0.07968457043170929,
-0.028388611972332,
0.03112204559147358,
-0.02115624025464058,
-0.02740130014717579,
0.07336116582155228,
-0.05786185711622238,
0.0826055258512497,
-0.022946665063500404,
-0.04982130602002144,
-0.056904859840869904,
-0.06417567282915115,
-2.195957159818439e-33,
0.05827869474887848,
0.02528763934969902,
-0.025582430884242058,
0.12207289785146713,
0.007171685807406902,
-0.0530807189643383,
0.034734927117824554,
0.026779215782880783,
0.02122471295297146,
0.00976462010294199,
-0.040063079446554184,
0.04880981519818306,
0.059567198157310486,
-0.09693208336830139,
0.03598575294017792,
0.07087713479995728,
-0.06874968856573105,
-0.03790048137307167,
0.0191380362957716,
-0.013148939236998558,
-0.08297624439001083,
0.03182973712682724,
-0.05005336552858353,
0.017083559185266495,
-0.04043826088309288,
0.05955866724252701,
-0.05857056751847267,
-0.06704201549291611,
-0.0591873899102211,
-0.012633818201720715,
-0.02626703679561615,
0.006766154896467924,
-0.05050624534487724,
-0.06130663678050041,
-0.044740229845047,
-0.021709026768803596,
-0.06680667400360107,
0.0659245178103447,
0.0796915665268898,
-0.08455521613359451,
0.06359714269638062,
0.00508253276348114,
0.005239940248429775,
0.0769616961479187,
-0.006836924701929092,
-0.03276495635509491,
0.020229611545801163,
0.056621529161930084,
-0.0031073226127773523,
-0.0632864236831665,
0.025784654542803764,
-0.028127027675509453,
0.022167019546031952,
0.008446695283055305,
0.019504917785525322,
-0.008743798360228539,
-0.07949379831552505,
0.053254108875989914,
-0.022983992472290993,
0.0006812861538492143,
0.0667903795838356,
-0.01956821233034134,
-0.06407085061073303,
-0.04670298472046852,
-0.09427478164434433,
-0.039911262691020966,
-0.12341946363449097,
-0.01802917569875717,
0.05252750962972641,
-0.029973605647683144,
-0.029005002230405807,
-0.030561180785298347,
0.1078653410077095,
0.027682341635227203,
0.03552212938666344,
-0.02098749950528145,
-0.016824033111333847,
0.010459820739924908,
0.012873427011072636,
0.061958108097314835,
-0.012938099913299084,
0.08795572817325592,
-0.04652303457260132,
0.05778065696358681,
0.05644221976399422,
-0.028830284252762794,
-0.037424568086862564,
0.08661257475614548,
-0.014475615695118904,
-0.03830059617757797,
0.03410176560282707,
0.08985993266105652,
-0.08005062490701675,
0.030170265585184097,
-0.01633673533797264,
-5.517151890899186e-8,
-0.02838396094739437,
0.0656065121293068,
-0.12353561073541641,
-0.006737181916832924,
-0.021252283826470375,
0.01868675835430622,
-0.028796205297112465,
0.11949220299720764,
0.04911106452345848,
0.1415289044380188,
0.04552406072616577,
-0.012842858210206032,
-0.051943399012088776,
-0.012777986004948616,
-0.02948620356619358,
0.032872408628463745,
-0.019620217382907867,
0.10508690774440765,
-0.04383886232972145,
-0.02217448689043522,
-0.03127500042319298,
0.03343676030635834,
-0.0080975741147995,
0.04088593274354935,
0.035167351365089417,
0.029869670048356056,
0.017046133056282997,
-0.000019343666281201877,
-0.052122000604867935,
-0.012546103447675705,
-0.06233302503824234,
0.03008878044784069,
-0.022833850234746933,
-0.0060515557415783405,
-0.040853872895240784,
0.09279125183820724,
0.0038604277651757,
-0.04943501949310303,
0.030596960335969925,
0.04610247164964676,
0.0121299521997571,
-0.021159589290618896,
-0.0009165683295577765,
0.032197874039411545,
-0.04391048848628998,
-0.03751389682292938,
0.004520944319665432,
0.08511045575141907,
0.011123732663691044,
0.03909944370388985,
0.07352836430072784,
-0.08026904612779617,
-0.053910236805677414,
-0.011034899391233921,
0.0239204540848732,
0.03042009100317955,
0.0000823332229629159,
-0.06159619614481926,
-0.030537519603967667,
-0.010123679414391518,
0.1264285296201706,
0.048046600073575974,
0.042528651654720306,
-0.016061430796980858
] | 0.029504 |
## `import.meta` \* Type: {Object} The `import.meta` meta property is an `Object` that contains the following properties. It is only supported in ES modules. ### `import.meta.dirname` \* Type: {string} The directory name of the current module. This is the same as the [`path.dirname()`][] of the [`import.meta.filename`][]. > \*\*Caveat\*\*: only present on `file:` modules. ### `import.meta.filename` \* Type: {string} The full absolute path and filename of the current module, with symlinks resolved. This is the same as the [`url.fileURLToPath()`][] of the [`import.meta.url`][]. > \*\*Caveat\*\* only local modules support this property. Modules not using the > `file:` protocol will not provide it. ### `import.meta.url` \* Type: {string} The absolute `file:` URL of the module. This is defined exactly the same as it is in browsers providing the URL of the current module file. This enables useful patterns such as relative file loading: ```js import { readFileSync } from 'node:fs'; const buffer = readFileSync(new URL('./data.proto', import.meta.url)); ``` ### `import.meta.main` > Stability: 1.0 - Early development \* Type: {boolean} `true` when the current module is the entry point of the current process; `false` otherwise. Equivalent to `require.main === module` in CommonJS. Analogous to Python's `\_\_name\_\_ == "\_\_main\_\_"`. ```js export function foo() { return 'Hello, world'; } function main() { const message = foo(); console.log(message); } if (import.meta.main) main(); // `foo` can be imported from another module without possible side-effects from `main` ``` ### `import.meta.resolve(specifier)` > Stability: 1.2 - Release candidate \* `specifier` {string} The module specifier to resolve relative to the current module. \* Returns: {string} The absolute URL string that the specifier would resolve to. [`import.meta.resolve`][] is a module-relative resolution function scoped to each module, returning the URL string. ```js const dependencyAsset = import.meta.resolve('component-lib/asset.css'); // file:///app/node\_modules/component-lib/asset.css import.meta.resolve('./dep.js'); // file:///app/dep.js ``` All features of the Node.js module resolution are supported. Dependency resolutions are subject to the permitted exports resolutions within the package. \*\*Caveats\*\*: \* This can result in synchronous file-system operations, which can impact performance similarly to `require.resolve`. \* This feature is not available within custom loaders (it would create a deadlock). \*\*Non-standard API\*\*: When using the `--experimental-import-meta-resolve` flag, that function accepts a second argument: \* `parent` {string|URL} An optional absolute parent module URL to resolve from. \*\*Default:\*\* `import.meta.url` ## Interoperability with CommonJS ### `import` statements An `import` statement can reference an ES module or a CommonJS module. `import` statements are permitted only in ES modules, but dynamic [`import()`][] expressions are supported in CommonJS for loading ES modules. When importing [CommonJS modules](#commonjs-namespaces), the `module.exports` object is provided as the default export. Named exports may be available, provided by static analysis as a convenience for better ecosystem compatibility. ### `require` The CommonJS module `require` currently only supports loading synchronous ES modules (that is, ES modules that do not use top-level `await`). See [Loading ECMAScript modules using `require()`][] for details. ### CommonJS Namespaces CommonJS modules consist of a `module.exports` object which can be of any type. To support this, when importing CommonJS from an ECMAScript module, a namespace wrapper for the CommonJS module is constructed, which always provides a `default` export key pointing to the CommonJS `module.exports` value. In addition, a heuristic static analysis is performed against the source text of the CommonJS module to get a best-effort static list of exports to provide on the namespace from values on `module.exports`. This is necessary since these namespaces must be constructed prior to the evaluation of the CJS module. These CommonJS namespace objects also provide the `default` export as a `'module.exports'` named export, in order to unambiguously indicate that their representation in CommonJS uses this value, and not the namespace value. This mirrors the semantics of the | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.013045250438153744,
-0.018547840416431427,
-0.022154994308948517,
0.008136752992868423,
0.08607278019189835,
-0.04404091835021973,
0.028221290558576584,
0.08070910722017288,
-0.03439067676663399,
-0.03484448045492172,
0.021436870098114014,
0.021197933703660965,
-0.009791438467800617,
0.05884765833616257,
0.06136031821370125,
0.04274774715304375,
-0.009364274330437183,
0.026791028678417206,
-0.00891428254544735,
0.04121186211705208,
0.08312178403139114,
0.00894477404654026,
0.08145909011363983,
-0.018319398164749146,
-0.04718916118144989,
-0.022726308554410934,
-0.05284024402499199,
0.007215521764010191,
-0.024814261123538017,
-0.014402687549591064,
-0.006353787146508694,
0.06541909277439117,
-0.10813958197832108,
-0.02591083012521267,
0.07506203651428223,
0.09963909536600113,
0.0005428243312053382,
-0.0035646790638566017,
-0.03877617418766022,
-0.04799570515751839,
0.07544246315956116,
0.023040348663926125,
-0.009236715734004974,
-0.08468047529459,
-0.10603971779346466,
-0.0721915066242218,
-0.03949818015098572,
-0.010736187919974327,
-0.08361084014177322,
-0.006521943490952253,
-0.14145727455615997,
0.002187572419643402,
-0.08330702036619186,
0.01683587208390236,
0.054011840373277664,
0.04737488552927971,
-0.011904501356184483,
-0.017711998894810677,
-0.0075558945536613464,
0.02850518561899662,
0.00034045628854073584,
-0.014358383603394032,
-0.010886657051742077,
-0.05832115188241005,
-0.01717331074178219,
0.011225790716707706,
-0.053794246166944504,
0.0014058459782972932,
0.0626593828201294,
-0.060944683849811554,
-0.07551971822977066,
0.011654792353510857,
-0.05741524696350098,
0.07478227466344833,
0.03775688260793686,
-0.01036314107477665,
0.0025379296857863665,
0.11951497942209244,
-0.006730262190103531,
-0.1335231363773346,
0.060071371495723724,
-0.03312603756785393,
0.05754341185092926,
-0.005875370465219021,
0.02533903904259205,
-0.044157277792692184,
0.020152613520622253,
0.024057405069470406,
0.05613606050610542,
0.010479035787284374,
-0.006164866499602795,
-0.11667802184820175,
-0.03271249309182167,
0.034212905913591385,
0.10130439698696136,
0.04212174564599991,
-0.04105372726917267,
0.14258335530757904,
-0.005372106097638607,
0.016781693324446678,
0.02637607604265213,
-0.01751880533993244,
0.023187965154647827,
0.028507249429821968,
0.08011577278375626,
0.022971153259277344,
0.017580002546310425,
0.0023480497766286135,
-0.014989026822149754,
-0.030046258121728897,
0.0036652295384556055,
-0.04449416697025299,
0.06037764996290207,
-0.10665471106767654,
-0.038043756037950516,
0.016518548130989075,
-0.04654303193092346,
0.06620461493730545,
-0.0009442662703804672,
0.10398631542921066,
0.034717947244644165,
-0.0326223149895668,
0.07416593283414841,
-0.03860817477107048,
0.08583183586597443,
-0.010104767046868801,
-0.011762033216655254,
-1.2574607453856602e-34,
-0.010688858106732368,
0.030102884396910667,
-0.03686292842030525,
0.03690927475690842,
0.08104853332042694,
-0.04834333807229996,
0.07203755527734756,
-0.017489023506641388,
-0.06063000485301018,
0.0073454310186207294,
-0.05313780903816223,
0.02417217195034027,
-0.08064451068639755,
-0.00020004868565592915,
-0.04718392714858055,
0.04513851925730705,
-0.0035439985804259777,
-0.024644652381539345,
0.033138345927000046,
-0.009507828392088413,
0.03857496380805969,
0.030504662543535233,
0.002010643482208252,
0.015926510095596313,
-0.0050871120765805244,
0.03479340672492981,
-0.03208908066153526,
-0.03127133473753929,
0.022612284868955612,
0.028669899329543114,
0.08531146496534348,
-0.015184173360466957,
0.06772322207689285,
0.07147496193647385,
0.029521597549319267,
-0.009831679984927177,
0.013595344498753548,
-0.03842086344957352,
-0.09098552167415619,
0.011817469261586666,
-0.003254082053899765,
0.02417096495628357,
-0.0411798320710659,
0.01778406649827957,
-0.07853227853775024,
-0.08458688855171204,
-0.0548408068716526,
-0.011531802825629711,
0.012368064373731613,
0.020621532574295998,
-0.03442632779479027,
-0.03678719326853752,
0.06651957333087921,
-0.0211251899600029,
0.027127336710691452,
0.00928240455687046,
-0.03385942801833153,
0.002803707029670477,
-0.00992424227297306,
-0.06690182536840439,
0.036377113312482834,
-0.029725532978773117,
-0.0330515056848526,
0.05383114889264107,
0.03441905602812767,
0.017433585599064827,
-0.0060651907697319984,
-0.0036006446462124586,
-0.004419127944856882,
0.008009633980691433,
-0.041160400956869125,
0.02477651834487915,
-0.11926749348640442,
-0.01924988627433777,
-0.041980158537626266,
-0.03482022508978844,
0.006540514528751373,
-0.06982672214508057,
0.0035098937805742025,
-0.008400692604482174,
-0.10615328699350357,
-0.018541395664215088,
-0.04421965405344963,
0.010725431144237518,
-0.04898674786090851,
-0.02127695083618164,
-0.07854758203029633,
-0.00887246336787939,
0.12034254521131516,
-0.14353765547275543,
0.05685464292764664,
-0.024672014638781548,
-0.07683954387903214,
0.008531816303730011,
-0.03625922277569771,
-2.4340704383087865e-33,
0.11741244047880173,
0.0798511654138565,
0.05309712886810303,
0.04149886220693588,
-0.06926047801971436,
0.04900158569216728,
0.07240337133407593,
-0.008486582897603512,
0.036443956196308136,
0.007550202775746584,
-0.024276908487081528,
0.06941647082567215,
0.05763441324234009,
-0.10536795109510422,
0.038799770176410675,
0.08216750621795654,
-0.004576998762786388,
-0.06302283704280853,
-0.015282374806702137,
-0.00030435420922003686,
-0.024696707725524902,
0.0032445122487843037,
-0.0054509928449988365,
0.07978963106870651,
0.0022399076260626316,
-0.005145419854670763,
0.02670355699956417,
-0.03927517309784889,
-0.0323246568441391,
-0.00013387425860855728,
0.07147172838449478,
0.07892515510320663,
-0.07894982397556305,
-0.10343074053525925,
-0.055399324744939804,
0.03264104574918747,
0.0023283043410629034,
0.030525820329785347,
0.02281016670167446,
0.016499755904078484,
0.11018448323011398,
0.047572873532772064,
-0.028151463717222214,
-0.011899536475539207,
0.0025700684636831284,
-0.025097306817770004,
0.013974123634397984,
0.023576846346259117,
-0.006228271871805191,
-0.05539001524448395,
0.06830089539289474,
-0.07986833155155182,
0.003601088421419263,
-0.06787102669477463,
0.024283066391944885,
0.047069016844034195,
0.04214268550276756,
0.0014230816159397364,
-0.07835236936807632,
0.007044370751827955,
0.05777759477496147,
-0.0578610822558403,
-0.1376761645078659,
-0.06731123477220535,
-0.0854189470410347,
0.059819526970386505,
-0.08652382344007492,
-0.03314734995365143,
0.04135603457689285,
-0.06057994067668915,
0.02512609027326107,
-0.011512954719364643,
-0.06491383165121078,
-0.015699656680226326,
0.04441601783037186,
0.07723871618509293,
0.04174800217151642,
0.09298981726169586,
0.0466141477227211,
0.0575236901640892,
0.06814119219779968,
0.05357912927865982,
0.00389206875115633,
-0.08054005354642868,
0.016940206289291382,
-0.02844124659895897,
-0.07985524088144302,
0.15340249240398407,
-0.03125002235174179,
-0.02767687663435936,
-0.0002493439242243767,
0.014730055816471577,
0.02123374305665493,
-0.018770014867186546,
-0.023826347663998604,
-4.981566803508031e-8,
-0.06374987959861755,
0.013630649074912071,
-0.08852523565292358,
0.0017703826306387782,
0.015521159395575523,
0.030058586969971657,
0.020708763971924782,
0.0021783059928566217,
0.08523713052272797,
0.07318934053182602,
-0.02566991187632084,
0.03598999232053757,
-0.0670294314622879,
0.05547286942601204,
-0.08722561597824097,
0.06641042232513428,
0.014532509259879589,
0.12787401676177979,
-0.02549605816602707,
-0.004878572188317776,
-0.00326153845526278,
-0.013131005689501762,
0.015669366344809532,
0.04445295035839081,
0.03182706609368324,
-0.016736144199967384,
0.008746236562728882,
-0.002393176546320319,
-0.04484188184142113,
0.026284124702215195,
-0.09549784660339355,
-0.0064715370535850525,
-0.02577322907745838,
-0.02915562316775322,
-0.09224089980125427,
0.07905027270317078,
0.025448797270655632,
-0.038280732929706573,
0.018331175670027733,
-0.018834054470062256,
0.04116196185350418,
-0.015875453129410744,
-0.02254265360534191,
-0.06863230466842651,
-0.02865995094180107,
-0.031689681112766266,
-0.042951565235853195,
0.039431456476449966,
-0.08818388730287552,
0.013504445552825928,
0.013468172401189804,
-0.0028586057014763355,
-0.014680886641144753,
0.037593189626932144,
-0.003716688835993409,
0.0657958984375,
-0.013032629154622555,
-0.029047280550003052,
-0.024281058460474014,
-0.07070090621709824,
0.02170591987669468,
0.006164874415844679,
0.061623264104127884,
-0.08076213300228119
] | 0.086299 |
namespaces must be constructed prior to the evaluation of the CJS module. These CommonJS namespace objects also provide the `default` export as a `'module.exports'` named export, in order to unambiguously indicate that their representation in CommonJS uses this value, and not the namespace value. This mirrors the semantics of the handling of the `'module.exports'` export name in [`require(esm)`][] interop support. When importing a CommonJS module, it can be reliably imported using the ES module default import or its corresponding sugar syntax: ```js import { default as cjs } from 'cjs'; // Identical to the above import cjsSugar from 'cjs'; console.log(cjs); console.log(cjs === cjsSugar); // Prints: // // true ``` This Module Namespace Exotic Object can be directly observed either when using `import \* as m from 'cjs'` or a dynamic import: ```js import \* as m from 'cjs'; console.log(m); console.log(m === await import('cjs')); // Prints: // [Module] { default: , 'module.exports': } // true ``` For better compatibility with existing usage in the JS ecosystem, Node.js in addition attempts to determine the CommonJS named exports of every imported CommonJS module to provide them as separate ES module exports using a static analysis process. For example, consider a CommonJS module written: ```cjs // cjs.cjs exports.name = 'exported'; ``` The preceding module supports named imports in ES modules: ```js import { name } from './cjs.cjs'; console.log(name); // Prints: 'exported' import cjs from './cjs.cjs'; console.log(cjs); // Prints: { name: 'exported' } import \* as m from './cjs.cjs'; console.log(m); // Prints: // [Module] { // default: { name: 'exported' }, // 'module.exports': { name: 'exported' }, // name: 'exported' // } ``` As can be seen from the last example of the Module Namespace Exotic Object being logged, the `name` export is copied off of the `module.exports` object and set directly on the ES module namespace when the module is imported. Live binding updates or new exports added to `module.exports` are not detected for these named exports. The detection of named exports is based on common syntax patterns but does not always correctly detect named exports. In these cases, using the default import form described above can be a better option. Named exports detection covers many common export patterns, reexport patterns and build tool and transpiler outputs. See [merve][] for the exact semantics implemented. ### Differences between ES modules and CommonJS #### No `require`, `exports`, or `module.exports` In most cases, the ES module `import` can be used to load CommonJS modules. If needed, a `require` function can be constructed within an ES module using [`module.createRequire()`][]. #### No `\_\_filename` or `\_\_dirname` These CommonJS variables are not available in ES modules. `\_\_filename` and `\_\_dirname` use cases can be replicated via [`import.meta.filename`][] and [`import.meta.dirname`][]. #### No Addon Loading [Addons][] are not currently supported with ES module imports. They can instead be loaded with [`module.createRequire()`][] or [`process.dlopen`][]. #### No `require.main` To replace `require.main === module`, there is the [`import.meta.main`][] API. #### No `require.resolve` Relative resolution can be handled via `new URL('./local', import.meta.url)`. For a complete `require.resolve` replacement, there is the [import.meta.resolve][] API. Alternatively `module.createRequire()` can be used. #### No `NODE\_PATH` `NODE\_PATH` is not part of resolving `import` specifiers. Please use symlinks if this behavior is desired. #### No `require.extensions` `require.extensions` is not used by `import`. Module customization hooks can provide a replacement. #### No `require.cache` `require.cache` is not used by `import` as the ES module loader has its own separate cache. ## JSON modules JSON files can be referenced by `import`: ```js import packageConfig from './package.json' with { type: 'json' }; ``` The `with { type: 'json' }` syntax is mandatory; see [Import Attributes][]. The imported JSON only | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.12144304066896439,
-0.07579365372657776,
-0.023761611431837082,
0.0734955444931984,
0.033754993230104446,
-0.040798306465148926,
0.009286330081522465,
0.033470623195171356,
0.013190796598792076,
-0.05860212445259094,
-0.008197493851184845,
-0.06236725673079491,
0.002701071323826909,
0.026651442050933838,
0.07579181343317032,
0.015511305071413517,
0.005140526220202446,
-0.033189088106155396,
-0.07394908368587494,
-0.009320801123976707,
0.0701737031340599,
-0.03854804113507271,
0.004422892816364765,
-0.0339459590613842,
-0.040811292827129364,
-0.022481299936771393,
0.005834648385643959,
0.0217419546097517,
0.03541421517729759,
-0.0438782162964344,
0.012102232314646244,
-0.01689348928630352,
-0.0007112102466635406,
0.07990825921297073,
-0.0076935430988669395,
0.1147296130657196,
-0.05676970258355141,
-0.0679549053311348,
0.05927093327045441,
-0.07531285285949707,
-0.007334344554692507,
0.12347730994224548,
0.009606518782675266,
-0.043963827192783356,
-0.030403345823287964,
-0.03549812734127045,
-0.11317204684019089,
-0.031455863267183304,
-0.08052955567836761,
-0.0007122436072677374,
-0.006460076197981834,
-0.05390244349837303,
-0.04821350798010826,
-0.037640076130628586,
-0.029545551165938377,
0.06398677825927734,
-0.049924883991479874,
-0.005219966173171997,
0.0509759783744812,
0.050609324127435684,
-0.032459158450365067,
0.057864584028720856,
0.030712639912962914,
0.03670782595872879,
0.0034682692494243383,
-0.08056510239839554,
-0.024686075747013092,
0.06844355911016464,
-0.004508442245423794,
0.0149189168587327,
-0.11038115620613098,
0.050954267382621765,
0.04377887398004532,
0.010996739380061626,
-0.03267968073487282,
-0.1320125311613083,
-0.019966479390859604,
0.06533192098140717,
0.032369714230298996,
0.022876320406794548,
-0.023500127717852592,
0.05771573260426521,
-0.07983709871768951,
0.05631560832262039,
0.027165979146957397,
0.07350844889879227,
-0.026659883558750153,
0.04340677335858345,
-0.005259625613689423,
0.026611849665641785,
-0.01930900476872921,
-0.17135755717754364,
0.0011940279509872198,
0.13419954478740692,
-0.028770659118890762,
-0.014123775996267796,
0.07708024233579636,
0.10778304189443588,
-0.016871485859155655,
-0.025735771283507347,
-0.07173670828342438,
0.022760353982448578,
0.09918440878391266,
0.030024193227291107,
0.02603341080248356,
-0.00930220726877451,
-0.011144310235977173,
-0.027241535484790802,
0.0291488915681839,
-0.005988720804452896,
-0.03901928290724754,
0.06970364600419998,
-0.06899840384721756,
-0.07364662736654282,
-0.043756626546382904,
0.004163101315498352,
0.032440315932035446,
-0.040786102414131165,
0.09194744378328323,
0.04875962808728218,
0.053492527455091476,
-0.014717936515808105,
0.10009640455245972,
-0.031832508742809296,
0.06519931554794312,
0.009878086857497692,
0.018156636506319046,
1.0671129451570072e-33,
-0.04440440610051155,
-0.03777700662612915,
-0.028772704303264618,
0.0671033039689064,
-0.002186277648434043,
-0.004550931043922901,
0.010756143368780613,
0.09168791770935059,
-0.060521021485328674,
0.014843927696347237,
-0.011859625577926636,
0.12569387257099152,
-0.01872633956372738,
0.015470974147319794,
0.004912691190838814,
0.10244496166706085,
0.0731978788971901,
-0.01894231326878071,
0.043223265558481216,
0.013818890787661076,
-0.0035859132185578346,
0.08542551100254059,
-0.005804563872516155,
0.033429767936468124,
0.0413823276758194,
0.04908376559615135,
0.017127977684140205,
-0.027821220457553864,
-0.0049304780550301075,
0.03451862931251526,
0.018893135711550713,
0.041319217532873154,
0.05083614960312843,
0.03573334217071533,
0.08954962342977524,
0.03875578194856644,
-0.02813282422721386,
0.018612317740917206,
-0.10644751042127609,
0.02484836056828499,
0.01691233366727829,
0.039354581385850906,
-0.08513867855072021,
0.01633617840707302,
-0.04855791851878166,
-0.0894138365983963,
-0.01614006608724594,
-0.05747455358505249,
0.05384271591901779,
-0.04086972773075104,
-0.06635558605194092,
0.04130285233259201,
0.08903352171182632,
0.041626956313848495,
0.014937995932996273,
0.00018326472491025925,
0.05761706456542015,
-0.02425481006503105,
-0.009838376194238663,
-0.08070016652345657,
-0.0002843848487827927,
0.0059061553329229355,
0.012880770489573479,
0.09103237092494965,
0.05001458525657654,
0.01075755525380373,
-0.053108759224414825,
0.03608230501413345,
-0.037304021418094635,
0.06784402579069138,
-0.006675731390714645,
-0.018452158197760582,
-0.1202714666724205,
0.0027954874094575644,
0.09789171069860458,
-0.007273246068507433,
-0.031780753284692764,
0.027991635724902153,
-0.030050117522478104,
-0.059040021151304245,
-0.02634289860725403,
0.0009974465938284993,
-0.016758330166339874,
-0.020198248326778412,
-0.025759071111679077,
0.037567853927612305,
-0.0007462495123036206,
-0.0001994361518882215,
0.08346647024154663,
0.025112450122833252,
0.04554374888539314,
-0.030430523678660393,
-0.038982242345809937,
-0.037728846073150635,
-0.11789354681968689,
-4.291189882134763e-33,
0.04972326382994652,
0.0473245270550251,
-0.0612405426800251,
0.06927073746919632,
-0.08639707416296005,
-0.04985750466585159,
0.004816365893930197,
-0.029578140005469322,
0.008436530828475952,
0.028291715309023857,
-0.05534649267792702,
0.042500853538513184,
0.05662820115685463,
0.031070822849869728,
0.0739467442035675,
0.09949461370706558,
-0.06471492350101471,
0.01032985094934702,
-0.03881338611245155,
-0.077248215675354,
0.03486189991235733,
0.014640295878052711,
0.00025640768581070006,
-0.055312879383563995,
-0.008172854781150818,
0.027057789266109467,
-0.11049805581569672,
0.04238398000597954,
-0.004046257585287094,
0.02571367844939232,
-0.05142362415790558,
0.006865669507533312,
0.011953861452639103,
0.0006933761178515851,
-0.0755552425980568,
-0.09494753926992416,
-0.030148714780807495,
0.05023528262972832,
0.06348039209842682,
-0.055855877697467804,
0.018796220421791077,
0.02642756700515747,
-0.0839298665523529,
0.0162441898137331,
-0.05314130336046219,
-0.004745151847600937,
-0.03789733350276947,
0.01119544543325901,
0.0909416452050209,
-0.06630408763885498,
-0.03134734183549881,
-0.10141979157924652,
-0.06273199617862701,
-0.039018381386995316,
-0.033309996128082275,
0.03039424866437912,
0.0028698411770164967,
-0.02928026020526886,
-0.034492507576942444,
0.0380198135972023,
0.04634067788720131,
-0.050690922886133194,
-0.048348840326070786,
-0.03638451546430588,
-0.02026711404323578,
-0.013708582147955894,
-0.10121850669384003,
-0.012388110160827637,
0.07691848278045654,
-0.09795116633176804,
-0.05062588304281235,
-0.019861100241541862,
-0.043384429067373276,
-0.02798500843346119,
-0.07305911928415298,
0.0472283735871315,
0.047486964613199234,
-0.04309343174099922,
0.06690265983343124,
0.03211725875735283,
0.005687988828867674,
0.0027918291743844748,
0.03200388327240944,
-0.004867724608629942,
-0.0032846347894519567,
0.024017352610826492,
0.0626547560095787,
0.03299163281917572,
-0.04132971540093422,
-0.05507619306445122,
0.06609056890010834,
0.046857185661792755,
-0.053103286772966385,
0.0005987926851958036,
0.020069845020771027,
-4.783117901752121e-8,
-0.06009824573993683,
-0.021207811310887337,
-0.06356872618198395,
-0.023661982268095016,
-0.0037873091641813517,
-0.03626760095357895,
0.01987600140273571,
-0.04520693048834801,
0.053390439599752426,
0.09565035253763199,
-0.025954119861125946,
0.04891262203454971,
0.017603201791644096,
0.014917096123099327,
-0.03204631432890892,
0.019300276413559914,
-0.0578710213303566,
0.041414979845285416,
-0.030971823260188103,
0.04247317835688591,
-0.06764031946659088,
-0.04780924320220947,
0.04984267055988312,
0.008639601059257984,
-0.026442037895321846,
-0.036433976143598557,
0.05618252232670784,
0.04725330322980881,
0.030296918004751205,
-0.049097947776317596,
-0.12608881294727325,
0.07378000766038895,
0.02725728414952755,
0.035509493201971054,
-0.0679549053311348,
0.01568099483847618,
0.04976298287510872,
-0.061337489634752274,
0.07394657284021378,
0.07636035233736038,
0.02546587772667408,
-0.013912414200603962,
-0.0430322103202343,
0.021499689668416977,
-0.021766195073723793,
0.03290349245071411,
-0.004997312091290951,
0.04689536988735199,
-0.04783570021390915,
0.019872372969985008,
0.008146031759679317,
0.01847640983760357,
-0.08715614676475525,
0.047336477786302567,
0.010635914281010628,
-0.010478349402546883,
-0.04580220207571983,
-0.020510686561465263,
0.010583315044641495,
-0.10306525230407715,
-0.009190898388624191,
-0.010491155087947845,
0.07106740772724152,
-0.06758354604244232
] | 0.112713 |
used by `import` as the ES module loader has its own separate cache. ## JSON modules JSON files can be referenced by `import`: ```js import packageConfig from './package.json' with { type: 'json' }; ``` The `with { type: 'json' }` syntax is mandatory; see [Import Attributes][]. The imported JSON only exposes a `default` export. There is no support for named exports. A cache entry is created in the CommonJS cache to avoid duplication. The same object is returned in CommonJS if the JSON module has already been imported from the same path. ## Wasm modules Importing both WebAssembly module instances and WebAssembly source phase imports is supported. Both of these integrations are in line with the [ES Module Integration Proposal for WebAssembly][]. ### Wasm Source Phase Imports > Stability: 1.2 - Release candidate The [Source Phase Imports][] proposal allows the `import source` keyword combination to import a `WebAssembly.Module` object directly, instead of getting a module instance already instantiated with its dependencies. This is useful when needing custom instantiations for Wasm, while still resolving and loading it through the ES module integration. For example, to create multiple instances of a module, or to pass custom imports into a new instance of `library.wasm`: ```js import source libraryModule from './library.wasm'; const instance1 = await WebAssembly.instantiate(libraryModule, importObject1); const instance2 = await WebAssembly.instantiate(libraryModule, importObject2); ``` In addition to the static source phase, there is also a dynamic variant of the source phase via the `import.source` dynamic phase import syntax: ```js const dynamicLibrary = await import.source('./library.wasm'); const instance = await WebAssembly.instantiate(dynamicLibrary, importObject); ``` ### JavaScript String Builtins > Stability: 1.2 - Release candidate When importing WebAssembly modules, the [WebAssembly JS String Builtins Proposal][] is automatically enabled through the ESM Integration. This allows WebAssembly modules to directly use efficient compile-time string builtins from the `wasm:js-string` namespace. For example, the following Wasm module exports a string `getLength` function using the `wasm:js-string` `length` builtin: ```text (module ;; Compile-time import of the string length builtin. (import "wasm:js-string" "length" (func $string\_length (param externref) (result i32))) ;; Define getLength, taking a JS value parameter assumed to be a string, ;; calling string length on it and returning the result. (func $getLength (param $str externref) (result i32) local.get $str call $string\_length ) ;; Export the getLength function. (export "getLength" (func $get\_length)) ) ``` ```js import { getLength } from './string-len.wasm'; getLength('foo'); // Returns 3. ``` Wasm builtins are compile-time imports that are linked during module compilation rather than during instantiation. They do not behave like normal module graph imports and they cannot be inspected via `WebAssembly.Module.imports(mod)` or virtualized unless recompiling the module using the direct `WebAssembly.compile` API with string builtins disabled. Importing a module in the source phase before it has been instantiated will also use the compile-time builtins automatically: ```js import source mod from './string-len.wasm'; const { exports: { getLength } } = await WebAssembly.instantiate(mod, {}); getLength('foo'); // Also returns 3. ``` ### Wasm Instance Phase Imports > Stability: 1.1 - Active development Instance imports allow any `.wasm` files to be imported as normal modules, supporting their module imports in turn. For example, an `index.js` containing: ```js import \* as M from './library.wasm'; console.log(M); ``` executed under: ```bash node index.mjs ``` would provide the exports interface for the instantiation of `library.wasm`. ### Reserved Wasm Namespaces When importing WebAssembly module instances, they cannot use import module names or import/export names that start with reserved prefixes: \* `wasm-js:` - reserved in all module import names, module names and export names. \* `wasm:` - reserved in module import names and export names (imported module names are allowed in order to support future builtin polyfills). Importing | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.11733078956604004,
-0.03242890164256096,
-0.005123336333781481,
0.003374675754457712,
0.06986768543720245,
-0.028160152956843376,
0.0008988851914182305,
0.016819333657622337,
-0.003368299687281251,
-0.01170861441642046,
0.026611844077706337,
0.03135521337389946,
-0.03652535751461983,
0.011930695734918118,
0.1297278255224228,
0.013982557691633701,
0.03019164875149727,
0.0008541028364561498,
-0.06753659248352051,
-0.009588449262082577,
0.08290400356054306,
0.01753580942749977,
0.018371224403381348,
-0.03266293555498123,
-0.013846577145159245,
-0.016921574249863625,
-0.003907401114702225,
0.008766653947532177,
0.046551816165447235,
-0.030346527695655823,
-0.023333285003900528,
0.032550226897001266,
-0.0665006935596466,
0.038275424391031265,
-0.030557183548808098,
0.12366937100887299,
-0.027813512831926346,
-0.09071097522974014,
0.032392002642154694,
-0.07882469147443771,
0.058676280081272125,
0.11177650094032288,
0.0002583708555903286,
-0.0736766830086708,
-0.026336105540394783,
-0.08391781151294708,
-0.03456969931721687,
-0.011742426082491875,
-0.08707257360219955,
0.006242763716727495,
0.017903342843055725,
-0.04450804740190506,
-0.07274067401885986,
0.02360701747238636,
-0.010446893982589245,
0.05799560248851776,
-0.005654448643326759,
0.011538608931005001,
-0.04410587251186371,
0.08455339074134827,
-0.012822483666241169,
0.012818768620491028,
0.04790651798248291,
-0.005271383561193943,
-0.01155882142484188,
-0.02976994216442108,
0.042416803538799286,
0.015745386481285095,
0.03669854626059532,
-0.07818815112113953,
-0.06791822612285614,
-0.025250999256968498,
0.030026663094758987,
-0.022960234433412552,
0.00744979502633214,
-0.04419945552945137,
0.031359829008579254,
0.05788753926753998,
0.02239830419421196,
-0.02210327237844467,
-0.06371892988681793,
-0.010772229172289371,
-0.01328605879098177,
-0.00967357587069273,
-0.04020291194319725,
0.03223499283194542,
0.01803341507911682,
0.022100821137428284,
0.05091605708003044,
0.008943046443164349,
-0.05884331464767456,
-0.15725015103816986,
0.03148028999567032,
0.04185335710644722,
0.003417011583223939,
0.028867032378911972,
0.05480196326971054,
0.14189457893371582,
-0.0008502712589688599,
-0.019615164026618004,
-0.003999553620815277,
0.017135415226221085,
0.09920697659254074,
0.029032306745648384,
-0.014523772522807121,
-0.04572002962231636,
0.028479773551225662,
-0.014376015402376652,
0.018832053989171982,
-0.00175800162833184,
-0.014888356439769268,
0.03449822589755058,
0.04784821718931198,
-0.09945404529571533,
-0.07197035849094391,
-0.013105610385537148,
0.009096532128751278,
-0.039358410984277725,
0.053093671798706055,
0.04755933955311775,
0.047767601907253265,
-0.017093148082494736,
0.147325798869133,
-0.027396634221076965,
0.10610774159431458,
-0.03227335959672928,
0.018672147765755653,
3.249143160147591e-33,
-0.005001724231988192,
-0.022651677951216698,
-0.046118997037410736,
0.10298106074333191,
0.007540307939052582,
-0.05405224487185478,
0.06953573226928711,
0.012039104476571083,
-0.06709342449903488,
-0.015517917461693287,
-0.02221405878663063,
0.11864659190177917,
-0.03334060683846474,
0.10606590658426285,
-0.03397789224982262,
0.02363651618361473,
0.023892149329185486,
-0.057043805718421936,
0.13329677283763885,
0.048655916005373,
0.022225704044103622,
0.029959021136164665,
0.03154367953538895,
0.01650511473417282,
0.0413285456597805,
0.026997746899724007,
0.015263095498085022,
0.04571644589304924,
-0.025080043822526932,
0.036959122866392136,
0.0578213706612587,
-0.0013820808380842209,
-0.010229479521512985,
0.05715393275022507,
0.045930225402116776,
0.0005857714568264782,
-0.013792499899864197,
0.006764639634639025,
-0.0833270326256752,
-0.0017427096609026194,
0.03978390991687775,
0.08400207757949829,
-0.07345781475305557,
-0.010182132013142109,
-0.0675087720155716,
-0.1348583996295929,
-0.01988820731639862,
-0.04835355654358864,
0.1255563497543335,
-0.07805851101875305,
-0.07882598787546158,
0.0061274063773453236,
0.11351071298122406,
-0.029606947675347328,
-0.0005046126316301525,
0.029723431915044785,
0.11790769547224045,
-0.06243804842233658,
0.03531791269779205,
-0.03834591060876846,
-0.024915631860494614,
-0.024224165827035904,
-0.02763417176902294,
0.08889346569776535,
0.053328100591897964,
0.06987131386995316,
-0.023691747337579727,
-0.0020159301348030567,
-0.020921824499964714,
0.023238150402903557,
0.012835859321057796,
-0.019749363884329796,
-0.06404022127389908,
-0.03257274627685547,
0.007256261073052883,
0.0047901892103254795,
-0.018374044448137283,
0.04882250726222992,
-0.012214509770274162,
0.011006800457835197,
0.01996496506035328,
0.031985804438591,
-0.07804933935403824,
-0.003831108333542943,
-0.07313212007284164,
0.024598950520157814,
-0.017461679875850677,
-0.05394583195447922,
0.08527149260044098,
0.023153476417064667,
0.028511937707662582,
0.020274514332413673,
0.035501834005117416,
-0.014127489179372787,
-0.05831357091665268,
-4.4888650529308695e-33,
0.04185733571648598,
0.017677081748843193,
-0.018065402284264565,
0.08349142223596573,
-0.04023431986570358,
-0.020810380578041077,
0.03095104545354843,
0.017651652917265892,
0.05464735999703407,
0.052322495728731155,
-0.029840383678674698,
-0.03761120140552521,
0.04734295234084129,
-0.014497721567749977,
0.03714334964752197,
0.12576715648174286,
0.00016884574142750353,
-0.0820300504565239,
0.026039384305477142,
-0.07851824909448624,
0.037647396326065063,
-0.0009893103269860148,
0.032044798135757446,
-0.010766790248453617,
-0.0023596854880452156,
-0.028237327933311462,
-0.04999534785747528,
-0.029700057581067085,
-0.0805165246129036,
0.0005662415642291307,
-0.060376401990652084,
0.0011350520653650165,
0.017044905573129654,
-0.058934301137924194,
-0.1159505695104599,
-0.02376243658363819,
0.007656150497496128,
0.03127886354923248,
0.008492346853017807,
-0.08586589246988297,
0.010564331896603107,
0.033373214304447174,
-0.044667378067970276,
0.042032718658447266,
-0.041308123618364334,
-0.03980023041367531,
-0.05226418748497963,
0.054585788398981094,
0.014809108339250088,
-0.025027379393577576,
-0.014757590368390083,
-0.021648738533258438,
-0.12093636393547058,
-0.04098701849579811,
-0.002920466009527445,
0.022862492129206657,
0.03263813629746437,
0.01963113062083721,
-0.02809903956949711,
-0.013058106414973736,
0.05354250594973564,
-0.08079561591148376,
-0.06207108497619629,
-0.05255095288157463,
-0.04083859920501709,
0.0059129917062819,
-0.07425568997859955,
-0.0915461853146553,
0.0187701266258955,
-0.016424423083662987,
-0.01994861662387848,
-0.046967513859272,
-0.008735225535929203,
-0.0188839640468359,
-0.04217515513300896,
-0.046010423451662064,
0.006659326609224081,
-0.03182443976402283,
0.03146519139409065,
0.028343921527266502,
-0.008181019686162472,
0.010565480217337608,
-0.034418292343616486,
-0.00035500156809575856,
0.07361707836389542,
-0.03299284726381302,
0.005166210234165192,
0.08374092727899551,
-0.019920971244573593,
-0.029201893135905266,
-0.006582993548363447,
-0.02833663485944271,
-0.04557444900274277,
-0.004419781267642975,
-0.01453523151576519,
-4.8117303919070764e-8,
-0.06280390918254852,
-0.015226133167743683,
-0.0835050716996193,
0.020489061251282692,
-0.009935913607478142,
-0.04146039858460426,
0.058891430497169495,
0.03385978937149048,
0.10460086166858673,
0.09060546010732651,
0.06993730366230011,
0.09182725101709366,
-0.06995343416929245,
0.01912444829940796,
-0.011261108331382275,
0.07048259675502777,
-0.004325384274125099,
0.10055024176836014,
-0.046006981283426285,
-0.08311141282320023,
0.022440670058131218,
-0.0031026452779769897,
0.08455881476402283,
0.017338046804070473,
0.059056781232357025,
0.0589614063501358,
0.010057109408080578,
0.0316082239151001,
-0.02907703071832657,
-0.07943771779537201,
-0.16077740490436554,
0.00824234914034605,
-0.023927917703986168,
-0.04752063378691673,
-0.020897602662444115,
-0.01565183326601982,
0.026253728196024895,
0.030392363667488098,
0.08186004310846329,
0.043237775564193726,
-0.0009669482242316008,
0.008364339359104633,
-0.054463960230350494,
0.041050396859645844,
0.028876349329948425,
0.057479433715343475,
-0.12563058733940125,
0.026529811322689056,
-0.08557801693677902,
-0.030633408576250076,
0.029870647937059402,
-0.037561025470495224,
-0.036786843091249466,
0.056237343698740005,
-0.030484622344374657,
-0.015990225598216057,
0.01316793728619814,
-0.015945224091410637,
0.04877036437392235,
-0.03827681392431259,
0.06589704006910324,
-0.008228777907788754,
0.058881182223558426,
-0.12620481848716736
] | 0.160385 |
use import module names or import/export names that start with reserved prefixes: \* `wasm-js:` - reserved in all module import names, module names and export names. \* `wasm:` - reserved in module import names and export names (imported module names are allowed in order to support future builtin polyfills). Importing a module using the above reserved names will throw a `WebAssembly.LinkError`. ## Top-level `await` The `await` keyword may be used in the top level body of an ECMAScript module. Assuming an `a.mjs` with ```js export const five = await Promise.resolve(5); ``` And a `b.mjs` with ```js import { five } from './a.mjs'; console.log(five); // Logs `5` ``` ```bash node b.mjs # works ``` If a top level `await` expression never resolves, the `node` process will exit with a `13` [status code][]. ```js import { spawn } from 'node:child\_process'; import { execPath } from 'node:process'; spawn(execPath, [ '--input-type=module', '--eval', // Never-resolving Promise: 'await new Promise(() => {})', ]).once('exit', (code) => { console.log(code); // Logs `13` }); ``` ## Loaders The former Loaders documentation is now at [Modules: Customization hooks][Module customization hooks]. ## Resolution and loading algorithm ### Features The default resolver has the following properties: \* FileURL-based resolution as is used by ES modules \* Relative and absolute URL resolution \* No default extensions \* No folder mains \* Bare specifier package resolution lookup through node\\_modules \* Does not fail on unknown extensions or protocols \* Can optionally provide a hint of the format to the loading phase The default loader has the following properties \* Support for builtin module loading via `node:` URLs \* Support for "inline" module loading via `data:` URLs \* Support for `file:` module loading \* Fails on any other URL protocol \* Fails on unknown extensions for `file:` loading (supports only `.cjs`, `.js`, and `.mjs`) ### Resolution algorithm The algorithm to load an ES module specifier is given through the \*\*ESM\\_RESOLVE\*\* method below. It returns the resolved URL for a module specifier relative to a parentURL. The resolution algorithm determines the full resolved URL for a module load, along with its suggested module format. The resolution algorithm does not determine whether the resolved URL protocol can be loaded, or whether the file extensions are permitted, instead these validations are applied by Node.js during the load phase (for example, if it was asked to load a URL that has a protocol that is not `file:`, `data:` or `node:`. The algorithm also tries to determine the format of the file based on the extension (see `ESM\_FILE\_FORMAT` algorithm below). If it does not recognize the file extension (eg if it is not `.mjs`, `.cjs`, or `.json`), then a format of `undefined` is returned, which will throw during the load phase. The algorithm to determine the module format of a resolved URL is provided by \*\*ESM\\_FILE\\_FORMAT\*\*, which returns the unique module format for any file. The \_"module"\_ format is returned for an ECMAScript Module, while the \_"commonjs"\_ format is used to indicate loading through the legacy CommonJS loader. Additional formats such as \_"addon"\_ can be extended in future updates. In the following algorithms, all subroutine errors are propagated as errors of these top-level routines unless stated otherwise. \_defaultConditions\_ is the conditional environment name array, `["node", "import"]`. The resolver can throw the following errors: \* \_Invalid Module Specifier\_: Module specifier is an invalid URL, package name or package subpath specifier. \* \_Invalid Package Configuration\_: package.json configuration is invalid or contains an invalid configuration. \* \_Invalid Package Target\_: Package exports or imports define a target module for the package that is an invalid type or string target. \* \_Package Path Not Exported\_: | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.06856371462345123,
-0.0016405114438384771,
0.018356993794441223,
0.07400777190923691,
0.058342911303043365,
-0.006139323115348816,
-0.04839641600847244,
0.07989711314439774,
-0.006896513048559427,
0.007370406296104193,
-0.020652493461966515,
-0.04316297546029091,
0.028524592518806458,
0.01779140718281269,
0.05887645110487938,
0.04738498851656914,
-0.07195552438497543,
0.03773991018533707,
0.028077315539121628,
-0.051379311829805374,
0.07566962391138077,
0.013357245363295078,
0.056635934859514236,
-0.03807607665657997,
-0.022661305963993073,
-0.0334746278822422,
-0.00772207323461771,
-0.0036519146524369717,
0.04560648649930954,
-0.07506050169467926,
0.005793558433651924,
0.0688965693116188,
-0.061587441712617874,
0.012769276276230812,
0.0655473843216896,
0.17219991981983185,
-0.05402691289782524,
-0.05041526257991791,
0.0013316511176526546,
-0.05758555978536606,
0.08976336568593979,
0.10522893816232681,
-0.02358856238424778,
-0.07968071848154068,
0.030639756470918655,
-0.08528830856084824,
-0.07233379781246185,
-0.00044715989497490227,
-0.0830627903342247,
0.004887459333986044,
0.0006585877272300422,
-0.0725235566496849,
-0.0915754958987236,
-0.004916428122669458,
0.0028806969057768583,
0.015749270096421242,
-0.03184477612376213,
-0.054414112120866776,
0.0026185796596109867,
0.02223227545619011,
-0.058699410408735275,
-0.0006494025583378971,
0.050941307097673416,
-0.03958185389637947,
0.03264817222952843,
0.07039982080459595,
-0.016735700890421867,
0.036361731588840485,
0.0034084294456988573,
0.12095212191343307,
-0.061543550342321396,
-0.023994198068976402,
-0.017091181129217148,
0.01987394690513611,
-0.08197294175624847,
-0.08799656480550766,
0.03438355028629303,
0.011510868556797504,
-0.03818314149975777,
0.0641644224524498,
-0.11383473873138428,
-0.02672133781015873,
-0.052391909062862396,
-0.023368297144770622,
-0.005778688937425613,
0.07459712773561478,
0.021912146359682083,
0.03562963008880615,
0.020377546548843384,
-0.00431371433660388,
-0.10560192167758942,
-0.19892194867134094,
-0.012426173314452171,
0.09255454689264297,
0.010756455361843109,
0.004108910448849201,
0.003024074947461486,
0.1429615169763565,
-0.02859075367450714,
-0.02908443659543991,
0.01389349065721035,
0.012024554423987865,
0.0029310944955796003,
-0.022507114335894585,
0.033620528876781464,
0.01092552486807108,
0.021783970296382904,
-0.013638386502861977,
0.01698238030076027,
-0.030477236956357956,
-0.026041505858302116,
-0.0091527309268713,
0.0545247383415699,
-0.04532301053404808,
0.030433770269155502,
0.01776934787631035,
0.06319619715213776,
-0.06972953677177429,
0.062448952347040176,
0.09174664318561554,
0.08544265478849411,
0.06746415793895721,
0.137858584523201,
-0.02125602960586548,
0.03315858915448189,
-0.010805903002619743,
-0.030503906309604645,
1.7932195709152766e-33,
-0.008920139633119106,
-0.040691692382097244,
-0.023226680234074593,
0.08940314501523972,
0.042576875537633896,
0.026745013892650604,
0.08852031081914902,
0.021014893427491188,
-0.11930493265390396,
0.004137578420341015,
-0.031786564737558365,
0.03821997344493866,
-0.03975176811218262,
-0.032109979540109634,
-0.017623648047447205,
-0.042525358498096466,
0.13568654656410217,
-0.039675042033195496,
0.03434537351131439,
0.05853458121418953,
-0.03428175672888756,
0.012369392439723015,
0.005963663104921579,
0.03765694051980972,
0.06057700514793396,
-0.002122132107615471,
-0.0033788562286645174,
0.01602480374276638,
0.05388738587498665,
0.0065265982411801815,
0.006749409716576338,
0.010735851712524891,
-0.02224907837808132,
0.011538977734744549,
0.05532335862517357,
-0.020393099635839462,
-0.032513298094272614,
0.03720507025718689,
-0.141816183924675,
-0.05454927310347557,
-0.019331471994519234,
0.05224775895476341,
-0.09095214307308197,
0.015546333976089954,
-0.027092507109045982,
-0.13833269476890564,
-0.025081977248191833,
-0.01260876003652811,
0.07825857400894165,
-0.06409505754709244,
-0.018661627545952797,
0.04098648950457573,
0.05944821983575821,
-0.07141754776239395,
0.03734127804636955,
-0.01135732140392065,
-0.024113405495882034,
-0.03713548183441162,
-0.005400719586759806,
-0.05593736842274666,
0.006716885603964329,
-0.07085719704627991,
-0.047867048531770706,
0.08284978568553925,
0.03295179456472397,
0.06090999022126198,
-0.015483307652175426,
0.03175406903028488,
-0.06743814051151276,
0.034077368676662445,
0.002422175370156765,
-0.021441204473376274,
0.02725055068731308,
0.06639406085014343,
0.07220566272735596,
0.003381904913112521,
-0.03792417421936989,
-0.009142976254224777,
-0.05075034871697426,
-0.024685217067599297,
0.06705110520124435,
-0.027936691418290138,
-0.0936160609126091,
0.03667234629392624,
0.025909898802638054,
0.021444806829094887,
-0.0021265575196594,
0.002347098896279931,
0.08585014939308167,
0.018090616911649704,
-0.00044947254355065525,
-0.04543006792664528,
-0.00994176510721445,
-0.05121782422065735,
-0.06562776118516922,
-3.963254141562207e-33,
0.05847147852182388,
0.08505935221910477,
-0.042359303683042526,
0.051146719604730606,
-0.08193003386259079,
-0.04052719473838806,
0.04592603072524071,
-0.00806264579296112,
-0.01663833111524582,
0.01760903373360634,
-0.05482790246605873,
0.03324509039521217,
0.06351067870855331,
0.014524023048579693,
0.006572513375431299,
0.08628691732883453,
-0.02661403827369213,
-0.024176694452762604,
0.05995072051882744,
-0.04478858411312103,
0.025681955739855766,
0.020643172785639763,
-0.04486512020230293,
0.0012576411245390773,
0.006224825046956539,
0.08374378830194473,
-0.06659766286611557,
0.03491576015949249,
-0.07325147837400436,
-0.0198122039437294,
-0.06394661217927933,
0.053810425102710724,
-0.07199744135141373,
-0.007084060925990343,
-0.02753075398504734,
-0.045433420687913895,
-0.014883166179060936,
0.06903784722089767,
-0.008605975657701492,
-0.07730732858181,
0.02714417688548565,
0.014761957339942455,
-0.020666198804974556,
0.01284712366759777,
-0.0032034595496952534,
-0.017612233757972717,
0.02249371074140072,
0.009455647319555283,
0.056189168244600296,
-0.005089490674436092,
-0.09309956431388855,
-0.07825916260480881,
-0.05430060625076294,
-0.020537296310067177,
-0.0299471877515316,
-0.051738981157541275,
-0.024101685732603073,
-0.014561866410076618,
0.04937810078263283,
-0.004876669961959124,
0.03791821375489235,
-0.10902009159326553,
0.04004579409956932,
-0.07639753818511963,
-0.05995272099971771,
-0.05769474804401398,
-0.1414070725440979,
-0.03023952804505825,
0.03573423624038696,
-0.005994739476591349,
0.0385163351893425,
0.019050024449825287,
-0.04748144745826721,
0.02643122896552086,
-0.042327310889959335,
0.013302418403327465,
-0.04670301079750061,
-0.022085007280111313,
0.05913267284631729,
0.08022361248731613,
0.013160113245248795,
0.04261694476008415,
-0.054287370294332504,
0.018167391419410706,
0.015896733850240707,
-0.046237364411354065,
0.07941534370183945,
0.06598472595214844,
-0.037184830754995346,
0.0006654143217019737,
0.025171687826514244,
0.01901206374168396,
-0.016497142612934113,
-0.016905086115002632,
-0.06803975999355316,
-5.23408374419887e-8,
-0.0531768873333931,
-0.04936446249485016,
-0.08665958046913147,
-0.02700848877429962,
0.04138569161295891,
-0.016270877793431282,
-0.02131444402039051,
-0.027160469442605972,
0.10576308518648148,
0.050151389092206955,
0.021723812445998192,
-0.02113330364227295,
0.005208071321249008,
0.0619986467063427,
-0.031475454568862915,
0.017635738477110863,
-0.014215448871254921,
0.05578358471393585,
-0.017625130712985992,
-0.03764037415385246,
-0.05176081880927086,
0.004695068579167128,
0.07931705564260483,
0.06926029920578003,
0.04366734251379967,
-0.051103994250297546,
0.08818413317203522,
0.011693811044096947,
-0.03378921374678612,
0.028940990567207336,
-0.11383794248104095,
0.03204576298594475,
0.0023899830412119627,
0.0011356354225426912,
-0.05676989629864693,
0.009664962068200111,
0.06648488342761993,
-0.030066831037402153,
0.04200340434908867,
0.058339741080999374,
0.02290363237261772,
0.005979984998703003,
-0.018020177260041237,
0.030246805399656296,
-0.00020440832304302603,
-0.02972092479467392,
-0.032579753547906876,
-0.012841770425438881,
-0.01694660261273384,
-0.019742388278245926,
0.052187878638505936,
-0.01625710166990757,
-0.02042577788233757,
0.06085251644253731,
0.04291359707713127,
-0.008487580344080925,
0.022734610363841057,
-0.07149560749530792,
0.014194848015904427,
-0.03053937293589115,
-0.005855486262589693,
-0.04154844582080841,
0.07769735157489777,
-0.06464313715696335
] | 0.076669 |
an invalid URL, package name or package subpath specifier. \* \_Invalid Package Configuration\_: package.json configuration is invalid or contains an invalid configuration. \* \_Invalid Package Target\_: Package exports or imports define a target module for the package that is an invalid type or string target. \* \_Package Path Not Exported\_: Package exports do not define or permit a target subpath in the package for the given module. \* \_Package Import Not Defined\_: Package imports do not define the specifier. \* \_Module Not Found\_: The package or module requested does not exist. \* \_Unsupported Directory Import\_: The resolved path corresponds to a directory, which is not a supported target for module imports. ### Resolution Algorithm Specification \*\*ESM\\_RESOLVE\*\*(\_specifier\_, \_parentURL\_) > 1. Let \_resolved\_ be \*\*undefined\*\*. > 2. If \_specifier\_ is a valid URL, then > 1. Set \_resolved\_ to the result of parsing and reserializing > \_specifier\_ as a URL. > 3. Otherwise, if \_specifier\_ starts with \_"/"\_, \_"./"\_, or \_"../"\_, then > 1. Set \_resolved\_ to the URL resolution of \_specifier\_ relative to > \_parentURL\_. > 4. Otherwise, if \_specifier\_ starts with \_"#"\_, then > 1. Set \_resolved\_ to the result of > \*\*PACKAGE\\_IMPORTS\\_RESOLVE\*\*(\_specifier\_, > \_parentURL\_, \_defaultConditions\_). > 5. Otherwise, > 1. Note: \_specifier\_ is now a bare specifier. > 2. Set \_resolved\_ the result of > \*\*PACKAGE\\_RESOLVE\*\*(\_specifier\_, \_parentURL\_). > 6. Let \_format\_ be \*\*undefined\*\*. > 7. If \_resolved\_ is a \_"file:"\_ URL, then > 1. If \_resolved\_ contains any percent encodings of \_"/"\_ or \_"\\"\_ (\_"%2F"\_ > and \_"%5C"\_ respectively), then > 1. Throw an \_Invalid Module Specifier\_ error. > 2. If the file at \_resolved\_ is a directory, then > 1. Throw an \_Unsupported Directory Import\_ error. > 3. If the file at \_resolved\_ does not exist, then > 1. Throw a \_Module Not Found\_ error. > 4. Set \_resolved\_ to the real path of \_resolved\_, maintaining the > same URL querystring and fragment components. > 5. Set \_format\_ to the result of \*\*ESM\\_FILE\\_FORMAT\*\*(\_resolved\_). > 8. Otherwise, > 1. Set \_format\_ the module format of the content type associated with the > URL \_resolved\_. > 9. Return \_format\_ and \_resolved\_ to the loading phase \*\*PACKAGE\\_RESOLVE\*\*(\_packageSpecifier\_, \_parentURL\_) > 1. Let \_packageName\_ be \*\*undefined\*\*. > 2. If \_packageSpecifier\_ is an empty string, then > 1. Throw an \_Invalid Module Specifier\_ error. > 3. If \_packageSpecifier\_ is a Node.js builtin module name, then > 1. Return the string \_"node:"\_ concatenated with \_packageSpecifier\_. > 4. If \_packageSpecifier\_ does not start with \_"@"\_, then > 1. Set \_packageName\_ to the substring of \_packageSpecifier\_ until the first > \_"/"\_ separator or the end of the string. > 5. Otherwise, > 1. If \_packageSpecifier\_ does not contain a \_"/"\_ separator, then > 1. Throw an \_Invalid Module Specifier\_ error. > 2. Set \_packageName\_ to the substring of \_packageSpecifier\_ > until the second \_"/"\_ separator or the end of the string. > 6. If \_packageName\_ starts with \_"."\_ or contains \_"\\"\_ or \_"%"\_, then > 1. Throw an \_Invalid Module Specifier\_ error. > 7. Let \_packageSubpath\_ be \_"."\_ concatenated with the substring of > \_packageSpecifier\_ from the position at the length of \_packageName\_. > 8. Let \_selfUrl\_ be the result of > \*\*PACKAGE\\_SELF\\_RESOLVE\*\*(\_packageName\_, \_packageSubpath\_, \_parentURL\_). > 9. If \_selfUrl\_ is not \*\*undefined\*\*, return \_selfUrl\_. > 10. While \_parentURL\_ is not the file system root, > 1. Let \_packageURL\_ be the URL resolution of \_"node\\_modules/"\_ > concatenated with \_packageName\_, relative to \_parentURL\_. > 2. Set \_parentURL\_ to the parent folder URL of \_parentURL\_. > 3. If the folder at \_packageURL\_ does not exist, then > 1. Continue the next loop iteration. > 4. Let \_pjson\_ be the result | https://github.com/nodejs/node/blob/main//doc/api/esm.md | main | nodejs | [
-0.06986156851053238,
-0.04390431195497513,
0.030855106189846992,
-0.04406594857573509,
-0.002550808247178793,
-0.03808347508311272,
-0.008321118541061878,
0.07961082458496094,
-0.05825178325176239,
0.0029795828741043806,
0.023826677352190018,
-0.05459942668676376,
-0.0017055163625627756,
0.06534235179424286,
0.1111828163266182,
0.11891784518957138,
0.0024445713497698307,
0.00752547150477767,
-0.058663032948970795,
0.019499028101563454,
0.08747483789920807,
0.02170528657734394,
0.01187661662697792,
-0.02903785929083824,
-0.051317740231752396,
-0.013917991891503334,
-0.039448853582143784,
0.0011717092711478472,
-0.02933025173842907,
0.0070752110332250595,
-0.004474475979804993,
0.057520363479852676,
-0.06489867717027664,
0.0025479504838585854,
0.16221193969249725,
0.11308717727661133,
-0.02018204890191555,
-0.1102730929851532,
0.0448504276573658,
-0.0741252675652504,
0.08736643195152283,
0.05621090531349182,
0.05482318252325058,
-0.14503063261508942,
-0.0010910645360127091,
-0.08666232228279114,
-0.023831959813833237,
0.017956137657165527,
-0.12608382105827332,
-0.029674645513296127,
-0.05472344160079956,
-0.0381317101418972,
-0.06817362457513809,
-0.05092751607298851,
0.047474320977926254,
0.049241628497838974,
-0.06274496018886566,
0.07530773431062698,
-0.024594644084572792,
0.021550271660089493,
0.05330437794327736,
-0.04743020236492157,
-0.0005001253448426723,
-0.09746472537517548,
-0.09316737949848175,
-0.009365363046526909,
-0.0578957200050354,
-0.035657238215208054,
0.031997859477996826,
0.03644438087940216,
-0.07667204737663269,
0.028705673292279243,
0.004774818662554026,
0.0836019441485405,
0.0171648059040308,
-0.09450842440128326,
0.038652464747428894,
0.042024798691272736,
-0.0077015189453959465,
-0.06359510868787766,
0.021759312599897385,
-0.014764606021344662,
-0.014155242592096329,
0.04663443937897682,
0.03453151509165764,
-0.0267720278352499,
-0.00997533556073904,
-0.009206126444041729,
0.016972187906503677,
0.020581413060426712,
-0.038932424038648605,
-0.16893459856510162,
-0.03298110514879227,
0.009562353603541851,
0.055298879742622375,
-0.012063357047736645,
-0.01781340315937996,
0.018250776454806328,
-0.03836655616760254,
0.04829559475183487,
-0.03302581608295441,
-0.015175244770944118,
0.05699668824672699,
0.028803475201129913,
-0.01013873890042305,
0.03256810083985329,
0.004030134528875351,
-0.008737096562981606,
-0.014280428178608418,
-0.04270277917385101,
-0.03129628300666809,
-0.04766393080353737,
0.03261813893914223,
-0.09827573597431183,
-0.0011788720730692148,
-0.0058292909525334835,
-0.01603601686656475,
0.015519144013524055,
0.0029427744448184967,
0.03715662285685539,
0.05209843069314957,
-0.015568558126688004,
0.07387766987085342,
-0.03774223476648331,
0.050364281982183456,
0.028199248015880585,
0.03751030191779137,
1.6835209687286023e-33,
-0.008090219460427761,
0.006124138366430998,
-0.036054790019989014,
0.0434480682015419,
0.07935912162065506,
-0.04512784630060196,
0.045279283076524734,
0.007199689280241728,
-0.007934545166790485,
-0.014095435850322247,
-0.024510951712727547,
-0.03385544195771217,
-0.05392961576581001,
0.060594797134399414,
0.0026828860864043236,
-0.02187735214829445,
0.04636804014444351,
0.052051838487386703,
0.06232122704386711,
0.003072810359299183,
0.04885420948266983,
0.02690514549612999,
0.001603313023224473,
-0.0047212629579007626,
-0.03253132849931717,
-0.019255321472883224,
0.039905011653900146,
-0.021426117047667503,
0.027972029522061348,
0.00302469776943326,
0.041169174015522,
-0.004701144061982632,
0.04563982039690018,
0.058999236673116684,
0.055437762290239334,
0.008691782131791115,
-0.0013906584354117513,
0.005952818784862757,
-0.09710528701543808,
-0.0010730063077062368,
-0.04257133975625038,
0.07981523126363754,
-0.0690232440829277,
0.07231000810861588,
0.04308975487947464,
-0.10298637300729752,
0.0040748389437794685,
-0.08236997574567795,
0.05785218998789787,
-0.024538513273000717,
-0.09200766682624817,
0.017276529222726822,
0.07780288904905319,
-0.06700341403484344,
0.04053589329123497,
-0.036352600902318954,
0.005232410505414009,
0.01778378151357174,
0.026490576565265656,
-0.13078245520591736,
0.021095406264066696,
-0.06802600622177124,
-0.051177412271499634,
0.013802952133119106,
0.06721419095993042,
0.02062731422483921,
-0.056380126625299454,
0.01281301211565733,
-0.04103771969676018,
0.04836362972855568,
0.013575408607721329,
0.044170040637254715,
-0.0275300033390522,
-0.010233656503260136,
-0.006589577998965979,
-0.04975719377398491,
0.048251524567604065,
0.05310199782252312,
-0.012880007736384869,
-0.058143988251686096,
-0.09210114181041718,
-0.02364112250506878,
-0.018163127824664116,
0.01473072450608015,
-0.04219844192266464,
0.040302928537130356,
-0.028643950819969177,
0.02779490128159523,
0.04458635300397873,
-0.028425928205251694,
-0.024901119992136955,
0.006497890688478947,
-0.09730938076972961,
-0.028057903051376343,
-0.03579450771212578,
-4.950666457517052e-33,
0.1021425724029541,
0.0925038605928421,
-0.004967584740370512,
0.05209509655833244,
-0.029052061960101128,
-0.039398711174726486,
0.034570276737213135,
-0.0006145463557913899,
0.08107010275125504,
0.045501936227083206,
-0.022627169266343117,
0.017330965027213097,
0.09049052745103836,
-0.07929834723472595,
0.021244626492261887,
0.08947402983903885,
-0.10276130586862564,
-0.06853581964969635,
-0.007927159778773785,
0.0026544330175966024,
0.01918056607246399,
0.06997542083263397,
-0.04945845529437065,
0.03846205770969391,
-0.00860772468149662,
-0.025342606008052826,
0.005240435712039471,
-0.03030683659017086,
-0.04957488924264908,
0.0482410229742527,
0.0323803573846817,
0.020445754751563072,
-0.04617270827293396,
0.051956549286842346,
-0.042724478989839554,
-0.004933529067784548,
0.030305758118629456,
-0.022044947370886803,
-0.05043463408946991,
-0.054560206830501556,
0.05677047371864319,
0.01421960350126028,
-0.05702231079339981,
0.041033726185560226,
0.05901582911610603,
-0.08302051573991776,
0.07997812330722809,
0.0619429349899292,
-0.00673286197707057,
-0.05794450268149376,
-0.0035867930855602026,
-0.05607803910970688,
-0.019555464386940002,
-0.044104356318712234,
0.008327286690473557,
0.08070056140422821,
0.03743298724293709,
0.03814011439681053,
-0.04547036066651344,
0.003271153662353754,
0.0025078952312469482,
-0.08055825531482697,
-0.06230137124657631,
-0.0606684647500515,
0.0069685219787061214,
0.01194191724061966,
-0.13245749473571777,
-0.010249428451061249,
0.02761182188987732,
-0.024061530828475952,
-0.02536071091890335,
-0.006249343976378441,
-0.002265838673338294,
-0.020945103839039803,
0.01728074625134468,
-0.003304507350549102,
-0.03782796114683151,
0.08252633363008499,
0.03932403400540352,
0.108523890376091,
-0.04579463601112366,
0.03358979895710945,
-0.02883598767220974,
0.024836380034685135,
0.07490680366754532,
-0.014030796475708485,
0.02332822047173977,
0.07160422950983047,
-0.08148942142724991,
-0.055055342614650726,
0.07572546601295471,
-0.02935958467423916,
-0.014671542681753635,
-0.01403888501226902,
-0.03287644684314728,
-5.768828970076356e-8,
-0.05494102090597153,
-0.011838147416710854,
-0.15474078059196472,
-0.013279246166348457,
0.031393054872751236,
0.009081457741558552,
0.045961812138557434,
-0.023078270256519318,
0.09078969806432724,
0.02759791538119316,
-0.048994433134794235,
0.08543112128973007,
-0.11616696417331696,
0.049200352281332016,
-0.07920460402965546,
-0.047215815633535385,
-0.09379653632640839,
0.1432560384273529,
-0.04947391897439957,
-0.010490565560758114,
-0.0019391118548810482,
-0.013462993316352367,
0.03203851357102394,
-0.0211590975522995,
0.05974728986620903,
-0.015584117732942104,
-0.0032341552432626486,
-0.0023411824367940426,
-0.052981987595558167,
0.0017136624082922935,
-0.012565430253744125,
0.0014417321654036641,
-0.006090153008699417,
-0.0426151417195797,
0.005826463457196951,
-0.0020410011056810617,
0.10807500779628754,
0.026992695406079292,
0.043111324310302734,
-0.004454829730093479,
0.01972424052655697,
0.08969949930906296,
-0.04719420149922371,
0.01731843315064907,
0.022211749106645584,
-0.027143927291035652,
-0.005459746345877647,
0.04985244944691658,
-0.03940250724554062,
0.016522955149412155,
0.011834902688860893,
0.0177629292011261,
-0.013752350583672523,
0.041261445730924606,
0.007367169484496117,
0.011293946765363216,
-0.059230878949165344,
-0.023364068940281868,
-0.07562925666570663,
-0.040028925985097885,
0.1076650395989418,
0.035542283207178116,
0.04015156626701355,
-0.06795758008956909
] | 0.094901 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.