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 |
|---|---|---|---|---|---|
repl.start('> ').context.m = msg; ``` Properties in the `context` object appear as local within the REPL: ```console $ node repl\_test.js > m 'message' ``` Context properties are not read-only by default. To specify read-only globals, context properties must be defined using `Object.defineProperty()`: ```mjs import rep... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.022503025829792023,
0.0317227728664875,
-0.04545355215668678,
0.10125661641359329,
0.02272292599081993,
0.002853013575077057,
0.04514840617775917,
0.0375039242208004,
0.03868705406785011,
0.0012708354042842984,
0.017247790470719337,
-0.029156433418393135,
0.02144012041389942,
0.02614569... | 0.017469 |
provided. This can be used, for instance, to implement fully customized REPL applications. An evaluation function accepts the following four arguments: \* `code` {string} The code to be executed (e.g. `1 + 1`). \* `context` {Object} The context in which the code is executed. This can either be the JavaScript `global` c... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.1872682422399521,
-0.015639038756489754,
-0.10344389081001282,
0.05975411459803581,
-0.0911884605884552,
-0.04271501302719116,
0.04001498222351074,
0.020117932930588722,
0.050519976764917374,
-0.05836404487490654,
-0.03238639608025551,
0.017728177830576897,
0.05046496167778969,
0.001429... | 0.139134 |
myEval(cmd, context, filename, callback) { callback(null, cmd); } function myWriter(output) { return output.toUpperCase(); } ``` ## Class: `REPLServer` \* `options` {Object|string} See [`repl.start()`][] \* Extends: {readline.Interface} Instances of `repl.REPLServer` are created using the [`repl.start()`][] method or d... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.11032167822122574,
0.020835917443037033,
-0.02272828482091427,
0.079549141228199,
-0.047906357795000076,
-0.02436147630214691,
-0.0006362560670822859,
0.05851877108216286,
0.03463537618517876,
-0.0038426981773227453,
0.0011609563371166587,
0.007778682745993137,
0.04575721547007561,
-0.0... | 0.002678 |
input is being entered, a pipe `'|'` is printed rather than the 'prompt'. When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. The `replServer.displayPrompt` method is primarily intended to be called from within the action function for commands registered using the `replServer.defineCommand()... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.05755547806620598,
-0.03277924284338951,
-0.06313521414995193,
0.0020262659527361393,
-0.06070489436388016,
-0.00028867251239717007,
0.03855140879750252,
0.029941126704216003,
0.005711651407182217,
0.016408655792474747,
0.026994097977876663,
0.006987191271036863,
0.059689342975616455,
-... | -0.033755 |
sets this value to `true`. \*\*Default:\*\* `false`. \* `ignoreUndefined` {boolean} If `true`, specifies that the default writer will not output the return value of a command if it evaluates to `undefined`. \*\*Default:\*\* `false`. \* `writer` {Function} The function to invoke to format the output of each command befo... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.05575362592935562,
0.008599196560680866,
0.019491398707032204,
0.0814950093626976,
-0.010070091113448143,
-0.032039906829595566,
0.05725761130452156,
-0.018898002803325653,
-0.008708137087523937,
0.016754159703850746,
0.01501054223626852,
-0.017600959166884422,
-0.018762635067105293,
0.... | 0.074282 |
is possible to create and run multiple REPL instances against a single running instance of Node.js that share a single `global` object (by setting the `useGlobal` option to `true`) but have separate I/O interfaces. The following example, for instance, provides separate REPLs on `stdin`, a Unix socket, and a TCP socket,... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.13023057579994202,
-0.07807499915361404,
-0.04747089371085167,
0.062255412340164185,
-0.03577025979757309,
-0.054021209478378296,
0.010095767676830292,
-0.003202056745067239,
0.06226811185479164,
-0.022613711655139923,
-0.1063445582985878,
0.019061585888266563,
0.035252783447504044,
-0.... | 0.050621 |
```cjs // repl-client.js const net = require('node:net'); const sock = net.connect(1337); process.stdin.pipe(sock); sock.pipe(process.stdout); sock.on('connect', () => { process.stdin.resume(); process.stdin.setRawMode(true); }); sock.on('close', () => { process.stdin.setRawMode(false); process.stdin.pause(); sock.remo... | https://github.com/nodejs/node/blob/main//doc/api/repl.md | main | nodejs | [
-0.05708641931414604,
-0.03481581062078476,
-0.06370183080434799,
-0.004822243936359882,
-0.04742738977074623,
-0.009840035811066628,
-0.034226302057504654,
0.0527963861823082,
0.06305702775716782,
-0.0018675742903724313,
-0.08452579379081726,
0.05249631404876709,
-0.043156374245882034,
-0... | 0.056054 |
# Events > Stability: 2 - Stable Much of the Node.js core API is built around an idiomatic asynchronous event-driven architecture in which certain kinds of objects (called "emitters") emit named events that cause `Function` objects ("listeners") to be called. For instance: a [`net.Server`][] object emits an event each ... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.04668070003390312,
-0.05048558861017227,
0.03122340701520443,
0.10821567475795746,
0.06232919171452522,
-0.033050548285245895,
0.024643732234835625,
0.016222143545746803,
0.13800999522209167,
0.008111572824418545,
-0.06321254372596741,
0.09061869233846664,
-0.06459853053092957,
-0.05196... | 0.208408 |
of operation using the `setImmediate()` or `process.nextTick()` methods: ```mjs import { EventEmitter } from 'node:events'; class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); myEmitter.on('event', (a, b) => { setImmediate(() => { console.log('this happens asynchronously'); }); }); myEmitter.emit... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.01623016595840454,
-0.017787819728255272,
-0.005198770668357611,
0.03892350196838379,
-0.016035065054893494,
0.00565071078017354,
0.046256471425294876,
0.06583037227392197,
0.09656588733196259,
-0.0017623498570173979,
-0.027975013479590416,
-0.00917953159660101,
-0.05214841291308403,
-0... | 0.104971 |
const myEmitter = new EventEmitter(); myEmitter.on(errorMonitor, (err) => { MyMonitoringTool.log(err); }); myEmitter.emit('error', new Error('whoops!')); // Still throws and crashes Node.js ``` ## Capture rejections of promises Using `async` functions with event handlers is problematic, because it can lead to an unhand... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.01974034681916237,
0.06558944284915924,
0.06530296802520752,
0.05442727357149124,
0.04719977080821991,
-0.015455065295100212,
0.011709935963153839,
0.08466625213623047,
0.0941966325044632,
-0.002467029495164752,
-0.07766804844141006,
-0.09366794675588608,
-0.023412030190229416,
-0.06758... | 0.08043 |
myEmitter.emit('event'); // Prints: // B // A ``` ```cjs const EventEmitter = require('node:events'); class MyEmitter extends EventEmitter {} const myEmitter = new MyEmitter(); // Only do this once so we don't loop forever myEmitter.once('newListener', (event, listener) => { if (event === 'event') { // Insert a new lis... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
0.02144663967192173,
0.0241862665861845,
0.027686061337590218,
0.02330228127539158,
-0.0024292697198688984,
-0.0072415792383253574,
0.10355745255947113,
0.03307958319783211,
0.1049746423959732,
-0.056196536868810654,
-0.01920522004365921,
0.011008662171661854,
-0.07196502387523651,
-0.0238... | 0.101742 |
Returns a copy of the array of listeners for the event named `eventName`. ```js server.on('connection', (stream) => { console.log('someone connected!'); }); console.log(util.inspect(server.listeners('connection'))); // Prints: [ [Function] ] ``` ### `emitter.off(eventName, listener)` \* `eventName` {string|symbol} \* `... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.030462030321359634,
-0.011758982203900814,
0.030222419649362564,
0.050586309283971786,
0.02146398462355137,
-0.0495150089263916,
0.141843780875206,
-0.008910664357244968,
0.15343447029590607,
-0.05842336639761925,
-0.031843822449445724,
0.06074104458093643,
-0.10204237699508667,
0.00889... | 0.119209 |
Removes all listeners, or those of the specified `eventName`. It is bad practice to remove listeners added elsewhere in the code, particularly when the `EventEmitter` instance was created by some other component or module (e.g. sockets or file streams). Returns a reference to the `EventEmitter`, so that calls can be ch... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.0195869579911232,
0.023008588701486588,
0.05859212577342987,
0.04962584376335144,
0.0017940723337233067,
-0.01711519993841648,
0.11764606088399887,
-0.0446663461625576,
0.14666931331157684,
-0.03761832416057587,
-0.008292007260024548,
0.07659795880317688,
-0.07623326033353806,
-0.003205... | 0.111378 |
specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained. ### `emitter.rawListeners(eventName)` \* `eventName` {string|symbol} \* Returns: {Function\[]} Returns a copy of the array ... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
0.00011107797035947442,
-0.03786313161253929,
0.08212202787399292,
0.09262946993112564,
-0.0036860082764178514,
-0.02743685245513916,
0.0724223181605339,
0.019927602261304855,
0.11231039464473724,
-0.020601969212293625,
-0.03925912082195282,
-0.02253558672964573,
-0.03497952222824097,
0.01... | 0.115549 |
use [`emitter.setMaxListeners(n)`][] to set a warning limit for individual `AbortSignal` instances, per default `AbortSignal` instances will not warn. ```mjs import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () =... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
0.02623920701444149,
0.012972954660654068,
0.03893299400806427,
0.017583554610610008,
-0.03411334007978439,
0.00350751681253314,
0.06517086923122406,
0.06944523751735687,
0.06163899600505829,
-0.024495568126440048,
-0.041482891887426376,
-0.03639332577586174,
-0.006757280323654413,
-0.0257... | 0.108942 |
event or that is rejected if the `EventEmitter` emits `'error'` while waiting. The `Promise` will resolve with an array of all the arguments emitted to the given event. This method is intentionally generic and works with the web platform [EventTarget][WHATWG-EventTarget] interface, which has no special `'error'` event ... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.04625409469008446,
0.06623591482639313,
0.04095448553562164,
0.017615536227822304,
0.022706689313054085,
-0.010588805191218853,
0.051827412098646164,
0.09058137983083725,
0.1035056859254837,
0.014932062476873398,
-0.04235187545418739,
-0.09204667061567307,
-0.02951565384864807,
-0.02842... | 0.093563 |
{ myEE.emit('bar'); myEE.emit('foo'); }); foo().then(() => console.log('done')); ``` ```cjs const { EventEmitter, once } = require('node:events'); const myEE = new EventEmitter(); async function foo() { await once(myEE, 'bar'); console.log('bar'); // This Promise will never resolve because the 'foo' event will // have ... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.05344303697347641,
-0.012335948646068573,
0.04497631639242172,
0.04113264009356499,
-0.018139289692044258,
0.023335961624979973,
-0.004397538024932146,
0.040917035192251205,
0.15000000596046448,
-0.003848286345601082,
-0.04701488837599754,
-0.046620626002550125,
-0.06332911550998688,
-0... | 0.048232 |
{ const ee = new EventEmitter(); // Emit later on process.nextTick(() => { ee.emit('foo', 'bar'); ee.emit('foo', 42); }); for await (const event of on(ee, 'foo')) { // The execution of this inner block is synchronous and it // processes one event at a time (even with await). Do not use // if concurrent execution is req... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.05592004954814911,
0.033250026404857635,
0.012707996182143688,
0.060425616800785065,
0.017973804846405983,
-0.0629773661494255,
0.05077929422259331,
0.012294341810047626,
0.09913447499275208,
-0.03731498494744301,
-0.04209200292825699,
-0.01757879927754402,
-0.06096179783344269,
-0.0821... | 0.122977 |
{ addAbortListener } from 'node:events'; function example(signal) { let disposable; try { signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); disposable = addAbortListener(signal, (e) => { // Do something when signal is aborted. }); } finally { disposable?.[Symbol.dispose](); } } ``` ## Class: `event... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.05189073830842972,
0.0031258058734238148,
0.06250223517417908,
0.07211247831583023,
0.05722249299287796,
-0.016651300713419914,
0.058028098195791245,
0.010528840124607086,
0.024207914248108864,
0.0040669795125722885,
-0.009045629762113094,
0.018025696277618408,
-0.06080312281847,
0.0271... | 0.126515 |
are two key differences between the Node.js `EventTarget` and the [`EventTarget` Web API][]: 1. Whereas DOM `EventTarget` instances \_may\_ be hierarchical, there is no concept of hierarchy and event propagation in Node.js. That is, an event dispatched to an `EventTarget` does not propagate through a hierarchy of neste... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.06240355595946312,
0.03795769438147545,
0.11915720254182816,
0.07728977501392365,
0.12737852334976196,
-0.08801534026861191,
-0.014496037736535072,
0.0250282920897007,
0.135596364736557,
-0.03150435537099838,
-0.03318236395716667,
-0.019784625619649887,
0.03352969512343407,
-0.069880671... | 0.028419 |
by Node.js. #### `event.bubbles` \* Type: {boolean} Always returns `false`. This is not used in Node.js and is provided purely for completeness. #### `event.cancelBubble` > Stability: 3 - Legacy: Use [`event.stopPropagation()`][] instead. \* Type: {boolean} Alias for `event.stopPropagation()` if set to `true`. This is ... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.03390635550022125,
0.00002864042835426517,
0.07891333848237991,
0.06171527877449989,
0.0940173864364624,
-0.019499069079756737,
0.10428175330162048,
-0.06433234363794327,
0.05209346488118172,
0.013315655291080475,
-0.03370572626590729,
0.04847801476716995,
-0.07727198302745819,
-0.02920... | 0.094527 |
is used as part of the key when registering a `listener`. Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. ```js function handler(event) {} const target = new EventTarget(); target.addEventListener('foo', handler, { capture: true }); // first target.addEventListener('f... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.05724700540304184,
-0.01071377657353878,
0.03870902955532074,
0.07293473184108734,
0.07231784611940384,
0.02677544392645359,
0.12533536553382874,
-0.014413946308195591,
0.08889768272638321,
-0.028154324740171432,
0.037504781037569046,
0.04266044870018959,
-0.040057480335235596,
-0.04511... | 0.151421 |
Web API]: https://dom.spec.whatwg.org/#customevent [`EventTarget` Web API]: https://dom.spec.whatwg.org/#eventtarget [`EventTarget` error handling]: #eventtarget-error-handling [`Event` Web API]: https://dom.spec.whatwg.org/#event [`domain`]: domain.md [`e.stopImmediatePropagation()`]: #eventstopimmediatepropagation [`... | https://github.com/nodejs/node/blob/main//doc/api/events.md | main | nodejs | [
-0.03356512263417244,
-0.03151923790574074,
0.01757396012544632,
0.013585084117949009,
0.0898648053407669,
-0.052719421684741974,
-0.026234176009893417,
0.021075380966067314,
0.012112471275031567,
-0.010678396560251713,
-0.01811409741640091,
-0.037436578422784805,
-0.07089027762413025,
-0.... | 0.050751 |
# UDP/datagram sockets > Stability: 2 - Stable The `node:dgram` module provides an implementation of UDP datagram sockets. ```mjs import dgram from 'node:dgram'; const server = dgram.createSocket('udp4'); server.on('error', (err) => { console.error(`server error:\n${err.stack}`); server.close(); }); server.on('message'... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.026368029415607452,
-0.015509873628616333,
0.04123610258102417,
-0.02257792465388775,
-0.04245954751968384,
-0.06240127235651016,
-0.045369330793619156,
0.014168388210237026,
0.004772023297846317,
-0.019043490290641785,
-0.018786964938044548,
0.043559618294239044,
0.0074112978763878345,
... | 0.090809 |
else { const s = dgram.createSocket('udp4'); s.bind(1234, () => { s.addMembership('224.0.0.114'); }); } ``` ### `socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])` \* `sourceAddress` {string} \* `groupAddress` {string} \* `multicastInterface` {string} Tells the kernel to join a sourc... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.035120561718940735,
-0.08966349810361862,
-0.020348360762000084,
-0.031483571976423264,
-0.011396567337214947,
0.030124260112643242,
0.02917429432272911,
0.004613000899553299,
-0.045034121721982956,
-0.008097822777926922,
-0.02933637611567974,
-0.03894117474555969,
0.08217036724090576,
... | 0.087621 |
`socket.bind()` method is not harmful but not very useful. The `options` object may contain an additional `exclusive` property that is used when using `dgram.Socket` objects with the [`cluster`][] module. When `exclusive` is set to `false` (the default), cluster workers will use the same underlying socket handle allowi... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.08070927113294601,
-0.03249223157763481,
0.013657492585480213,
0.06852295249700546,
-0.051985178142786026,
-0.03474757820367813,
-0.016875745728611946,
-0.025338878855109215,
0.030906209722161293,
0.00003205369284842163,
-0.0056024943478405476,
0.10979574918746948,
0.00047392802662216127,... | 0.122729 |
Number of bytes queued for sending. ### `socket.getSendQueueCount()` \* Returns: {number} Number of send requests currently in the queue awaiting to be processed. ### `socket.ref()` \* Returns: {dgram.Socket} By default, binding a socket will cause it to block the Node.js process from exiting as long as the socket is o... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.07925929129123688,
-0.044274572283029556,
0.03077874518930912,
0.07786253839731216,
0.002180875279009342,
-0.037712011486291885,
0.02065517194569111,
-0.041750818490982056,
0.11085326969623566,
0.045214150100946426,
-0.07434934377670288,
0.09844924509525299,
0.004051432944834232,
-0.079... | 0.068781 |
a `DataView`. This method throws [`ERR\_SOCKET\_BAD\_PORT`][] if called on an unbound socket. Example of sending a UDP packet to a port on `localhost`; ```mjs import dgram from 'node:dgram'; import { Buffer } from 'node:buffer'; const message = Buffer.from('Some bytes'); const client = dgram.createSocket('udp4'); clien... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.01518190000206232,
0.007887736894190311,
0.07292404770851135,
-0.05889328569173813,
-0.056543655693531036,
-0.07884317636489868,
0.005491509567946196,
0.05319695174694061,
-0.003483997192233801,
-0.009527250193059444,
-0.03520682826638222,
-0.004868536721915007,
-0.023701753467321396,
-... | 0.079092 |
in this section are referring to [IPv6 Zone Indexes][], which are defined by [RFC 4007][]. In string form, an IP with a scope index is written as `'IP%scope'` where scope is an interface name or interface number.\_ Sets the default outgoing multicast interface of the socket to a chosen interface or back to system inter... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.0037247459404170513,
-0.03845720365643501,
0.006342888344079256,
-0.07210472971200943,
-0.006644891574978828,
0.05296776443719864,
0.002029901370406151,
-0.012684401124715805,
-0.013504117727279663,
-0.010387540794909,
-0.04342825338244438,
-0.003428412601351738,
0.0017978959949687123,
... | 0.101199 |
maximum socket send buffer in bytes. This method throws [`ERR\_SOCKET\_BUFFER\_SIZE`][] if called on an unbound socket. ### `socket.setTTL(ttl)` \* `ttl` {integer} Sets the `IP\_TTL` socket option. While TTL generally stands for "Time to Live", in this context it specifies the number of IP hops that a packet is allowed... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.020784134045243263,
-0.034139588475227356,
-0.01973031461238861,
-0.0037395877297967672,
-0.05815745145082474,
-0.06847840547561646,
-0.0516529455780983,
0.010279509238898754,
0.08552706241607666,
0.0038242570590227842,
-0.05038173124194145,
0.09363143146038055,
-0.036207713186740875,
-... | 0.110852 |
to calling `.close()` on the socket: ```js const controller = new AbortController(); const { signal } = controller; const server = dgram.createSocket({ type: 'udp4', signal }); server.on('message', (msg, rinfo) => { console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); }); // Later, when you want to cl... | https://github.com/nodejs/node/blob/main//doc/api/dgram.md | main | nodejs | [
-0.0405026450753212,
-0.05032927170395851,
0.02131558023393154,
0.025607990100979805,
-0.02099025808274746,
-0.03028908744454384,
0.017910417169332504,
0.02139960043132305,
0.09574799239635468,
0.006455346941947937,
-0.024172315374016762,
0.07417481392621994,
-0.12388083338737488,
-0.04150... | 0.080554 |
# VM (executing JavaScript) > Stability: 2 - Stable The `node:vm` module enables compiling and running code within V8 Virtual Machine contexts. **The `node:vm` module is not a security mechanism. Do not use it to run untrusted code.** JavaScript code can be compiled and run immediately or compiled, saved, and run later... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.03583170846104622,
0.02360418438911438,
-0.023326953873038292,
0.045282088220119476,
0.08343680948019028,
-0.045921433717012405,
-0.005082903429865837,
0.01595771126449108,
-0.009462008252739906,
-0.05657178908586502,
0.005810425151139498,
0.02463754452764988,
0.0053144171833992004,
-0.... | 0.113642 |
Returns a `Buffer`. This method may be called at any time and any number of times. The code cache of the `Script` doesn't contain any JavaScript observable states. The code cache is safe to be saved along side the script source and used to construct new `Script` instances multiple times. Functions in the `Script` sourc... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.050956182181835175,
-0.011950979009270668,
-0.014448627829551697,
0.019646020606160164,
-0.02775370515882969,
0.016067996621131897,
-0.03946997970342636,
-0.007518511265516281,
0.049709122627973557,
0.010454783216118813,
-0.03514339029788971,
0.05701758340001106,
-0.08499385416507721,
-... | 0.07275 |
name of the newly created context. \*\*Default:\*\* `'VM Context i'`, where `i` is an ascending numerical index of the created context. \* `contextOrigin` {string} [Origin][origin] corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host,... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.02475760318338871,
0.04916179180145264,
-0.0626131221652031,
0.0346217080950737,
-0.03884880244731903,
-0.09304077178239822,
0.04688749462366104,
0.023637356236577034,
-0.040682632476091385,
-0.008005978539586067,
0.016411934047937393,
-0.08693907409906387,
0.028971778228878975,
0.03657... | 0.118169 |
(let i = 0; i < 1000; ++i) { script.runInThisContext(); } console.log(globalVar); // 1000 ``` ### `script.sourceMapURL` \* Type: {string|undefined} When the script is compiled from a source that contains a source map magic comment, this property will be set to the URL of the source map. ```mjs import vm from 'node:vm';... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.012359373271465302,
0.04443041980266571,
0.020644396543502808,
0.011442395858466625,
0.03232046589255333,
0.0011858619982376695,
-0.014355611056089401,
0.031112385913729668,
-0.018003325909376144,
-0.040610626339912415,
0.001688101445324719,
-0.03567636385560036,
-0.04023874178528786,
-... | 0.003182 |
42, print: console.log, }); (async () => { // Step 1 // // Create a Module by constructing a new `vm.SourceTextModule` object. This // parses the provided source text, throwing a `SyntaxError` if anything goes // wrong. By default, a Module is created in the top context. But here, we // specify `contextifiedObject` as ... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.08169008791446686,
0.008357805199921131,
-0.053382426500320435,
0.09365356713533401,
0.02971314638853073,
-0.01807921938598156,
0.05643358454108238,
0.06871334463357925,
-0.03948216140270233,
-0.06067808344960213,
0.024734562262892723,
-0.09184708446264267,
0.010588987730443478,
0.00930... | 0.045709 |
top-level `await` in itself or any of its dependencies, the promise will be fulfilled \_synchronously\_ after the module and all its dependencies have been evaluated. 1. If the evaluation succeeds, the promise will be \_synchronously\_ resolved to `undefined`. 2. If the evaluation results in an exception, the promise w... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.11354523152112961,
0.01919618621468544,
0.012477070093154907,
0.08330407738685608,
0.06889346241950989,
0.004451477900147438,
-0.03224260360002518,
0.023225421085953712,
0.052668407559394836,
-0.05028286203742027,
0.018798667937517166,
-0.06758099049329758,
0.055349286645650864,
-0.0577... | 0.081918 |
function either throws an exception or returns an invalid `Module`. The linker function roughly corresponds to the implementation-defined [HostResolveImportedModule][] abstract operation in the ECMAScript specification, with a few key differences: \* The linker function is allowed to be asynchronous while [HostResolveI... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.0581059530377388,
0.017837360501289368,
-0.009640498086810112,
0.07951980829238892,
0.04459159076213837,
-0.029565714299678802,
-0.08679015934467316,
0.07858363538980484,
-0.0428994745016098,
-0.08070320636034012,
-0.0012472070520743728,
-0.027994409203529358,
0.009742784313857555,
-0.0... | 0.088664 |
secret: 42 }); const module = new vm.SourceTextModule( 'Object.getPrototypeOf(import.meta.prop).secret = secret;', { initializeImportMeta(meta) { // Note: this object is created in the top context. As such, // Object.getPrototypeOf(import.meta.prop) points to the // Object.prototype in the top context rather than that ... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.06652117520570755,
0.07374384999275208,
-0.010954456403851509,
0.05751099810004234,
0.04667961969971657,
0.011153987608850002,
0.06802699714899063,
0.12188540399074554,
-0.002716846065595746,
0.0008337799226865172,
-0.0225143413990736,
-0.10287526249885559,
-0.07890908420085907,
0.01591... | 0.042088 |
the requested modules include cyclic dependencies, the [`sourceTextModule.linkRequests(modules)`][] method must be called on all modules in the cycle before calling this method. ### `sourceTextModule.linkRequests(modules)` \* `modules` {vm.Module\[]} Array of `vm.Module` objects that this module depends on. The order o... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.07245670258998871,
-0.013532731682062149,
-0.013559719547629356,
0.053255919367074966,
0.06987980753183365,
-0.03210323676466942,
0.03178950771689415,
-0.01057275291532278,
-0.02289333939552307,
-0.06866781413555145,
0.05880571901798248,
-0.004082788713276386,
0.0485718734562397,
0.0196... | 0.031347 |
to set the export to. This method sets the module export binding slots with the given value. ```mjs import vm from 'node:vm'; const m = new vm.SyntheticModule(['x'], () => { m.setExport('x', 1); }); await m.evaluate(); assert.strictEqual(m.namespace.x, 1); ``` ```cjs const vm = require('node:vm'); (async () => { const ... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.0193770844489336,
0.022457346320152283,
-0.08485501259565353,
0.0941881537437439,
-0.01208386942744255,
0.048101916909217834,
0.0016770669026300311,
0.06795352697372437,
-0.0692003071308136,
-0.020718170329928398,
-0.036666881293058395,
-0.10306228697299957,
0.01077903900295496,
-0.0284... | -0.001109 |
this string should omit the trailing slash, as that denotes a path. \*\*Default:\*\* `''`. \* `codeGeneration` {Object} \* `strings` {boolean} If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`. \*\*Default:\*\* `true`. \* `wasm` {boolean} If se... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.05248299986124039,
0.05945510044693947,
-0.04040582850575447,
0.08925284445285797,
0.009714305400848389,
-0.04605785757303238,
0.02608504146337509,
0.045013427734375,
-0.05925474688410759,
-0.013809763826429844,
0.036018505692481995,
-0.08814384043216705,
0.008873593993484974,
0.0164401... | 0.057289 |
eager execution, the GC will be started right away to measure the memory. \*\*Default:\*\* `'default'` \* Returns: {Promise} If the memory is successfully measured, the promise will resolve with an object containing information about the memory usage. Otherwise it will be rejected with an `ERR\_CONTEXT\_NOT\_INITIALIZE... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.08305878937244415,
0.04413631930947304,
-0.02325531095266342,
0.10025192052125931,
0.028001772239804268,
-0.031195523217320442,
-0.022057561203837395,
0.07908464968204498,
0.017317356541752815,
-0.04355129599571228,
-0.04060039669275284,
0.015782508999109268,
-0.041106995195150375,
-0.0... | 0.078648 |
part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see [Support of dynamic `import()` in compilation APIs][]. The `vm.runInContext()` method compiles `code`, runs it within the context of the `contextifiedObject`, then returns the result. Running co... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.05069348216056824,
0.03854374960064888,
-0.05914042517542839,
0.09058461338281631,
0.06521253287792206,
-0.05908907204866409,
0.034297190606594086,
0.10266988724470139,
-0.011765526607632637,
-0.06920627504587173,
0.027077337726950645,
-0.00667016115039587,
-0.03660425543785095,
0.01382... | 0.104505 |
V8's code cache data for the supplied source. \* `importModuleDynamically` {Function|vm.constants.USE\\_MAIN\\_CONTEXT\\_DEFAULT\\_LOADER} Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not r... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.10100885480642319,
-0.00043174982420168817,
-0.027903513982892036,
0.09998910129070282,
0.0480259470641613,
-0.028775546699762344,
-0.0385618731379509,
0.04211290180683136,
-0.0374809093773365,
-0.0633544847369194,
-0.000494369538500905,
0.03188115730881691,
-0.04115423560142517,
-0.006... | 0.094023 |
the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see [Support of dynamic `import()` in compilation APIs][]. \* Returns: {any} the result of the very last statement executed in... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.07331940531730652,
0.06597357243299484,
-0.033810410648584366,
0.08151759207248688,
0.13120383024215698,
-0.03569146245718002,
0.0463358573615551,
0.08365561068058014,
-0.02905293181538582,
-0.05480445176362991,
0.0313907265663147,
0.031418632715940475,
-0.058258358389139175,
0.01666943... | 0.113501 |
vm = require('node:vm'); // An undefined `contextObject` option makes the global object contextified. const context = vm.createContext(); console.log(vm.runInContext('globalThis', context) === context); // false // A contextified global object cannot be frozen. try { vm.runInContext('Object.freeze(globalThis);', contex... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.03518351539969444,
0.009674863889813423,
-0.015658149495720863,
0.06492874771356583,
0.0590466633439064,
-0.018089570105075836,
0.037164390087127686,
0.022771652787923813,
-0.035626281052827835,
-0.018219009041786194,
-0.04091286286711693,
-0.04769834131002426,
-0.024513958021998405,
0.... | 0.075791 |
`loop` in the above example, then `loop` will be pushed into the global microtask queue, because it is a function from the outer (main) context, and thus will also be able to escape the timeout. If asynchronous scheduling functions such as `process.nextTick()`, `queueMicrotask()`, `setTimeout()`, `setImmediate()`, etc.... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.07683014869689941,
0.03788295388221741,
-0.0613228976726532,
0.05741261690855026,
0.005292722024023533,
-0.022125212475657463,
0.03162660822272301,
-0.01143653690814972,
0.05155325308442116,
-0.04738638177514076,
0.031173940747976303,
0.021462827920913696,
-0.027955152094364166,
-0.0470... | 0.085756 |
will reject with [`ERR\_VM\_DYNAMIC\_IMPORT\_CALLBACK\_MISSING`][]. ### When `importModuleDynamically` is `vm.constants.USE\_MAIN\_CONTEXT\_DEFAULT\_LOADER` This option is currently not supported for `vm.SourceTextModule`. With this option, when an `import()` is initiated in the compiled code, Node.js would use the def... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.06528764963150024,
0.06310360133647919,
-0.007255039643496275,
0.07594680041074753,
0.10317105799913406,
-0.020166322588920593,
0.0021066840272396803,
0.04354262351989746,
-0.0207634586840868,
-0.04455718398094177,
0.004316572565585375,
-0.02343575842678547,
0.025974411517381668,
-0.030... | 0.070458 |
path, once the process manages to load a particular module from that path, the result may be cached, and subsequent load of the same module from the same path would return the same thing. If the `filename` is a URL string, the cache would not be hit if it has different search parameters. For `filename`s that are not UR... | https://github.com/nodejs/node/blob/main//doc/api/vm.md | main | nodejs | [
-0.08330849558115005,
0.012766116298735142,
-0.00953045953065157,
0.0630807876586914,
0.055049214512109756,
-0.07130120694637299,
-0.02864614501595497,
0.003942687530070543,
0.0265455711632967,
-0.050564445555210114,
-0.011459419503808022,
0.10623054951429367,
-0.0009337455267086625,
-0.04... | 0.016025 |
# C++ addons \_Addons\_ are dynamically-linked shared objects written in C++. The [`require()`][require] function can load addons as ordinary Node.js modules. Addons provide an interface between JavaScript and C/C++ libraries. There are three options for implementing addons: \* Node-API \* `nan` ([Native Abstractions f... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.13670791685581207,
-0.029452277347445488,
0.01241814810782671,
0.039625175297260284,
0.04315444082021713,
0.0015888961497694254,
-0.05764845386147499,
0.05335857719182968,
0.009810823947191238,
-0.062275443226099014,
0.008410608395934105,
-0.02213788405060768,
-0.05797354876995087,
-0.0... | 0.113297 |
environments in which Node.js addons may need to be loaded multiple times in multiple contexts. For example, the [Electron][] runtime runs multiple instances of Node.js in a single process. Each instance will have its own `require()` cache, and thus each instance will need a native addon to behave correctly when loaded... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.09678333252668381,
-0.03264613077044487,
0.018615487962961197,
0.05155215784907341,
0.011690816842019558,
-0.04336514696478844,
0.0033618290908634663,
0.046147577464580536,
0.032317038625478745,
-0.06182681769132614,
0.0025974507443606853,
-0.04784192517399788,
-0.028253130614757538,
-0... | 0.076072 |
be context-aware. NODE\_MODULE\_INIT(/\* exports, module, context \*/) { Isolate\* isolate = Isolate::GetCurrent(); // Create a new instance of `AddonData` for this instance of the addon and // tie its life cycle to that of the Node.js environment. AddonData\* data = new AddonData(isolate); // Wrap the data in a `v8::E... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.08403372764587402,
-0.03332498297095299,
-0.007539758458733559,
0.07245149463415146,
0.028036009520292282,
0.012320554815232754,
0.01369682140648365,
0.07581991702318192,
-0.029368039220571518,
-0.01876244880259037,
0.04938386008143425,
-0.04339846968650818,
-0.10237262398004532,
-0.022... | 0.057605 |
file has been created, use `node-gyp configure` to generate the appropriate project build files for the current platform. This will generate either a `Makefile` (on Unix platforms) or a `vcxproj` file (on Windows) in the `build/` directory. Next, invoke the `node-gyp build` command to generate the compiled `addon.node`... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.09405826032161713,
0.000009957938345905859,
0.01107056625187397,
0.026574747636914253,
0.08180545270442963,
-0.05523326247930527,
-0.04907482862472534,
0.06382711231708527,
0.02710697427392006,
0.01968821883201599,
0.020236408337950706,
0.0017642220482230186,
-0.07258106023073196,
-0.00... | 0.06991 |
little that Node.js can do to ensure stability of the V8 APIs. The [Native Abstractions for Node.js][] (or `nan`) provide a set of tools that addon developers are recommended to use to keep compatibility between past and future releases of V8 and Node.js. See the `nan` [examples][] for an illustration of how it can be ... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.1050279289484024,
-0.05479225888848305,
0.04415382817387581,
0.02102033607661724,
0.09436537325382233,
-0.04577330872416496,
-0.12808595597743988,
0.018138812854886055,
-0.029176834970712662,
-0.05604901909828186,
-0.08035285025835037,
0.09314607083797455,
-0.04940227419137955,
-0.05307... | 0.121381 |
number of arguments passed. if (args.Length() < 2) { // Throw an Error that is passed back to JavaScript isolate->ThrowException(Exception::TypeError( String::NewFromUtf8(isolate, "Wrong number of arguments").ToLocalChecked())); return; } // Check the argument types if (!args[0]->IsNumber() || !args[1]->IsNumber()) { i... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
0.0383680984377861,
0.01389284711331129,
-0.023949073627591133,
0.01994157023727894,
-0.04426959529519081,
0.03240858390927315,
0.07066181302070618,
0.06689811497926712,
0.006476244423538446,
-0.03338778391480446,
-0.040428273379802704,
-0.06251325458288193,
-0.017632123082876205,
-0.02338... | 0.050727 |
Wrapping C++ objects It is also possible to wrap C++ objects/classes in a way that allows new instances to be created using the JavaScript `new` operator: ```cpp // addon.cc #include #include "myobject.h" namespace demo { using v8::Local; using v8::Object; void InitAll(Local exports) { MyObject::Init(exports); } NODE\_... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.11038508266210556,
0.024050194770097733,
0.011996502056717873,
0.07993094623088837,
-0.009075023233890533,
-0.014911784790456295,
-0.010800118558108807,
0.010725241154432297,
-0.06937725841999054,
-0.018678613007068634,
0.017358966171741486,
-0.06404095888137817,
-0.06447848677635193,
-... | 0.057654 |
using v8::FunctionCallbackInfo; using v8::Isolate; using v8::Local; using v8::Object; using v8::String; using v8::Value; void CreateObject(const FunctionCallbackInfo& args) { MyObject::NewInstance(args); } void InitAll(Local exports, Local module) { MyObject::Init(); NODE\_SET\_METHOD(module, "exports", CreateObject); ... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.0958041101694107,
0.011845067143440247,
-0.02323383279144764,
0.05563366413116455,
-0.019604576751589775,
-0.040943898260593414,
0.007157092913985252,
0.06072908639907837,
0.005815601907670498,
-0.04541417211294174,
0.031577251851558685,
-0.07355529814958572,
-0.08247744292020798,
-0.01... | 0.099552 |
CreateObject); NODE\_SET\_METHOD(exports, "add", Add); } NODE\_MODULE(NODE\_GYP\_MODULE\_NAME, InitAll) } // namespace demo ``` In `myobject.h`, a new public method is added to allow access to private values after unwrapping the object. ```cpp // myobject.h #ifndef MYOBJECT\_H #define MYOBJECT\_H #include #include name... | https://github.com/nodejs/node/blob/main//doc/api/addons.md | main | nodejs | [
-0.06878652423620224,
0.08881435543298721,
-0.03805248439311981,
0.07084324955940247,
-0.03546849265694618,
0.012355746701359749,
-0.00510849105194211,
0.0808735191822052,
-0.06203056126832962,
-0.007965427823364735,
0.029346883296966553,
-0.08419666439294815,
-0.07930123060941696,
-0.0332... | 0.102895 |
# Environment Variables Environment variables are variables associated to the environment the Node.js process runs in. ## CLI Environment Variables There is a set of environment variables that can be defined to customize the behavior of Node.js, for more details refer to the [CLI Environment Variables documentation][].... | https://github.com/nodejs/node/blob/main//doc/api/environment_variables.md | main | nodejs | [
-0.030412472784519196,
-0.02564319036900997,
-0.003879845142364502,
-0.005857291165739298,
0.07391341775655746,
-0.05983993411064148,
0.022660592570900917,
0.04732348024845123,
0.0026806399691849947,
-0.010775637812912464,
-0.08137821406126022,
0.05339621379971504,
0.038273122161626816,
-0... | 0.122455 |
my variable b ' ``` #### Comments Hash-tag (`#`) characters denote the beginning of a comment, meaning that the rest of the line will be completely ignored. Hash-tags found within quotes are however treated as any other standard character. For example: ```text # This is a comment MY\_VAR = my variable # This is also a ... | https://github.com/nodejs/node/blob/main//doc/api/environment_variables.md | main | nodejs | [
-0.06446859240531921,
0.002104638610035181,
-0.006805269978940487,
0.027829362079501152,
0.008773407898843288,
-0.03385654091835022,
0.0831775888800621,
0.011295502074062824,
0.020526478067040443,
0.03400496393442154,
-0.026910144835710526,
0.031221896409988403,
0.08481091260910034,
-0.016... | -0.040302 |
# Modules: TypeScript > Stability: 2 - Stable ## Enabling There are two ways to enable runtime TypeScript support in Node.js: 1. For [full support][] of all of TypeScript's syntax and features, including using any version of TypeScript, use a third-party package. 2. For lightweight support, you can use the built-in sup... | https://github.com/nodejs/node/blob/main//doc/api/typescript.md | main | nodejs | [
-0.0503762848675251,
-0.022519217804074287,
0.04245443269610405,
0.057039178907871246,
0.0018786946311593056,
0.03522789105772972,
0.022780917584896088,
0.08906993269920349,
-0.07892551273107529,
0.043421849608421326,
-0.11969243735074997,
0.08099853992462158,
-0.05950210615992546,
0.06414... | 0.152274 |
is only removing inline types, any TypeScript features that involve \_replacing\_ TypeScript syntax with new JavaScript syntax will error, unless the flag [`--experimental-transform-types`][] is passed. The most prominent features that require transformation are: \* `Enum` declarations \* `namespace` with runtime code ... | https://github.com/nodejs/node/blob/main//doc/api/typescript.md | main | nodejs | [
-0.08217310160398483,
-0.006726165767759085,
0.0681404322385788,
0.06074674427509308,
0.004071975592523813,
-0.0087755611166358,
-0.013309278525412083,
-0.020072992891073227,
-0.060610149055719376,
0.027640176936984062,
-0.06621474027633667,
0.015332761220633984,
-0.0506441630423069,
0.044... | 0.080307 |
# Util > Stability: 2 - Stable The `node:util` module supports the needs of Node.js internal APIs. Many of the utilities are useful for application and module developers as well. To access it: ```mjs import util from 'node:util'; ``` ```cjs const util = require('node:util'); ``` ## `util.callbackify(original)` \* `orig... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.1623135656118393,
0.025991573929786682,
0.0009367865277454257,
0.10116611421108246,
0.0015637228498235345,
-0.039341963827610016,
-0.03337523713707924,
0.06296228617429733,
0.05172570049762726,
-0.05702706798911095,
-0.057515423744916916,
0.051146410405635834,
0.007485106587409973,
-0.0... | 0.155261 |
log('hello from foo [%d]', 123); ``` ```cjs const { debuglog } = require('node:util'); const log = debuglog('foo'); log('hello from foo [%d]', 123); ``` If this program is run with `NODE\_DEBUG=foo` in the environment, then it will output something like: ```console FOO 3245: hello from foo [123] ``` where `3245` is the... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
0.013217546977102757,
0.04461444169282913,
0.07272181659936905,
0.015677187591791153,
0.051842834800481796,
-0.09169105440378189,
0.03183022141456604,
0.042473919689655304,
0.006566154304891825,
-0.026059474796056747,
-0.05688872188329697,
-0.037604622542858124,
0.012987079098820686,
0.003... | 0.047192 |
emitted and printed to `stderr` the first time the returned function is called. After the warning is emitted, the wrapped function is called without emitting a warning. If the same optional `code` is supplied in multiple calls to `util.deprecate()`, the warning will be emitted only once for that `code`. ```mjs import {... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.05823925882577896,
0.06742006540298462,
0.04863673448562622,
0.05136561393737793,
0.03312184289097786,
-0.03720744326710701,
0.01220780611038208,
0.0504755862057209,
0.06235704943537712,
-0.026806501671671867,
0.05575893446803093,
-0.004848867189139128,
0.011877881363034248,
-0.03910455... | 0.096212 |
which can contain zero or more format specifiers. Each specifier is replaced with the converted value from the corresponding argument. Supported specifiers are: \* `%s`: `String` will be used to convert all values except `BigInt`, `Object` and `-0`. `BigInt` values will be represented with an `n` and Objects that have ... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.010572385974228382,
0.1148516982793808,
-0.07280074805021286,
-0.009972015395760536,
-0.012084081768989563,
-0.07825852185487747,
-0.015663769096136093,
0.13734155893325806,
-0.004933095071464777,
-0.04884732514619827,
-0.02513316087424755,
-0.04073113948106766,
0.04884802922606468,
0.0... | 0.104439 |
the resource that contains the script for the function for this call site. \* `scriptId` {string} Returns the unique id of the script, as in Chrome DevTools protocol [`Runtime.ScriptId`][]. \* `lineNumber` {number} Returns the JavaScript script line number (1-based). \* `columnNumber` {number} Returns the JavaScript sc... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.10047809034585953,
-0.003160280641168356,
-0.04753541946411133,
0.05203697085380554,
-0.01504648569971323,
-0.07913074642419815,
-0.013766812160611153,
0.09104957431554794,
0.075686976313591,
-0.02666529454290867,
-0.0517006441950798,
-0.04729665070772171,
-0.03198552504181862,
-0.06326... | 0.060326 |
message for a numeric error code that comes from a Node.js API. The mapping between error codes and string messages is platform-dependent. ```js fs.access('file/that/does/not/exist', (err) => { const message = util.getSystemErrorMessage(err.errno); console.error(message); // No such file or directory }); ``` ## `util.s... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.04657907038927078,
0.010725765489041805,
0.024151833727955818,
0.0368712954223156,
0.07509417086839676,
-0.04182521253824234,
-0.00956051517277956,
0.121053546667099,
0.00994776003062725,
-0.05028335377573967,
0.0022477570455521345,
0.015811704099178314,
-0.006947048474103212,
0.0128107... | 0.173389 |
new line. It will break on new lines in text that is longer than `breakLength`. If set to a number, the most `n` inner elements are united on a single line as long as all properties fit into `breakLength`. Short array elements are also grouped together. For more information, see the example below. \*\*Default:\*\* `3`.... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.017824651673436165,
0.05133464187383652,
0.01786665804684162,
0.003350555431097746,
-0.07972844690084457,
-0.006418721750378609,
0.0011759056942537427,
-0.033183082938194275,
-0.045188140124082565,
0.018291262909770012,
0.000024745882910792716,
0.06490782648324966,
-0.02219841070473194,
... | 0.116351 |
// [ // [ // 'Lorem ipsum dolor sit amet,\n' + // 'consectetur adipiscing elit, sed do eiusmod \n' + // 'tempor incididunt ut labore et dolore magna aliqua.', // 'test', // 'foo' // ] // ], // 4 // ], // b: Map(2) { // 'za' => 1, // 'zb' => 'test' // } // } // Setting `breakLength` to e.g. 150 will print the "Lorem ips... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.047414153814315796,
0.12110207974910736,
0.07420123368501663,
-0.02619483880698681,
-0.00371043523773551,
0.0009656334877945483,
0.016300681978464127,
0.06620392948389053,
-0.016101902350783348,
0.005500624421983957,
0.009285137988626957,
-0.016791148111224174,
-0.030973752960562706,
-0... | 0.095571 |
true }), ); ``` ```cjs const { inspect } = require('node:util'); const assert = require('node:assert'); const o1 = { b: [2, 3, 1], a: '`a` comes before `b`', c: new Set([2, 3, 1]), }; console.log(inspect(o1, { sorted: true })); // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } console.log(inspect(... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.05107889324426651,
0.0430891215801239,
0.03498721867799759,
-0.0019616312347352505,
0.018735190853476524,
-0.05194316804409027,
0.005482136271893978,
-0.05021842196583748,
0.0052533759735524654,
-0.014507601968944073,
-0.04768098518252373,
0.05238347128033638,
0.008757482282817364,
-0.0... | 0.058943 |
dim - Decreased color intensity (Alias: `faint`) \* overlined - Make text overlined \* blink - Hides and shows the text in an interval \* inverse - Swap foreground and background colors (Alias: `swapcolors`, `swapColors`) \* doubleunderline - Make text double underlined (Alias: `doubleUnderline`) \* framed - Draw a fra... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.02289300411939621,
-0.009721571579575539,
0.07218818366527557,
0.05239739269018173,
-0.0018935886910185218,
-0.020445022732019424,
0.07332094758749008,
0.04158593714237213,
-0.020826326683163643,
-0.079587422311306,
-0.01722155511379242,
-0.007188563700765371,
0.03998751938343048,
-0.06... | 0.048798 |
new Password('r0sebud'); console.log(password); // Prints Password ``` See [Custom inspection functions on Objects][] for more details. ### `util.inspect.defaultOptions` The `defaultOptions` value allows customization of the default options used by `util.inspect`. This is useful for functions like `console.log` or `uti... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.003955797292292118,
0.10428299009799957,
-0.05416366085410118,
0.02813704125583172,
-0.03517995402216911,
-0.032824113965034485,
0.0323583222925663,
0.08067040145397186,
-0.01203934382647276,
0.03429572284221649,
-0.05602290853857994,
0.016118556261062622,
-0.025414282456040382,
0.03943... | 0.044233 |
Prints: text/javascript ``` ```cjs const { MIMEType } = require('node:util'); const myMIME = new MIMEType('text/ecmascript'); console.log(myMIME.subtype); // Prints: ecmascript myMIME.subtype = 'javascript'; console.log(myMIME.subtype); // Prints: javascript console.log(String(myMIME)); // Prints: text/javascript ``` #... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.03953646868467331,
0.038947056978940964,
0.09437429159879684,
0.08156675100326538,
0.03662528842687607,
-0.06162698194384575,
0.06921765208244324,
0.15661711990833282,
0.023979905992746353,
-0.09040261805057526,
-0.010470055043697357,
-0.01483027171343565,
0.0018875624518841505,
0.06385... | 0.124971 |
foo=def;bar=1;baz=xyz ``` ```cjs const { MIMEType } = require('node:util'); const { params } = new MIMEType('text/plain;foo=0;bar=1'); params.set('foo', 'def'); params.set('baz', 'xyz'); console.log(params.toString()); // Prints: foo=def;bar=1;baz=xyz ``` ### `mimeParams.values()` \* Returns: {Iterator} Returns an iter... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.08196177333593369,
0.03917776793241501,
0.008141054771840572,
0.07799267023801804,
-0.07075780630111694,
-0.02980947680771351,
0.10621234774589539,
0.10381762683391571,
-0.018182773143053055,
-0.09280170500278473,
-0.02098586969077587,
0.027243684977293015,
0.07491603493690491,
0.046221... | 0.023248 |
short: 'f', }, bar: { type: 'string', }, }; const { values, positionals, } = parseArgs({ args, options }); console.log(values, positionals); // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] ``` ### `parseArgs` `tokens` Detailed parse information is available for adding custom behaviors by specifying `toke... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.058046091347932816,
0.0466877780854702,
0.032090071588754654,
0.04868943616747856,
-0.06584903597831726,
0.004712359048426151,
0.08603279292583466,
0.0767602026462555,
-0.016265220940113068,
-0.03363626077771187,
-0.027119005098938942,
0.0022693490609526634,
-0.04346456378698349,
0.0024... | 0.078614 |
file: ```cjs const { parseEnv } = require('node:util'); parseEnv('HELLO=world\nHELLO=oh my\n'); // Returns: { HELLO: 'oh my' } ``` ```mjs import { parseEnv } from 'node:util'; parseEnv('HELLO=world\nHELLO=oh my\n'); // Returns: { HELLO: 'oh my' } ``` ## `util.promisify(original)` \* `original` {Function} \* Returns: {F... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.13590359687805176,
0.07128443568944931,
0.06519049406051636,
0.040905341506004333,
-0.005915553774684668,
-0.06250231713056564,
-0.037769120186567307,
0.05486185476183891,
0.038961704820394516,
-0.053265344351530075,
-0.03166481852531433,
0.018609367311000824,
-0.052846819162368774,
-0.... | 0.114829 |
{ doSomething(foo, resolve, reject); }); }; ``` If `promisify.custom` is defined but is not a function, `promisify()` will throw an error. ### `util.promisify.custom` \* Type: {symbol} that can be used to declare custom promisified variants of functions, see [Custom promisified functions][]. In addition to being access... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.028953371569514275,
0.046830371022224426,
0.07119148224592209,
0.02403087168931961,
-0.042232684791088104,
0.00477075157687068,
0.025578955188393593,
0.025772973895072937,
0.02598513849079609,
-0.04066552594304085,
-0.024807434529066086,
-0.0075617218390107155,
-0.03984053432941437,
-0.... | 0.102329 |
`'greek'`, `'greek8'`, `'iso-ir-126'`, `'iso8859-7'`, `'iso88597'`, `'iso\_8859-7'`, `'iso\_8859-7:1987'`, `'sun\_eu\_greek'` | | `'iso-8859-8'` | `'csiso88598e'`, `'csisolatinhebrew'`, `'hebrew'`, `'iso-8859-8-e'`, `'iso-ir-138'`, `'iso8859-8'`, `'iso88598'`, `'iso\_8859-8'`, `'iso\_8859-8:1988'`, `'visual'` | | `'iso... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
0.01973061077296734,
-0.011559699662029743,
-0.0006923857727088034,
-0.03850824758410454,
-0.044368926435709,
-0.0039963689632713795,
0.08107024431228638,
-0.0028263204731047153,
0.006497986614704132,
0.0177520252764225,
0.1259240061044693,
-0.04297667369246483,
0.02591864764690399,
0.0482... | 0.189195 |
order mark. ## Class: `util.TextEncoder` An implementation of the [WHATWG Encoding Standard][] `TextEncoder` API. All instances of `TextEncoder` only support UTF-8 encoding. ```js const encoder = new TextEncoder(); const uint8array = encoder.encode('this is some data'); ``` The `TextEncoder` class is also available on ... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.06163492053747177,
0.03607872501015663,
0.017056046053767204,
-0.0009759233798831701,
-0.09411606937646866,
0.020494982600212097,
-0.02951263263821602,
0.022097691893577576,
0.03176519274711609,
-0.029505329206585884,
-0.016370605677366257,
0.06088366359472275,
-0.013337776064872742,
0.... | 0.090365 |
`aborted` promise to resolve. }); ``` ## `util.types` `util.types` provides type checks for different kinds of built-in objects. Unlike `instanceof` or `Object.prototype.toString.call(value)`, these checks do not inspect properties of the object that are accessible from JavaScript (like their prototype), and usually ha... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.07165738940238953,
0.06224416568875313,
0.033014506101608276,
0.09631101042032242,
-0.005853081587702036,
-0.03235190361738205,
0.03943604230880737,
0.017817042768001556,
0.0061325556598603725,
-0.06670776009559631,
-0.1127346083521843,
0.0010514596942812204,
-0.08618353307247162,
0.021... | 0.119799 |
util.types.isDataView(new DataView(ab)); // Returns true util.types.isDataView(new Float64Array()); // Returns false ``` See also [`ArrayBuffer.isView()`][]. ### `util.types.isDate(value)` \* `value` {any} \* Returns: {boolean} Returns `true` if the value is a built-in {Date} instance. ```js util.types.isDate(new Date(... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
-0.03205518797039986,
-0.015112188644707203,
-0.029890097677707672,
0.05119467154145241,
0.009936182759702206,
-0.013860191218554974,
0.01404162123799324,
0.015915414318442345,
0.015384956263005733,
-0.014305423945188522,
-0.0038402345962822437,
-0.041830841451883316,
-0.08641848713159561,
... | 0.14339 |
``` ### `util.types.isKeyObject(value)` \* `value` {Object} \* Returns: {boolean} Returns `true` if `value` is a {KeyObject}, `false` otherwise. ### `util.types.isMap(value)` \* `value` {any} \* Returns: {boolean} Returns `true` if the value is a built-in {Map} instance. ```js util.types.isMap(new Map()); // Returns tr... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
0.013509433716535568,
0.08583804219961166,
0.038462378084659576,
0.00528333056718111,
-0.008068909868597984,
-0.011622443795204163,
0.03374047204852104,
0.027234254404902458,
-0.02665560133755207,
-0.010919662192463875,
-0.02632232941687107,
-0.05319315567612648,
-0.022535325959324837,
-0.... | 0.086241 |
{any} \* Returns: {boolean} Returns `true` if the value is a built-in {SharedArrayBuffer} instance. This does \_not\_ include {ArrayBuffer} instances. Usually, it is desirable to test for both; See [`util.types.isAnyArrayBuffer()`][] for that. ```js util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false ut... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
0.009863616898655891,
0.03514495864510536,
-0.01239930372685194,
0.0414954274892807,
-0.05973121151328087,
-0.014908716082572937,
0.0916655883193016,
-0.07797448337078094,
0.005150702781975269,
-0.08454211056232452,
-0.05364436283707619,
-0.024375107139348984,
-0.04033515229821205,
0.02952... | 0.106034 |
[`tty.hasColors()`]: tty.md#writestreamhascolorscount-env [`util.diff()`]: #utildiffactual-expected [`util.format()`]: #utilformatformat-args [`util.inspect()`]: #utilinspectobject-options [`util.promisify()`]: #utilpromisifyoriginal [`util.types.isAnyArrayBuffer()`]: #utiltypesisanyarraybuffervalue [`util.types.isArra... | https://github.com/nodejs/node/blob/main//doc/api/util.md | main | nodejs | [
0.011652909219264984,
0.0010484112426638603,
-0.054608214646577835,
0.03827435523271561,
-0.046312980353832245,
-0.004840041510760784,
0.01066754013299942,
0.01188826933503151,
-0.018896309658885002,
-0.06212128326296806,
-0.10242880135774612,
-0.06060946732759476,
-0.03412599116563797,
0.... | 0.009722 |
# Single executable applications > Stability: 1.1 - Active development This feature allows the distribution of a Node.js application conveniently to a system that does not have Node.js installed. Node.js supports the creation of [single executable applications][] by allowing the injection of a blob prepared by Node.js,... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
-0.026993172243237495,
-0.02932790480554104,
-0.023206351324915886,
0.028200088068842888,
0.07935076951980591,
-0.05633435770869255,
-0.05328667163848877,
0.08898390084505081,
0.03625448793172836,
0.019618840888142586,
-0.05437152087688446,
0.06015211343765259,
0.02363143302500248,
-0.0417... | 0.18038 |
can retrieve the assets using the [`sea.getAsset()`][] and [`sea.getAssetAsBlob()`][] APIs. ```json { "main": "/path/to/bundled/script.js", "output": "/path/to/write/the/generated/executable", "assets": { "a.jpg": "/path/to/a.jpg", "b.txt": "/path/to/b.txt" } } ``` The single-executable application can access the asset... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
-0.02464170940220356,
0.0519845113158226,
-0.0347602479159832,
0.00775425648316741,
-0.0075059873051941395,
-0.011922698467969894,
0.024438846856355667,
0.0977252945303917,
0.005816696677356958,
-0.039970580488443375,
-0.030396653339266777,
-0.03471456468105316,
-0.02804243005812168,
0.021... | -0.010369 |
in the executable, these flags can be accessed using the `process.execArgv` property: ```js // If the executable is launched with `sea user-arg1 user-arg2` console.log(process.execArgv); // Prints: ['--no-warnings', '--max-old-space-size=2048'] console.log(process.argv); // Prints ['/path/to/sea', 'path/to/sea', 'user-... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
0.0014001949457451701,
0.019482417032122612,
-0.10886354744434357,
0.010414307937026024,
0.04586004093289375,
-0.06914077699184418,
0.054919589310884476,
0.10191228985786438,
0.016038678586483,
-0.022009870037436485,
-0.0047538564540445805,
0.008289591409265995,
-0.028319669887423515,
0.00... | 0.124855 |
embedded in the executable. If no assets are embedded, returns an empty array. This method can be used to retrieve an array of all the keys of assets embedded into the single-executable application. An error is thrown when not running inside a single-executable application. ### `require(id)` in the injected main script... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
-0.044119250029325485,
0.029898542910814285,
-0.03468972444534302,
0.051304157823324203,
0.07926993072032928,
-0.08161932975053787,
0.024539370089769363,
0.07295795530080795,
0.03496992215514183,
-0.07338421791791916,
0.039943236857652664,
0.05718759074807167,
0.0721999853849411,
-0.016074... | 0.14891 |
of the final executable, this is the path to write the blob. "output": "/path/to/write/the/generated/blob.blob" } ``` #### 2. Injecting the preparation blob into the `node` binary To complete the creation of a single executable application, the generated blob needs to be injected into a copy of the `node` binary, as do... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
-0.020672954618930817,
0.043144822120666504,
-0.009649710729718208,
0.0010595211060717702,
-0.012902049347758293,
-0.08073132485151291,
0.02864057384431362,
-0.01507060881704092,
-0.05988352373242378,
-0.00981304980814457,
0.001063599600456655,
-0.11739849299192429,
0.016942696645855904,
-... | 0.112169 |
[Mach-O]: https://en.wikipedia.org/wiki/Mach-O [PE]: https://en.wikipedia.org/wiki/Portable\_Executable [Windows SDK]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ [`process.execPath`]: process.md#processexecpath [`require()`]: modules.md#requireid [`require.main`]: modules.md#accessing-the-main... | https://github.com/nodejs/node/blob/main//doc/api/single-executable-applications.md | main | nodejs | [
-0.05760299414396286,
0.020684555172920227,
-0.08183228969573975,
-0.010216675698757172,
-0.002006782218813896,
-0.05399109423160553,
0.003774874610826373,
0.0674741342663765,
-0.034735243767499924,
0.002177414484322071,
0.039316900074481964,
-0.08429256826639175,
-0.0448448471724987,
-0.0... | 0.074105 |
# Net > Stability: 2 - Stable The `node:net` module provides an asynchronous network API for creating stream-based TCP or [IPC][] servers ([`net.createServer()`][]) and clients ([`net.createConnection()`][]). It can be accessed using: ```mjs import net from 'node:net'; ``` ```cjs const net = require('node:net'); ``` ##... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.09857505559921265,
-0.022219229489564896,
-0.07258561998605728,
0.006602015346288681,
-0.013304315507411957,
-0.09553398936986923,
-0.036402154713869095,
0.08036878705024719,
0.0319441482424736,
0.0202056672424078,
-0.07426782697439194,
0.026576371863484383,
-0.002384565304964781,
-0.04... | 0.124121 |
type])` \* `address` {string|net.SocketAddress} The IP address to check \* `type` {string} Either `'ipv4'` or `'ipv6'`. \*\*Default:\*\* `'ipv4'`. \* Returns: {boolean} Returns `true` if the given IP address matches any of the rules added to the `BlockList`. ```js const blockList = new net.BlockList(); blockList.addAdd... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.01840278133749962,
0.016821498051285744,
0.0024402253329753876,
-0.02201233245432377,
0.027108684182167053,
0.0025582348462194204,
0.03916768729686737,
-0.028786087408661842,
0.014739799313247204,
-0.020713642239570618,
-0.008270030841231346,
0.01001015305519104,
-0.06297484040260315,
0... | 0.059832 |
server listening on a pipe or Unix domain socket, the name is returned as a string. ```js const server = net.createServer((socket) => { socket.end('goodbye\n'); }).on('error', (err) => { // Handle errors here. throw err; }); // Grab an arbitrary unused port. server.listen(() => { console.log('opened server on', server.... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.0886877104640007,
-0.018753016367554665,
-0.007588574197143316,
0.023211903870105743,
-0.02050251141190529,
-0.098064124584198,
0.015924008563160896,
0.01728910394012928,
0.13075724244117737,
-0.026311706751585007,
-0.05984760820865631,
0.07118268311023712,
-0.06832277029752731,
-0.0199... | 0.120872 |
support, i.e., binding to host `::` won't make `0.0.0.0` be bound. \*\*Default:\*\* `false`. \* `reusePort` {boolean} For TCP servers, setting `reusePort` to `true` allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This ... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.01739218458533287,
0.007805952336639166,
-0.05625748634338379,
-0.045896824449300766,
-0.05803341418504715,
-0.0013024797663092613,
0.026160184293985367,
0.01004226878285408,
0.04409290850162506,
0.0003995338047388941,
0.006522211711853743,
-0.010959845967590809,
0.011962736025452614,
-... | 0.059387 |
not running in cluster mode, Node.js will close the connection. 2. If the process is running in cluster mode, Node.js will, by default, route the connection to another worker process. To close the connection instead, set \[`server.dropMaxConnection`]\[] to `true`. It is not recommended to use this option once a socket ... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.05650927871465683,
-0.0472991056740284,
-0.0109292296692729,
0.04758472368121147,
0.028881261125206947,
-0.053663622587919235,
0.015295460820198059,
0.003324291203171015,
-0.0054885270074009895,
0.033878155052661896,
-0.03673586994409561,
0.05773322284221649,
-0.018649796023964882,
-0.0... | 0.099807 |
a reference to `buffer`. Return `false` from this function to implicitly `pause()` the socket. This function will be executed in the global context. \* `readable` {boolean} Allow reads on the socket when an `fd` is passed, otherwise ignored. \*\*Default:\*\* `false`. \* `signal` {AbortSignal} An Abort signal that may b... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.04400864988565445,
0.0075232540257275105,
-0.07286310940980911,
0.06316094845533371,
0.028457945212721825,
-0.03188776224851608,
0.04257421940565109,
0.0017287521623075008,
0.03680441901087761,
0.02763749286532402,
0.016491085290908813,
0.08494078367948532,
-0.04042983800172806,
-0.0087... | 0.181191 |
### Event: `'lookup'` Emitted after resolving the host name but before connecting. Not applicable to Unix sockets. \* `err` {Error|null} The error object. See [`dns.lookup()`][]. \* `address` {string} The IP address. \* `family` {number|null} The address type. See [`dns.lookup()`][]. \* `host` {string} The host name. #... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.1095583364367485,
0.01485124509781599,
-0.053188808262348175,
0.034626275300979614,
-0.04198075458407402,
-0.07729443907737732,
-0.03617118299007416,
-0.023049553856253624,
0.060760483145713806,
0.02043331228196621,
-0.022330543026328087,
0.06309857964515686,
-0.05169960856437683,
-0.01... | 0.099027 |
5 of [RFC 8305][]. The `all` option passed to lookup is set to `true` and the sockets attempts to connect to all obtained IPv6 and IPv4 addresses, in sequence, until a connection is established. The first returned AAAA address is tried first, then the first returned A address, then the second returned AAAA address and ... | https://github.com/nodejs/node/blob/main//doc/api/net.md | main | nodejs | [
-0.05408543720841408,
0.007791957817971706,
-0.005531516391783953,
0.03019201010465622,
-0.05308767035603523,
-0.00554471043869853,
-0.053792860358953476,
-0.07197354733943939,
0.05334501713514328,
-0.000567154202144593,
-0.014003820717334747,
0.011165305972099304,
-0.04353142902255058,
-0... | 0.054061 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.