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 |
|---|---|---|---|---|---|
# Process The `process` object provides information about, and control over, the current Node.js process. ```mjs import process from 'node:process'; ``` ```cjs const process = require('node:process'); ``` ## Process events The `process` object is an instance of [`EventEmitter`][]. ### Event: `'beforeExit'` The `'before... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.08048714697360992,
-0.014997819438576698,
0.026660412549972534,
0.07168350368738174,
0.11290401220321655,
-0.02473660744726658,
-0.03937844932079315,
0.02839348092675209,
0.04308680444955826,
-0.007054581772536039,
-0.10734138637781143,
0.07444368302822113,
0.02389288879930973,
-0.03275... | 0.118276 |
channel (see the [Child Process][] and [Cluster][] documentation), the `'message'` event is emitted whenever a message sent by a parent process using [`childprocess.send()`][] is received by the child process. The message goes through serialization and parsing. The resulting message might not be the same as what is ori... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.048568665981292725,
0.025694018229842186,
0.04973533749580383,
0.07497693598270416,
0.04106703773140907,
-0.07150409370660782,
-0.019687442108988762,
0.04107292741537094,
0.1117621511220932,
-0.01766575314104557,
-0.038852717727422714,
0.05071064829826355,
0.014647465199232101,
0.031509... | 0.126695 |
the `'uncaughtException'` event overrides this default behavior. Alternatively, change the [`process.exitCode`][] in the `'uncaughtException'` handler which will result in the process exiting with the provided exit code. Otherwise, in the presence of such handler the process will exit with 0. ```mjs import process from... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.026872264221310616,
0.026658937335014343,
-0.02410421334207058,
0.047989699989557266,
0.09686030447483063,
-0.037166617810726166,
-0.07653266191482544,
0.06528998166322708,
0.0763983353972435,
0.03980458527803421,
-0.032750848680734634,
0.013412626460194588,
-0.00914593506604433,
-0.078... | 0.056476 |
### Event: `'unhandledRejection'` \* `reason` {Error|any} The object with which the promise was rejected (typically an [`Error`][] object). \* `promise` {Promise} The rejected promise. The `'unhandledRejection'` event is emitted whenever a `Promise` is rejected and no error handler is attached to the promise within a t... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.06249630078673363,
0.07741951197385788,
0.08033861219882965,
0.08838939666748047,
0.07814156264066696,
-0.038216158747673035,
0.0035263157915323973,
0.04694199189543724,
0.11469060927629471,
-0.015290752984583378,
-0.03842819109559059,
-0.0018020081333816051,
0.047518085688352585,
-0.04... | 0.113858 |
`--no-warnings` command-line option can be used to suppress the default console output but the `'warning'` event will still be emitted by the `process` object. Currently, it is not possible to suppress specific warning types other than deprecation warnings. To suppress deprecation warnings, check out the [`--no-depreca... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
0.0690658837556839,
0.028944773599505424,
-0.03026309795677662,
0.10227860510349274,
0.08289776742458344,
0.02448922023177147,
0.042879048734903336,
0.06046184524893761,
0.06053018197417259,
0.03383243456482887,
-0.036390818655490875,
-0.019142935052514076,
-0.017690954729914665,
-0.027708... | 0.068474 |
etc. Signals are not available on [`Worker`][] threads. The signal handler will receive the signal's name (`'SIGINT'`, `'SIGTERM'`, etc.) as the first argument. The name of each event will be the uppercase common name for the signal (e.g. `'SIGINT'` for `SIGINT` signals). ```mjs import process from 'node:process'; // B... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.031183522194623947,
-0.05718404799699783,
0.008353542536497116,
-0.006795310880988836,
0.009094499982893467,
-0.013956917449831963,
0.030155960470438004,
0.03723631799221039,
0.07841203361749649,
-0.014394349418580532,
-0.05198206752538681,
-0.016478387638926506,
-0.05701921507716179,
-... | 0.129714 |
for the existence of a process. ## `process.abort()` The `process.abort()` method causes the Node.js process to exit immediately and generate a core file. This feature is not available in [`Worker`][] threads. ## `process.allowedNodeEnvironmentFlags` \* Type: {Set} The `process.allowedNodeEnvironmentFlags` property is ... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.07847682386636734,
0.034796249121427536,
-0.03246524930000305,
0.0182918943464756,
0.13893136382102966,
-0.07023090124130249,
-0.0227335374802351,
0.028584666550159454,
-0.018111201003193855,
0.027712412178516388,
-0.05909347906708717,
0.026428982615470886,
-0.05423895642161369,
-0.0505... | 0.13387 |
the IPC channel keep the event loop of the process running if `.unref()` has been called before. Typically, this is managed through the number of `'disconnect'` and `'message'` listeners on the `process` object. However, this method can be used to explicitly request a specific behavior. ### `process.channel.unref()` Th... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.06600836664438248,
-0.054169584065675735,
0.00482753524556756,
0.051881272345781326,
0.09342921525239944,
-0.07307775318622589,
0.052091795951128006,
-0.011930184438824654,
0.12258926779031754,
0.011784500442445278,
-0.04257733002305031,
0.10717344284057617,
-0.07209965586662292,
-0.034... | 0.103527 |
= cpuUsage(); // { user: 38579, system: 6986 } // spin the CPU for 500 milliseconds const now = Date.now(); while (Date.now() - now < 500); console.log(cpuUsage(startUsage)); // { user: 514883, system: 11226 } ``` ## `process.cwd()` \* Returns: {string} The `process.cwd()` method returns the current working directory o... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.060109395533800125,
-0.000721729826182127,
-0.027086356654763222,
-0.0020604608580470085,
0.03838706761598587,
-0.09063032269477844,
-0.05297071859240532,
0.09210630506277084,
0.02496916428208351,
0.04107049107551575,
-0.00010429206304252148,
0.03901837766170502,
-0.05793214589357376,
-... | 0.112918 |
```cjs const { emitWarning } = require('node:process'); // Emit a warning with a code and additional detail. emitWarning('Something happened!', { code: 'MY\_WARNING', detail: 'This is some additional information', }); // Emits: // (node:56338) [MY\_WARNING] Warning: Something happened! // This is some additional inform... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.012732906267046928,
0.04413650929927826,
0.005149614531546831,
0.08371984213590622,
0.11528889089822769,
-0.05891192704439163,
0.07055170089006424,
0.07718208432197571,
0.08793966472148895,
-0.009428713470697403,
-0.023345738649368286,
-0.052162665873765945,
0.005122098606079817,
-0.036... | 0.232767 |
A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. While process warnings use `Error` objects, the process warning mechanism is \*\*not\*\* a replacement for normal error handling mechanisms. The following additional handling is implemented if the warning `type` is `'DeprecationWarn... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.021394431591033936,
0.030045274645090103,
0.033604808151721954,
0.0856277272105217,
0.08046846091747284,
-0.08017710596323013,
0.035259366035461426,
0.06416110694408417,
0.02210049331188202,
-0.006085890345275402,
-0.008075429126620293,
-0.01698184758424759,
0.017839012667536736,
-0.022... | 0.120842 |
[`Worker`][] instance operates in a case-sensitive manner unlike the main thread. ## `process.execArgv` \* Type: {string\[]} The `process.execArgv` property returns the set of Node.js-specific command-line options passed when the Node.js process was launched. These options do not appear in the array returned by the [`p... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.04129514843225479,
0.025614045560359955,
-0.05459245294332504,
0.024828016757965088,
0.05657888948917389,
-0.0770806148648262,
0.014533966779708862,
0.04176513850688934,
0.023037763312458992,
0.0091217877343297,
-0.04518071189522743,
0.041561998426914215,
-0.0473928228020668,
0.01605171... | 0.123153 |
reason this is problematic is because writes to `process.stdout` in Node.js are sometimes \_asynchronous\_ and may occur over multiple ticks of the Node.js event loop. Calling `process.exit()`, however, forces the process to exit \_before\_ those additional writes to `stdout` can be performed. Rather than calling `proc... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.008974486030638218,
0.03348613902926445,
0.04714449122548103,
0.06117663532495499,
0.030733469873666763,
-0.026166358962655067,
-0.043231453746557236,
0.08874472975730896,
0.05540155991911888,
0.03713222220540047,
-0.08845703303813934,
-0.011109588667750359,
-0.0004158879746682942,
-0.0... | 0.019198 |
is `true` if the current Node.js build includes support for OCSP in TLS. In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support. This value is therefore identical to that of `process.features.tls`. ## `process.features.tls\_sni` > Stability: 0 - Deprecated. Use `process.featur... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.10391220450401306,
0.0733092650771141,
0.01014619879424572,
0.04739919304847717,
0.1140855923295021,
-0.05727415159344673,
-0.018781177699565887,
0.005111068487167358,
0.06602072715759277,
-0.009302695281803608,
-0.08448631316423416,
0.057344336062669754,
-0.04264416918158531,
0.0261457... | -0.021115 |
obj.dispose(); } function setup() { // This object can be safely garbage collected, // and the resulting shutdown function will not be called. // There are no leaks. const myDisposableObject = { dispose() { // Free your resources synchronously }, }; finalization.register(myDisposableObject, onFinalize); } setup(); ``` ... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.043612707406282425,
0.051627207547426224,
0.014893928542733192,
0.06873267889022827,
0.007184687536209822,
-0.059014998376369476,
0.05659386143088341,
0.05018699914216995,
0.04265517741441727,
-0.005152896977961063,
-0.026736577972769737,
0.09204193204641342,
-0.03890543058514595,
0.002... | 0.158086 |
object obj.dispose(); } finalization.register(myDisposableObject, onFinalize); // Do something myDisposableObject.dispose(); finalization.unregister(myDisposableObject); } setup(); ``` ## `process.getActiveResourcesInfo()` \* Returns: {string\[]} The `process.getActiveResourcesInfo()` method returns an array of strings... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.0017060262616723776,
0.05794266238808632,
-0.026995060965418816,
0.11408374458551407,
0.04779603332281113,
-0.025624677538871765,
0.11049535870552063,
0.03480082005262375,
0.05471135303378105,
-0.007365269120782614,
-0.02192179672420025,
0.04380461201071739,
-0.058309778571128845,
-0.02... | 0.160899 |
console.log(process.getgroups()); // [ 16, 21, 297 ] } ``` ```cjs const process = require('node:process'); if (process.getgroups) { console.log(process.getgroups()); // [ 16, 21, 297 ] } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). ## `process.getuid()` \* Returns: {integer} The... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.05344441905617714,
0.02985946275293827,
-0.06941784173250198,
0.012352444231510162,
0.03885982930660248,
-0.07072025537490845,
0.08066300302743912,
0.03735906630754471,
0.039864975959062576,
-0.023285727947950363,
0.01521799061447382,
-0.06433729827404022,
-0.015143237076699734,
-0.0090... | 0.137882 |
initgroups, setgid } from 'node:process'; console.log(getgroups()); // [ 0 ] initgroups('nodeuser', 1000); // switch user console.log(getgroups()); // [ 27, 30, 46, 1000, 0 ] setgid(1000); // drop root gid console.log(getgroups()); // [ 27, 30, 46, 1000 ] ``` ```cjs const { getgroups, initgroups, setgid } = require('no... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.033249106258153915,
-0.005477659869939089,
-0.06173529103398323,
0.03171350434422493,
-0.010012577287852764,
-0.05573292449116707,
0.03355111926794052,
0.05070207640528679,
0.021165654063224792,
0.0046583241783082485,
0.054169561713933945,
-0.040587007999420166,
-0.06567957997322083,
-0... | 0.124582 |
`rss`, Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the process, including all C++ and JavaScript objects and code. \* `arrayBuffers` refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js [`Buffe... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.009451022371649742,
-0.03617759793996811,
-0.0840151309967041,
0.054031435400247574,
0.07288220524787903,
-0.049128808081150055,
0.022711576893925667,
0.08241540193557739,
0.06376641988754272,
-0.0010950593277812004,
-0.08565075695514679,
0.10794921219348907,
-0.0016172390896826982,
-0.... | 0.177227 |
0.5; maybeSync(maybeTrue, () => { foo(); }); bar(); ``` It is not clear whether `foo()` or `bar()` will be called first. The following approach is much better: ```mjs import { nextTick } from 'node:process'; function definitelyAsync(arg, cb) { if (arg) { nextTick(cb); return; } fs.stat('file', cb); } ``` ```cjs const {... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.14665958285331726,
0.002921156818047166,
-0.053147222846746445,
-0.00009479173604631796,
0.022286782041192055,
-0.07515409588813782,
0.020476019009947777,
0.06374762207269669,
0.10847901552915573,
0.007671820931136608,
-0.028538111597299576,
0.03500862419605255,
-0.009422147646546364,
-... | 0.108197 |
on the provided scope. For example, the reference when the scope is File System means files and folders. The available scopes are: \* `fs` - All File System \* `fs.read` - File System read operations \* `fs.write` - File System write operations \* `child` - Child process spawning operations \* `worker` - Worker thread ... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.06517627090215683,
0.03511102870106697,
-0.07848940044641495,
0.012936023063957691,
0.057728201150894165,
-0.06244029104709625,
0.05135151743888855,
0.09119396656751633,
0.05568906292319298,
0.04081391915678978,
-0.05954257398843765,
0.07137695699930191,
-0.0005312092835083604,
0.019361... | 0.111807 |
(including those that are no longer supported). \* `'Fermium'` for the 14.x LTS line beginning with 14.15.0. \* `'Gallium'` for the 16.x LTS line beginning with 16.13.0. \* `'Hydrogen'` for the 18.x LTS line beginning with 18.12.0. For other LTS Release code names, see [Node.js Changelog Archive](https://github.com/nod... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.08389762789011002,
0.022446855902671814,
0.04351746663451195,
-0.0005803732201457024,
0.1353377401828766,
0.005639112088829279,
-0.07227546721696854,
0.012622775509953499,
-0.013421827927231789,
0.00041591684566810727,
0.006946331821382046,
0.047635406255722046,
-0.07538311183452606,
-0... | 0.047048 |
``` ### `process.report.excludeEnv` \* Type: {boolean} If `true`, a diagnostic report is generated without the environment variables. ### `process.report.signal` \* Type: {string} The signal used to trigger the creation of a diagnostic report. Defaults to `'SIGUSR2'`. ```mjs import { report } from 'node:process'; conso... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.03331559896469116,
0.037511780858039856,
-0.024240193888545036,
0.08153235167264938,
0.07391786575317383,
-0.031239980831742287,
-0.013731283135712147,
0.11856091767549515,
0.04187263920903206,
0.0032814890146255493,
-0.006053795572370291,
0.014478428289294243,
0.031363315880298615,
0.0... | 0.11554 |
on Windows. ```mjs import { resourceUsage } from 'node:process'; console.log(resourceUsage()); /\* Will output: { userCPUTime: 82872, systemCPUTime: 4143, maxRSS: 33164, sharedMemorySize: 0, unsharedDataSize: 0, unsharedStackSize: 0, minorPageFault: 2469, majorPageFault: 0, swappedOut: 0, fsRead: 0, fsWrite: 8, ipcSent... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.02330014668405056,
0.01212623342871666,
-0.01772278919816017,
0.03478328138589859,
0.06733758747577667,
-0.06779006123542786,
0.03419491648674011,
0.03770964965224266,
0.07443585246801376,
0.036903440952301025,
-0.037869829684495926,
-0.032558273524045944,
0.0037744641304016113,
-0.0224... | 0.147522 |
from 'node:process'; if (process.getgid && process.setgid) { console.log(`Current gid: ${process.getgid()}`); try { process.setgid(501); console.log(`New gid: ${process.getgid()}`); } catch (err) { console.error(`Failed to set gid: ${err}`); } } ``` ```cjs const process = require('node:process'); if (process.getgid && ... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.06513706594705582,
0.0034528153482824564,
0.012767975218594074,
-0.010305321775376797,
0.03110729157924652,
-0.0315665639936924,
-0.012234145775437355,
0.043138664215803146,
0.06236295402050018,
0.0267032440751791,
0.0038036915939301252,
-0.0183878056704998,
-0.024526702240109444,
0.007... | 0.115331 |
Type: {Stream} The `process.stderr` property returns a stream connected to `stderr` (fd `2`). It is a [`net.Socket`][] (which is a [Duplex][] stream) unless fd `2` refers to a file, in which case it is a [Writable][] stream. `process.stderr` differs from other Node.js streams in important ways. See [note on process I/O... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.06857553869485855,
-0.007761980872601271,
-0.04525198042392731,
0.01800619252026081,
0.03957719728350639,
-0.0510067343711853,
0.03757548704743385,
0.03133174031972885,
0.09810885787010193,
-0.015057460404932499,
-0.07177262753248215,
0.07713176310062408,
-0.07229802012443542,
-0.029589... | 0.131359 |
terminal session, but consider this particularly careful when doing production logging to the process output streams. To check if a stream is connected to a [TTY][] context, check the `isTTY` property. For instance: ```console $ node -p "Boolean(process.stdin.isTTY)" true $ echo "foo" | node -p "Boolean(process.stdin.i... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
0.0672755241394043,
0.0026762611232697964,
-0.016878526657819748,
0.03965640068054199,
0.07715237885713577,
-0.018703991547226906,
0.010621230117976665,
0.030892658978700638,
0.04601951688528061,
0.016789965331554413,
-0.059661444276571274,
0.003164490219205618,
-0.002068130299448967,
-0.0... | 0.114416 |
mode creation mask. Child processes inherit the mask from the parent process. Returns the previous mask. ```mjs import { umask } from 'node:process'; const newmask = 0o022; const oldmask = umask(newmask); console.log( `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}`, ); ``` ```cjs const { umask } =... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.07332231849431992,
0.01768541894853115,
-0.019646011292934418,
0.06942235678434372,
0.0808170884847641,
-0.10148697346448898,
-0.0008165704202838242,
-0.0029471213929355145,
0.010316431522369385,
-0.03940800204873085,
0.0009716865606606007,
0.002147392835468054,
-0.038464128971099854,
-... | 0.075814 |
the prefix `FATAL ERROR`. \* `6` \*\*Non-function Internal Exception Handler\*\*: There was an uncaught exception, but the internal fatal exception handler function was somehow set to a non-function, and could not be called. \* `7` \*\*Internal Exception Handler Run-Time Failure\*\*: There was an uncaught exception, an... | https://github.com/nodejs/node/blob/main//doc/api/process.md | main | nodejs | [
-0.05692482367157936,
-0.03572916239500046,
0.05745651572942734,
0.0437777079641819,
0.07702764868736267,
-0.04865643382072449,
-0.07414504140615463,
0.07507042586803436,
-0.0028091249987483025,
0.031108161434531212,
0.010128946043550968,
0.04883193597197533,
-0.00880036223679781,
-0.04893... | 0.082515 |
# Async hooks > Stability: 1 - Experimental. Please migrate away from this API, if you can. > We do not recommend using the [`createHook`][], [`AsyncHook`][], and > [`executionAsyncResource`][] APIs as they have usability issues, safety risks, > and performance implications. Async context tracking use cases are better ... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.09592781960964203,
0.002618466503918171,
-0.1522120088338852,
0.12007278203964233,
0.009252763353288174,
-0.10082948952913284,
0.03593885898590088,
-0.02868065983057022,
-0.013624369166791439,
-0.04368295893073082,
-0.01109294593334198,
-0.04939357191324234,
0.014330394566059113,
-0.083... | 0.139255 |
the callback of the // current execution scope to call. const tid = async\_hooks.triggerAsyncId(); // Create a new AsyncHook instance. All of these callbacks are optional. const asyncHook = async\_hooks.createHook({ init, before, after, destroy, promiseResolve }); // Allow callbacks of this AsyncHook instance to call. ... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.12041902542114258,
0.06459405273199081,
-0.05531502887606621,
0.10852760821580887,
-0.008106610737740993,
-0.039303045719861984,
0.024375760927796364,
-0.00901680625975132,
0.08920256048440933,
-0.046026699244976044,
-0.06145238131284714,
0.035383354872465134,
-0.03238583356142044,
-0.0... | 0.091053 |
The reason for this error handling behavior is that these callbacks are running at potentially volatile points in an object's lifetime, for example during class construction and destruction. Because of this, it is deemed necessary to bring down the process quickly in order to prevent an unintentional abort in the futur... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.0824817419052124,
0.046488188207149506,
-0.05375855788588524,
0.16390493512153625,
0.011263854801654816,
-0.11627870053052902,
-0.024638470262289047,
0.08339500427246094,
0.04974270239472389,
-0.007479085586965084,
-0.00202352786436677,
0.0851878821849823,
-0.0030318358913064003,
-0.078... | 0.026634 |
closing it before the resource can be used. The following snippet demonstrates this. ```mjs import { createServer } from 'node:net'; createServer().listen(function() { this.close(); }); // OR clearTimeout(setTimeout(() => {}, 10)); ``` ```cjs require('node:net').createServer().listen(function() { this.close(); }); // O... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.11306934803724289,
0.0747176855802536,
-0.0027296843472868204,
0.07097718119621277,
0.08637262880802155,
-0.04002287983894348,
0.03378407284617424,
-0.04152870178222656,
0.11310894042253494,
0.004696850199252367,
-0.04823927581310272,
0.08092533051967621,
0.02184646762907505,
-0.0239298... | 0.133412 |
it. ##### Asynchronous context example The context tracking use case is covered by the stable API [`AsyncLocalStorage`][]. This example only illustrates async hooks operation but [`AsyncLocalStorage`][] fits better to this use case. The following is an example with additional information about the calls to `init` betwe... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.07036424428224564,
0.03693334013223648,
-0.09979183971881866,
0.08499016612768173,
0.054897699505090714,
-0.04469458758831024,
0.07683249562978745,
0.029692014679312706,
0.039651840925216675,
-0.060789089649915695,
-0.025309022516012192,
-0.008795403875410557,
0.014079887419939041,
-0.0... | 0.155138 |
about to execute the callback. The `before` callback will be called 0 to N times. The `before` callback will typically be called 0 times if the asynchronous operation was cancelled or, for example, if no connections are received by a TCP server. Persistent asynchronous resources like a TCP server will typically call th... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.07939353585243225,
-0.01132458820939064,
-0.05943332985043526,
0.09581758826971054,
0.028275536373257637,
-0.07390870898962021,
-0.04100089892745018,
0.04652949050068855,
0.15813742578029633,
-0.060061920434236526,
-0.008545898832380772,
0.11164942383766174,
-0.016800040379166603,
-0.10... | 0.12745 |
state: req.url }; setTimeout(function() { res.end(JSON.stringify(executionAsyncResource()[sym])); }, 100); }).listen(3000); ``` ```cjs const { createServer } = require('node:http'); const { executionAsyncId, executionAsyncResource, createHook, } = require('node:async\_hooks'); const sym = Symbol('state'); // Private sy... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.07294683158397675,
0.05211451277136803,
-0.03740568459033966,
0.030956657603383064,
-0.022244103252887726,
-0.030941270291805267,
-0.03735516220331192,
0.014771352522075176,
0.04925696551799774,
-0.0069891358725726604,
-0.042216360569000244,
-0.033441416919231415,
-0.02286488562822342,
... | 0.123337 |
callback to be executed. Installing async hooks via `async\_hooks.createHook` enables promise execution tracking: ```mjs import { createHook, executionAsyncId, triggerAsyncId } from 'node:async\_hooks'; createHook({ init() {} }).enable(); // forces PromiseHooks to be enabled. Promise.resolve(1729).then(() => { console.... | https://github.com/nodejs/node/blob/main//doc/api/async_hooks.md | main | nodejs | [
-0.128844752907753,
0.0688132643699646,
-0.036763399839401245,
0.08609097450971603,
-0.003919552080333233,
-0.003693278646096587,
-0.06787533313035965,
0.01595226861536503,
0.0487353578209877,
-0.0154853081330657,
-0.0286252498626709,
-0.0069409580901265144,
-0.03117959573864937,
-0.066065... | 0.1103 |
# Permissions Permissions can be used to control what system resources the Node.js process has access to or what actions the process can take with those resources. \* [Process-based permissions](#process-based-permissions) control the Node.js process's access to resources. The resource can be entirely allowed or denied... | https://github.com/nodejs/node/blob/main//doc/api/permissions.md | main | nodejs | [
-0.0829429104924202,
0.004237644374370575,
-0.021641915664076805,
0.05161960422992706,
0.09467850625514984,
-0.0424310564994812,
0.011714525520801544,
0.04595813900232315,
0.05547197908163071,
0.009975849650800228,
-0.06881948560476303,
0.15101517736911774,
0.028465373441576958,
-0.0150694... | 0.152927 |
- It will allow all `FileSystemWrite` operations. \* `--allow-fs-write=/tmp/` - It will allow `FileSystemWrite` access to the `/tmp/` folder. \* `--allow-fs-read=/tmp/ --allow-fs-read=/home/.gitignore` - It allows `FileSystemRead` access to the `/tmp/` folder \*\*and\*\* the `/home/.gitignore` path. Wildcards are suppo... | https://github.com/nodejs/node/blob/main//doc/api/permissions.md | main | nodejs | [
-0.031898949295282364,
-0.0008214744157157838,
-0.04936584457755089,
0.037298377603292465,
0.03675443306565285,
-0.020578552037477493,
0.0012555415742099285,
0.04021512344479561,
-0.02734380215406418,
-0.027750851586461067,
0.030250485986471176,
0.07017666101455688,
0.011229843832552433,
0... | 0.171249 |
when the Permission Model is enabled, affecting the sqlite module. \* Using existing file descriptors via the `node:fs` module bypasses the Permission Model. #### Limitations and Known Issues \* Symbolic links will be followed even to locations outside of the set of paths that access has been granted to. Relative symbo... | https://github.com/nodejs/node/blob/main//doc/api/permissions.md | main | nodejs | [
-0.005060592666268349,
-0.061208974570035934,
-0.06516966968774796,
0.033065807074308395,
0.09046708047389984,
-0.04849788174033165,
-0.017128244042396545,
0.04983776435256004,
-0.061697546392679214,
0.05337285250425339,
0.02424650453031063,
0.04484652727842331,
-0.020289503037929535,
0.01... | 0.014215 |
# Web Crypto API > Stability: 2 - Stable Node.js provides an implementation of the [Web Crypto API][] standard. Use `globalThis.crypto` or `require('node:crypto').webcrypto` to access this module. ```js const { subtle } = globalThis.crypto; (async function() { const key = await subtle.generateKey({ name: 'HMAC', hash: ... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.07680782675743103,
0.016973188146948814,
-0.03547380864620209,
0.04461837187409401,
0.03953879699110985,
-0.0801072046160698,
0.0026436985936015844,
0.018111389130353928,
0.016975242644548416,
-0.05077210068702698,
-0.009318947792053223,
-0.007757115177810192,
0.03273927792906761,
-0.01... | 0.054033 |
true, ['sign', 'verify']); return key; } ``` ### Wrapping and unwrapping keys ```js const { subtle } = globalThis.crypto; async function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') { const [ key, wrappingKey, ] = await Promise.all([ subtle.generateKey({ name: 'HMAC', hash, }, true, ['sign', 'verify']), sub... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.1264019012451172,
0.05571543052792549,
-0.010168861597776413,
0.07462108135223389,
-0.003400030778720975,
-0.04743118956685066,
0.009472759440541267,
-0.029541853815317154,
-0.021147601306438446,
-0.03747556358575821,
0.04206686094403267,
-0.05341947078704834,
0.006922364700585604,
0.01... | -0.054575 |
| | `'AES-CBC'` | ✔ | ✔ | ✔ | | | `'AES-CTR'` | ✔ | ✔ | ✔ | | | `'AES-GCM'` | ✔ | ✔ | ✔ | | | `'AES-KW'` | ✔ | ✔ | ✔ | | | `'AES-OCB'` | ✔ | ✔ | ✔ | | | `'Argon2d'` | | | ✔ | | | `'Argon2i'` | | | ✔ | | | `'Argon2id'` | | | ✔ | | | `'ChaCha20-Poly1305'`[^modern-algos] | ✔ | ✔ | ✔ | | | `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | `'EC... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.06389477849006653,
0.0980825200676918,
-0.09322366118431091,
-0.03974957391619682,
0.0008437087526544929,
-0.07097367197275162,
0.07475899159908295,
0.009317596442997456,
0.00817443523555994,
-0.019206274300813675,
0.10203021764755249,
-0.07271479815244675,
0.08002476394176483,
-0.04005... | 0.082292 |
| | | | `'KMAC128'`[^modern-algos] | | ✔ | | | | | | `'KMAC256'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-44'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-65'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-87'`[^modern-algos] | | ✔ | | | | | | `'ML-KEM-512'`[^modern-algos] | | | | | ✔ | | | `'ML-KEM-768'`[^modern-algos] | |... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.01890011876821518,
0.04016854986548424,
-0.0952029749751091,
-0.05859421566128731,
-0.00839540921151638,
-0.023442061617970467,
0.02400841750204563,
-0.010168906301259995,
-0.025339312851428986,
-0.008877573534846306,
0.09056297689676285,
-0.03175561502575874,
0.020876383408904076,
-0.0... | 0.065911 |
/ [`subtle.decrypt()`][] \* \*\*Signatures and MAC\*\*: [`subtle.sign()`][] / [`subtle.verify()`][] \* \*\*Key or Bits Derivation\*\*: [`subtle.deriveBits()`][] / [`subtle.deriveKey()`][] \* \*\*Key Wrapping\*\*: [`subtle.wrapKey()`][] / [`subtle.unwrapKey()`][] \* \*\*Key Encapsulation\*\*: [`subtle.encapsulateBits()`... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.07115934044122696,
0.02442304603755474,
0.020031150430440903,
-0.01748882792890072,
0.03063664585351944,
-0.10155058652162552,
0.06318530440330505,
0.019561365246772766,
-0.052888162434101105,
-0.04731040075421333,
0.028928667306900024,
-0.08689571171998978,
0.03921220824122429,
-0.0084... | 0.059331 |
of this method. ### `subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)` > Stability: 1.1 - Active development \* `decapsulationAlgorithm` {string|Algorithm} \* `decapsulationKey` {CryptoKey} \* `ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with {ArrayBuf... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.03030621074140072,
0.02448669821023941,
0.011705601587891579,
0.016423549503087997,
-0.07679206132888794,
-0.10109804570674896,
0.03146417438983917,
-0.054233990609645844,
-0.009873507544398308,
-0.008098122663795948,
-0.011377684772014618,
-0.04398433864116669,
-0.0024602499324828386,
... | 0.130096 |
an {Object}, it must have a `name` property whose value is one of the above. ### `subtle.encapsulateBits(encapsulationAlgorithm, encapsulationKey)` > Stability: 1.1 - Active development \* `encapsulationAlgorithm` {string|Algorithm} \* `encapsulationKey` {CryptoKey} \* Returns: {Promise} Fulfills with {EncapsulatedBits... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.041967447847127914,
0.023609858006238937,
-0.005548432469367981,
0.03954169899225235,
-0.052369147539138794,
-0.08883543312549591,
0.04450802505016327,
-0.04385551065206528,
-0.0059440224431455135,
-0.015170888975262642,
-0.019750159233808517,
-0.1138954758644104,
0.0047460561618208885,
... | 0.138505 |
✔ | ✔ | | | ✔ | ✔ | | `'ML-DSA-87'`[^modern-algos] | ✔ | ✔ | ✔ | | | ✔ | ✔ | | `'ML-KEM-512'`[^modern-algos] | ✔ | ✔ | | | | ✔ | ✔ | | `'ML-KEM-768'`[^modern-algos] | ✔ | ✔ | | | | ✔ | ✔ | | `'ML-KEM-1024'`[^modern-algos] | ✔ | ✔ | | | | ✔ | ✔ | | `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | | | | `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | |... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.061733461916446686,
0.01078367605805397,
-0.09749344736337662,
-0.020124638453125954,
-0.008026170544326305,
0.006193829700350761,
0.046919889748096466,
0.021177105605602264,
-0.07418688386678696,
0.030715953558683395,
0.11664971709251404,
-0.07976988703012466,
0.06774619221687317,
-0.0... | 0.055231 |
| `'Ed25519'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'HDKF'` | | | | ✔ | ✔ | | | | `'HMAC'` | | | ✔ | ✔ | ✔ | | | | `'KMAC128'`[^modern-algos] | | | ✔ | | ✔ | | | | `'KMAC256'`[^modern-algos] | | | ✔ | | ✔ | | | | `'ML-DSA-44'`[^modern-algos] | ✔ | ✔ | ✔ | | | ✔ | ✔ | | `'ML-... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.036549147218465805,
0.025195319205522537,
-0.06947777420282364,
-0.06987221539020538,
0.009015793912112713,
-0.06436622142791748,
0.012963414192199707,
0.0024555488489568233,
-0.050069067627191544,
-0.025940341874957085,
0.12633498013019562,
-0.07059717178344727,
0.031817469745874405,
-... | 0.078214 |
`signature` {ArrayBuffer|TypedArray|DataView|Buffer} \* `data` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with a {boolean} upon success. Using the method and parameters given in `algorithm` and the keying material provided by `key`, this method attempts to verify that `signature` is a valid... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
-0.056863781064748764,
0.05423465371131897,
-0.014563377015292645,
-0.06618589907884598,
-0.053608015179634094,
-0.13230040669441223,
0.042862966656684875,
-0.056656256318092346,
-0.03231016919016838,
-0.03202201798558235,
-0.010371596552431583,
0.0155409537255764,
0.06464405357837677,
-0.... | 0.04312 |
the optional associated data. #### `argon2Params.memory` \* Type: {number} Represents the memory size in kibibytes. It must be at least 8 times the degree of parallelism. #### `argon2Params.name` \* Type: {string} Must be one of `'Argon2d'`, `'Argon2i'`, or `'Argon2id'`. #### `argon2Params.nonce` \* Type: {ArrayBuffer|... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
0.001320553943514824,
0.03636183962225914,
-0.12072031944990158,
0.0029330113902688026,
-0.09852349758148193,
-0.055797312408685684,
0.08932659029960632,
0.0196323711425066,
-0.020070677623152733,
-0.06761369854211807,
-0.03279875963926315,
-0.057040564715862274,
0.047257598489522934,
-0.0... | 0.118235 |
`hkdfParams.hash` \* Type: {string|Algorithm} If represented as a {string}, the value must be one of: \* `'SHA-1'` \* `'SHA-256'` \* `'SHA-384'` \* `'SHA-512'` \* `'SHA3-256'`[^modern-algos] \* `'SHA3-384'`[^modern-algos] \* `'SHA3-512'`[^modern-algos] If represented as an {Algorithm}, the object's `name` property must... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
0.0518181174993515,
0.04351407662034035,
-0.0440763458609581,
-0.0380442775785923,
-0.1187746524810791,
-0.008736188523471355,
0.07251320779323578,
-0.035462282598018646,
-0.0976509377360344,
-0.07276590168476105,
-0.000608839385677129,
-0.1269650012254715,
0.018135393038392067,
-0.0309920... | -0.032874 |
algorithm should make when deriving bits. #### `pbkdf2Params.name` \* Type: {string} Must be `'PBKDF2'`. #### `pbkdf2Params.salt` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} Should be at least 16 random or pseudorandom bytes. ### Class: `RsaHashedImportParams` #### `rsaHashedImportParams.hash` \* Type: {string|Al... | https://github.com/nodejs/node/blob/main//doc/api/webcrypto.md | main | nodejs | [
0.026622792705893517,
0.052938058972358704,
-0.04320477694272995,
-0.07286092638969421,
-0.09530709683895111,
-0.08211595565080643,
0.05741983279585838,
-0.0666097104549408,
-0.0856381207704544,
-0.03660529479384422,
-0.06589207053184509,
-0.08818954974412918,
0.07001233100891113,
-0.04489... | -0.01308 |
# Web Streams API > Stability: 2 - Stable An implementation of the [WHATWG Streams Standard][]. ## Overview The [WHATWG Streams Standard][] (or "web streams") defines an API for handling streaming data. It is similar to the Node.js [Streams][] API but emerged later and has become the "standard" API for streaming data a... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.0948198214173317,
0.02281138300895691,
-0.03284067288041115,
0.02970902808010578,
0.03179357945919037,
-0.06194675341248512,
-0.037575408816337585,
0.032261960208415985,
0.005973695311695337,
-0.02046259120106697,
-0.061139583587646484,
0.05993185564875603,
-0.04579208791255951,
0.01888... | 0.17619 |
} from 'node:stream/web'; const stream = new ReadableStream(); const reader = stream.getReader(); console.log(await reader.read()); ``` ```cjs const { ReadableStream } = require('node:stream/web'); const stream = new ReadableStream(); const reader = stream.getReader(); reader.read().then(console.log); ``` Causes the `r... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.03964050114154816,
0.03958649933338165,
-0.02760631963610649,
0.01949886605143547,
0.026933468878269196,
-0.015514177270233631,
-0.045212987810373306,
0.0671461969614029,
-0.003112252103164792,
0.008931674063205719,
-0.05010150745511055,
0.05985693633556366,
-0.07582592219114304,
0.0106... | 0.050105 |
(via either a `break`, `return`, or a `throw`), the {ReadableStream} will be closed. To prevent automatic closing of the {ReadableStream}, use the `readableStream.values()` method to acquire the async iterator and set the `preventCancel` option to `true`. The {ReadableStream} must not be locked (that is, it must not ha... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.07515381276607513,
-0.012918292544782162,
-0.05615874379873276,
0.036273662000894547,
-0.01262836903333664,
-0.028268270194530487,
-0.02189086750149727,
-0.005613046698272228,
0.022368911653757095,
-0.06292637437582016,
-0.03954998031258583,
0.05926546826958656,
-0.050437599420547485,
-... | 0.032032 |
controller; } async pull(controller) { const view = controller.byobRequest?.view; const { bytesRead, } = await this.file.read({ buffer: view, offset: view.byteOffset, length: view.byteLength, }); if (bytesRead === 0) { await this.file.close(); this.controller.close(); } controller.byobRequest.respond(bytesRead); } } co... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.024082044139504433,
-0.007631510030478239,
-0.086110919713974,
-0.0028448179364204407,
-0.02933908998966217,
-0.012065206654369831,
-0.0059317597188055515,
0.07045620679855347,
-0.001396618434228003,
-0.01674404926598072,
-0.031259238719940186,
0.03900708630681038,
-0.11979500204324722,
... | 0.013337 |
object is used to gain access to the `ArrayBuffer`/`TypedArray` that has been provided for the read request to fill, and provides methods for signaling that the data has been provided. #### `readableStreamBYOBRequest.respond(bytesWritten)` \* `bytesWritten` {number} Signals that a `bytesWritten` number of bytes have be... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.01702454872429371,
0.0298245158046484,
-0.007499085273593664,
0.027951080352067947,
-0.08985395729541779,
-0.05805157497525215,
0.0575065053999424,
0.02378213405609131,
0.017728291451931,
-0.004153494723141193,
-0.11645437777042389,
0.0717678815126419,
-0.040987562388181686,
-0.01165770... | 0.151072 |
A promise fulfilled with `undefined`. Appends a new chunk of data to the {WritableStream}'s queue. ### Class: `WritableStreamDefaultController` The `WritableStreamDefaultController` manages the {WritableStream}'s internal state. #### `writableStreamDefaultController.error([error])` \* `error` {any} Called by user-code ... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.11645463109016418,
0.03619779646396637,
-0.010904360562562943,
0.03600002080202103,
-0.0012104188790544868,
-0.06906195729970932,
-0.008442887105047703,
0.012747314758598804,
0.07270587235689163,
0.020387960597872734,
-0.011901180259883404,
0.1058042049407959,
-0.04419684782624245,
-0.0... | 0.123009 |
Type: {Function} \* `chunk` {any} \* Returns: {number} ### Class: `TextEncoderStream` #### `new TextEncoderStream()` Creates a new `TextEncoderStream` instance. #### `textEncoderStream.encoding` \* Type: {string} The encoding supported by the `TextEncoderStream` instance. #### `textEncoderStream.readable` \* Type: {Rea... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.08079799264669418,
-0.04325276240706444,
-0.009051923640072346,
0.047166258096694946,
-0.05539349466562271,
-0.03093196637928486,
-0.0073523689061403275,
0.01285042054951191,
-0.017293037846684456,
-0.06846022605895996,
0.002952649723738432,
-0.018082546070218086,
-0.0363965705037117,
0... | 0.054675 |
require('node:stream'); const { Buffer } = require('node:buffer'); const dataBuffer = Buffer.from('hello world from consumers!'); const readable = Readable.from(dataBuffer); buffer(readable).then((data) => { console.log(`from readable: ${data.length}`); // Prints: from readable: 27 }); ``` #### `streamConsumers.bytes(s... | https://github.com/nodejs/node/blob/main//doc/api/webstreams.md | main | nodejs | [
-0.029254969209432602,
0.05591276288032532,
0.00901938695460558,
0.02237587794661522,
-0.009723466821014881,
-0.05055579915642738,
0.03694816306233406,
0.03136216104030609,
-0.007420347072184086,
-0.042060982435941696,
-0.05275668576359749,
0.014601949602365494,
-0.04174740985035896,
0.029... | 0.048488 |
# WebAssembly System Interface (WASI) > Stability: 1 - Experimental **The `node:wasi` module does not currently provide the comprehensive file system security properties provided by some WASI runtimes. Full support for secure file system sandboxing may or may not be implemented in future. In the mean time, do not rely ... | https://github.com/nodejs/node/blob/main//doc/api/wasi.md | main | nodejs | [
-0.09281798452138901,
0.07468502968549728,
-0.07204040884971619,
0.0014209786895662546,
0.0537082813680172,
-0.09337424486875534,
-0.01228646282106638,
0.09657612442970276,
-0.049359939992427826,
0.03186136856675148,
-0.0030320454388856888,
0.020341161638498306,
0.001964573748409748,
-0.05... | 0.202571 |
WASI([options])` \* `options` {Object} \* `args` {Array} An array of strings that the WebAssembly application will see as command-line arguments. The first argument is the virtual path to the WASI command itself. \*\*Default:\*\* `[]`. \* `env` {Object} An object similar to `process.env` that the WebAssembly applicatio... | https://github.com/nodejs/node/blob/main//doc/api/wasi.md | main | nodejs | [
-0.004487712401896715,
0.032141510397195816,
-0.06198708340525627,
0.006212381646037102,
-0.00503467908129096,
-0.0737614706158638,
0.00400626240298152,
0.039208605885505676,
-0.02656991221010685,
0.038525138050317764,
0.03477466478943825,
-0.01985335536301136,
-0.011749451979994774,
-0.00... | 0.161935 |
# URL > Stability: 2 - Stable The `node:url` module provides utilities for URL resolution and parsing. It can be accessed using: ```mjs import url from 'node:url'; ``` ```cjs const url = require('node:url'); ``` ## URL strings and URL objects A URL string is a structured string containing multiple meaningful components... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.13083332777023315,
0.058482877910137177,
0.05109316483139992,
0.00903412513434887,
-0.00975057203322649,
-0.0760059803724289,
-0.0941990464925766,
0.043733205646276474,
0.021500542759895325,
-0.027616450563073158,
-0.062405116856098175,
0.052040133625268936,
0.006888257339596748,
0.0016... | 0.080415 |
`base` {string} The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is [converted to a string][] first. Creates a new `URL` object by parsing the `input` relative to the `base`. If `base` is passed as a string, it will be parsed equivalent to `new URL(base)`. ```js const myURL ... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.0634220764040947,
0.04307990148663521,
0.037569310516119,
0.012882005423307419,
-0.035060763359069824,
-0.05973699316382408,
-0.10051917284727097,
0.06687071919441223,
0.06534727662801743,
-0.0009306793217547238,
-0.05605098605155945,
0.012601092457771301,
-0.004190323408693075,
0.04536... | 0.078087 |
read-only serialization of the URL's origin. ```js const myURL = new URL('https://example.org/foo/bar?baz'); console.log(myURL.origin); // Prints https://example.org ``` ```js const idnURL = new URL('https://測試'); console.log(idnURL.origin); // Prints https://xn--g6w251d console.log(idnURL.hostname); // Prints xn--g6w2... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.0513337217271328,
0.03398556634783745,
-0.023862620815634727,
-0.034147318452596664,
-0.04398978501558304,
-0.06973718851804733,
-0.041717104613780975,
0.013844168744981289,
0.09959288686513901,
-0.032060407102108,
-0.07754428684711456,
0.08896175026893616,
0.017109818756580353,
0.00614... | -0.011215 |
schemes The [WHATWG URL Standard][] considers a handful of URL protocol schemes to be \_special\_ in terms of how they are parsed and serialized. When a URL is parsed using one of these special protocols, the `url.protocol` property may be changed to another special protocol but cannot be changed to a non-special proto... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.08279314637184143,
0.03224664926528931,
0.005772463511675596,
-0.05297871306538582,
-0.028827829286456108,
-0.06930074840784073,
-0.0402342714369297,
-0.01792421005666256,
0.02888895571231842,
-0.0044337050057947636,
-0.018983203917741776,
0.043725963681936264,
-0.04798027127981186,
0.1... | 0.083899 |
retained in memory until `URL.revokeObjectURL()` is called to remove it. `Blob` objects are registered within the current thread. If using Worker Threads, `Blob` objects registered within one Worker will not be available to other workers or the main thread. #### `URL.revokeObjectURL(id)` \* `id` {string} A `'blob:noded... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.0778421089053154,
0.07068487256765366,
-0.03421219065785408,
0.07443239539861679,
-0.06314422190189362,
-0.05390917882323265,
0.01517126988619566,
-0.044741082936525345,
0.021096687763929367,
-0.02594481222331524,
-0.04883526265621185,
0.07543071359395981,
0.0643884539604187,
-0.0339830... | 0.122869 |
`hostname`, `port`, `pathname`, `search`, `hash` or `baseURL`. If `baseURL` is not specified, it defaults to `undefined`. An option can have `ignoreCase` boolean attribute which enables case-insensitive matching if set to true. The constructor can throw a `TypeError` to indicate parsing failure. #### `urlPattern.exec(i... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.06037912890315056,
0.02000274509191513,
-0.041092649102211,
0.0035912066232413054,
-0.0603095181286335,
-0.11392602324485779,
-0.009633674286305904,
0.03776184841990471,
-0.01998729817569256,
-0.018468424677848816,
0.0035956630017608404,
-0.017059914767742157,
0.04861051216721535,
0.038... | 0.129208 |
pairs Instantiate a new `URLSearchParams` object with a query hash map. The key and value of each property of `obj` are always coerced to strings. Unlike [`querystring`][] module, duplicate keys in the form of array values are not allowed. Arrays are stringified using [`array.toString()`][], which simply joins all arra... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
0.005259530618786812,
0.07003135234117508,
-0.044757142663002014,
0.02359655871987343,
-0.11981606483459473,
0.034211087971925735,
0.026897616684436798,
0.04353989660739899,
0.019647100940346718,
-0.0793662965297699,
-0.04435610771179199,
0.029647983610630035,
0.019717473536729813,
0.01010... | 0.040331 |
provided, returns `true` if there is at least one name-value pair whose name is `name`. #### `urlSearchParams.keys()` \* Returns: {Iterator} Returns an ES6 `Iterator` over the names of each name-value pair. ```js const params = new URLSearchParams('foo=bar&foo=baz'); for (const name of params.keys()) { console.log(name... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.0653982162475586,
0.0730062872171402,
-0.006003713700920343,
0.04492955282330513,
-0.10235613584518433,
-0.0009704598924145103,
0.046086881309747696,
0.0023160323034971952,
0.0560787171125412,
-0.06428766250610352,
-0.032974209636449814,
0.013094806112349033,
0.0294913612306118,
-0.0329... | 0.011058 |
encoded directory traversal sequences (such as `%2e%2e`) are decoded and processed as actual path traversal, even though encoded slashes (`%2F`, `%5C`) are correctly rejected. \*\*Applications must not rely on `fileURLToPath()` alone to prevent directory traversal attacks.\*\* Always perform explicit path validation an... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.054906055331230164,
0.0358070470392704,
0.026466958224773407,
0.023557191714644432,
-0.031556546688079834,
-0.05426989123225212,
-0.044334474951028824,
0.09838520735502243,
0.029597915709018707,
0.02379508875310421,
-0.01012391783297062,
0.01608632504940033,
0.04261937737464905,
0.09106... | 0.077525 |
`options` {Object} \* `windows` {boolean|undefined} `true` if the `path` should be treated as a windows filepath, `false` for posix, and `undefined` for the system default. \*\*Default:\*\* `undefined`. \* Returns: {URL} The file URL object. This function ensures that `path` is resolved absolutely, and that the URL con... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.06160149723291397,
0.041350509971380234,
0.012223192490637302,
0.04039697349071503,
-0.049663297832012177,
-0.032152507454156876,
-0.02748579904437065,
0.04366258904337883,
0.05792635679244995,
0.02375437505543232,
0.00523028988391161,
0.01319237519055605,
0.008007105439901352,
0.062267... | 0.020856 |
a concatenation of the `pathname` and `search` components. For example: `'/p/a/t/h?query=string'`. No decoding of the `path` is performed. #### `urlObject.pathname` The `pathname` property consists of the entire path section of the URL. This is everything following the `host` (including the `port`) and before the start... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.043471239507198334,
0.03514281287789345,
-0.020322106778621674,
-0.00294945458881557,
-0.0645487904548645,
-0.0560850091278553,
-0.022031821310520172,
0.007429542951285839,
0.04887305945158005,
-0.03992151468992233,
-0.00020509825844783336,
0.031452130526304245,
0.06546986103057861,
0.0... | 0.092298 |
and appended to `result`. \* If the `urlObject.pathname` property is a string that is not an empty string: \* If the `urlObject.pathname` \_does not start\_ with an ASCII forward slash (`/`), then the literal string `'/'` is appended to `result`. \* The value of `urlObject.pathname` is appended to `result`. \* Otherwis... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.03354274109005928,
0.06411579996347427,
-0.009637651965022087,
0.06705746054649353,
-0.07757487148046494,
-0.029114583507180214,
0.026002150028944016,
0.06423651427030563,
0.02057836391031742,
-0.037768036127090454,
0.0199151411652565,
-0.025550920516252518,
0.05837443843483925,
0.00139... | 0.104715 |
an anchor tag. ```js const url = require('node:url'); url.resolve('/one/two/three', 'four'); // '/one/two/four' url.resolve('http://example.com/', '/one'); // 'http://example.com/one' url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' ``` To achieve the same result using the WHATWG URL API: ```j... | https://github.com/nodejs/node/blob/main//doc/api/url.md | main | nodejs | [
-0.102483369410038,
0.047982357442379,
0.03546769917011261,
-0.04694468900561333,
-0.046353816986083984,
-0.05610477924346924,
-0.07750710099935532,
0.0045884340070188046,
0.06426504254341125,
-0.015038084238767624,
-0.02238469384610653,
0.0002793700550682843,
0.018665339797735214,
0.05101... | -0.007886 |
# TLS (SSL) > Stability: 2 - Stable The `node:tls` module provides an implementation of the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. The module can be accessed using: ```mjs import tls from 'node:tls'; ``` ```cjs const tls = require('node:tls'); ``` ## Dete... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.08910638093948364,
0.008051136508584023,
0.0032851588912308216,
0.03987649083137512,
0.055867910385131836,
-0.0478174164891243,
-0.01575102098286152,
0.0068704839795827866,
0.01839476451277733,
-0.03305163234472275,
0.0004697381518781185,
0.03522758185863495,
0.04684773460030556,
0.0471... | 0.087794 |
to obtain the key-pair specifically generated for the session. Perfect forward secrecy is achieved by randomly generating a key pair for key-agreement on every TLS/SSL handshake (in contrast to using the same key for all sessions). Methods implementing this technique are called "ephemeral". Currently two methods are co... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.06202703341841698,
0.06677869707345963,
-0.004770096857100725,
0.03243556246161461,
-0.0641724243760109,
0.01117847952991724,
0.02623610757291317,
0.018832562491297722,
0.1134151816368103,
0.005041700787842274,
0.0352548211812973,
0.004594440571963787,
-0.01953035406768322,
-0.035936310... | 0.10144 |
the server to help the client decide which identity to use during negotiation. Always `null` if TLS 1.3 is used. \* Returns: {Object} in the form `{ psk: , identity: }` or `null`. Then on the server: \* `socket` {tls.TLSSocket} the server socket instance, equivalent to `this`. \* `identity` {string} identity parameter ... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.1368507444858551,
0.1617908924818039,
-0.05693463981151581,
0.027528731152415276,
-0.06707275658845901,
-0.03710485249757767,
0.12643641233444214,
-0.029637152329087257,
0.17226868867874146,
0.016095725819468498,
-0.0001796288270270452,
-0.01996130309998989,
0.04165654629468918,
-0.0119... | 0.074827 |
returns a value, the session data contains a ticket, otherwise it contains client-side session state. With TLSv1.3, be aware that multiple tickets may be sent by the server, resulting in multiple `'session'` events, see [`'session'`][] for more information. Single process servers need no specific implementation to use ... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.07752581685781479,
0.07601775228977203,
-0.07186450064182281,
-0.05139537900686264,
-0.06386946886777878,
-0.07273703068494797,
0.07515940070152283,
-0.008694001473486423,
0.10647723078727722,
0.04465165734291077,
-0.06962201744318008,
-0.028218818828463554,
0.07757313549518585,
-0.0009... | -0.061445 |
':!ECDHE-RSA-AES128-SHA:!ECDHE-RSA-AES128-SHA256:!ECDHE-RSA-AES256-SHA:!ECDHE-RSA-AES256-SHA384' + ':!ECDHE-ECDSA-AES128-SHA:!ECDHE-ECDSA-AES128-SHA256:!ECDHE-ECDSA-AES256-SHA:!ECDHE-ECDSA-AES256-SHA384' + ':!kRSA'; ``` The default can also be replaced on a per client or server basis using the `ciphers` option from [`t... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.026190582662820816,
0.07843054831027985,
-0.027681509032845497,
-0.06449371576309204,
0.009528074413537979,
-0.02163807488977909,
-0.031528446823358536,
-0.061035092920064926,
0.09546490758657455,
-0.030480507761240005,
0.013978252187371254,
-0.016913628205657005,
0.03269577398896217,
-... | -0.052512 |
'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1' }); }); ``` This approach sets the security level to 0, allowing the use of legacy features while still leveraging the default OpenSSL ciphers. ### Using [`--tls-cipher-list`][] You can also set the security level and ciphers from the command line using the `--tls-cipher-list=D... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.03471735119819641,
0.07824601978063583,
-0.0943220779299736,
-0.0016681262059137225,
-0.027067560702562332,
-0.040527645498514175,
-0.03538507968187332,
0.05224870145320892,
-0.012690029107034206,
-0.0512860007584095,
0.05081307515501976,
-0.06594204902648926,
0.09618167579174042,
0.064... | -0.046531 |
the traffic: ```js const logFile = fs.createWriteStream('/tmp/ssl-keys.log', { flags: 'a' }); // ... server.on('keylog', (line, tlsSocket) => { if (tlsSocket.remoteAddress !== '...') return; // Only log keys for a particular IP logFile.write(line); }); ``` ### Event: `'newSession'` The `'newSession'` event is emitted u... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.029913539066910744,
0.07676499336957932,
-0.00709226168692112,
0.019834833219647408,
-0.019699126482009888,
-0.07810559123754501,
0.058624714612960815,
0.025812288746237755,
0.142491415143013,
0.007234432268887758,
-0.07496992498636246,
0.07355727255344391,
-0.012875821441411972,
0.0365... | 0.018168 |
created. It is possible to call `callback(err)` to terminate the incoming connection and destroy the socket. Listening for this event will have an effect only on connections established after the addition of the event listener. The following illustrates resuming a TLS session: ```js const tlsSessionStore = {}; server.o... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.08898966014385223,
0.09154465794563293,
-0.019971473142504692,
0.05715964362025261,
-0.06200730800628662,
-0.04884664714336395,
0.06151158735156059,
-0.046164970844984055,
0.10638123750686646,
-0.02251092717051506,
-0.04226111248135567,
0.08534494787454605,
0.016908977180719376,
0.01188... | 0.005649 |
and all required TLS negotiation. Instances of `tls.TLSSocket` implement the duplex [Stream][] interface. Methods that return TLS connection metadata (e.g. [`tls.TLSSocket.getPeerCertificate()`][]) will only return data while the connection is open. ### `new tls.TLSSocket(socket[, options])` \* `socket` {net.Socket|str... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.08722928911447525,
0.05066375806927681,
-0.04692450538277626,
0.01846608892083168,
-0.1328732818365097,
-0.0665794163942337,
0.0023854365572333336,
-0.009533162228763103,
0.06125903129577637,
-0.049031805247068405,
-0.025008386000990868,
0.038826361298561096,
0.010295145213603973,
0.027... | -0.014533 |
to determine the negotiated protocol. The `'secureConnect'` event is not emitted when a {tls.TLSSocket} is created using the `new tls.TLSSocket()` constructor. ### Event: `'session'` \* `session` {Buffer} The `'session'` event is emitted on a client `tls.TLSSocket` when a new session or TLS ticket is available. This ma... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.061784591525793076,
0.06085623800754547,
-0.017763329669833183,
0.020758336409926414,
-0.02753310836851597,
-0.05086842551827431,
0.06458847969770432,
-0.02359490841627121,
0.1445278823375702,
-0.03046511486172676,
-0.030004695057868958,
0.025654708966612816,
0.013704868033528328,
0.018... | 0.007735 |
the certificate. See [`tls.TLSSocket.getPeerCertificate()`][] for an example of the certificate structure. If there is no local certificate, an empty object will be returned. If the socket has been destroyed, `null` will be returned. ### `tlsSocket.getCipher()` \* Returns: {Object} \* `name` {string} OpenSSL name for t... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.029567433521151543,
0.09372323751449585,
-0.00846589170396328,
0.033680204302072525,
-0.02304634265601635,
-0.04319491609930992,
-0.04243931919336319,
-0.025817861780524254,
0.08172435313463211,
-0.06313522160053253,
-0.03448278084397316,
0.021518155932426453,
0.024087557569146156,
0.02... | -0.021631 |
DER encoded certificate. It is returned as a `:` separated hexadecimal string. Example: `'2A:7A:C2:DD:...'`. \* `ext\_key\_usage` {Array} (Optional) The extended key usage, a set of OIDs. \* `subjectaltname` {string} (Optional) A string containing concatenated names for the subject, an alternative to the `subject` name... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.009189398027956486,
0.08648376166820526,
-0.08799853175878525,
0.03036639094352722,
0.0077958013862371445,
-0.048582617193460464,
0.0876004546880722,
0.07189574092626572,
0.09877058118581772,
-0.0868082195520401,
-0.006948383990675211,
-0.010684587061405182,
0.04537244141101837,
0.04434... | 0.094306 |
data can be provided to the `session` option of [`tls.connect()`][] to resume the connection. On the server, it may be useful for debugging. See [Session Resumption][] for more information. Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications must use the [`'session'`][] event (it also works... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.03372891619801521,
0.10479722917079926,
-0.054645080119371414,
-0.011653539724647999,
-0.036585334688425064,
-0.07368423044681549,
0.01827491633594036,
0.006611493416130543,
0.0677851215004921,
-0.09381639212369919,
-0.060423485934734344,
0.013392699882388115,
0.018745891749858856,
-0.0... | -0.052558 |
can be delayed due to packet loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, which may decrease overall server throughput. ## `tls.checkServerIdentity(hostname, cert)` \* `hostname` {string} The host name or IP address to verify the certificate against. \* `cert` {Object} A ... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.05611032992601395,
0.06637298315763474,
0.0368446409702301,
0.04251515120267868,
0.0518793985247612,
-0.15291687846183777,
-0.016832582652568817,
-0.025018570944666862,
0.06836585700511932,
-0.003029406536370516,
0.0430523119866848,
0.027216888964176178,
0.03204329311847687,
0.017939694... | -0.088552 |
the builtin `tls.checkServerIdentity()` function) when checking the server's host name (or the provided `servername` when explicitly set) against the certificate. This should return an {Error} if verification fails. The method should return `undefined` if the `servername` and `cert` are verified. \* `session` {Buffer} ... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.08730915933847427,
0.10605417937040329,
0.006550112273544073,
0.05075446143746376,
0.022736987099051476,
-0.19247379899024963,
0.05417666956782341,
-0.01868613064289093,
0.09787440299987793,
-0.04233534261584282,
0.011801110580563545,
-0.012250857427716255,
0.03047410026192665,
0.034241... | -0.053338 |
socket.on('end', () => { console.log('server ends connection'); }); ``` To generate the certificate and key for this example, run: ```bash openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \ -keyout client-key.pem -out client-cert.pem ``` Then, to generate the `server-cert.pem` certificate for thi... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.03400948643684387,
0.05966281145811081,
-0.08388440310955048,
0.01870424672961235,
-0.03588249161839485,
-0.04562190920114517,
-0.05638083070516586,
0.029735291376709938,
0.04833555594086647,
-0.007565638981759548,
-0.016737084835767746,
0.0006605364033021033,
0.049443114548921585,
0.01... | -0.109787 |
replacing the default. For more information, see [Modifying the default TLS cipher suite][]. Permitted ciphers can be obtained via [`tls.getCiphers()`][]. Cipher names must be uppercased in order for OpenSSL to accept them. \* `clientCertEngine` {string} Name of an OpenSSL engine which can provide the client certificat... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.06873111426830292,
0.12248289585113525,
0.017295828089118004,
0.00865686871111393,
-0.06665442883968353,
-0.020571211352944374,
-0.044959522783756256,
0.0011731676058843732,
0.04708392173051834,
-0.07241220772266388,
0.00607707304880023,
-0.04045579209923744,
0.016253601759672165,
0.017... | -0.057094 |
from [OpenSSL Options][]. \* `secureProtocol` {string} Legacy mechanism to select the TLS protocol version to use, it does not support independent control of the minimum and maximum version, and does not support limiting the protocol to TLSv1.3. Use `minVersion` and `maxVersion` instead. The possible values are listed ... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.021563736721873283,
0.08409812301397324,
-0.09702662378549576,
-0.07312321662902832,
-0.026087846606969833,
-0.03754229471087456,
-0.001614162465557456,
0.007630526088178158,
0.04700218886137009,
0.003997748252004385,
-0.02780742570757866,
-0.019177280366420746,
0.01260096114128828,
0.0... | -0.04737 |
OpenSSL engine which can provide the client certificate. \*\*Deprecated.\*\* \* `enableTrace` {boolean} If `true`, [`tls.TLSSocket.enableTrace()`][] will be called on new connections. Tracing can be enabled after the secure connection is established, but this option must be used to trace the secure connection setup. \*... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.07443734258413315,
0.06693559885025024,
-0.026038898155093193,
0.0602293461561203,
-0.028196603059768677,
-0.04765722155570984,
-0.042454447597265244,
-0.026445947587490082,
0.09242987632751465,
-0.08164472132921219,
0.006535319611430168,
0.02855636365711689,
0.06436192989349365,
0.0421... | 0.016142 |
openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \ -keyout server-key.pem -out server-cert.pem ``` Then, to generate the `client-cert.pem` certificate for this example, run: ```bash openssl pkcs12 -certpbe AES-256-CBC -export -out client-cert.pem \ -inkey server-key.pem -in server-cert.pem ``` Th... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.0182409156113863,
0.06920014321804047,
-0.034270692616701126,
0.0182894729077816,
-0.015260630287230015,
-0.02138221450150013,
-0.046947140246629715,
0.007876354269683361,
0.04022648185491562,
-0.0047397976741194725,
-0.04586034640669823,
-0.017870383337140083,
0.08898139744997025,
0.02... | -0.115116 |
is a snapshot of Mozilla CA store that is fixed at release time. It is identical on all supported platforms. To get the actual CA certificates used by the current Node.js instance, which may include certificates loaded from the system store (if `--use-system-ca` is used) or loaded from a file indicated by `NODE\_EXTRA\... | https://github.com/nodejs/node/blob/main//doc/api/tls.md | main | nodejs | [
-0.044873371720314026,
0.07691973447799683,
-0.02021276019513607,
0.010402129031717777,
-0.0028962334617972374,
-0.07348605245351791,
-0.03080015629529953,
-0.00711921276524663,
0.11840370297431946,
-0.0465722382068634,
0.0070226374082267284,
-0.03106318786740303,
0.05978960171341896,
0.04... | -0.010766 |
# Deprecated APIs Node.js APIs might be deprecated for any of the following reasons: \* Use of the API is unsafe. \* An improved alternative API is available. \* Breaking changes to the API are expected in a future major release. Node.js uses four kinds of deprecations: \* Documentation-only \* Application (non-`node\_... | https://github.com/nodejs/node/blob/main//doc/api/deprecations.md | main | nodejs | [
-0.053394146263599396,
0.03541310131549835,
0.10955269634723663,
0.05459776893258095,
0.12454171478748322,
-0.030232427641749382,
-0.12396951019763947,
0.0575823150575161,
0.044569943100214005,
0.036873962730169296,
-0.022380227223038673,
0.10032615065574646,
-0.013044399209320545,
-0.0254... | 0.068899 |
a new [`worker.exitedAfterDisconnect`][] property. The old property name did not precisely describe the actual semantics and was unnecessarily emotion-laden. ### DEP0008: `require('node:constants')` Type: Documentation-only The `node:constants` module is deprecated. When requiring access to constants relevant to specif... | https://github.com/nodejs/node/blob/main//doc/api/deprecations.md | main | nodejs | [
-0.0637957900762558,
0.02365082874894142,
-0.03711649402976036,
0.06932836025953293,
0.10079479962587357,
-0.09103351831436157,
-0.06786616146564484,
0.020604955032467842,
0.001241897465661168,
-0.03263336047530174,
-0.048017919063568115,
-0.009047981351613998,
-0.018558785319328308,
0.025... | 0.016479 |
`util.debug()` has been removed. Please use [`console.error()`][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log)): ```bash npx codemod@latest @nodejs/util-print-to-console-log ``` ### DEP0029: `util.error()` Type: End-of-... | https://github.com/nodejs/node/blob/main//doc/api/deprecations.md | main | nodejs | [
0.0013320643920451403,
0.010376950725913048,
0.015186593867838383,
0.0033303105738013983,
0.12430167198181152,
-0.07579895853996277,
-0.041574571281671524,
0.007126449141651392,
-0.0029767071828246117,
0.061127595603466034,
0.0006061794119887054,
-0.03726239129900932,
-0.0525052472949028,
... | 0.044534 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.