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
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 containing the types of the active resources that are currently keeping the event loop alive. ```mjs import { getActiveResourcesInfo } from 'node:process'; import { setTimeout } from 'node:timers'; console.log('Before:', getActiveResourcesInfo()); setTimeout(() => {}, 1000); console.log('After:', getActiveResourcesInfo()); // Prints: // Before: [ 'CloseReq', 'TTYWrap', 'TTYWrap', 'TTYWrap' ] // After: [ 'CloseReq', 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] ``` ```cjs const { getActiveResourcesInfo } = require('node:process'); const { setTimeout } = require('node:timers'); console.log('Before:', getActiveResourcesInfo()); setTimeout(() => {}, 1000); console.log('After:', getActiveResourcesInfo()); // Prints: // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] ``` ## `process.getBuiltinModule(id)` \* `id` {string} ID of the built-in module being requested. \* Returns: {Object|undefined} `process.getBuiltinModule(id)` provides a way to load built-in modules in a globally available function. ES Modules that need to support other environments can use it to conditionally load a Node.js built-in when it is run in Node.js, without having to deal with the resolution error that can be thrown by `import` in a non-Node.js environment or having to use dynamic `import()` which either turns the module into an asynchronous module, or turns a synchronous API into an asynchronous one. ```mjs if (globalThis.process?.getBuiltinModule) { // Run in Node.js, use the Node.js fs module. const fs = globalThis.process.getBuiltinModule('fs'); // If `require()` is needed to load user-modules, use createRequire() const module = globalThis.process.getBuiltinModule('module'); const require = module.createRequire(import.meta.url); const foo = require('foo'); } ``` If `id` specifies a built-in module available in the current Node.js process, `process.getBuiltinModule(id)` method returns the corresponding built-in module. If `id` does not correspond to any built-in module, `undefined` is returned. `process.getBuiltinModule(id)` accepts built-in module IDs that are recognized by [`module.isBuiltin(id)`][]. Some built-in modules must be loaded with the `node:` prefix, see [built-in modules with mandatory `node:` prefix][]. The references returned by `process.getBuiltinModule(id)` always point to the built-in module corresponding to `id` even if users modify [`require.cache`][] so that `require(id)` returns something else. ## `process.getegid()` The `process.getegid()` method returns the numerical effective group identity of the Node.js process. (See getegid(2).) ```mjs import process from 'node:process'; if (process.getegid) { console.log(`Current gid: ${process.getegid()}`); } ``` ```cjs const process = require('node:process'); if (process.getegid) { console.log(`Current gid: ${process.getegid()}`); } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). ## `process.geteuid()` \* Returns: {Object} The `process.geteuid()` method returns the numerical effective user identity of the process. (See geteuid(2).) ```mjs import process from 'node:process'; if (process.geteuid) { console.log(`Current uid: ${process.geteuid()}`); } ``` ```cjs const process = require('node:process'); if (process.geteuid) { console.log(`Current uid: ${process.geteuid()}`); } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). ## `process.getgid()` \* Returns: {Object} The `process.getgid()` method returns the numerical group identity of the process. (See getgid(2).) ```mjs import process from 'node:process'; if (process.getgid) { console.log(`Current gid: ${process.getgid()}`); } ``` ```cjs const process = require('node:process'); if (process.getgid) { console.log(`Current gid: ${process.getgid()}`); } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). ## `process.getgroups()` \* Returns: {integer\[]} The `process.getgroups()` method returns an array with the supplementary group IDs. POSIX leaves it unspecified if the effective group ID is included but Node.js ensures it always is. ```mjs import process from 'node:process'; if (process.getgroups) { 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 `process.getuid()` method returns the numeric
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.02194734290242195, -0.005544420797377825, 0.031704481691122055, -0.02226848527789116, 0.018559983000159264, -0.012622551061213017, -0.04635978490114212, 0.07799297571182251, 0.01682603545486927, 0.01595914177596569, -0.033930834382772446, -0.0634496882557869, -0.0016004241770133376, -0.010022079572081566, -0.06754167377948761, 0.1041085422039032, 0.025671854615211487, 0.006793141830712557, -0.05088432505726814, -0.10784444212913513, -0.05511481687426567, 0.05117056146264076, 0.1370275318622589, -0.0469011589884758, -0.10668812692165375, -0.007615839596837759, -0.015405448153614998, 0.1368013471364975, 0.06043418496847153, -0.05307845398783684, -0.039660967886447906, 0.04823269695043564, 0.0045277439057827, -0.12598972022533417, -0.009262198582291603, -0.07722973823547363, -0.028742117807269096, 0.02535209059715271, -0.03650663048028946, -0.04197429493069649, -0.016244009137153625, 0.03423968702554703, 0.05409468710422516, 0.08872421085834503, -0.027083348482847214, 0.010115661658346653, 0.04765118658542633, -0.0020246226340532303, -0.023851662874221802, -0.028202567249536514, -0.04213051497936249, 0.050574932247400284, 0.045160602778196335, 0.021278725937008858, -0.03136086091399193, 0.04166368022561073, -0.00470998790115118, -0.023650534451007843, 0.0035354120191186666, -0.032469458878040314, 0.0039386022835969925, -0.01580285280942917, -0.06037338823080063, -0.023284344002604485, -0.02553870901465416, -0.05055251717567444, -0.008550446480512619, 0.017223233357071877, -0.049963947385549545, 0.04847497120499611, 0.006307392846792936, 0.009247946552932262, 0.08884274959564209, -0.03188468888401985, 0.02354428917169571, 0.08682090044021606, 0.0755581483244896, -0.14389562606811523, 0.011957570910453796, -0.036816976964473724, 0.022203506901860237, -0.007464324589818716, 0.05919727310538292, -0.017867248505353928, 0.03692208603024483, -0.040209557861089706, 0.016338618472218513, 0.03482139855623245, 0.026106713339686394, -0.057101283222436905, 0.008631784468889236, 0.04444184526801109, -0.042303673923015594, -0.054366473108530045, 0.032451651990413666, -0.015568332746624947, 0.0528327040374279, -0.0097734360024333, 0.016891485080122948, 0.037028972059488297, 0.05198868364095688, 0.009230418130755424, 0.06391779333353043, 0.0819355770945549, 0.020960316061973572, 0.06035005673766136, 0.09577149897813797, 0.14785076677799225, 0.02804345265030861, 0.018886614590883255, -0.05308064445853233, 0.014169622212648392, -0.053063541650772095, 0.023082295432686806, 5.271756045522021e-33, -0.0354321151971817, -0.11870357394218445, -0.00035016436595469713, 0.04458163306117058, 0.029505843296647072, -0.02066618762910366, 0.04515790939331055, -0.00035901920637115836, 0.004084958229213953, -0.027870003134012222, -0.02537662163376808, 0.037236642092466354, -0.07277931272983551, -0.07504939287900925, -0.04629760980606079, -0.10120939463376999, 0.13526558876037598, 0.05707191303372383, 0.07783132791519165, 0.021197175607085228, 0.03849339857697487, 0.004040613770484924, 0.0012742619728669524, 0.004150835797190666, 0.02345905266702175, 0.039038389921188354, -0.08285778760910034, 0.04655788466334343, -0.03703894838690758, 0.00010186715371673927, 0.07250138372182846, 0.042124129831790924, -0.08499859273433685, 0.024806736037135124, 0.006266288924962282, -0.07374633103609085, -0.03626697510480881, 0.042138535529375076, -0.06676150858402252, -0.0955667644739151, -0.05875542387366295, 0.045070357620716095, -0.022044511511921883, -0.027255112305283546, -0.06277350336313248, -0.12855926156044006, -0.004517317749559879, -0.033498816192150116, 0.019580502063035965, -0.024578893557190895, 0.07880666106939316, 0.02384142391383648, 0.04168473929166794, -0.09840258955955505, -0.05156830698251724, -0.009050027467310429, 0.02678978256881237, 0.02478974685072899, -0.05034249648451805, 0.0469428114593029, 0.03743399679660797, 0.011136970482766628, -0.03615211322903633, -0.0007633385248482227, 0.03374125063419342, 0.0015377439558506012, -0.00689005758613348, -0.06552574783563614, -0.012885946780443192, -0.017112482339143753, -0.004442271776497364, 0.044518135488033295, 0.06175004318356514, -0.025655854493379593, -0.00878221821039915, 0.03632725030183792, -0.03284338116645813, -0.026952821761369705, -0.15415868163108826, -0.012524738907814026, 0.11056405305862427, -0.005611386615782976, -0.04159536957740784, 0.01724966987967491, 0.03373727202415466, -0.01415687520056963, -0.024014413356781006, -0.06108333170413971, 0.021072516217827797, 0.07853458821773529, -0.025727063417434692, -0.012378446757793427, -0.06204075738787651, -0.06370871514081955, -0.1376589685678482, -7.229934575398113e-33, 0.08447925001382828, 0.02106565609574318, -0.054901883006095886, 0.011823466047644615, -0.01109339576214552, -0.0651683509349823, -0.08213305473327637, 0.034465350210666656, -0.07528537511825562, -0.014532698318362236, 0.020581183955073357, 0.01958468370139599, 0.010057401843369007, 0.06439439952373505, -0.0260819960385561, 0.005934092216193676, 0.004286787007004023, 0.010616794228553772, -0.022354895249009132, -0.008645354770123959, -0.034946199506521225, 0.07729325443506241, 0.013760342262685299, -0.03248265013098717, -0.06597406417131424, -0.004367627669125795, -0.05209040269255638, 0.029354603961110115, -0.022183414548635483, -0.05865901708602905, -0.026134934276342392, -0.022273937240242958, -0.0160517655313015, 0.04168558865785599, 0.019893266260623932, -0.01676962524652481, -0.04039086028933525, 0.07002220302820206, 0.0514073371887207, -0.018280895426869392, 0.15993165969848633, 0.014708669856190681, -0.09309939295053482, 0.0006328200688585639, 0.034128136932849884, 0.01592877320945263, -0.016081633046269417, -0.002390603069216013, 0.005459170322865248, 0.0014377132756635547, -0.000843395886477083, -0.09076870232820511, 0.013404185883700848, 0.014386103488504887, -0.004574786406010389, -0.010072045028209686, 0.09006335586309433, -0.11551821976900101, 0.019507555291056633, -0.03775981813669205, 0.0810435488820076, -0.09738010913133621, -0.03150058537721634, 0.02886643074452877, 0.056273914873600006, 0.02374236471951008, -0.007567922119051218, 0.02135968767106533, -0.010859993286430836, -0.0449279248714447, 0.06528303772211075, 0.08768945932388306, -0.089218370616436, -0.013257820159196854, -0.04413259029388428, 0.02295408397912979, -0.0026485524140298367, -0.09975656121969223, -0.008583371527493, 0.043706707656383514, -0.06001373752951622, 0.016922196373343468, -0.08082329481840134, -0.02488359622657299, -0.009914837777614594, 0.00640886090695858, -0.04941685497760773, -0.003392367158085108, -0.004128562286496162, 0.02133786492049694, -0.054543521255254745, 0.020090756937861443, -0.07381299883127213, 0.025666575878858566, -0.10559900104999542, -5.774463573970934e-8, -0.07381730526685715, 0.02751399204134941, -0.016031555831432343, 0.027878111228346825, 0.0702226385474205, -0.05324243754148483, 0.02075636200606823, 0.045633215457201004, 0.06541330367326736, 0.020148808136582375, -0.028889089822769165, -0.07807018607854843, 0.10808616131544113, -0.009678317233920097, 0.03989021107554436, -0.028198717162013054, 0.006111545022577047, -0.01053790282458067, -0.024091089144349098, -0.021196885034441948, 0.003320635762065649, -0.050518136471509933, 0.0022857002913951874, 0.011966792866587639, 0.004845379386097193, -0.05422941967844963, 0.09964242577552795, 0.06354137510061264, -0.0018465494504198432, 0.05077458173036575, -0.04995134845376015, 0.013923540711402893, 0.0072305588982999325, 0.053477849811315536, -0.11672665923833847, 0.014073739759624004, -0.04483071342110634, -0.04301297664642334, 0.025619320571422577, 0.07520634680986404, 0.04786859452724457, 0.03475780040025711, -0.05438020080327988, 0.10759700834751129, -0.020103810355067253, 0.012079753912985325, -0.015189435333013535, 0.03136512637138367, 0.0335727334022522, -0.008331882767379284, -0.04257951304316521, -0.03504322096705437, -0.04716087877750397, 0.018476687371730804, -0.026914844289422035, -0.019797755405306816, 0.06828870624303818, -0.02078186348080635, -0.012901507318019867, 0.0945366621017456, 0.028578629717230797, 0.01759939268231392, -0.0026290114037692547, -0.023266201838850975 ]
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 `process.getuid()` method returns the numeric user identity of the process. (See getuid(2).) ```mjs import process from 'node:process'; if (process.getuid) { console.log(`Current uid: ${process.getuid()}`); } ``` ```cjs const process = require('node:process'); if (process.getuid) { console.log(`Current uid: ${process.getuid()}`); } ``` This function not available on Windows. ## `process.hasUncaughtExceptionCaptureCallback()` \* Returns: {boolean} Indicates whether a callback has been set using [`process.setUncaughtExceptionCaptureCallback()`][]. ## `process.hrtime([time])` > Stability: 3 - Legacy. Use [`process.hrtime.bigint()`][] instead. \* `time` {integer\[]} The result of a previous call to `process.hrtime()` \* Returns: {integer\[]} This is the legacy version of [`process.hrtime.bigint()`][] before `bigint` was introduced in JavaScript. The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`, where `nanoseconds` is the remaining part of the real time that can't be represented in second precision. `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time. If the parameter passed in is not a tuple `Array`, a `TypeError` will be thrown. Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior. These times are relative to an arbitrary time in the past, and not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals: ```mjs import { hrtime } from 'node:process'; const NS\_PER\_SEC = 1e9; const time = hrtime(); // [ 1800216, 25 ] setTimeout(() => { const diff = hrtime(time); // [ 1, 552 ] console.log(`Benchmark took ${diff[0] \* NS\_PER\_SEC + diff[1]} nanoseconds`); // Benchmark took 1000000552 nanoseconds }, 1000); ``` ```cjs const { hrtime } = require('node:process'); const NS\_PER\_SEC = 1e9; const time = hrtime(); // [ 1800216, 25 ] setTimeout(() => { const diff = hrtime(time); // [ 1, 552 ] console.log(`Benchmark took ${diff[0] \* NS\_PER\_SEC + diff[1]} nanoseconds`); // Benchmark took 1000000552 nanoseconds }, 1000); ``` ## `process.hrtime.bigint()` \* Returns: {bigint} The `bigint` version of the [`process.hrtime()`][] method returning the current high-resolution real time in nanoseconds as a `bigint`. Unlike [`process.hrtime()`][], it does not support an additional `time` argument since the difference can just be computed directly by subtraction of the two `bigint`s. ```mjs import { hrtime } from 'node:process'; const start = hrtime.bigint(); // 191051479007711n setTimeout(() => { const end = hrtime.bigint(); // 191052633396993n console.log(`Benchmark took ${end - start} nanoseconds`); // Benchmark took 1154389282 nanoseconds }, 1000); ``` ```cjs const { hrtime } = require('node:process'); const start = hrtime.bigint(); // 191051479007711n setTimeout(() => { const end = hrtime.bigint(); // 191052633396993n console.log(`Benchmark took ${end - start} nanoseconds`); // Benchmark took 1154389282 nanoseconds }, 1000); ``` ## `process.initgroups(user, extraGroup)` \* `user` {string|number} The user name or numeric identifier. \* `extraGroup` {string|number} A group name or numeric identifier. The `process.initgroups()` method reads the `/etc/group` file and initializes the group access list, using all groups of which the user is a member. This is a privileged operation that requires that the Node.js process either have `root` access or the `CAP\_SETGID` capability. Use care when dropping privileges: ```mjs import { getgroups, 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('node:process'); console.log(getgroups()); // [
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.009047032333910465, -0.009850185364484787, -0.0770811215043068, -0.07634954154491425, 0.03727346286177635, -0.021193906664848328, -0.09857404977083206, -0.006361114326864481, 0.0023128404282033443, 0.040507275611162186, -0.007231534458696842, -0.05491432175040245, -0.08217833936214447, -0.0233721025288105, -0.024075033143162727, 0.08366014808416367, -0.010823388583958149, 0.05269400402903557, 0.03498242422938347, -0.027682509273290634, 0.0023348082322627306, -0.010185050778090954, 0.15066611766815186, -0.010826620273292065, -0.10850868374109268, -0.033354926854372025, -0.05092727392911911, 0.03606700897216797, 0.06394235789775848, -0.03967766836285591, 0.05499273166060448, 0.02334943413734436, 0.05355049669742584, -0.08772607147693634, 0.027087446302175522, -0.11474379152059555, 0.07382352650165558, 0.04850321635603905, 0.04941748455166817, -0.015962963923811913, 0.009726970456540585, -0.007108902093023062, -0.028445890173316002, 0.014941764064133167, -0.04975220188498497, 0.04899244010448456, 0.07666461914777756, -0.01102747954428196, -0.06548197567462921, 0.02638285979628563, -0.000974034599494189, 0.0018083230825141072, -0.0023590698838233948, -0.001267111743800342, -0.012493587099015713, 0.037972670048475266, -0.1052534207701683, 0.0716683566570282, -0.011762628331780434, 0.00809206161648035, 0.020990008488297462, -0.043532561510801315, -0.0019265712471678853, 0.011838272213935852, -0.034203313291072845, -0.07714162021875381, -0.031414441764354706, -0.036782845854759216, 0.031734999269247055, -0.03697782754898071, -0.02057441882789135, 0.09937798976898193, 0.10496725142002106, -0.04708698019385338, 0.035815440118312836, -0.006681571248918772, 0.09446348994970322, -0.13764594495296478, 0.07830312103033066, -0.052518125623464584, 0.00424169609323144, 0.0638231635093689, 0.013357345014810562, 0.006457425653934479, 0.053166262805461884, -0.05531815066933632, 0.04214048758149147, -0.05584396794438362, 0.07664291560649872, -0.0016382039757445455, -0.010257950983941555, 0.029197605326771736, -0.04035850241780281, -0.05046703293919563, -0.008054191246628761, -0.009250645525753498, -0.050513774156570435, -0.061182793229818344, 0.05140642821788788, 0.01417868584394455, 0.06164674833416939, 0.028762519359588623, -0.08995643258094788, 0.13315069675445557, -0.0010383469052612782, 0.06438840925693512, 0.06891407072544098, 0.13059034943580627, -0.006396711338311434, -0.04455225542187691, -0.004553382750600576, -0.022916972637176514, 0.06523880362510681, 0.07598379999399185, 1.2947718544357212e-33, -0.029252884909510612, -0.09109684824943542, 0.06369869410991669, 0.03246665373444557, 0.019598674029111862, -0.055118534713983536, 0.01326469611376524, -0.0100938081741333, -0.08088453114032745, 0.008879542350769043, -0.07423093914985657, 0.03173086419701576, -0.00011247341899434105, -0.09090710431337357, -0.02507210336625576, 0.010529140941798687, 0.08417843282222748, -0.03420954570174217, 0.03209167718887329, -0.017262114211916924, -0.007760900072753429, 0.05594542995095253, -0.04346127063035965, 0.029497234150767326, 0.046624504029750824, 0.02361009642481804, -0.045952096581459045, 0.013604480773210526, 0.054088201373815536, -0.0041198162361979485, 0.05894511565566063, 0.014584183692932129, -0.067562997341156, 0.022459711879491806, -0.021949302405118942, 0.001959577901288867, -0.0128900445997715, 0.045310165733098984, -0.06232565641403198, -0.10764790326356888, -0.006182466633617878, -0.03695932775735855, 0.01091957651078701, -0.005698194727301598, -0.0384068600833416, -0.05540304258465767, -0.08907619118690491, -0.008385385386645794, 0.0049725547432899475, 0.005038202274590731, -0.016031071543693542, 0.07830367237329483, 0.04295232519507408, -0.056820694357156754, 0.004794240929186344, -0.04978793486952782, 0.005597714334726334, 0.06257054209709167, -0.06714186817407608, 0.0033874146174639463, 0.025114137679338455, 0.04330768063664436, -0.06187853217124939, 0.02320782095193863, -0.027085063979029655, -0.0849544033408165, 0.01760691963136196, -0.0221005417406559, 0.012010829523205757, 0.09423448145389557, -0.004631641320884228, 0.018867265433073044, -0.010089018382132053, 0.03159797564148903, -0.002663011895492673, 0.0016513393493369222, 0.0042495122179389, -0.0530502125620842, -0.09910029917955399, -0.006007671821862459, -0.007057406473904848, 0.05108559876680374, -0.04393468052148819, 0.008537331596016884, 0.03447282686829567, 0.02506827749311924, -0.06739863753318787, 0.03763981908559799, 0.006348790135234594, 0.021995481103658676, -0.0059562548995018005, 0.013906735926866531, 0.0566428005695343, 0.07014510780572891, -0.1502278447151184, -4.976849492155664e-33, -0.08372923731803894, 0.026223786175251007, -0.00030763805261813104, -0.02262200601398945, -0.04634369537234306, -0.06337901949882507, 0.00785362534224987, -0.03719199448823929, 0.03302003815770149, 0.019343186169862747, -0.015540532767772675, 0.01486363634467125, 0.07244662195444107, 0.10108857601881027, 0.04959733784198761, 0.06633621454238892, -0.07423225790262222, 0.02450551465153694, 0.08188734948635101, 0.02858640067279339, -0.09905099123716354, 0.15098831057548523, 0.08139768242835999, 0.02689165435731411, -0.035187214612960815, 0.017110269516706467, -0.012906452640891075, -0.028916502371430397, -0.009897111915051937, -0.03517187759280205, -0.012748894281685352, -0.026179064065217972, -0.10587284713983536, 0.06165216490626335, 0.01806415617465973, -0.08261853456497192, 0.030970215797424316, 0.10278623551130295, 0.0161757692694664, 0.05254412442445755, 0.006755050737410784, 0.02436980977654457, -0.027018561959266663, 0.0252850279211998, 0.04183635115623474, 0.04981458559632301, 0.10956999659538269, -0.015733443200588226, -0.03533058241009712, 0.06523997336626053, 0.027155879884958267, -0.0015184879302978516, 0.07795388251543045, 0.04580237716436386, 0.008493844419717789, -0.02492823824286461, 0.04998979717493057, -0.10829468816518784, 0.02704796940088272, -0.013935789465904236, 0.07555772364139557, -0.08619958162307739, -0.09758568555116653, 0.024692174047231674, -0.07955310493707657, -0.024747861549258232, -0.03307632356882095, 0.027285119518637657, -0.0014260197058320045, -0.01176525093615055, 0.031007645651698112, 0.0038534393534064293, -0.057314466685056686, -0.019916128367185593, -0.07548865675926208, 0.013724558055400848, -0.001207823632284999, -0.0573226623237133, -0.061132483184337616, 0.04196223244071007, 0.04090125858783722, 0.044039081782102585, -0.026432393118739128, -0.037141431123018265, -0.037144578993320465, -0.11511515825986862, 0.09731584787368774, 0.04116631671786308, -0.014918279834091663, 0.010709749534726143, -0.04015716165304184, 0.03200456127524376, -0.09325401484966278, -0.07008147984743118, -0.057183217257261276, -4.733214353791482e-8, -0.023145653307437897, -0.034883078187704086, -0.0045661902986466885, -0.0804031640291214, 0.02574138343334198, -0.004903438501060009, -0.04924270883202553, -0.006025450769811869, 0.02524391934275627, -0.006613829173147678, -0.018094345927238464, -0.02696208655834198, 0.05131559446454048, -0.06587443500757217, 0.05495443940162659, -0.05175388231873512, -0.028310133144259453, 0.052657872438430786, -0.003107829485088587, 0.022747309878468513, -0.02084253542125225, -0.023235829547047615, 0.008409214206039906, -0.016197331249713898, -0.08802101016044617, -0.03005490079522133, 0.01607004553079605, -0.04056911915540695, -0.10044164210557938, -0.018497388809919357, -0.07009030133485794, 0.05922630429267883, 0.05900853872299194, 0.08261667937040329, 0.0014123700093477964, 0.04654806852340698, -0.016749035567045212, 0.09046570956707001, 0.07611610740423203, 0.02561889961361885, -0.004224950447678566, 0.024724256247282028, -0.05263988673686981, 0.06359615921974182, -0.06357394903898239, -0.02600523829460144, -0.014128321781754494, -0.024331320077180862, 0.0473707839846611, 0.043997157365083694, 0.03484094515442848, -0.07584710419178009, -0.01047622598707676, 0.016585808247327805, 0.002294168109074235, 0.0018989632371813059, -0.03726238012313843, -0.054790664464235306, 0.043708350509405136, -0.00683214794844389, 0.006894036661833525, 0.08004637807607651, -0.005145029630511999, -0.030713627114892006 ]
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('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 ] ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.kill(pid[, signal])` \* `pid` {number} A process ID \* `signal` {string|number} The signal to send, either as a string or number. \*\*Default:\*\* `'SIGTERM'`. The `process.kill()` method sends the `signal` to the process identified by `pid`. Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See [Signal Events][] and kill(2) for more information. This method will throw an error if the target `pid` does not exist. As a special case, a signal of `0` can be used to test for the existence of a process. Windows platforms will throw an error if the `pid` is used to kill a process group. Even though the name of this function is `process.kill()`, it is really just a signal sender, like the `kill` system call. The signal sent may do something other than kill the target process. ```mjs import process, { kill } from 'node:process'; process.on('SIGHUP', () => { console.log('Got SIGHUP signal.'); }); setTimeout(() => { console.log('Exiting.'); process.exit(0); }, 100); kill(process.pid, 'SIGHUP'); ``` ```cjs const process = require('node:process'); process.on('SIGHUP', () => { console.log('Got SIGHUP signal.'); }); setTimeout(() => { console.log('Exiting.'); process.exit(0); }, 100); process.kill(process.pid, 'SIGHUP'); ``` When `SIGUSR1` is received by a Node.js process, Node.js will start the debugger. See [Signal Events][]. ## `process.loadEnvFile(path)` \* `path` {string | URL | Buffer | undefined}. \*\*Default:\*\* `'./.env'` Loads the `.env` file into `process.env`. Usage of `NODE\_OPTIONS` in the `.env` file will not have any effect on Node.js. ```cjs const { loadEnvFile } = require('node:process'); loadEnvFile(); ``` ```mjs import { loadEnvFile } from 'node:process'; loadEnvFile(); ``` ## `process.mainModule` > Stability: 0 - Deprecated: Use [`require.main`][] instead. \* Type: {Object} The `process.mainModule` property provides an alternative way of retrieving [`require.main`][]. The difference is that if the main module changes at runtime, [`require.main`][] may still refer to the original main module in modules that were required before the change occurred. Generally, it's safe to assume that the two refer to the same module. As with [`require.main`][], `process.mainModule` will be `undefined` if there is no entry script. ## `process.memoryUsage()` \* Returns: {Object} \* `rss` {integer} \* `heapTotal` {integer} \* `heapUsed` {integer} \* `external` {integer} \* `arrayBuffers` {integer} Returns an object describing the memory usage of the Node.js process measured in bytes. ```mjs import { memoryUsage } from 'node:process'; console.log(memoryUsage()); // Prints: // { // rss: 4935680, // heapTotal: 1826816, // heapUsed: 650472, // external: 49879, // arrayBuffers: 9386 // } ``` ```cjs const { memoryUsage } = require('node:process'); console.log(memoryUsage()); // Prints: // { // rss: 4935680, // heapTotal: 1826816, // heapUsed: 650472, // external: 49879, // arrayBuffers: 9386 // } ``` \* `heapTotal` and `heapUsed` refer to V8's memory usage. \* `external` refers to the memory usage of C++ objects bound to JavaScript objects managed by V8. \* `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 [`Buffer`][]s. This
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.007694529369473457, 0.027610981836915016, -0.04538772255182266, -0.09692496061325073, 0.05925118550658226, -0.007963667623698711, -0.11025281250476837, -0.02650468237698078, -0.06829943507909775, 0.007513462100178003, -0.024802744388580322, 0.0035944231785833836, -0.06596507132053375, -0.07183131575584412, -0.053064245730638504, 0.04879479482769966, 0.019876690581440926, 0.04201067239046097, 0.002924603410065174, -0.019564365968108177, 0.039625536650419235, -0.018537908792495728, 0.19354890286922455, -0.006029684096574783, -0.14106495678424835, -0.010254709050059319, -0.021141167730093002, 0.014298181980848312, 0.09765549749135971, -0.03394261747598648, -0.018888063728809357, -0.02312210388481617, 0.020893774926662445, -0.11467012763023376, 0.03413121774792671, -0.04636932536959648, 0.02282077632844448, 0.050376854836940765, 0.04952138662338257, 0.022768866270780563, 0.0020875600166618824, 0.0336139015853405, 0.008861432783305645, 0.0236976221203804, -0.036039769649505615, 0.10841622203588486, 0.04001832753419876, -0.028993912041187286, -0.03795448690652847, 0.03231009840965271, 0.0037999346386641264, 0.019703475758433342, -0.0029193030204623938, 0.008767486549913883, -0.0181006770581007, -0.0063925632275640965, -0.04514314606785774, 0.038658659905195236, -0.026292547583580017, 0.02356579713523388, 0.01463374588638544, -0.027975641191005707, -0.024748176336288452, 0.010693134739995003, -0.006469365209341049, -0.07909920811653137, -0.029643693938851357, 0.02616710029542446, 0.05438780039548874, -0.025568801909685135, 0.00315644359216094, -0.012666993774473667, 0.13649041950702667, 0.0005167173221707344, 0.02678696997463703, -0.0022525310050696135, 0.030316026881337166, -0.12087500840425491, 0.05665189027786255, -0.01862889900803566, 0.023120969533920288, -0.013533864170312881, -0.008000430651009083, 0.0357203483581543, 0.04295229911804199, -0.06559055298566818, 0.0504659079015255, -0.024429768323898315, 0.005389540921896696, 0.0552038736641407, 0.005037953611463308, -0.045312996953725815, -0.0697379857301712, -0.03716600313782692, 0.022503186017274857, -0.053050022572278976, -0.040754836052656174, -0.05431274324655533, 0.07716778665781021, -0.05256449058651924, 0.03690030798316002, -0.006040876731276512, -0.04087061807513237, 0.14914408326148987, -0.04996766522526741, 0.041404951363801956, 0.10282286256551743, 0.09525613486766815, -0.0013889584224671125, -0.023195672780275345, 0.039649270474910736, -0.015731295570731163, 0.04718383774161339, 0.030256060883402824, -6.802097702546498e-34, 0.007894625887274742, -0.14231839776039124, -0.0009338214294984937, 0.004075303673744202, 0.06968557834625244, -0.01009982731193304, -0.02885349653661251, -0.0010497815674170852, -0.10931079834699631, -0.004207565914839506, -0.061573248356580734, -0.02465011365711689, 0.0031178684439510107, -0.10114340484142303, 0.017091048881411552, -0.03843606635928154, 0.0660732239484787, -0.025580935180187225, 0.05178447440266609, -0.04977849870920181, -0.027906861156225204, 0.06394989043474197, -0.04665684700012207, 0.050902895629405975, 0.03211404010653496, -0.030165433883666992, -0.08898921310901642, -0.013653256930410862, 0.08706342428922653, -0.004689892753958702, 0.06594207137823105, 0.053923528641462326, -0.07535446435213089, 0.0228826142847538, -0.00804964080452919, 0.021222496405243874, 0.0100014116615057, 0.03495296090841293, -0.10999025404453278, -0.0572776235640049, 0.015072575770318508, -0.021487561985850334, -0.013628136366605759, -0.00528637133538723, 0.02628592774271965, -0.07214444130659103, -0.07840358465909958, -0.03581223264336586, 0.003701286856085062, 0.028852766379714012, -0.03768550232052803, 0.10042377561330795, 0.002002846682444215, -0.07908239215612411, 0.025173580273985863, -0.006094766315072775, 0.00022664203424938023, -0.0027903697919100523, -0.0018012281507253647, 0.016755588352680206, 0.04185579717159271, 0.01029297523200512, -0.012728175148367882, -0.0020350953564047813, 0.0015201021451503038, -0.061856769025325775, -0.017397277057170868, 0.0032421441283077, -0.02652142569422722, 0.04480425640940666, -0.0805770605802536, 0.023025935515761375, 0.02579805813729763, 0.06428520381450653, -0.03846949711441994, 0.009486928582191467, -0.024144956842064857, -0.001938756788149476, -0.11692590266466141, -0.03000500239431858, 0.022617939859628677, -0.004057164769619703, -0.07595423609018326, 0.00892937183380127, 0.07141304016113281, 0.0004940390936098993, -0.03343426436185837, -0.00002209005288023036, -0.014769531786441803, 0.03946690633893013, -0.023009104654192924, 0.015316183678805828, 0.03815199434757233, -0.0002811043232213706, -0.0789024829864502, -3.2502282883701936e-33, -0.07489795237779617, 0.04396729916334152, -0.04301033541560173, 0.004496455658227205, -0.01239049807190895, -0.030093925073742867, 0.03665397688746452, -0.048158563673496246, -0.0010202866978943348, 0.08455955237150192, -0.012900409288704395, 0.07126616686582565, 0.03557189181447029, 0.08375074714422226, -0.006625383626669645, 0.03941083699464798, -0.05086855590343475, -0.018874293193221092, 0.058325450867414474, 0.0005117888213135302, -0.05254112556576729, 0.12986120581626892, 0.04905277490615845, 0.09603912383317947, -0.04882531985640526, 0.03034723550081253, -0.014977576211094856, -0.0307012926787138, -0.019554344937205315, -0.03792865201830864, -0.02295238897204399, -0.00498405285179615, -0.11589745432138443, 0.10427585244178772, 0.044096969068050385, -0.07017220556735992, -0.0503850057721138, 0.16794520616531372, -0.03809473291039467, 0.04629462584853172, 0.03319603204727173, 0.020454421639442444, -0.04060671478509903, 0.029305996373295784, 0.0027142323087900877, 0.0754595398902893, 0.10019423067569733, -0.00681135943159461, -0.07731065899133682, 0.0848069116473198, -0.015076837502419949, -0.029271529987454414, 0.12354251742362976, 0.03841199725866318, 0.01300081331282854, -0.0483240932226181, 0.07337012887001038, -0.09588341414928436, 0.040666766464710236, 0.001953315455466509, 0.05531012639403343, -0.10259217023849487, -0.05009710416197777, 0.036856792867183685, -0.03155817836523056, -0.09467164427042007, -0.1303519308567047, 0.04390629380941391, 0.027345428243279457, -0.05263921618461609, -0.02728341519832611, 0.007371034473180771, -0.014612640254199505, -0.06967656314373016, -0.05326084420084953, -0.011377392336726189, -0.030483512207865715, -0.09377666562795639, 0.019456224516034126, 0.04142673313617706, -0.018290461972355843, 0.0443233884871006, -0.05106513574719429, 0.015711350366473198, -0.04289670288562775, -0.06472662836313248, 0.0023344778455793858, 0.09187400341033936, 0.021388277411460876, -0.007848328910768032, -0.02734621800482273, 0.04449843615293503, 0.0340626984834671, -0.04457578435540199, -0.0363323912024498, -4.365834271879976e-8, -0.03404392674565315, 0.011915785260498524, -0.025790799409151077, -0.016296174377202988, 0.05852076783776283, -0.0288645438849926, 0.0023362459614872932, 0.04268287122249603, -0.01596762239933014, 0.0011237639700993896, -0.05590701103210449, 0.07117167860269547, 0.048626236617565155, -0.01265337597578764, 0.05955585464835167, -0.04145202040672302, -0.007260838523507118, 0.017892135307192802, 0.026146981865167618, 0.051935065537691116, -0.0353083536028862, -0.050274163484573364, 0.011695925146341324, 0.023367295041680336, -0.05631566420197487, -0.08292019367218018, 0.04146525636315346, 0.011578013189136982, -0.12629692256450653, 0.01121731847524643, -0.05264892429113388, 0.043895237147808075, 0.0019175790948793292, 0.06876951456069946, -0.01134516391903162, 0.012809052132070065, -0.046781398355960846, 0.06558039039373398, 0.0422607958316803, 0.03759071230888367, 0.026173464953899384, -0.01879437454044819, -0.04743828997015953, 0.045951537787914276, -0.09514673054218292, 0.0012536118738353252, 0.03559199720621109, 0.0640331581234932, 0.08371615409851074, 0.010835489258170128, 0.010069029405713081, -0.039454925805330276, -0.059105005115270615, 0.04528813809156418, 0.045088738203048706, -0.01661398634314537, 0.01359810121357441, -0.03419794887304306, 0.037614673376083374, 0.039498236030340195, -0.05558325722813606, 0.0764206051826477, -0.0041928282007575035, -0.017145926132798195 ]
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 [`Buffer`][]s. This is also included in the `external` value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s may not be tracked in that case. When using [`Worker`][] threads, `rss` will be a value that is valid for the entire process, while the other fields will only refer to the current thread. The `process.memoryUsage()` method iterates over each page to gather information about memory usage which might be slow depending on the program memory allocations. ### A note on process memoryUsage On Linux or other systems where glibc is commonly used, an application may have sustained `rss` growth despite stable `heapTotal` due to fragmentation caused by the glibc `malloc` implementation. See [nodejs/node#21973][] on how to switch to an alternative `malloc` implementation to address the performance issue. ## `process.memoryUsage.rss()` \* Returns: {integer} The `process.memoryUsage.rss()` method returns an integer representing the Resident Set Size (RSS) in bytes. The 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. This is the same value as the `rss` property provided by `process.memoryUsage()` but `process.memoryUsage.rss()` is faster. ```mjs import { memoryUsage } from 'node:process'; console.log(memoryUsage.rss()); // 35655680 ``` ```cjs const { memoryUsage } = require('node:process'); console.log(memoryUsage.rss()); // 35655680 ``` ## `process.nextTick(callback[, ...args])` > Stability: 3 - Legacy: Use [`queueMicrotask()`][] instead. \* `callback` {Function} \* `...args` {any} Additional arguments to pass when invoking the `callback` `process.nextTick()` adds `callback` to the "next tick queue". This queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue. It's possible to create an infinite loop if one were to recursively call `process.nextTick()`. See the [Event Loop][] guide for more background. ```mjs import { nextTick } from 'node:process'; console.log('start'); nextTick(() => { console.log('nextTick callback'); }); console.log('scheduled'); // Output: // start // scheduled // nextTick callback ``` ```cjs const { nextTick } = require('node:process'); console.log('start'); nextTick(() => { console.log('nextTick callback'); }); console.log('scheduled'); // Output: // start // scheduled // nextTick callback ``` This is important when developing APIs in order to give users the opportunity to assign event handlers \_after\_ an object has been constructed but before any I/O has occurred: ```mjs import { nextTick } from 'node:process'; function MyThing(options) { this.setupOptions(options); nextTick(() => { this.startDoingStuff(); }); } const thing = new MyThing(); thing.getReadyForStuff(); // thing.startDoingStuff() gets called now, not before. ``` ```cjs const { nextTick } = require('node:process'); function MyThing(options) { this.setupOptions(options); nextTick(() => { this.startDoingStuff(); }); } const thing = new MyThing(); thing.getReadyForStuff(); // thing.startDoingStuff() gets called now, not before. ``` It is very important for APIs to be either 100% synchronous or 100% asynchronous. Consider this example: ```js // WARNING! DO NOT USE! BAD UNSAFE HAZARD! function maybeSync(arg, cb) { if (arg) { cb(); return; } fs.stat('file', cb); } ``` This API is hazardous because in the following case: ```js const maybeTrue = Math.random() > 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.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.06009044125676155, -0.020207729190587997, -0.03412758186459541, 0.02113226056098938, -0.06781413406133652, -0.010230328887701035, 0.004648211877793074, 0.04295826703310013, -0.06951132416725159, -0.036568783223629, -0.0026242192834615707, 0.029609059914946556, 0.018264690414071083, -0.038892924785614014, -0.02911338582634926, 0.053532764315605164, 0.03456248342990875, 0.06301681697368622, -0.032721806317567825, 0.03153900429606438, 0.017019785940647125, -0.058848313987255096, 0.11715470999479294, 0.006324047222733498, -0.10329568386077881, -0.059778302907943726, 0.027910752221941948, -0.013534270226955414, 0.09369704872369766, -0.0985303670167923, 0.011113463900983334, 0.004864164162427187, 0.04599481821060181, -0.08189618587493896, 0.021387990564107895, -0.10860986262559891, -0.10263179242610931, 0.0072007388807833195, -0.0029376649763435125, -0.018248727545142174, 0.04034741595387459, 0.014973287470638752, -0.013216988183557987, 0.017317643389105797, -0.060112059116363525, -0.030116261914372444, 0.07710457593202591, -0.03982812538743019, -0.05011264607310295, 0.056960415095090866, 0.02338377758860588, 0.0545463003218174, 0.022275498136878014, 0.013325071893632412, -0.0008335675811395049, 0.04450562223792076, -0.047491807490587234, -0.046922843903303146, 0.07713266462087631, -0.04453496262431145, 0.043589912354946136, -0.06667547672986984, -0.07031986117362976, -0.02967667207121849, -0.03223753720521927, -0.03132057189941406, -0.07367873191833496, 0.00840754620730877, -0.028127063065767288, -0.04173101857304573, 0.024569638073444366, 0.006206343416124582, 0.08785447478294373, 0.016268065199255943, -0.008018584921956062, 0.018823012709617615, 0.02941185235977173, 0.02592400461435318, -0.03223516792058945, -0.04157720506191254, 0.06377419084310532, 0.023168744519352913, -0.010966683737933636, 0.033461399376392365, 0.04157989099621773, -0.04762507975101471, -0.03706895932555199, 0.046697948127985, 0.07262585312128067, 0.10189274698495865, 0.008425465784966946, -0.015638159587979317, -0.002410770859569311, -0.05113945156335831, 0.07451079040765762, -0.06798140704631805, 0.0008768541156314313, 0.050021231174468994, 0.0792933776974678, -0.03489901125431061, 0.06912969052791595, -0.011080293916165829, -0.0014668451622128487, 0.07323499023914337, -0.08327785134315491, 0.04219484701752663, 0.15806293487548828, 0.037053994834423065, 0.048646554350852966, -0.06477059423923492, -0.028618739917874336, -0.02609212137758732, -0.006769297178834677, -0.03821658343076706, 2.4507848659515255e-33, -0.04502512514591217, -0.05840346962213516, -0.002030154224485159, -0.02479490637779236, -0.04493984207510948, 0.04090011492371559, -0.05193033814430237, 0.03724582865834236, 0.030672084540128708, -0.016319921240210533, 0.0009497865685261786, 0.01857295259833336, 0.03495573252439499, 0.01970464549958706, 0.0415555015206337, -0.00540064787492156, 0.0398097038269043, 0.047562193125486374, 0.05927123501896858, 0.01699933223426342, -0.03447200357913971, 0.055585093796253204, -0.0482625886797905, 0.06218443438410759, 0.04809989035129547, -0.027129124850034714, 0.028259407728910446, 0.013260875828564167, -0.06570815294981003, 0.010380365885794163, 0.01686292141675949, 0.06156878545880318, -0.09438247233629227, 0.026661040261387825, 0.10718567669391632, -0.019085906445980072, 0.03394816070795059, -0.040112245827913284, -0.04360124096274376, -0.07437215745449066, 0.005045513156801462, 0.07855894416570663, -0.02337353676557541, -0.011301148682832718, -0.10888642817735672, -0.09162770956754684, -0.04908088594675064, -0.002167253755033016, 0.018310220912098885, 0.048658404499292374, 0.03291875869035721, 0.033501919358968735, 0.0582999587059021, 0.019584761932492256, 0.032530058175325394, -0.027921590954065323, 0.07133369147777557, -0.041582413017749786, -0.010357275605201721, 0.06336699426174164, 0.03874370455741882, -0.05058485269546509, -0.00832070130854845, 0.013754350133240223, 0.03848320245742798, 0.04357610642910004, 0.0017326021334156394, 0.009863813407719135, -0.006990430410951376, 0.05876821279525757, -0.0069046360440552235, 0.0405227392911911, 0.051113493740558624, 0.11048853397369385, -0.04623629152774811, 0.03038746304810047, -0.003104798961430788, -0.0066032991744577885, -0.10846350342035294, 0.034375350922346115, -0.005661893170326948, 0.008655059151351452, -0.006878633052110672, -0.017533333972096443, 0.018168332055211067, -0.06247042864561081, -0.00032896161428652704, 0.004193727392703295, -0.019014079123735428, 0.01736314781010151, 0.09594352543354034, 0.0038874249439686537, 0.0032491108868271112, -0.024740122258663177, -0.16967296600341797, -3.640417842420313e-33, -0.06807728856801987, -0.0263911671936512, -0.08193628489971161, 0.06055836006999016, -0.022847458720207214, -0.05045333132147789, -0.06699220091104507, -0.007342410273849964, 0.00014154589734971523, 0.009825736284255981, -0.05948532372713089, 0.03597039356827736, 0.03302096202969551, 0.03593087196350098, 0.019338415935635567, 0.014264984987676144, -0.029292799532413483, -0.035103701055049896, 0.01552515011280775, -0.00752199487760663, -0.0500376857817173, 0.06610025465488434, 0.16148141026496887, -0.021594280377030373, 0.007665583398193121, 0.016953391954302788, -0.05973261222243309, -0.01002832967787981, -0.04284694045782089, -0.07493477314710617, 0.052310049533843994, -0.04695967584848404, -0.037861909717321396, 0.0516870878636837, -0.00956850964576006, -0.04671665281057358, -0.01622886024415493, -0.011619948782026768, 0.08817163109779358, -0.051946818828582764, 0.09289170801639557, 0.04538567364215851, -0.030127309262752533, -0.0009120983886532485, -0.01870901882648468, -0.010956361889839172, -0.07953464984893799, 0.0031955663580447435, 0.040469590574502945, -0.09921775013208389, -0.012440578080713749, -0.025890329852700233, 0.05730946362018585, 0.049367792904376984, 0.035873498767614365, -0.06222141534090042, -0.023617198690772057, 0.027587221935391426, 0.0665874034166336, -0.06907021999359131, 0.07774167507886887, -0.06951137632131577, -0.06107078492641449, -0.01609468273818493, -0.04830068722367287, -0.05292380228638649, 0.016767609864473343, -0.0892706960439682, 0.03227141499519348, -0.007820619270205498, 0.0705810934305191, 0.06618772447109222, -0.04102637991309166, 0.01668986678123474, -0.13258647918701172, 0.031132632866501808, -0.0007976436172612011, -0.09108715504407883, -0.0408971793949604, 0.004989791661500931, -0.08263286203145981, 0.12143649160861969, 0.015632696449756622, 0.0009146301308646798, -0.008928352035582066, -0.002538099652156234, -0.003377840155735612, 0.016321169212460518, -0.05603158101439476, -0.07523853331804276, 0.024017004296183586, 0.049762897193431854, -0.11858072876930237, 0.015965135768055916, -0.00939640961587429, -4.887102278416933e-8, 0.06141548976302147, -0.02971097268164158, -0.07636668533086777, 0.017750054597854614, 0.014447072520852089, -0.11170508712530136, 0.00470370426774025, 0.011821303516626358, 0.0428282767534256, 0.14508222043514252, 0.062043093144893646, -0.04138598591089249, -0.00793551281094551, -0.05533502250909805, 0.08180119097232819, -0.019710807129740715, 0.0018617986934259534, 0.005504697561264038, -0.03737039864063263, -0.03368961438536644, 0.06839447468519211, -0.015496491454541683, -0.013877085410058498, 0.07947202771902084, -0.003061230992898345, -0.07726536691188812, 0.08701973408460617, 0.05037056282162666, 0.015711383894085884, -0.060725703835487366, 0.005117910448461771, 0.04714904725551605, 0.015128890983760357, -0.017016947269439697, 0.07113037258386612, -0.004136939998716116, -0.04172259196639061, 0.016875142231583595, 0.060385026037693024, 0.07198914885520935, -0.04642198234796524, -0.06673018634319305, 0.024837074801325798, 0.06813744455575943, 0.023701876401901245, 0.024134941399097443, -0.08811165392398834, 0.0773826614022255, -0.03037071041762829, -0.02245924435555935, 0.07534942775964737, -0.025594418868422508, -0.05962451919913292, 0.06293737143278122, -0.024183034896850586, -0.022437239065766335, -0.009389744140207767, -0.04269915074110031, 0.008904866874217987, -0.0024264920502901077, 0.016819952055811882, 0.04500478878617287, -0.028812197968363762, 0.010123476386070251 ]
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 { nextTick } = require('node:process'); function definitelyAsync(arg, cb) { if (arg) { nextTick(cb); return; } fs.stat('file', cb); } ``` ### When to use `queueMicrotask()` vs. `process.nextTick()` The [`queueMicrotask()`][] API is an alternative to `process.nextTick()` that instead of using the "next tick queue" defers execution of a function using the same microtask queue used to execute the then, catch, and finally handlers of resolved promises. Within Node.js, every time the "next tick queue" is drained, the microtask queue is drained immediately after. So in CJS modules `process.nextTick()` callbacks are always run before `queueMicrotask()` ones. However since ESM modules are processed already as part of the microtask queue, there `queueMicrotask()` callbacks are always executed before `process.nextTick()` ones since Node.js is already in the process of draining the microtask queue. ```mjs import { nextTick } from 'node:process'; Promise.resolve().then(() => console.log('resolve')); queueMicrotask(() => console.log('microtask')); nextTick(() => console.log('nextTick')); // Output: // resolve // microtask // nextTick ``` ```cjs const { nextTick } = require('node:process'); Promise.resolve().then(() => console.log('resolve')); queueMicrotask(() => console.log('microtask')); nextTick(() => console.log('nextTick')); // Output: // nextTick // resolve // microtask ``` For \_most\_ userland use cases, the `queueMicrotask()` API provides a portable and reliable mechanism for deferring execution that works across multiple JavaScript platform environments and should be favored over `process.nextTick()`. In simple scenarios, `queueMicrotask()` can be a drop-in replacement for `process.nextTick()`. ```js console.log('start'); queueMicrotask(() => { console.log('microtask callback'); }); console.log('scheduled'); // Output: // start // scheduled // microtask callback ``` One note-worthy difference between the two APIs is that `process.nextTick()` allows specifying additional values that will be passed as arguments to the deferred function when it is called. Achieving the same result with `queueMicrotask()` requires using either a closure or a bound function: ```js function deferred(a, b) { console.log('microtask', a + b); } console.log('start'); queueMicrotask(deferred.bind(undefined, 1, 2)); console.log('scheduled'); // Output: // start // scheduled // microtask 3 ``` There are minor differences in the way errors raised from within the next tick queue and microtask queue are handled. Errors thrown within a queued microtask callback should be handled within the queued callback when possible. If they are not, the `process.on('uncaughtException')` event handler can be used to capture and handle the errors. When in doubt, unless the specific capabilities of `process.nextTick()` are needed, use `queueMicrotask()`. ## `process.noDeprecation` \* Type: {boolean} The `process.noDeprecation` property indicates whether the `--no-deprecation` flag is set on the current Node.js process. See the documentation for the [`'warning'` event][process\_warning] and the [`emitWarning()` method][process\_emit\_warning] for more information about this flag's behavior. ## `process.permission` \* Type: {Object} This API is available through the [`--permission`][] flag. `process.permission` is an object whose methods are used to manage permissions for the current process. Additional documentation is available in the [Permission Model][]. ### `process.permission.has(scope[, reference])` \* `scope` {string} \* `reference` {string} \* Returns: {boolean} Verifies that the process is able to access the given scope and reference. If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` will check if the process has ALL file system read permissions. The reference has a meaning based 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 \*
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.04185669124126434, 0.02645140327513218, -0.04707259312272072, 0.017650526016950607, -0.05361934006214142, 0.031405672430992126, -0.065141461789608, -0.0244147852063179, -0.01356795709580183, 0.05476704239845276, 0.014301125891506672, -0.06816383451223373, -0.03501700982451439, -0.0688062235713005, 0.02982429414987564, 0.06531752645969391, -0.019404426217079163, 0.044483039528131485, 0.0428941436111927, -0.16948482394218445, 0.005803266074508429, -0.02935730293393135, 0.10299897193908691, -0.021429067477583885, -0.15182781219482422, -0.02937312237918377, 0.009522284381091595, 0.04729839041829109, 0.061604276299476624, -0.05909533426165581, -0.027898650616407394, 0.07088188827037811, 0.017711851745843887, -0.06296238303184509, 0.023459183052182198, -0.11951443552970886, 0.05877436324954033, -0.041983529925346375, -0.027367867529392242, -0.09904732555150986, -0.023110318928956985, 0.06612566858530045, 0.048838719725608826, 0.021288225427269936, -0.015959598124027252, 0.0210952740162611, 0.058505069464445114, -0.05286275967955589, -0.059781838208436966, 0.02284776046872139, 0.03221805393695831, 0.09479173272848129, 0.0076880427077412605, -0.056739237159490585, 0.051737669855356216, 0.0681024044752121, 0.11945515125989914, -0.004061301238834858, -0.003722627181559801, -0.03786470368504524, 0.0839206650853157, -0.04523323103785515, -0.03271293267607689, 0.01980922929942608, 0.03154618665575981, -0.06690816581249237, -0.05028245598077774, -0.04944296181201935, -0.09188051521778107, -0.020427092909812927, -0.01658877730369568, 0.01293739303946495, 0.061116255819797516, -0.027939448133111, -0.013700272887945175, 0.07160819321870804, -0.008770450949668884, -0.019685035571455956, 0.024722611531615257, -0.08066041022539139, 0.01271924376487732, 0.05613454431295395, 0.0814884603023529, -0.00881102867424488, 0.06320372223854065, 0.0018100760644301772, 0.019905855879187584, 0.006575292441993952, 0.02958221174776554, 0.0246589295566082, -0.018291432410478592, 0.03211473301053047, 0.0038245166651904583, -0.024797404184937477, -0.018399255350232124, -0.02888478897511959, -0.05383314564824104, -0.03560471907258034, 0.04736003279685974, 0.030858159065246582, 0.012418766506016254, -0.03601723164319992, -0.0018167209345847368, 0.0828704759478569, -0.02257426455616951, 0.041512418538331985, 0.09936720132827759, 0.09687230736017227, 0.027690362185239792, -0.042929936200380325, -0.026732400059700012, -0.010997260920703411, -0.05688203498721123, 0.07425244152545929, 1.2228620665912476e-34, -0.027775904163718224, -0.11139768362045288, 0.04961902275681496, -0.052577823400497437, 0.004358082544058561, 0.04361657798290253, 0.0449366569519043, 0.003537485608831048, -0.09472759068012238, 0.032637808471918106, -0.000958472432103008, -0.0205173809081316, -0.02827777899801731, -0.034258805215358734, -0.02238159254193306, -0.03495857119560242, 0.0874205231666565, -0.08383549749851227, -0.013493006117641926, -0.008799628354609013, 0.027719182893633842, 0.00620375107973814, -0.0674661248922348, 0.02703958936035633, 0.005935833789408207, 0.01902957633137703, 0.049671415239572525, -0.010475427843630314, 0.03750922158360481, -0.00462097954005003, -0.009114943444728851, 0.002832697471603751, -0.07088925689458847, 0.011782035231590271, 0.01576061360538006, 0.01828017272055149, -0.031446970999240875, 0.005997733678668737, -0.10651162266731262, -0.06987328082323074, 0.008863138034939766, 0.041425321251153946, -0.09481063485145569, 0.027707362547516823, -0.08075091242790222, -0.047233596444129944, -0.07246284931898117, -0.0048276083543896675, 0.041021738201379776, -0.04293961822986603, 0.09093085676431656, 0.04984581843018532, 0.12794335186481476, -0.02680387906730175, 0.053820010274648666, -0.02270347997546196, 0.033873312175273895, -0.022452741861343384, -0.09890866279602051, -0.0031571241561323404, 0.05233854427933693, -0.045780669897794724, -0.03701121360063553, 0.018491987138986588, 0.016688229516148567, 0.0375346913933754, -0.0331074483692646, 0.03166689723730087, 0.07247185707092285, 0.0183159988373518, 0.032947391271591187, 0.025547083467245102, 0.004051017574965954, -0.02320495806634426, 0.06510482728481293, 0.04427142068743706, -0.10745597630739212, -0.06505106389522552, -0.050815481692552567, -0.10437522083520889, 0.05800877511501312, -0.0361776128411293, -0.055461589246988297, 0.06265980005264282, 0.025689061731100082, -0.025363370776176453, 0.004067120607942343, -0.011930642649531364, 0.0051652612164616585, 0.01837501861155033, -0.01643553003668785, -0.011474423110485077, 0.05727052688598633, 0.0010890355333685875, -0.10133903473615646, -3.056516921259258e-33, 0.012485089711844921, 0.02942359447479248, -0.004448991268873215, 0.09915653616189957, -0.04262154549360275, -0.01951340213418007, 0.01031919289380312, -0.05856157839298248, 0.056505922228097916, 0.03217678144574165, -0.09087365120649338, -0.0042426809668540955, 0.029893891885876656, -0.031625427305698395, 0.04224365949630737, 0.06476783007383347, -0.054654013365507126, -0.0533791184425354, 0.012301863171160221, -0.013702004216611385, -0.04910995066165924, -0.029751090332865715, 0.0989467054605484, 0.06595923751592636, -0.008696459233760834, 0.030443359166383743, 0.02315640076994896, 0.0038044326938688755, -0.05247819051146507, -0.0711599737405777, -0.09097733348608017, -0.08780495077371597, -0.010206672362983227, -0.009946068748831749, 0.055062562227249146, -0.04739587754011154, 0.07782385498285294, 0.07788631319999695, 0.015207544900476933, -0.040689967572689056, 0.0707978680729866, 0.03355799615383148, -0.014228859916329384, -0.033148057758808136, 0.0018833563663065434, 0.03705364465713501, -0.05560176447033882, 0.06566484272480011, -0.036588799208402634, -0.028251321986317635, -0.06706708669662476, 0.01709788292646408, -0.001273136935196817, 0.06223445385694504, -0.02344239503145218, -0.018046071752905846, -0.023144392296671867, -0.04847420006990433, 0.0386568158864975, 0.03658963739871979, 0.05870363488793373, -0.11139492690563202, -0.01690789684653282, -0.07870607078075409, 0.027003943920135498, -0.024361712858080864, -0.06724783778190613, -0.06908971071243286, 0.09795527160167694, 0.057868991047143936, 0.033875077962875366, 0.09465818852186203, -0.06963850557804108, -0.007756948005408049, -0.03565920144319534, 0.029378391802310944, 0.051947567611932755, -0.15038375556468964, -0.011791824363172054, 0.062146902084350586, -0.024701066315174103, 0.03410075232386589, 0.006038220599293709, 0.055489681661129, -0.029166558757424355, 0.04342224448919296, 0.05191090330481529, 0.0009488092618994415, 0.042647719383239746, -0.030780797824263573, 0.02729860320687294, 0.029423965141177177, -0.013874880969524384, -0.05836542695760727, -0.06415404379367828, -4.647249340905546e-8, -0.04053371027112007, -0.08141279965639114, -0.04268960654735565, 0.07028778642416, -0.018095606938004494, -0.008410792797803879, -0.04666043445467949, 0.0004656693490687758, 0.04988871142268181, -0.014650174416601658, 0.06128429248929024, -0.04417262598872185, 0.05165278539061546, -0.03642726689577103, -0.0031805788166821003, -0.01354162860661745, 0.0658985823392868, 0.000268029747530818, -0.01834021881222725, 0.022602427750825882, 0.011901312507689, 0.04362509772181511, -0.00782646331936121, 0.05722588300704956, -0.05563206970691681, -0.03430166840553284, 0.10287526994943619, 0.04358376935124397, 0.012570166029036045, -0.045884184539318085, -0.09031318128108978, 0.004576419480144978, 0.08074529469013214, 0.03213460370898247, -0.09176958352327347, -0.007418903522193432, 0.07153543829917908, 0.038435596972703934, 0.07047490030527115, 0.03524869307875633, 0.007266388740390539, 0.014494452625513077, -0.07734739035367966, 0.04267825931310654, -0.0299990214407444, -0.09054829180240631, 0.03425449877977371, -0.014474920928478241, 0.013888164423406124, -0.02249416708946228, -0.003884520847350359, -0.07001383602619171, -0.03609645366668701, 0.03632943332195282, 0.049336373805999756, -0.017054609954357147, 0.024701246991753578, -0.03488320857286453, -0.027379514649510384, 0.029773050919175148, 0.04310868680477142, 0.03871644660830498, 0.0515509694814682, 0.015568211674690247 ]
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 spawning operation ```js // Check if the process has permission to read the README file process.permission.has('fs.read', './README.md'); // Check if the process has read permission operations process.permission.has('fs.read'); ``` ## `process.pid` \* Type: {integer} The `process.pid` property returns the PID of the process. ```mjs import { pid } from 'node:process'; console.log(`This process is pid ${pid}`); ``` ```cjs const { pid } = require('node:process'); console.log(`This process is pid ${pid}`); ``` ## `process.platform` \* Type: {string} The `process.platform` property returns a string identifying the operating system platform for which the Node.js binary was compiled. Currently possible values are: \* `'aix'` \* `'darwin'` \* `'freebsd'` \* `'linux'` \* `'openbsd'` \* `'sunos'` \* `'win32'` ```mjs import { platform } from 'node:process'; console.log(`This platform is ${platform}`); ``` ```cjs const { platform } = require('node:process'); console.log(`This platform is ${platform}`); ``` The value `'android'` may also be returned if the Node.js is built on the Android operating system. However, Android support in Node.js [is experimental][Android building]. ## `process.ppid` \* Type: {integer} The `process.ppid` property returns the PID of the parent of the current process. ```mjs import { ppid } from 'node:process'; console.log(`The parent process is pid ${ppid}`); ``` ```cjs const { ppid } = require('node:process'); console.log(`The parent process is pid ${ppid}`); ``` ## `process.ref(maybeRefable)` > Stability: 1 - Experimental \* `maybeRefable` {any} An object that may be "refable". An object is "refable" if it implements the Node.js "Refable protocol". Specifically, this means that the object implements the `Symbol.for('nodejs.ref')` and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js event loop alive, while "unref'd" objects will not. Historically, this was implemented by using `ref()` and `unref()` methods directly on the objects. This pattern, however, is being deprecated in favor of the "Refable protocol" in order to better support Web Platform API types whose APIs cannot be modified to add `ref()` and `unref()` methods but still need to support that behavior. ## `process.release` \* Type: {Object} The `process.release` property returns an `Object` containing metadata related to the current release, including URLs for the source tarball and headers-only tarball. `process.release` contains the following properties: \* `name` {string} A value that will always be `'node'`. \* `sourceUrl` {string} an absolute URL pointing to a \_`.tar.gz`\_ file containing the source code of the current release. \* `headersUrl`{string} an absolute URL pointing to a \_`.tar.gz`\_ file containing only the source header files for the current release. This file is significantly smaller than the full source file and can be used for compiling Node.js native add-ons. \* `libUrl` {string|undefined} an absolute URL pointing to a \_`node.lib`\_ file matching the architecture and version of the current release. This file is used for compiling Node.js native add-ons. \_This property is only present on Windows builds of Node.js and will be missing on all other platforms.\_ \* `lts` {string|undefined} a string label identifying the [LTS][] label for this release. This property only exists for LTS releases and is `undefined` for all other release types, including \_Current\_ releases. Valid values include the LTS Release code names (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/nodejs/node/blob/HEAD/doc/changelogs/CHANGELOG\_ARCHIVE.md) ```js { name:
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.019361894577741623, -0.022853996604681015, -0.05193859338760376, -0.020217519253492355, 0.017087744548916817, 0.026635916903614998, -0.09174828976392746, 0.051710277795791626, 0.002052472671493888, 0.04102017730474472, -0.022997431457042694, -0.04249001294374466, -0.018396103754639626, -0.048471882939338684, -0.04512522369623184, 0.06204375997185707, -0.01753324270248413, 0.009542944841086864, 0.015830863267183304, -0.033766698092222214, 0.0009241449297405779, -0.004498870577663183, 0.15293706953525543, 0.07538750767707825, -0.15213346481323242, -0.04784915968775749, 0.006693716626614332, 0.0727652758359909, 0.14802509546279907, -0.04295067861676216, -0.06030788645148277, 0.022930096834897995, 0.01193289179354906, -0.012547570280730724, -0.0010333738755434752, -0.09834426641464233, 0.03472919762134552, -0.03981051966547966, -0.04086083173751831, -0.03883521258831024, 0.02812565304338932, -0.005023762583732605, -0.001952550606802106, 0.048800718039274216, -0.035189397633075714, -0.0308982003480196, 0.014004542492330074, -0.07745025306940079, -0.023583732545375824, 0.006386169698089361, -0.04153486341238022, 0.07872925698757172, 0.04089448228478432, -0.057164620608091354, 0.006255492568016052, -0.036588478833436966, -0.057462166994810104, 0.05042635276913643, 0.03635060414671898, -0.04409614950418472, -0.004804573021829128, -0.03503003343939781, -0.03985006734728813, -0.00726194866001606, -0.0006025591283105314, -0.06316188722848892, -0.036056529730558395, -0.04896007850766182, -0.025982370600104332, 0.029401054605841637, -0.024913419038057327, -0.013895011506974697, 0.07834941893815994, -0.009231822565197945, 0.029990848153829575, 0.07659444957971573, 0.04286392405629158, -0.057342372834682465, -0.014102651737630367, -0.06328486651182175, 0.03531697392463684, 0.041274040937423706, 0.023316334933042526, 0.012122518382966518, 0.09754124283790588, -0.023057738319039345, -0.0197020061314106, -0.012501946650445461, 0.020139263942837715, 0.04633353650569916, 0.018808159977197647, 0.06913141161203384, 0.04280451312661171, -0.03345842659473419, 0.017455046996474266, -0.09074324369430542, -0.04513448476791382, -0.002524917246773839, 0.051010653376579285, -0.002826786134392023, 0.048851341009140015, 0.029835117980837822, -0.051981210708618164, 0.09885434061288834, -0.02219625748693943, -0.015356700867414474, 0.09045755863189697, 0.09345825761556625, 0.016056008636951447, -0.0038317544385790825, 0.01841077394783497, 0.005792868323624134, -0.04252775013446808, -0.026604630053043365, 2.5203866211476824e-33, -0.030776800587773323, -0.05972719192504883, 0.05408703535795212, 0.07442227005958557, 0.0002724414807744324, 0.02227318100631237, 0.014026148244738579, -0.05367503687739372, -0.06161361187696457, 0.01736638881266117, -0.05739196389913559, 0.0856623649597168, -0.02347080036997795, -0.09984088689088821, 0.0068514724262058735, -0.006592003162950277, 0.12283964455127716, -0.09647191315889359, 0.06835700571537018, 0.016937894746661186, 0.027086833491921425, 0.030929401516914368, -0.10267001390457153, 0.04404135048389435, 0.08419516682624817, -0.04000059887766838, -0.048543501645326614, -0.04612353816628456, -0.0007984283147379756, -0.015424096956849098, 0.06555403023958206, 0.04477715864777565, -0.03378301113843918, 0.01243606861680746, -0.042890917509794235, -0.04669283330440521, 0.02788504958152771, 0.04412253201007843, -0.09089570492506027, -0.09093175083398819, 0.047156885266304016, -0.06308097392320633, -0.04116557911038399, 0.04707520827651024, -0.10594787448644638, -0.05108062922954559, -0.14486823976039886, -0.02181045152246952, 0.015805426985025406, 0.08145371079444885, 0.026510121300816536, 0.03041914850473404, 0.06736835092306137, -0.07425379753112793, 0.06809081137180328, -0.016132036224007607, -0.041840530931949615, -0.05897102504968643, -0.030793657526373863, 0.016412505879998207, 0.09578748047351837, -0.001168215530924499, -0.011943708173930645, 0.05749388039112091, 0.020494982600212097, -0.08279214799404144, 0.007923788391053677, -0.014674863778054714, 0.08447423577308655, 0.061983074992895126, -0.11457917839288712, 0.026748498901724815, 0.04486525431275368, 0.05332711711525917, 0.029811574146151543, -0.027715275064110756, -0.01010496262460947, -0.027862215414643288, -0.034398823976516724, 0.00428431760519743, 0.03626052290201187, -0.004897247068583965, -0.0531311109662056, 0.0027065661270171404, 0.0023099470417946577, -0.023272385820746422, -0.07223647087812424, 0.011231047101318836, 0.0206884928047657, -0.04274141788482666, 0.038077473640441895, -0.018677834421396255, 0.02592356503009796, 0.007383977994322777, -0.11713451892137527, -5.07216922703789e-33, -0.010491540655493736, -0.043997038155794144, -0.04262622073292732, 0.0193818099796772, -0.06801997125148773, -0.024768449366092682, -0.0034385602921247482, -0.08086292445659637, 0.024260949343442917, 0.0205680038779974, -0.0836857259273529, 0.0007132947212085128, 0.0034184404648840427, 0.08015727251768112, 0.022095076739788055, 0.01655772514641285, -0.08726100623607635, -0.03775564581155777, 0.03012234903872013, 0.0006056507118046284, -0.10394224524497986, 0.06767773628234863, 0.12341649830341339, 0.060687463730573654, 0.0007236125529743731, 0.020504267886281013, -0.08686023950576782, -0.08214793354272842, -0.03819775581359863, -0.030494770035147667, -0.06720347702503204, -0.014295392669737339, -0.007323665544390678, 0.04851759225130081, -0.03600102290511131, -0.10836951434612274, -0.033849988132715225, 0.09451532363891602, 0.02275669015944004, -0.042657095938920975, 0.0910143330693245, 0.021127501502633095, 0.024523206055164337, -0.004759788513183594, -0.038682110607624054, 0.011951006948947906, 0.07239126414060593, 0.02132529765367508, -0.017007170245051384, -0.020190319046378136, -0.006013785023242235, -0.05363072082400322, 0.08715350180864334, 0.05172118544578552, 0.040279943495988846, -0.0004444591759238392, 0.07789266854524612, -0.0822969451546669, 0.03072463721036911, 0.015190139412879944, 0.11978718638420105, -0.10344792157411575, -0.08521350473165512, 0.0015648078406229615, -0.05673972889780998, -0.0426473431289196, -0.02645253762602806, -0.043102510273456573, 0.11214269697666168, 0.02469594031572342, 0.052639439702034, 0.03177842125296593, -0.0003241307567805052, 0.020042628049850464, 0.008754800073802471, 0.01937805861234665, -0.025622550398111343, -0.08461970835924149, -0.049975186586380005, 0.04606592655181885, 0.012349656783044338, 0.06193855032324791, -0.08074912428855896, 0.07031112164258957, -0.016245612874627113, -0.07342227548360825, 0.02905265800654888, -0.04913901537656784, -0.002197708236053586, -0.05534012243151665, 0.005401942413300276, 0.030897231772542, -0.0641070306301117, -0.06532764434814453, -0.028146956115961075, -4.736773107083536e-8, -0.02245083451271057, -0.011226127855479717, -0.0797615721821785, 0.010377871803939342, 0.060553133487701416, -0.04205802083015442, -0.02488383650779724, 0.0016488619148731232, 0.061423808336257935, 0.06940822303295135, -0.02435454912483692, -0.04231066629290581, 0.03984268009662628, -0.03470167517662048, 0.012281944043934345, 0.03031427226960659, 0.039832841604948044, 0.0563061349093914, 0.015344900079071522, 0.012622328475117683, 0.035514749586582184, -0.021615371108055115, 0.003408908611163497, 0.08986081182956696, -0.039220329374074936, -0.033792175352573395, 0.04189995303750038, -0.0044213831424713135, -0.05272229388356209, 0.04712663218379021, -0.0337691605091095, -0.005633193533867598, 0.03113473579287529, 0.03993544727563858, -0.053392600268125534, -0.03995051607489586, 0.022339627146720886, 0.015998221933841705, 0.054138824343681335, 0.03303132206201553, 0.03724224120378494, 0.07050365209579468, 0.005456556100398302, 0.05381348356604576, -0.04300206899642944, -0.046217404305934906, 0.02072146348655224, 0.007918255403637886, -0.026483742520213127, 0.004165614023804665, 0.01713055558502674, 0.00035830194246955216, -0.005546503234654665, 0.06213432550430298, -0.022657200694084167, 0.03990628197789192, 0.0837983712553978, -0.029467642307281494, -0.02377677895128727, -0.017974097281694412, 0.05358387529850006, 0.10855494439601898, 0.024557139724493027, -0.022053364664316177 ]
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/nodejs/node/blob/HEAD/doc/changelogs/CHANGELOG\_ARCHIVE.md) ```js { name: 'node', lts: 'Hydrogen', sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' } ``` In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be relied upon to exist. ## `process.report` \* Type: {Object} `process.report` is an object whose methods are used to generate diagnostic reports for the current process. Additional documentation is available in the [report documentation][]. ### `process.report.compact` \* Type: {boolean} Write reports in a compact format, single-line JSON, more easily consumable by log processing systems than the default multi-line format designed for human consumption. ```mjs import { report } from 'node:process'; console.log(`Reports are compact? ${report.compact}`); ``` ```cjs const { report } = require('node:process'); console.log(`Reports are compact? ${report.compact}`); ``` ### `process.report.directory` \* Type: {string} Directory where the report is written. The default value is the empty string, indicating that reports are written to the current working directory of the Node.js process. ```mjs import { report } from 'node:process'; console.log(`Report directory is ${report.directory}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report directory is ${report.directory}`); ``` ### `process.report.filename` \* Type: {string} Filename where the report is written. If set to the empty string, the output filename will be comprised of a timestamp, PID, and sequence number. The default value is the empty string. If the value of `process.report.filename` is set to `'stdout'` or `'stderr'`, the report is written to the stdout or stderr of the process respectively. ```mjs import { report } from 'node:process'; console.log(`Report filename is ${report.filename}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report filename is ${report.filename}`); ``` ### `process.report.getReport([err])` \* `err` {Error} A custom error used for reporting the JavaScript stack. \* Returns: {Object} Returns a JavaScript Object representation of a diagnostic report for the running process. The report's JavaScript stack trace is taken from `err`, if present. ```mjs import { report } from 'node:process'; import util from 'node:util'; const data = report.getReport(); console.log(data.header.nodejsVersion); // Similar to process.report.writeReport() import fs from 'node:fs'; fs.writeFileSync('my-report.log', util.inspect(data), 'utf8'); ``` ```cjs const { report } = require('node:process'); const util = require('node:util'); const data = report.getReport(); console.log(data.header.nodejsVersion); // Similar to process.report.writeReport() const fs = require('node:fs'); fs.writeFileSync('my-report.log', util.inspect(data), 'utf8'); ``` Additional documentation is available in the [report documentation][]. ### `process.report.reportOnFatalError` \* Type: {boolean} If `true`, a diagnostic report is generated on fatal errors, such as out of memory errors or failed C++ assertions. ```mjs import { report } from 'node:process'; console.log(`Report on fatal error: ${report.reportOnFatalError}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report on fatal error: ${report.reportOnFatalError}`); ``` ### `process.report.reportOnSignal` \* Type: {boolean} If `true`, a diagnostic report is generated when the process receives the signal specified by `process.report.signal`. ```mjs import { report } from 'node:process'; console.log(`Report on signal: ${report.reportOnSignal}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report on signal: ${report.reportOnSignal}`); ``` ### `process.report.reportOnUncaughtException` \* Type: {boolean} If `true`, a diagnostic report is generated on uncaught exception. ```mjs import { report } from 'node:process'; console.log(`Report on exception: ${report.reportOnUncaughtException}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report on exception: ${report.reportOnUncaughtException}`); ``` ### `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'; console.log(`Report signal: ${report.signal}`); ``` ```cjs const {
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.003996529616415501, 0.06320331990718842, 0.03987481817603111, -0.034077249467372894, 0.04793444648385048, 0.07290208339691162, 0.0007555487100034952, -0.004668569657951593, 0.008117259480059147, 0.059857506304979324, -0.0055669150315225124, 0.02843431569635868, 0.027397749945521355, -0.061604972928762436, -0.010060322470963001, 0.01586269773542881, -0.08276375383138657, 0.04748467355966568, -0.006600699387490749, 0.005194822326302528, -0.04605429619550705, -0.03275645151734352, 0.0732407495379448, -0.003251587273553014, -0.05114275589585304, -0.023390071466565132, -0.022484032437205315, 0.008857590146362782, 0.06254377961158752, -0.03452639281749725, -0.10711483657360077, -0.027806883677840233, -0.05636591836810112, -0.02053382620215416, -0.0322447195649147, -0.05338124558329582, 0.028488099575042725, 0.016768066212534904, -0.0941319465637207, 0.036661259829998016, -0.004135224502533674, -0.009629122912883759, 0.01806468702852726, -0.06221846491098404, 0.018693380057811737, 0.05941734462976456, 0.059073153883218765, -0.01393490843474865, -0.01294633001089096, -0.018086090683937073, -0.008056742139160633, -0.02485613338649273, 0.03363015875220299, -0.030485622584819794, 0.015573904849588871, 0.00218598241917789, 0.03247188776731491, -0.05125237628817558, 0.030375150963664055, -0.06569962203502655, -0.050926245748996735, -0.060270220041275024, -0.020213115960359573, 0.09403692930936813, 0.061598703265190125, 0.012932662852108479, -0.0457884781062603, -0.06975534558296204, -0.05760553106665611, -0.007416309788823128, 0.09031107276678085, -0.07001601159572601, 0.08414456993341446, -0.03600431978702545, 0.02769504487514496, 0.030024996027350426, 0.0069076260551810265, -0.036990687251091, -0.033055227249860764, 0.06031664088368416, 0.0296761654317379, -0.04045965522527695, 0.055565718561410904, 0.022806139662861824, 0.052354905754327774, 0.04074615612626076, -0.008790388703346252, 0.025473812595009804, 0.011891686357557774, 0.03844610974192619, -0.015373493544757366, 0.0007307592313736677, 0.030454963445663452, -0.001982836751267314, 0.05822856351733208, 0.026537731289863586, 0.01076003909111023, 0.05724547058343887, -0.0011192363454028964, -0.025926124304533005, -0.14202794432640076, -0.034603167325258255, -0.06514079123735428, -0.003084380179643631, -0.07839033752679825, 0.04264865443110466, 0.11468260735273361, 0.11281377822160721, 0.03366527706384659, 0.008447888307273388, 0.011689933016896248, 0.017879869788885117, -0.03074408508837223, -0.00862632691860199, 2.5999031201800484e-33, 0.07273655384778976, -0.007781120482832193, 0.01906224526464939, 0.05099022760987282, 0.0689634308218956, -0.024962415918707848, -0.003906946629285812, -0.04051840677857399, -0.12795738875865936, 0.02343972586095333, -0.013683964498341084, 0.009807096794247627, -0.05372297018766403, -0.09008854627609253, -0.020133126527071, -0.087925486266613, 0.018113350495696068, 0.031674373894929886, 0.08606871217489243, 0.0272807739675045, -0.07981355488300323, 0.034457817673683167, -0.009347428567707539, 0.04949960857629776, -0.004518631845712662, 0.0395466573536396, 0.09794636815786362, -0.020366426557302475, -0.017868822440505028, -0.01985228806734085, 0.0852208212018013, 0.0037780199199914932, -0.033273011445999146, 0.09252135455608368, 0.046141695231199265, 0.019589217379689217, -0.11090339720249176, -0.01883397251367569, -0.08402690291404724, -0.05399134382605553, 0.024746427312493324, 0.07579515874385834, -0.07946201413869858, -0.024988539516925812, 0.05216193571686745, -0.01893194392323494, -0.01716453582048416, -0.048876382410526276, 0.08287373185157776, -0.03583825007081032, -0.09730331599712372, 0.05139413848519325, 0.004025283735245466, -0.030643567442893982, 0.019455887377262115, 0.015381215140223503, 0.026641635224223137, -0.026235032826662064, 0.01572919636964798, -0.006503459066152573, 0.06182943284511566, 0.08804012089967728, -0.002024665242061019, -0.05104985460639, 0.03862043470144272, 0.06653175503015518, -0.010149363428354263, 0.01650022342801094, -0.05908622220158577, 0.08324537426233292, -0.04872029274702072, -0.014821510761976242, 0.09663133323192596, 0.10805710405111313, 0.038161762058734894, -0.029665321111679077, -0.06464756280183792, -0.0548345185816288, 0.035998884588479996, -0.004173831548541784, -0.007337121292948723, -0.05671250447630882, -0.028747493401169777, 0.039430975914001465, 0.04399272799491882, -0.05064252391457558, -0.0377705879509449, 0.10376699268817902, 0.10129434615373611, 0.01577947661280632, 0.05375940352678299, -0.03426392003893852, 0.029015516862273216, -0.04634610936045647, -0.1443026214838028, -3.237145770929511e-33, -0.04114006832242012, 0.026622071862220764, -0.0633176937699318, 0.05837346240878105, -0.01650739461183548, -0.052013199776411057, -0.018712742254137993, 0.020258842036128044, 0.09846283495426178, 0.030189504846930504, -0.005971623584628105, 0.031611036509275436, 0.013163912110030651, -0.04124249145388603, 0.010116892866790295, 0.09218350797891617, -0.0806223452091217, -0.08243750035762787, 0.010101989842951298, -0.05501284822821617, -0.041380997747182846, 0.0757201761007309, -0.03789917007088661, 0.06557992100715637, -0.001247135573066771, -0.049707379192113876, 0.046751078218221664, 0.03330085054039955, -0.012131933122873306, -0.08318502455949783, -0.004828000906854868, 0.04061419889330864, -0.047281041741371155, 0.027524245902895927, 0.008582602255046368, -0.08316125720739365, -0.006468917243182659, 0.08188150078058243, 0.00020212367235217243, -0.0995635911822319, -0.030758464708924294, -0.02381914108991623, 0.02458345703780651, -0.041340090334415436, 0.022500276565551758, 0.0014179613208398223, -0.07527895271778107, 0.03874577581882477, -0.023894524201750755, 0.013799304142594337, -0.08297005295753479, -0.08764106035232544, 0.011675658635795116, -0.011788311414420605, -0.012783483602106571, -0.025518575683236122, -0.039952024817466736, 0.12705685198307037, 0.01750248670578003, 0.061766643077135086, 0.0364384725689888, -0.07423427700996399, 0.007271795533597469, 0.012203685007989407, -0.031183648854494095, -0.052662987262010574, -0.153684601187706, -0.007367437239736319, 0.008233200758695602, -0.004384608939290047, -0.022115234285593033, -0.00683157192543149, 0.04700203612446785, -0.015387937426567078, 0.0469265952706337, -0.028846442699432373, 0.06335071474313736, -0.0695345476269722, 0.004391560796648264, -0.01414499245584011, -0.036528684198856354, 0.15291067957878113, -0.025367097929120064, 0.055025726556777954, 0.05591548979282379, 0.013272389769554138, -0.03092813491821289, 0.05138206481933594, -0.010906764306128025, -0.043425288051366806, -0.01855497807264328, 0.012980753555893898, -0.031098535284399986, 0.022074731066823006, -0.035857997834682465, -5.249795265171997e-8, -0.03731825575232506, 0.005097145214676857, -0.0763634443283081, -0.04379304498434067, 0.103996641933918, 0.05117891728878021, 0.015995213761925697, 0.05690504238009453, 0.010457349941134453, 0.0329802967607975, 0.05100380256772041, 0.06987915188074112, 0.010779380798339844, -0.031546857208013535, -0.038724180310964584, -0.034153882414102554, -0.022687235847115517, 0.09429012984037399, 0.0014605197357013822, -0.023029305040836334, 0.01503587607294321, 0.056264255195856094, 0.005898528732359409, 0.014985514804720879, 0.018261082470417023, -0.06973961740732193, 0.01685754954814911, 0.030058706179261208, -0.04386090114712715, -0.06296335905790329, -0.07017074525356293, 0.05822983756661415, 0.05755335092544556, -0.10854984819889069, 0.03580491617321968, -0.01612113043665886, -0.050994809716939926, 0.009357086382806301, 0.04984332621097565, 0.051931291818618774, 0.041009847074747086, 0.01995600014925003, 0.0006007595802657306, -0.005322731100022793, -0.11703349649906158, -0.024144642055034637, -0.037465330213308334, 0.045951053500175476, 0.023070985451340675, 0.009364793077111244, 0.0626087337732315, -0.04659351706504822, -0.017738163471221924, -0.044573795050382614, 0.04469943419098854, 0.04172272980213165, -0.0032374775037169456, -0.10915180295705795, 0.026277439668774605, -0.08258645981550217, 0.10812699794769287, -0.03948954492807388, 0.07869108766317368, -0.010878089815378189 ]
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'; console.log(`Report signal: ${report.signal}`); ``` ```cjs const { report } = require('node:process'); console.log(`Report signal: ${report.signal}`); ``` ### `process.report.writeReport([filename][, err])` \* `filename` {string} Name of the file where the report is written. This should be a relative path, that will be appended to the directory specified in `process.report.directory`, or the current working directory of the Node.js process, if unspecified. \* `err` {Error} A custom error used for reporting the JavaScript stack. \* Returns: {string} Returns the filename of the generated report. Writes a diagnostic report to a file. If `filename` is not provided, the default filename includes the date, time, PID, and a sequence number. The report's JavaScript stack trace is taken from `err`, if present. If the value of `filename` is set to `'stdout'` or `'stderr'`, the report is written to the stdout or stderr of the process respectively. ```mjs import { report } from 'node:process'; report.writeReport(); ``` ```cjs const { report } = require('node:process'); report.writeReport(); ``` Additional documentation is available in the [report documentation][]. ## `process.resourceUsage()` \* Returns: {Object} the resource usage for the current process. All of these values come from the `uv\_getrusage` call which returns a [`uv\_rusage\_t` struct][uv\_rusage\_t]. \* `userCPUTime` {integer} maps to `ru\_utime` computed in microseconds. It is the same value as [`process.cpuUsage().user`][process.cpuUsage]. \* `systemCPUTime` {integer} maps to `ru\_stime` computed in microseconds. It is the same value as [`process.cpuUsage().system`][process.cpuUsage]. \* `maxRSS` {integer} maps to `ru\_maxrss` which is the maximum resident set size used in kibibytes (1024 bytes). \* `sharedMemorySize` {integer} maps to `ru\_ixrss` but is not supported by any platform. \* `unsharedDataSize` {integer} maps to `ru\_idrss` but is not supported by any platform. \* `unsharedStackSize` {integer} maps to `ru\_isrss` but is not supported by any platform. \* `minorPageFault` {integer} maps to `ru\_minflt` which is the number of minor page faults for the process, see [this article for more details][wikipedia\_minor\_fault]. \* `majorPageFault` {integer} maps to `ru\_majflt` which is the number of major page faults for the process, see [this article for more details][wikipedia\_major\_fault]. This field is not supported on Windows. \* `swappedOut` {integer} maps to `ru\_nswap` but is not supported by any platform. \* `fsRead` {integer} maps to `ru\_inblock` which is the number of times the file system had to perform input. \* `fsWrite` {integer} maps to `ru\_oublock` which is the number of times the file system had to perform output. \* `ipcSent` {integer} maps to `ru\_msgsnd` but is not supported by any platform. \* `ipcReceived` {integer} maps to `ru\_msgrcv` but is not supported by any platform. \* `signalsCount` {integer} maps to `ru\_nsignals` but is not supported by any platform. \* `voluntaryContextSwitches` {integer} maps to `ru\_nvcsw` which is the number of times a CPU context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). This field is not supported on Windows. \* `involuntaryContextSwitches` {integer} maps to `ru\_nivcsw` which is the number of times a CPU context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice. This field is not supported 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: 0, ipcReceived: 0, signalsCount: 0, voluntaryContextSwitches: 79, involuntaryContextSwitches: 1 } \*/ ``` ```cjs
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.007102088071405888, -0.01999741978943348, 0.00521929981186986, -0.020283140242099762, -0.02763707935810089, 0.08417270332574844, -0.0878647118806839, 0.055733822286129, 0.05633567273616791, 0.0962793305516243, 0.0163338091224432, -0.029928311705589294, -0.07541311532258987, -0.017147600650787354, 0.05191310495138168, 0.011164980940520763, -0.028415093198418617, 0.03621285781264305, 0.026126304641366005, -0.04559427127242088, 0.02387162484228611, 0.04190429672598839, 0.15307553112506866, 0.014375180006027222, -0.07332287728786469, -0.050513286143541336, -0.04859910160303116, 0.09332450479269028, 0.08598027378320694, -0.019540872424840927, -0.10043085366487503, -0.0005907714366912842, -0.0469353012740612, -0.10501471161842346, -0.0429590567946434, -0.13004401326179504, 0.007539665326476097, -0.0615929551422596, -0.0008371652220375836, -0.07273006439208984, -0.019312221556901932, 0.008429341949522495, -0.0005954671069048345, -0.00825856439769268, -0.007010590750724077, 0.013348724693059921, 0.013727573677897453, -0.004539739806205034, 0.003978068009018898, 0.029647445306181908, -0.06324803084135056, 0.07025090605020523, 0.06546784937381744, -0.07759710401296616, 0.05705023184418678, 0.03492244333028793, 0.0420229472219944, -0.0446622297167778, -0.008712250739336014, -0.07682231068611145, 0.0007914461311884224, -0.02374962531030178, -0.07428445667028427, -0.006941154599189758, 0.05543464422225952, -0.008059323765337467, -0.022794973105192184, -0.07392653077840805, -0.052507031708955765, -0.03825729340314865, 0.01899832673370838, 0.012507998384535313, 0.09374000132083893, 0.0015564975328743458, -0.010177593678236008, 0.03678405284881592, -0.03850182145833969, -0.11162110418081284, -0.13570226728916168, -0.0582222081720829, 0.07015670090913773, 0.0005889277090318501, 0.03802531212568283, 0.002587072318419814, 0.02955693192780018, 0.07953841239213943, 0.003572472371160984, 0.02815892919898033, -0.015895502641797066, 0.06346109509468079, 0.04068462923169136, 0.03197472542524338, -0.01918623596429825, -0.021725468337535858, -0.001350337639451027, -0.023770997300744057, -0.004492848180234432, 0.03544409200549126, 0.05919167771935463, 0.005515826400369406, -0.025041278451681137, 0.05645594373345375, 0.030675474554300308, 0.07567568123340607, 0.04374297335743904, 0.014167025685310364, 0.14197680354118347, 0.1096612811088562, -0.05650925263762474, -0.003062989329919219, 0.029767531901597977, 0.09612396359443665, -0.03836817666888237, 0.05496878921985626, 1.8331830727653727e-33, 0.0059712608344852924, -0.03519778698682785, 0.010676383040845394, 0.02166532166302204, 0.08160354197025299, 0.075450100004673, -0.005185633897781372, 0.00159271783195436, -0.045959144830703735, 0.03705926239490509, -0.061125271022319794, 0.010499808005988598, -0.027214571833610535, -0.034496065229177475, -0.00972250010818243, 0.002699368866160512, 0.055742520838975906, -0.02107878029346466, -0.021507225930690765, 0.0033353327307850122, 0.04669657722115517, -0.021752510219812393, -0.05741618946194649, 0.044187191873788834, 0.0032614560332149267, -0.0016473307041451335, -0.03065621666610241, 0.018782973289489746, -0.03246691823005676, -0.05038583278656006, 0.06615278124809265, 0.02217915654182434, 0.057610128074884415, 0.07160045951604843, 0.035400744527578354, -0.06275060027837753, 0.006605878937989473, 0.028019117191433907, -0.1071542352437973, -0.03191144019365311, 0.05469280481338501, 0.07376415282487869, -0.06394638121128082, -0.014414159581065178, 0.004965462256222963, -0.05723561346530914, -0.04762153699994087, -0.010552182793617249, 0.07357674837112427, -0.03907015174627304, 0.007942314259707928, 0.057373080402612686, 0.07847710698843002, -0.01784873940050602, 0.026805466040968895, 0.03047085739672184, -0.007116665132343769, -0.11806885153055191, -0.029235510155558586, -0.036114923655986786, 0.08665052056312561, 0.000936738564632833, 0.008137975819408894, 0.01590382307767868, 0.05188892036676407, -0.06272060424089432, 0.0343841053545475, 0.03583480417728424, -0.016538212075829506, 0.023092398419976234, -0.07075551897287369, 0.007626080885529518, 0.013387217186391354, -0.02539273351430893, 0.06867342442274094, -0.035406310111284256, -0.064681775867939, 0.01411973312497139, -0.02929719351232052, -0.04639686271548271, 0.013263932429254055, -0.0457143671810627, -0.07573620975017548, 0.017799749970436096, 0.06730824708938599, 0.04055022820830345, -0.06547055393457413, 0.004558023530989885, 0.015154819004237652, 0.025168411433696747, 0.05555693805217743, -0.01580282300710678, -0.020051706582307816, 0.007419846951961517, -0.11775743961334229, -5.025341940204945e-33, -0.023195521906018257, 0.08834582567214966, -0.01275643426924944, -0.04789147153496742, -0.09071950614452362, -0.025821905583143234, -0.0013608570443466306, -0.07735998928546906, -0.02054736390709877, 0.026534730568528175, -0.02215571328997612, -0.033376168459653854, 0.05400568246841431, 0.05471513047814369, -0.08055825531482697, 0.0760122761130333, -0.057965103536844254, -0.008374695666134357, -0.018793383613228798, -0.040231503546237946, -0.03197919949889183, 0.03095872327685356, 0.05406966805458069, 0.009578896686434746, -0.11087912321090698, 0.012360109016299248, 0.025117183104157448, 0.0342697948217392, -0.08893991261720657, -0.030300747603178024, -0.044671885669231415, 0.08148090541362762, -0.0562346950173378, 0.002123929327353835, -0.0005926107405684888, -0.11382339894771576, 0.016640450805425644, 0.042436376214027405, 0.03504524752497673, -0.020434636622667313, 0.07357727736234665, 0.09777383506298065, -0.04966975376009941, 0.01904660277068615, -0.006680245511233807, 0.05617915838956833, 0.0629812702536583, 0.02631651796400547, -0.01392266433686018, -0.058422621339559555, -0.06129835173487663, -0.028835589066147804, 0.006410087924450636, -0.006820234470069408, -0.07663394510746002, 0.025522002950310707, -0.03509289771318436, -0.06808467954397202, -0.06048325076699257, 0.020329313352704048, 0.0414462611079216, -0.0813007801771164, -0.07186610996723175, -0.07711104303598404, -0.01955917477607727, -0.03942812979221344, -0.04092329367995262, 0.04029202088713646, 0.14868196845054626, -0.049145326018333435, -0.015254017896950245, 0.044042110443115234, -0.020441750064492226, -0.03162273392081261, 0.011816157028079033, 0.05490971729159355, -0.03435906022787094, -0.11615340411663055, -0.023751843720674515, 0.027332818135619164, -0.020385555922985077, 0.026165854185819626, -0.03716089576482773, -0.018184145912528038, -0.010278848931193352, -0.0279555581510067, -0.01226061675697565, 0.047627005726099014, -0.007603059057146311, -0.050495751202106476, 0.049534816294908524, 0.08734283596277237, -0.09053055197000504, -0.07602053135633469, -0.0026055467315018177, -5.0472223733777355e-8, -0.06247718632221222, -0.00864882580935955, -0.11914895474910736, -0.04490144923329353, 0.016960814595222473, -0.018190898001194, 0.01834212802350521, 0.0082292091101408, 0.054395053535699844, 0.057994257658720016, -0.05105896294116974, -0.061283644288778305, -0.047205012291669846, -0.01351267658174038, 0.004286900628358126, -0.05646264925599098, -0.0008642833563499153, 0.11164707690477371, -0.059595316648483276, -0.013871782459318638, 0.05391795560717583, -0.02170783281326294, -0.0036965191829949617, 0.055732984095811844, -0.013476262800395489, -0.07808902114629745, 0.06801580637693405, 0.032887816429138184, -0.021204117685556412, 0.0038436120375990868, -0.06399064511060715, 0.04374389722943306, 0.0400070995092392, 0.013409283012151718, -0.06449205428361893, 0.057106051594018936, 0.11018159240484238, -0.01696060225367546, 0.0428817942738533, 0.04356570169329643, 0.03999819979071617, 0.09105245023965836, -0.05096258595585823, 0.0617537759244442, -0.08792362362146378, -0.05230475217103958, 0.009485052898526192, -0.07044187188148499, 0.03488829731941223, 0.019790951162576675, 0.02997380681335926, -0.024667391553521156, 0.012685541063547134, 0.033970750868320465, 0.015568898990750313, 0.036603979766368866, 0.012579125352203846, -0.04051553085446358, -0.09008639305830002, -0.014516249299049377, 0.05616157501935959, 0.0228484645485878, 0.04503434896469116, -0.037292979657649994 ]
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: 0, ipcReceived: 0, signalsCount: 0, voluntaryContextSwitches: 79, involuntaryContextSwitches: 1 } \*/ ``` ```cjs const { resourceUsage } = require('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: 0, ipcReceived: 0, signalsCount: 0, voluntaryContextSwitches: 79, involuntaryContextSwitches: 1 } \*/ ``` ## `process.send(message[, sendHandle[, options]][, callback])` \* `message` {Object} \* `sendHandle` {net.Server|net.Socket} \* `options` {Object} used to parameterize the sending of certain types of handles.`options` supports the following properties: \* `keepOpen` {boolean} A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process. \*\*Default:\*\* `false`. \* `callback` {Function} \* Returns: {boolean} If Node.js is spawned with an IPC channel, the `process.send()` method can be used to send messages to the parent process. Messages will be received as a [`'message'`][] event on the parent's [`ChildProcess`][] object. If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent. ## `process.setegid(id)` \* `id` {string|number} A group name or ID The `process.setegid()` method sets the effective group identity of the process. (See setegid(2).) The `id` can be passed as either a numeric ID or a group name string. If a group name is specified, this method blocks while resolving the associated a numeric ID. ```mjs import process from 'node:process'; if (process.getegid && process.setegid) { console.log(`Current gid: ${process.getegid()}`); try { process.setegid(501); console.log(`New gid: ${process.getegid()}`); } catch (err) { console.error(`Failed to set gid: ${err}`); } } ``` ```cjs const process = require('node:process'); if (process.getegid && process.setegid) { console.log(`Current gid: ${process.getegid()}`); try { process.setegid(501); console.log(`New gid: ${process.getegid()}`); } catch (err) { console.error(`Failed to set gid: ${err}`); } } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.seteuid(id)` \* `id` {string|number} A user name or ID The `process.seteuid()` method sets the effective user identity of the process. (See seteuid(2).) The `id` can be passed as either a numeric ID or a username string. If a username is specified, the method blocks while resolving the associated numeric ID. ```mjs import process from 'node:process'; if (process.geteuid && process.seteuid) { console.log(`Current uid: ${process.geteuid()}`); try { process.seteuid(501); console.log(`New uid: ${process.geteuid()}`); } catch (err) { console.error(`Failed to set uid: ${err}`); } } ``` ```cjs const process = require('node:process'); if (process.geteuid && process.seteuid) { console.log(`Current uid: ${process.geteuid()}`); try { process.seteuid(501); console.log(`New uid: ${process.geteuid()}`); } catch (err) { console.error(`Failed to set uid: ${err}`); } } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.setgid(id)` \* `id` {string|number} The group name or ID The `process.setgid()` method sets the group identity of the process. (See setgid(2).) The `id` can be passed as either a numeric ID or a group name string. If a group name is specified, this method blocks while resolving the associated numeric ID. ```mjs import process 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 && process.setgid) { console.log(`Current gid: ${process.getgid()}`); try { process.setgid(501); console.log(`New gid: ${process.getgid()}`); } catch (err)
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.022478971630334854, -0.007571004796773195, -0.00547398766502738, 0.015677522867918015, -0.023560361936688423, -0.045329783111810684, -0.05728379264473915, 0.06587430089712143, -0.00601566769182682, 0.007186103146523237, -0.060635246336460114, 0.008353055454790592, 0.008485015481710434, -0.036419812589883804, -0.028085073456168175, 0.05575273558497429, -0.04414694011211395, 0.03192516788840294, -0.04723430052399635, -0.07580436766147614, 0.022914040833711624, 0.040593598037958145, 0.16329450905323029, -0.02901649661362171, -0.17476113140583038, -0.0639873668551445, -0.03615906834602356, 0.05858515202999115, 0.09882979840040207, -0.04753941297531128, 0.022879181429743767, -0.0008792635053396225, 0.03317699581384659, -0.1055392175912857, -0.05106126517057419, -0.05821707844734192, -0.009640262462198734, -0.015702588483691216, 0.06935755163431168, 0.0069450209848582745, -0.023459412157535553, 0.06020720675587654, -0.028496162965893745, 0.016596974804997444, 0.01750498265028, 0.023859413340687752, 0.05147441104054451, -0.05628193914890289, -0.04234737902879715, 0.029595093801617622, -0.04908858612179756, 0.09010489284992218, 0.025756601244211197, -0.014586437493562698, 0.0412919819355011, 0.018540889024734497, -0.026745034381747246, -0.044457245618104935, 0.011541172862052917, -0.048848558217287064, -0.0001030729035846889, -0.005652924068272114, -0.055235981941223145, -0.06835775822401047, 0.007735079154372215, -0.02410617098212242, -0.04128639027476311, 0.002956135431304574, -0.022211212664842606, -0.02359803020954132, 0.03636099025607109, 0.05732116475701332, 0.08113545924425125, -0.05873693525791168, -0.022983398288488388, 0.04443632811307907, 0.0834236890077591, -0.12339404225349426, 0.0077585941180586815, -0.07661181688308716, 0.08576523512601852, -0.007545492146164179, 0.011866149492561817, 0.019749971106648445, 0.03512825444340706, -0.060374531894922256, 0.057293135672807693, -0.0016843728953972459, 0.03790673241019249, 0.07192517071962357, 0.04879629984498024, 0.06845735758543015, -0.007556764408946037, -0.03464999794960022, 0.05493510141968727, -0.031349558383226395, -0.009440185502171516, -0.011652051471173763, 0.05657040700316429, -0.03914978727698326, 0.0327303372323513, 0.07539750635623932, -0.024971220642328262, 0.11278808861970901, -0.021769292652606964, 0.020474979653954506, 0.1162923127412796, 0.08426360040903091, -0.07020356506109238, -0.05093070864677429, 0.009811470285058022, -0.05242038518190384, -0.03926325961947441, 0.053111813962459564, 1.0999908058326365e-32, -0.03296392783522606, -0.12838062644004822, 0.03839658200740814, 0.015947643667459488, 0.06166921928524971, 0.01294473186135292, 0.013263082131743431, -0.010636855848133564, -0.04923013970255852, 0.013490102253854275, -0.08658456057310104, 0.038043323904275894, 0.015872487798333168, -0.04040447622537613, -0.02042428031563759, -0.08710344135761261, 0.09565433859825134, 0.019996650516986847, 0.028563974425196648, -0.00636166101321578, 0.04088015481829643, 0.06613782048225403, -0.0030591688118875027, -0.040653686970472336, -0.008953974582254887, -0.02076302282512188, -0.051880184561014175, -0.0012841630959883332, 0.04349188134074211, 0.002275644103065133, 0.0487932451069355, 0.1251405030488968, -0.03601549565792084, -0.015103873796761036, 0.004605791997164488, -0.057093676179647446, 0.037168070673942566, 0.023036321625113487, -0.09940982609987259, -0.06886164098978043, -0.04545040428638458, 0.009466699324548244, -0.04419523477554321, -0.08354616165161133, -0.09177009016275406, -0.11745947599411011, -0.05334560573101044, -0.08368553966283798, -0.02457675151526928, 0.021520381793379784, 0.03943231329321861, 0.0771494060754776, 0.03236525505781174, -0.042288150638341904, -0.007735040038824081, -0.022480899468064308, 0.07229439914226532, 0.006822660565376282, -0.021403774619102478, 0.06154434010386467, 0.04876166954636574, 0.0162851270288229, 0.01696312054991722, -0.011865786276757717, 0.06770364940166473, -0.027970094233751297, -0.04519154503941536, 0.038862235844135284, -0.013222796842455864, 0.06893002241849899, -0.03995740786194801, -0.0087008411064744, 0.024556053802371025, 0.010131379589438438, -0.0026950279716402292, -0.0052548921667039394, -0.06489790230989456, -0.011147033423185349, -0.1325596123933792, -0.02450958825647831, 0.07668199390172958, 0.005028493702411652, -0.016381213441491127, -0.028080200776457787, -0.02903996780514717, -0.029711786657571793, -0.05989483371376991, -0.05581801012158394, 0.00012209768465254456, 0.05013710632920265, 0.02386827953159809, -0.010063118301331997, 0.034141525626182556, -0.020139988511800766, -0.1732443869113922, -1.3124617770857496e-32, 0.004958076868206263, 0.05194651335477829, -0.05361372232437134, 0.024774864315986633, -0.01674525998532772, -0.029854832217097282, -0.0015907103661447763, 0.03718207776546478, -0.06663231551647186, 0.022860726341605186, 0.047563716769218445, -0.0065613421611487865, 0.017611732706427574, 0.09797114878892899, 0.017486335709691048, 0.022031234577298164, -0.01872408576309681, 0.011017036624252796, 0.01923256926238537, 0.02091360092163086, -0.06123337149620056, 0.12731242179870605, 0.05599987506866455, 0.0031275376677513123, -0.02228521928191185, 0.005726933013647795, -0.0158530343323946, 0.0038489336147904396, -0.029204197227954865, -0.07339046895503998, -0.021135590970516205, 0.014634043909609318, -0.08568063378334045, 0.030629940330982208, 0.012283027172088623, -0.03985682874917984, -0.03212079033255577, 0.10269594937562943, 0.03701106458902359, -0.0380207858979702, 0.11526229977607727, 0.04286988452076912, -0.004319608211517334, 0.04174674302339554, 0.03873497620224953, 0.001227482920512557, -0.030440445989370346, -0.050690267235040665, 0.005314127542078495, 0.004702004138380289, 0.03966573253273964, -0.032491590827703476, 0.050160735845565796, 0.03940381482243538, -0.03509833663702011, -0.03134860843420029, 0.042617879807949066, -0.051327649503946304, 0.04117479920387268, -0.032559070736169815, 0.0572245754301548, -0.14969170093536377, -0.13316640257835388, -0.026067374274134636, 0.07542097568511963, 0.002376778284087777, -0.0761493444442749, -0.01240219734609127, 0.09035307168960571, -0.06897372752428055, 0.03736903890967369, 0.07496960461139679, -0.043595634400844574, 0.0057024480774998665, -0.02967991679906845, -0.012360162101686, 0.01801837608218193, -0.1496465504169464, -0.02159891091287136, 0.03868652135133743, -0.08956611901521683, 0.0526270717382431, -0.05974854528903961, -0.00849493220448494, -0.033636897802352905, -0.010587134398519993, -0.05049511790275574, 0.034211937338113785, 0.004174449015408754, -0.016867652535438538, -0.04742477834224701, 0.047182030975818634, -0.13560695946216583, 0.04523002356290817, 0.011011455208063126, -6.437826272076563e-8, -0.0484047532081604, -0.011465406976640224, -0.04925476759672165, 0.031186828389763832, 0.05264478921890259, -0.018105758354067802, 0.0060312398709356785, -0.058359093964099884, -0.006502077914774418, 0.038837455213069916, -0.019703345373272896, -0.038465071469545364, -0.006445219740271568, -0.05653221905231476, 0.07124663144350052, 0.003760659834370017, -0.03282420337200165, 0.02916381135582924, 0.007093085907399654, -0.04892684891819954, 0.013525118120014668, -0.02170536294579506, -0.021825624629855156, 0.08071865886449814, -0.06551142781972885, -0.035199329257011414, 0.034737009555101395, 0.08021171391010284, -0.07376337796449661, -0.01684516668319702, -0.04899320378899574, 0.013952435925602913, 0.024712951853871346, -0.02629144676029682, -0.10601754486560822, 0.09270969033241272, -0.04446619749069214, -0.00028117187321186066, 0.05442602187395096, -0.005527008790522814, 0.0023336249869316816, 0.06347911804914474, -0.035124268382787704, 0.07684846967458725, -0.0042344145476818085, 0.040163204073905945, -0.017030110582709312, 0.06455624103546143, 0.025356922298669815, -0.02088940143585205, 0.01003434881567955, -0.02372840605676174, -0.03246745839715004, 0.013560100458562374, 0.01661510393023491, -0.021752819418907166, 0.007796924095600843, -0.04550599306821823, -0.013742447830736637, 0.05758361145853996, 0.08557537198066711, 0.023799369111657143, -0.0329257994890213, -0.0381036214530468 ]
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 && 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}`); } } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.setgroups(groups)` \* `groups` {integer\[]} The `process.setgroups()` method sets the supplementary group IDs for the Node.js process. This is a privileged operation that requires the Node.js process to have `root` or the `CAP\_SETGID` capability. The `groups` array can contain numeric group IDs, group names, or both. ```mjs import process from 'node:process'; if (process.getgroups && process.setgroups) { try { process.setgroups([501]); console.log(process.getgroups()); // new groups } catch (err) { console.error(`Failed to set groups: ${err}`); } } ``` ```cjs const process = require('node:process'); if (process.getgroups && process.setgroups) { try { process.setgroups([501]); console.log(process.getgroups()); // new groups } catch (err) { console.error(`Failed to set groups: ${err}`); } } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.setuid(id)` \* `id` {integer | string} The `process.setuid(id)` method sets the user identity of the process. (See setuid(2).) The `id` can be passed as either a numeric ID or a username string. If a username is specified, the method blocks while resolving the associated numeric ID. ```mjs import process from 'node:process'; if (process.getuid && process.setuid) { console.log(`Current uid: ${process.getuid()}`); try { process.setuid(501); console.log(`New uid: ${process.getuid()}`); } catch (err) { console.error(`Failed to set uid: ${err}`); } } ``` ```cjs const process = require('node:process'); if (process.getuid && process.setuid) { console.log(`Current uid: ${process.getuid()}`); try { process.setuid(501); console.log(`New uid: ${process.getuid()}`); } catch (err) { console.error(`Failed to set uid: ${err}`); } } ``` This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. ## `process.setSourceMapsEnabled(val)` > Stability: 1 - Experimental: Use [`module.setSourceMapsSupport()`][] instead. \* `val` {boolean} This function enables or disables the [Source Map][] support for stack traces. It provides same features as launching Node.js process with commandline options `--enable-source-maps`. Only source maps in JavaScript files that are loaded after source maps has been enabled will be parsed and loaded. This implies calling `module.setSourceMapsSupport()` with an option `{ nodeModules: true, generatedCode: true }`. ## `process.setUncaughtExceptionCaptureCallback(fn)` \* `fn` {Function|null} The `process.setUncaughtExceptionCaptureCallback()` function sets a function that will be invoked when an uncaught exception occurs, which will receive the exception value itself as its first argument. If such a function is set, the [`'uncaughtException'`][] event will not be emitted. If `--abort-on-uncaught-exception` was passed from the command line or set through [`v8.setFlagsFromString()`][], the process will not abort. Actions configured to take place on exceptions such as report generations will be affected too To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this method with a non-`null` argument while another capture function is set will throw an error. Using this function is mutually exclusive with using the deprecated [`domain`][] built-in module. ## `process.sourceMapsEnabled` > Stability: 1 - Experimental: Use [`module.getSourceMapsSupport()`][] instead. \* Type: {boolean} The `process.sourceMapsEnabled` property returns whether the [Source Map][] support for stack traces is enabled. ## `process.stderr` \* 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
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.007043762598186731, 0.0729188546538353, -0.058814290910959244, -0.015729853883385658, 0.051628053188323975, -0.045311082154512405, -0.005091328639537096, 0.03790387138724327, -0.012410364113748074, 0.01646444760262966, -0.006303818430751562, -0.04192933812737465, -0.09712521731853485, -0.03573235496878624, -0.042630065232515335, 0.046365611255168915, 0.015528162941336632, 0.028994712978601456, -0.011718837544322014, -0.13286852836608887, 0.02363496460020542, 0.004624313209205866, 0.15832695364952087, -0.06250370293855667, -0.13920612633228302, -0.03675457835197449, -0.003033533226698637, 0.015363000333309174, 0.0827682614326477, -0.05250515788793564, -0.02886924520134926, 0.022088805213570595, -0.041549429297447205, -0.08815731108188629, 0.024563923478126526, -0.08505962789058685, -0.055849529802799225, -0.030177626758813858, -0.010741367004811764, 0.0002468405873514712, -0.05028029531240463, 0.01015531551092863, 0.033882636576890945, -0.001733327517285943, 0.008770434185862541, 0.059794362634420395, 0.11094443500041962, -0.024815600365400314, -0.07609493285417557, 0.02640705555677414, -0.045504070818424225, 0.02844170108437538, -0.023739954456686974, -0.0738128200173378, -0.04456133022904396, 0.014724468812346458, -0.010341096669435501, -0.009341352619230747, -0.026145795360207558, -0.02784111723303795, -0.021147970110177994, -0.05899178236722946, -0.021073874086141586, 0.019424594938755035, -0.024417726323008537, -0.08671355247497559, -0.01471648458391428, -0.009805365465581417, -0.006885618437081575, -0.00599667290225625, 0.01644059084355831, 0.04540880396962166, 0.12343334406614304, 0.009258417412638664, 0.08560894429683685, 0.056882478296756744, 0.03446461632847786, -0.1153423935174942, -0.009015357121825218, -0.06976267695426941, 0.06202803924679756, 0.03754418343305588, 0.009658554568886757, 0.035706643015146255, 0.04249211773276329, -0.03094366192817688, 0.009334532544016838, 0.03122752346098423, 0.03741275146603584, 0.10011844336986542, -0.03686213120818138, 0.04136764258146286, -0.05576150119304657, -0.03338209167122841, 0.030913623049855232, 0.021516500040888786, -0.06072389706969261, -0.005735698156058788, 0.04691605269908905, 0.017589233815670013, -0.005536125041544437, -0.016009071841835976, 0.05769362673163414, 0.0876796692609787, -0.0322604700922966, 0.048286620527505875, 0.06551285088062286, 0.08659004420042038, -0.04813855513930321, 0.026398660615086555, -0.008503940887749195, -0.02622670866549015, -0.05333101376891136, 0.06794309616088867, 4.308911837005851e-34, 0.040508076548576355, -0.14530345797538757, -0.01414006482809782, 0.007233479991555214, 0.024974916130304337, 0.029740436002612114, -0.05888744443655014, -0.04264931380748749, -0.08043013513088226, -0.01228194311261177, 0.04344077780842781, -0.06725163012742996, -0.06017819792032242, -0.04364374279975891, 0.01409192569553852, -0.002148037776350975, 0.08395561575889587, -0.06248072162270546, 0.07936695218086243, 0.0031977680046111345, 0.009752420708537102, -0.02736450545489788, -0.055594224482774734, 0.01166943646967411, 0.050208814442157745, 0.017049552872776985, -0.06872645765542984, 0.02310582995414734, 0.03960108011960983, -0.03183116763830185, 0.111087366938591, 0.024196328595280647, -0.026261620223522186, 0.03960951417684555, 0.0004301439330447465, -0.03169383853673935, -0.06406809389591217, 0.03450110927224159, -0.11361467093229294, -0.10318899154663086, 0.023398587480187416, 0.015257666818797588, -0.04836061969399452, 0.055820342153310776, 0.06447593122720718, -0.12077659368515015, -0.08525702357292175, -0.029676957055926323, 0.03897831588983536, 0.017071222886443138, 0.016445888206362724, 0.1358073204755783, 0.05431913956999779, -0.04089859873056412, 0.038299500942230225, 0.004319699481129646, -0.024841537699103355, -0.0523243173956871, -0.01803547330200672, -0.015876999124884605, 0.08106711506843567, -0.02870335802435875, -0.03875276818871498, 0.018377719447016716, 0.024033941328525543, -0.0411660298705101, -0.024618729948997498, -0.011068545281887054, -0.014200515113770962, 0.05930182337760925, -0.050565022975206375, -0.08509556949138641, -0.001383025897666812, 0.03794780373573303, -0.010007984936237335, -0.043347109109163284, -0.010565949603915215, -0.05155587196350098, -0.018053164705634117, -0.07660914957523346, -0.010050622746348381, -0.019567685201764107, -0.05588582158088684, 0.08806763589382172, 0.04368136450648308, 0.040277983993291855, -0.051374517381191254, 0.06491455435752869, -0.004170062020421028, 0.08504034578800201, 0.021850835531949997, 0.037724386900663376, 0.00011927002196898684, 0.007700659334659576, -0.05277257040143013, -4.484737598391545e-33, -0.04650210216641426, -0.017860600724816322, -0.08170811831951141, 0.044183552265167236, -0.05661585181951523, -0.07063659280538559, 0.026261674240231514, -0.0880340039730072, 0.03813650459051132, -0.0029215854592621326, -0.053527697920799255, 0.022993357852101326, 0.05157572776079178, 0.08930986374616623, -0.02523432858288288, 0.05446099489927292, -0.1095559298992157, -0.018623000010848045, 0.024832045659422874, 0.05989385023713112, -0.024123208597302437, 0.07213304936885834, 0.07255244255065918, 0.08628272265195847, -0.06474778801202774, 0.0550028532743454, -0.024951307103037834, -0.06395021826028824, -0.09996558725833893, -0.04576824605464935, -0.01764002814888954, 0.041399117559194565, -0.11207808554172516, 0.12492780387401581, 0.043883685022592545, -0.12060133367776871, 0.0034935774747282267, 0.06152211129665375, -0.008876408450305462, 0.03725389391183853, 0.077672578394413, 0.045794688165187836, -0.04198639094829559, 0.008493795059621334, 0.007721287198364735, 0.03164069727063179, 0.09513990581035614, -0.0032882895320653915, 0.006466630380600691, -0.005306966137140989, -0.014379243366420269, -0.03683027625083923, 0.08310186117887497, 0.0011391891166567802, 0.019367609173059464, -0.01850872114300728, 0.06445400416851044, -0.030384672805666924, 0.0008233232074417174, 0.014059135690331459, 0.021406495943665504, -0.0891014114022255, -0.030474381521344185, -0.017667314037680626, -0.03645111992955208, 0.011297035031020641, -0.11256449669599533, 0.061554066836833954, 0.08656753599643707, -0.009002532809972763, 0.03384691849350929, 0.08160393685102463, -0.05384526401758194, -0.060121193528175354, -0.04822167381644249, 0.027105126529932022, -0.015134615823626518, -0.10520649701356888, 0.03579479828476906, 0.04475083574652672, 0.021396048367023468, 0.09548307210206985, -0.04569132626056671, -0.04559030756354332, 0.0040146587416529655, 0.008691506460309029, -0.02777387760579586, 0.008454921655356884, -0.028168607503175735, -0.0362878181040287, 0.02656383626163006, 0.03517312556505203, -0.05395184084773064, -0.011421909555792809, -0.030577179044485092, -5.011969150814366e-8, -0.0608714260160923, -0.004374632611870766, -0.04887508973479271, -0.10523708909749985, 0.03961848467588425, -0.044546738266944885, 0.04855549708008766, -0.029986416921019554, -0.011996831744909286, -0.018285177648067474, -0.04381611570715904, 0.05509043484926224, 0.03525002673268318, 0.03248141333460808, 0.04824021831154823, -0.06672537326812744, 0.01563877798616886, 0.09040757268667221, -0.016943434253335, 0.042707305401563644, -0.04107312485575676, 0.013075320981442928, 0.0018690278520807624, 0.07804238051176071, -0.05845636501908302, -0.08835596591234207, 0.07785666733980179, 0.08864354342222214, -0.05964100733399391, 0.008314995095133781, -0.017660601064562798, 0.025706760585308075, 0.06461459398269653, 0.01945449598133564, -0.006639794446527958, 0.05724220722913742, 0.0020796998869627714, 0.007516189012676477, 0.04732935130596161, -0.0045453691855072975, 0.0660625547170639, 0.00013914407463744283, 0.00674463203176856, 0.01863710954785347, -0.10610081255435944, -0.007431330159306526, 0.03051909990608692, -0.020169731229543686, 0.038279540836811066, 0.019806915894150734, 0.006125045940279961, -0.005513187497854233, -0.022971948608756065, 0.0369006022810936, 0.03456781432032585, 0.05127773433923721, 0.022386685013771057, -0.07904455810785294, -0.03534037619829178, -0.01385582610964775, 0.029582591727375984, 0.04111010581254959, 0.028467707335948944, -0.0012245244579389691 ]
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][] for more information. ### `process.stderr.fd` \* Type: {number} This property refers to the value of underlying file descriptor of `process.stderr`. The value is fixed at `2`. In [`Worker`][] threads, this field does not exist. ## `process.stdin` \* Type: {Stream} The `process.stdin` property returns a stream connected to `stdin` (fd `0`). It is a [`net.Socket`][] (which is a [Duplex][] stream) unless fd `0` refers to a file, in which case it is a [Readable][] stream. For details of how to read from `stdin` see [`readable.read()`][]. As a [Duplex][] stream, `process.stdin` can also be used in "old" mode that is compatible with scripts written for Node.js prior to v0.10. For more information see [Stream compatibility][]. In "old" streams mode the `stdin` stream is paused by default, so one must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. ### `process.stdin.fd` \* Type: {number} This property refers to the value of underlying file descriptor of `process.stdin`. The value is fixed at `0`. In [`Worker`][] threads, this field does not exist. ## `process.stdout` \* Type: {Stream} The `process.stdout` property returns a stream connected to `stdout` (fd `1`). It is a [`net.Socket`][] (which is a [Duplex][] stream) unless fd `1` refers to a file, in which case it is a [Writable][] stream. For example, to copy `process.stdin` to `process.stdout`: ```mjs import { stdin, stdout } from 'node:process'; stdin.pipe(stdout); ``` ```cjs const { stdin, stdout } = require('node:process'); stdin.pipe(stdout); ``` `process.stdout` differs from other Node.js streams in important ways. See [note on process I/O][] for more information. ### `process.stdout.fd` \* Type: {number} This property refers to the value of underlying file descriptor of `process.stdout`. The value is fixed at `1`. In [`Worker`][] threads, this field does not exist. ### A note on process I/O `process.stdout` and `process.stderr` differ from other Node.js streams in important ways: 1. They are used internally by [`console.log()`][] and [`console.error()`][], respectively. 2. Writes may be synchronous depending on what the stream is connected to and whether the system is Windows or POSIX: \* Files: \_synchronous\_ on Windows and POSIX \* TTYs (Terminals): \_asynchronous\_ on Windows, \_synchronous\_ on POSIX \* Pipes (and sockets): \_synchronous\_ on Windows, \_asynchronous\_ on POSIX These behaviors are partly for historical reasons, as changing them would create backward incompatibility, but they are also expected by some users. Synchronous writes avoid problems such as output written with `console.log()` or `console.error()` being unexpectedly interleaved, or not written at all if `process.exit()` is called before an asynchronous write completes. See [`process.exit()`][] for more information. \_\*\*Warning\*\*\_: Synchronous writes block the event loop until the write has completed. This can be near instantaneous in the case of output to a file, but under high system load, pipes that are not being read at the receiving end, or with slow terminals or file systems, it's possible for the event loop to be blocked often enough and long enough to have severe negative performance impacts. This may not be a problem when writing to an interactive 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.isTTY)" false $ node -p
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.029589161276817322, -0.007879715412855148, -0.08560163527727127, -0.02882344275712967, -0.06994489580392838, 0.044315021485090256, -0.08075544983148575, 0.002976330928504467, 0.06145114451646805, 0.0030116883572191, -0.024970443919301033, -0.020564263686537743, 0.003190485527738929, -0.044506147503852844, -0.01834365352988243, 0.04972075670957565, 0.007090861443430185, 0.03980967774987221, 0.03293827548623085, -0.0965043157339096, 0.029679439961910248, -0.0165561530739069, 0.10440828651189804, 0.036523349583148956, -0.08517501503229141, -0.11916757375001907, 0.07487058639526367, 0.10988825559616089, 0.03413066267967224, -0.02751263603568077, -0.06069618836045265, -0.07186281681060791, 0.061954423785209656, -0.05013957992196083, -0.03330640494823456, -0.0963413417339325, -0.07093629986047745, -0.03761890158057213, 0.060652878135442734, -0.045491382479667664, 0.05741559714078903, 0.0821109414100647, -0.0409933477640152, -0.010808675549924374, -0.034210436046123505, -0.021024327725172043, 0.03914501518011093, -0.01649480313062668, 0.009668941609561443, 0.05719833821058273, -0.030514221638441086, 0.058116547763347626, 0.005870708264410496, -0.03580290451645851, 0.025385046377778053, 0.030473915860056877, -0.04328366369009018, -0.001662741182371974, 0.036096151918172836, -0.04937877878546715, -0.017255598679184914, -0.04377727955579758, -0.11944235861301422, -0.005653094034641981, 0.004559927619993687, -0.0012415189994499087, 0.03757995367050171, -0.06396538764238358, -0.08227434009313583, 0.01150804478675127, 0.04190416261553764, -0.04521035775542259, 0.07308226078748703, -0.03407362103462219, -0.010336452163755894, 0.06899202615022659, 0.08163575828075409, -0.11551643908023834, 0.015945298597216606, -0.0639520063996315, 0.11182814836502075, 0.03492879495024681, 0.06275250017642975, 0.03061080351471901, 0.07700399309396744, -0.04318051412701607, 0.02597831003367901, -0.034959279000759125, 0.024608885869383812, 0.08079397678375244, -0.038228798657655716, 0.05870576947927475, -0.03723742440342903, -0.03270798176527023, 0.02729451283812523, 0.009253246709704399, -0.08539769053459167, 0.012643668800592422, -0.0024962301831692457, 0.01769142597913742, 0.03156745433807373, 0.012703120708465576, -0.023979470133781433, 0.005291403736919165, 0.0003640041686594486, 0.0449041873216629, 0.12356173247098923, 0.10375982522964478, -0.0086281206458807, -0.04457380622625351, 0.03017358109354973, 0.030949709936976433, -0.045128852128982544, 0.020125655457377434, -8.585129319024496e-34, -0.025453727692365646, -0.06724369525909424, 0.024240609258413315, 0.04608386009931564, 0.04385073110461235, -0.004674750380218029, -0.022174818441271782, 0.05589877814054489, -0.02256256528198719, 0.027439430356025696, -0.04382864013314247, -0.013066324405372143, -0.02135148085653782, 0.02862684428691864, 0.013686135411262512, -0.07628387957811356, 0.07317011058330536, 0.010719461366534233, 0.04915906861424446, -0.02237558737397194, 0.11698563396930695, 0.05884358659386635, -0.08478802442550659, 0.02692364528775215, 0.004716941155493259, -0.024079276248812675, -0.05157018080353737, -0.056440677493810654, 0.03584200516343117, -0.007836787961423397, 0.00026640910073183477, 0.021946096792817116, 0.046312734484672546, -0.021601581946015358, 0.04948356747627258, -0.0492854043841362, 0.019146818667650223, -0.023207979276776314, -0.08382061868906021, -0.08885638415813446, 0.0015699167270213366, -0.0070966314524412155, -0.09010761231184006, 0.004509728401899338, -0.0070918286219239235, -0.07812780141830444, -0.07464399188756943, -0.01021517999470234, -0.014310571365058422, 0.013981806114315987, 0.036958448588848114, 0.07026724517345428, 0.09165752679109573, 0.04125192016363144, 0.03141367435455322, -0.03000650741159916, 0.06583207845687866, 0.06110542640089989, -0.00821454543620348, 0.08307769149541855, 0.019215289503335953, 0.060559067875146866, -0.032611507922410965, -0.015462382696568966, 0.07391370087862015, -0.014553395099937916, 0.059921812266111374, -0.0010276330867782235, 0.04535334184765816, 0.03326569125056267, -0.11003519594669342, 0.06129177659749985, -0.04352758452296257, 0.007796057965606451, 0.036280784755945206, 0.03690238669514656, -0.022779908031225204, -0.048520609736442566, -0.026351403445005417, -0.00532558374106884, -0.05534561350941658, -0.03256368264555931, -0.04456386715173721, 0.043228138238191605, -0.0388149656355381, 0.012800099328160286, -0.04456267133355141, -0.049972087144851685, 0.07615742832422256, 0.004924406297504902, 0.038204826414585114, -0.046963151544332504, 0.0002538546978030354, -0.08038520812988281, -0.055242184549570084, -2.6248663957586905e-33, -0.05194540321826935, -0.05676115304231644, -0.12784582376480103, 0.06974583864212036, -0.0019470518454909325, -0.04930323734879494, 0.000320114369969815, -0.03444847837090492, 0.049674760550260544, -0.034023985266685486, -0.0042579285800457, 0.005389247555285692, -0.004607833921909332, 0.03441542387008667, 0.04697873443365097, 0.015876539051532745, -0.0838451087474823, -0.027335304766893387, 0.016171347349882126, 0.010288766585290432, -0.043089400976896286, 0.021129440516233444, 0.12159686535596848, -0.001499631442129612, -0.02775651589035988, 0.02091127447783947, 0.008857067674398422, -0.010529185645282269, -0.058082226663827896, -0.04629916325211525, 0.004075481556355953, -0.023718278855085373, -0.028512414544820786, 0.015075921081006527, -0.0665634423494339, -0.03265101835131645, 0.0382428802549839, 0.04162893816828728, 0.07120776176452637, -0.04513800889253616, 0.16116109490394592, 0.037411414086818695, 0.010127805173397064, 0.005479387938976288, 0.04574665427207947, 0.021338051185011864, -0.02577497810125351, -0.006790328770875931, -0.005012458190321922, -0.014064475893974304, 0.01955677755177021, 0.024999046698212624, 0.00033665430964902043, 0.030083443969488144, -0.04159079119563103, -0.017496027052402496, 0.07236035168170929, -0.04112901911139488, -0.036446165293455124, 0.01547083631157875, 0.09105116873979568, -0.09035059064626694, -0.06934802234172821, 0.06330806016921997, 0.02255401574075222, -0.10667451471090317, -0.040899306535720825, -0.05505520850419998, 0.07144235074520111, -0.05137345939874649, 0.06351833790540695, 0.004315969999879599, -0.0314314067363739, 0.02976127527654171, -0.019209083169698715, 0.003233875846490264, 0.018517374992370605, 0.020439716055989265, -0.027320919558405876, 0.10121987015008926, -0.05826541408896446, 0.09068780392408371, -0.0020674187690019608, 0.0439600795507431, 0.02708393707871437, -0.00149739277549088, 0.06106482446193695, -0.02092805504798889, -0.015268741175532341, -0.07002022117376328, 0.014755035750567913, 0.02722945436835289, -0.11915774643421173, -0.017347073182463646, -0.07025559991598129, -4.637531247908555e-8, -0.0596742182970047, -0.06782068312168121, -0.10314326733350754, -0.026708004996180534, 0.05516049638390541, -0.03364832326769829, -0.042042605578899384, -0.03838533163070679, 0.017242124304175377, 0.06710230559110641, -0.016173236072063446, -0.0625840499997139, -0.009384244680404663, -0.09725765883922577, 0.1287645399570465, 0.008888226933777332, 0.024696212261915207, -0.02498561143875122, -0.023117205128073692, -0.051586586982011795, 0.06247343122959137, -0.04186036065220833, -0.04149077460169792, 0.08674120903015137, -0.09479030966758728, -0.027205590158700943, 0.10458497703075409, 0.04043053463101387, -0.053789589554071426, -0.005602903664112091, -0.028551310300827026, 0.05344301834702492, 0.07518506050109863, 0.031140947714447975, 0.003052511252462864, 0.05760137736797333, -0.02408529818058014, 0.028609201312065125, 0.02535710483789444, 0.08793220669031143, -0.03503205627202988, 0.017195649445056915, -0.05412673577666283, 0.014483487233519554, -0.00937960110604763, 0.022274617105722427, -0.01021688524633646, -0.012414444237947464, -0.017758920788764954, -0.025383958593010902, 0.014112820848822594, 0.04054494574666023, -0.015300273895263672, 0.054324422031641006, -0.05383683741092682, 0.04393872991204262, -0.03624027222394943, -0.08481059968471527, -0.08505144715309143, -0.03464408218860626, 0.07020996510982513, 0.06792857497930527, 0.04787008836865425, 0.02246035449206829 ]
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.isTTY)" false $ node -p "Boolean(process.stdout.isTTY)" true $ node -p "Boolean(process.stdout.isTTY)" | cat false ``` See the [TTY][] documentation for more information. ## `process.throwDeprecation` \* Type: {boolean} The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the [`'warning'` event][process\_warning] and the [`emitWarning()` method][process\_emit\_warning] for more information. ```console $ node --throw-deprecation -p "process.throwDeprecation" true $ node -p "process.throwDeprecation" undefined $ node > process.emitWarning('test', 'DeprecationWarning'); undefined > (node:26598) DeprecationWarning: test > process.throwDeprecation = true; true > process.emitWarning('test', 'DeprecationWarning'); Thrown: [DeprecationWarning: test] { name: 'DeprecationWarning' } ``` ## `process.threadCpuUsage([previousValue])` \* `previousValue` {Object} A previous return value from calling `process.threadCpuUsage()` \* Returns: {Object} \* `user` {integer} \* `system` {integer} The `process.threadCpuUsage()` method returns the user and system CPU time usage of the current worker thread, in an object with properties `user` and `system`, whose values are microsecond values (millionth of a second). The result of a previous call to `process.threadCpuUsage()` can be passed as the argument to the function, to get a diff reading. ## `process.title` \* Type: {string} The `process.title` property returns the current process title (i.e. returns the current value of `ps`). Assigning a new value to `process.title` modifies the current value of `ps`. When a new value is assigned, different platforms will impose different maximum length restrictions on the title. Usually such restrictions are quite limited. For instance, on Linux and macOS, `process.title` is limited to the size of the binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js 0.8 allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) cases. Assigning a value to `process.title` might not result in an accurate label within process manager applications such as macOS Activity Monitor or Windows Services Manager. ## `process.traceDeprecation` \* Type: {boolean} The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the documentation for the [`'warning'` event][process\_warning] and the [`emitWarning()` method][process\_emit\_warning] for more information about this flag's behavior. ## `process.traceProcessWarnings` \* {boolean} The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag is set on the current Node.js process. This property allows programmatic control over the tracing of warnings, enabling or disabling stack traces for warnings at runtime. ```js // Enable trace warnings process.traceProcessWarnings = true; // Emit a warning with a stack trace process.emitWarning('Warning with stack trace'); // Disable trace warnings process.traceProcessWarnings = false; ``` ## `process.umask()` > Stability: 0 - Deprecated. Calling `process.umask()` with no argument causes > the process-wide umask to be written twice. This introduces a race condition > between threads, and is a potential security vulnerability. There is no safe, > cross-platform alternative API. `process.umask()` returns the Node.js process's file mode creation mask. Child processes inherit the mask from the parent process. ## `process.umask(mask)` \* `mask` {string|integer} `process.umask(mask)` sets the Node.js process's file 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 } = require('node:process'); const newmask =
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.010299690067768097, -0.039059579372406006, -0.0781286284327507, -0.027632679790258408, 0.006427432876080275, 0.00035267951898276806, -0.09719698131084442, 0.049043022096157074, -0.006905938498675823, -0.02462751604616642, 0.03909233957529068, -0.06486958265304565, 0.012431577779352665, -0.0044609904289245605, -0.017679423093795776, -0.017205724492669106, -0.011278877966105938, -0.12030375748872757, 0.03219425305724144, -0.08815723657608032, -0.015375143848359585, 0.026615221053361893, 0.08895616978406906, 0.06746247410774231, -0.060034770518541336, -0.021740060299634933, -0.047024063766002655, 0.08854693174362183, -0.010360279120504856, -0.09887204319238663, -0.024608034640550613, -0.03391381353139877, -0.026492303237318993, -0.14296911656856537, -0.051177021116018295, -0.127121239900589, -0.050282470881938934, 0.014894116669893265, 0.013473673723638058, 0.07209190726280212, -0.01781599037349224, -0.0067295231856405735, 0.06382410228252411, 0.003952526953071356, 0.02484179474413395, -0.010254391469061375, 0.05958744138479233, -0.05044940486550331, -0.02807961218059063, -0.05637644603848457, -0.016708243638277054, 0.07759916037321091, 0.0585302859544754, 0.010541246272623539, 0.023949390277266502, 0.06135004758834839, 0.08716221898794174, -0.050243083387613297, -0.03377348557114601, -0.10850675404071808, -0.03926878795027733, -0.07928751409053802, -0.01896284893155098, 0.040280118584632874, -0.044009532779455185, -0.09564827382564545, 0.013029839843511581, -0.028225738555192947, 0.023892834782600403, 0.010362371802330017, -0.02536168321967125, -0.03906302899122238, 0.14431510865688324, -0.01573425531387329, 0.007426365278661251, 0.07009759545326233, 0.036736320704221725, -0.11722492426633835, -0.07653544098138809, -0.01232342142611742, 0.062367863953113556, 0.04549792408943176, 0.09364119172096252, -0.017868749797344208, 0.0034676287323236465, 0.000814099155832082, 0.032351091504096985, 0.03370295464992523, 0.0454668328166008, 0.03158682957291603, -0.03826156631112099, 0.0929965227842331, -0.02574373222887516, 0.003130038036033511, -0.04517184570431709, 0.03901654854416847, 0.0019906337838619947, 0.04884006455540657, 0.039773210883140564, 0.0547642819583416, 0.0062148007564246655, 0.011524063535034657, 0.03231129050254822, 0.04981657862663269, 0.02320309728384018, 0.0402463898062706, 0.10778532922267914, 0.10670892149209976, 0.027604924514889717, 0.01806001551449299, 0.07759364694356918, 0.05692931264638901, -0.10229836404323578, 0.0398109033703804, 4.022903133026746e-33, 0.048359185457229614, -0.07003520429134369, 0.04688936099410057, 0.021785203367471695, 0.06730388849973679, 0.06995955109596252, 0.0028491681441664696, -0.015383102931082249, 0.014816143549978733, 0.0005811470909975469, -0.0325692854821682, 0.013771130703389645, -0.0508013591170311, -0.07595746219158173, 0.037418827414512634, 0.0040634991601109505, 0.05103264003992081, 0.005245573353022337, 0.0705188512802124, 0.06565699726343155, 0.042887844145298004, -0.07893656939268112, -0.05301821976900101, -0.0026739039458334446, 0.036203548312187195, -0.03647677227854729, -0.09257245063781738, -0.006571777630597353, -0.002332650125026703, 0.0011388283455744386, -0.0007437269086949527, 0.045600078999996185, 0.007417281158268452, 0.026597067713737488, 0.031138649210333824, -0.12168844789266586, -0.02820548415184021, 0.02550826407968998, -0.036769673228263855, -0.007710869424045086, -0.03577293083071709, 0.023904917761683464, -0.055347152054309845, 0.027834724634885788, -0.010102313943207264, -0.11533422023057938, -0.04048443213105202, -0.0506417453289032, 0.013207848183810711, -0.01291541289538145, 0.04677930101752281, 0.10806217789649963, 0.07880991697311401, 0.0099696209654212, 0.015555054880678654, -0.049403078854084015, 0.06413547694683075, -0.07065289467573166, -0.027336537837982178, 0.05697381868958473, 0.06814008951187134, 0.007691696751862764, -0.05979069322347641, -0.03282926604151726, 0.026861801743507385, 0.04040658846497536, -0.03587869927287102, 0.00994849856942892, 0.03825177997350693, -0.05070460960268974, -0.15401749312877655, -0.019850043579936028, -0.006760032381862402, 0.007489464245736599, 0.053928084671497345, 0.008955229073762894, -0.021003853529691696, 0.029675832018256187, 0.033027127385139465, -0.03714245557785034, 0.06700756400823593, -0.072296142578125, -0.051016464829444885, 0.05820925161242485, 0.029175853356719017, 0.016852062195539474, -0.04492036625742912, -0.05540437623858452, -0.02429346926510334, 0.07501319795846939, 0.0065541137009859085, 0.02734922431409359, 0.04623257368803024, -0.001768286689184606, -0.043957870453596115, -6.242481851824959e-33, -0.025097230449318886, 0.022633986547589302, -0.059662025421857834, 0.08341526985168457, -0.0740247517824173, -0.07720766216516495, 0.004536674357950687, -0.05717236548662186, -0.0011218661675229669, -0.0449935682117939, -0.009150216355919838, 0.03498583659529686, 0.002694482449442148, 0.1045873761177063, -0.060022350400686264, 0.03485289588570595, -0.04204091429710388, -0.06323231011629105, 0.038930363953113556, -0.05308380350470543, 0.052361391484737396, 0.01937483437359333, 0.03142743557691574, 0.0026618661358952522, -0.020567236468195915, -0.030516555532813072, 0.043049752712249756, -0.040386952459812164, -0.06306386739015579, -0.08467787504196167, 0.04571916162967682, 0.07485289871692657, -0.0028264657594263554, 0.07632572203874588, 0.03423931077122688, -0.07398929446935654, 0.008965171873569489, 0.06023789569735527, 0.01931610144674778, 0.02751312218606472, 0.09065797924995422, 0.07874973863363266, -0.051327675580978394, -0.01664969138801098, -0.040090519934892654, -0.0026829824782907963, -0.007902459241449833, -0.015445150434970856, 0.023650504648685455, 0.022919896990060806, -0.009036896750330925, -0.025582944974303246, 0.030322495847940445, 0.06047946214675903, -0.03969752416014671, -0.09665820002555847, 0.019661961123347282, -0.03160608932375908, -0.06382144242525101, 0.03841901943087578, 0.030647549778223038, -0.06270871311426163, -0.03127196431159973, -0.013749158009886742, -0.01787625066936016, -0.06478826701641083, -0.025764109566807747, 0.06298185884952545, 0.12574169039726257, 0.01588975265622139, 0.07820943742990494, 0.005190767347812653, -0.07496834546327591, 0.012464292347431183, -0.05895504355430603, 0.004084568005055189, 0.0015433862572535872, -0.1485319435596466, -0.021531857550144196, 0.06233334168791771, -0.051561061292886734, 0.06997022032737732, -0.044267430901527405, 0.0026436951011419296, 0.02507340908050537, 0.05834522098302841, 0.011825469322502613, 0.05216190591454506, -0.00875338539481163, 0.04196716845035553, 0.014571985229849815, 0.057128556072711945, -0.16680845618247986, -0.04910743236541748, -0.0527411513030529, -5.262537428052383e-8, -0.06498800963163376, -0.05923662334680557, -0.08717597275972366, 0.004828484263271093, 0.05818979814648628, -0.031060433015227318, 0.05338198319077492, -0.03781544044613838, 0.010556502267718315, -0.03297652676701546, -0.06006528064608574, -0.019295770674943924, 0.009670538827776909, -0.036631353199481964, 0.05771587789058685, 0.019371498376131058, 0.026732822880148888, 0.008006099611520767, -0.02629884146153927, -0.00541856000199914, 0.010986032895743847, 0.03435021638870239, -0.06027182564139366, 0.06093795970082283, -0.09247364848852158, -0.07993627339601517, 0.0675685852766037, 0.09639289975166321, -0.052737757563591, -0.05149279907345772, 0.021812407299876213, 0.041160859167575836, 0.04206698387861252, 0.016408788040280342, -0.007933585904538631, 0.07126057893037796, -0.009848091751337051, -0.021836213767528534, -0.02119474671781063, 0.037253499031066895, 0.013985160738229752, 0.03318314999341965, -0.015959613025188446, 0.04226510226726532, -0.04715847596526146, -0.001665416406467557, 0.03295755386352539, 0.03323163092136383, 0.026567701250314713, -0.058106716722249985, 0.0068825650960206985, 0.07889103889465332, -0.058561183512210846, 0.05004121735692024, 0.006860253866761923, -0.01121605932712555, 0.004064067266881466, -0.03067028895020485, -0.02771434560418129, 0.013022241182625294, 0.04462215304374695, -0.046391699463129044, 0.052281565964221954, -0.04827544465661049 ]
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 } = require('node:process'); const newmask = 0o022; const oldmask = umask(newmask); console.log( `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}`, ); ``` In [`Worker`][] threads, `process.umask(mask)` will throw an exception. ## `process.unref(maybeRefable)` > Stability: 1 - Experimental \* `maybeRefable` {any} An object that may be "unref'd". An object is "unrefable" if it implements the Node.js "Refable protocol". Specifically, this means that the object implements the `Symbol.for('nodejs.ref')` and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js event loop alive, while "unref'd" objects will not. Historically, this was implemented by using `ref()` and `unref()` methods directly on the objects. This pattern, however, is being deprecated in favor of the "Refable protocol" in order to better support Web Platform API types whose APIs cannot be modified to add `ref()` and `unref()` methods but still need to support that behavior. ## `process.uptime()` \* Returns: {number} The `process.uptime()` method returns the number of seconds the current Node.js process has been running. The return value includes fractions of a second. Use `Math.floor()` to get whole seconds. ## `process.version` \* Type: {string} The `process.version` property contains the Node.js version string. ```mjs import { version } from 'node:process'; console.log(`Version: ${version}`); // Version: v14.8.0 ``` ```cjs const { version } = require('node:process'); console.log(`Version: ${version}`); // Version: v14.8.0 ``` To get the version string without the prepended \_v\_, use `process.versions.node`. ## `process.versions` \* Type: {Object} The `process.versions` property returns an object listing the version strings of Node.js and its dependencies. `process.versions.modules` indicates the current ABI version, which is increased whenever a C++ API changes. Node.js will refuse to load modules that were compiled against a different module ABI version. ```mjs import { versions } from 'node:process'; console.log(versions); ``` ```cjs const { versions } = require('node:process'); console.log(versions); ``` Will generate an object similar to: ```console { node: '26.0.0-pre', acorn: '8.15.0', ada: '3.4.1', amaro: '1.1.5', ares: '1.34.6', brotli: '1.2.0', merve: '1.0.0', cldr: '48.0', icu: '78.2', llhttp: '9.3.0', modules: '144', napi: '10', nbytes: '0.1.1', ncrypto: '0.0.1', nghttp2: '1.68.0', nghttp3: '', ngtcp2: '', openssl: '3.5.4', simdjson: '4.2.4', simdutf: '7.3.3', sqlite: '3.51.2', tz: '2025c', undici: '7.18.2', unicode: '17.0', uv: '1.51.0', uvwasi: '0.0.23', v8: '14.3.127.18-node.10', zlib: '1.3.1-e00f703', zstd: '1.5.7' } ``` ## Exit codes Node.js will normally exit with a `0` status code when no more async operations are pending. The following status codes are used in other cases: \* `1` \*\*Uncaught Fatal Exception\*\*: There was an uncaught exception, and it was not handled by a domain or an [`'uncaughtException'`][] event handler. \* `2`: Unused (reserved by Bash for builtin misuse) \* `3` \*\*Internal JavaScript Parse Error\*\*: The JavaScript source code internal in the Node.js bootstrapping process caused a parse error. This is extremely rare, and generally can only happen during development of Node.js itself. \* `4` \*\*Internal JavaScript Evaluation Failure\*\*: The JavaScript source code internal in the Node.js bootstrapping process failed to return a function value when evaluated. This is extremely rare, and generally can only happen during development of Node.js itself. \* `5` \*\*Fatal Error\*\*: There was a fatal unrecoverable error in V8. Typically a message will be printed to stderr with 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, and the internal fatal exception
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.0009296938078477979, 0.0020553090143948793, 0.06464645266532898, -0.03492971882224083, 0.08765658736228943, -0.0011148841585963964, -0.09801894426345825, 0.0865483358502388, -0.021750014275312424, 0.03513621166348457, -0.05509302020072937, 0.004581926856189966, -0.03693503886461258, -0.03888443857431412, 0.0034669847227633, 0.08499312400817871, -0.06401948630809784, 0.046238094568252563, -0.0015138996532186866, -0.03632423281669617, -0.007605744991451502, -0.004933326039463282, 0.1624155193567276, 0.005756107624620199, -0.07624807208776474, -0.005141322035342455, 0.005270938854664564, 0.00007429895049426705, 0.1669795960187912, -0.07544611394405365, -0.01510863658040762, 0.011544127948582172, -0.001137969782575965, -0.034058332443237305, -0.04735782742500305, -0.06360302865505219, 0.006872998550534248, 0.01561460830271244, -0.01780572533607483, -0.029506459832191467, -0.03891749680042267, -0.026949137449264526, -0.0662030279636383, -0.026282208040356636, -0.0029352984856814146, 0.018638884648680687, 0.02809194289147854, 0.023301569744944572, -0.04256056994199753, 0.020426498726010323, -0.026927877217531204, 0.03572335094213486, -0.017293639481067657, -0.02522321417927742, -0.009122741408646107, 0.03620374575257301, 0.027720993384718895, 0.013920526951551437, -0.005440190434455872, -0.057392463088035583, 0.029525216668844223, -0.0004602393019013107, 0.011978186666965485, -0.05038968846201897, 0.015033258125185966, -0.025935359299182892, 0.012490146793425083, 0.033994775265455246, 0.03320053964853287, -0.030993349850177765, -0.032687295228242874, 0.006685732863843441, 0.025730453431606293, -0.025650303810834885, 0.01546547468751669, 0.034165158867836, 0.02445918135344982, -0.10294772684574127, 0.005966502707451582, -0.030632564797997475, 0.08291077613830566, 0.0711015909910202, -0.05220939591526985, 0.0383562333881855, 0.09917043894529343, -0.02246835269033909, 0.06761080771684647, -0.012654779478907585, -0.013115968555212021, -0.0586714968085289, 0.019288191571831703, 0.05251092091202736, -0.04623623564839363, -0.016123652458190918, 0.016141243278980255, -0.07971245795488358, -0.0018106675706803799, -0.023066623136401176, 0.10322152078151703, 0.004436984658241272, 0.05324335768818855, 0.0029921545647084713, -0.02110511250793934, 0.03733264282345772, 0.0069872671738266945, 0.011772146448493004, 0.20108050107955933, 0.08832129091024399, 0.009706446900963783, -0.018776044249534607, 0.01699582114815712, -0.027002934366464615, -0.03754780441522598, 0.007337448187172413, 5.212047177313988e-33, -0.003750886768102646, -0.05783838778734207, -0.024923168122768402, 0.026202600449323654, 0.071402408182621, 0.005544397979974747, 0.06027303636074066, 0.0003245625121053308, -0.04736284911632538, 0.012159360572695732, 0.02281220816075802, 0.020803028717637062, -0.09554465860128403, -0.09152577817440033, -0.055442553013563156, -0.04823761060833931, 0.10978064686059952, -0.005206560716032982, 0.0634303092956543, -0.056122224777936935, -0.03274025022983551, 0.12486013770103455, -0.0821971446275711, 0.023066099733114243, 0.07462067157030106, 0.006470543798059225, -0.03341535106301308, -0.027911890298128128, 0.0008916810620576143, 0.021158896386623383, 0.017120540142059326, 0.026694010943174362, -0.005890145432204008, 0.04888380318880081, -0.07976517826318741, 0.021639863029122353, 0.07930439710617065, 0.028870292007923126, -0.05662919208407402, -0.12574779987335205, 0.054624516516923904, 0.015367184765636921, -0.05213511362671852, -0.005978734698146582, -0.05478518083691597, -0.12680092453956604, -0.10454317927360535, 0.03817255049943924, -0.03366050124168396, 0.01440136693418026, 0.02650793269276619, 0.054209329187870026, -0.0029538855887949467, -0.09186060726642609, -0.0607929527759552, -0.05691537261009216, -0.02662801928818226, 0.020673656836152077, 0.01064961776137352, -0.057796917855739594, 0.06509433686733246, 0.036442387849092484, -0.0439612902700901, 0.09606438875198364, -0.003026888705790043, -0.049929287284612656, -0.009383819997310638, -0.007613201625645161, -0.012802746146917343, 0.020553749054670334, -0.08033455908298492, 0.012903647497296333, -0.12270811945199966, 0.01888229511678219, -0.06325623393058777, -0.0690591037273407, -0.049122072756290436, 0.002144383965060115, -0.08434195071458817, -0.044734567403793335, 0.06660214811563492, 0.029790356755256653, -0.07427064329385757, -0.04737497493624687, -0.055298179388046265, 0.004834907129406929, -0.017042074352502823, 0.03191763907670975, 0.02993299439549446, 0.04882318153977394, 0.05356050655245781, -0.07852551341056824, 0.06718521565198898, 0.02792183868587017, -0.012564362026751041, -7.14912962435465e-33, 0.00920948851853609, -0.010288605466485023, -0.012428372167050838, 0.04777723550796509, -0.05393654480576515, -0.05017922446131706, 0.0053617460653185844, 0.037484798580408096, -0.04270630329847336, 0.002070736140012741, -0.08506406098604202, -0.027141885831952095, 0.024289513006806374, 0.02406277135014534, -0.009171041660010815, 0.00772853335365653, -0.04668405279517174, 0.08212940394878387, 0.026851912960410118, 0.029378555715084076, -0.07532703876495361, 0.12413185834884644, 0.07102177292108536, -0.0224467720836401, -0.053548261523246765, 0.02542315609753132, -0.05665863677859306, 0.04488622769713402, -0.004639509133994579, -0.030784256756305695, -0.05362433195114136, 0.01022981945425272, -0.022997748106718063, 0.09716589748859406, -0.003060148796066642, -0.10354260355234146, -0.023122265934944153, 0.1053490936756134, 0.027679594233632088, -0.03044179640710354, 0.055433787405490875, 0.02399342693388462, -0.014029649086296558, 0.05387677997350693, 0.03382476046681404, 0.066010981798172, 0.061772752553224564, -0.044370245188474655, 0.0635552704334259, -0.06588279455900192, 0.023508749902248383, -0.04701344668865204, 0.03351783752441406, -0.01582898013293743, -0.016805749386548996, 0.06970619410276413, 0.002616728888824582, -0.08798510581254959, 0.04292534664273262, -0.011703410185873508, 0.06580200046300888, -0.11923369765281677, -0.033415745943784714, -0.040874674916267395, 0.0425109937787056, 0.014003189280629158, -0.1538051813840866, 0.060419775545597076, 0.023884465917944908, 0.013716215267777443, 0.048908792436122894, 0.054655056446790695, -0.0172562412917614, -0.01474787201732397, -0.0027473538648337126, -0.03861423581838608, -0.004542987793684006, -0.07368502020835876, -0.04736380651593208, 0.055131230503320694, -0.11331035196781158, 0.02927960827946663, -0.03309217840433121, 0.05628938227891922, 0.022406604140996933, 0.002303896937519312, 0.05565738305449486, 0.03241541236639023, -0.015895426273345947, -0.02096433751285076, 0.011220063082873821, 0.030353235080838203, -0.10684788227081299, -0.04367223381996155, 0.02748170681297779, -5.4303058050209074e-8, -0.014771615155041218, -0.07247520238161087, -0.054411839693784714, 0.06079865247011185, 0.05175521597266197, -0.06491128355264664, -0.06461040675640106, 0.03244664892554283, 0.0561281219124794, -0.020085491240024567, -0.0434347465634346, 0.03787801414728165, 0.03436427563428879, -0.038040224462747574, 0.007659221533685923, -0.031248383224010468, 0.003517373465001583, 0.036010924726724625, 0.04224342852830887, -0.022464293986558914, -0.0624370202422142, -0.0014164252206683159, 0.04893973842263222, 0.0832342579960823, -0.05525286868214607, -0.01824495568871498, 0.09075657278299332, 0.034719984978437424, -0.014521164819598198, 0.09816594421863556, -0.06317143887281418, 0.00902817863970995, 0.016762645915150642, 0.07718419283628464, -0.07533448934555054, -0.016850464046001434, -0.034730251878499985, -0.018516739830374718, 0.04846243932843208, -0.025471532717347145, 0.04333137720823288, 0.022248730063438416, -0.024813955649733543, 0.06416396051645279, -0.0681316927075386, -0.0703464150428772, 0.039362575858831406, -0.003284342586994171, 0.02180555649101734, -0.02340484969317913, 0.04365208372473717, -0.003096184926107526, -0.07077968120574951, -0.020639585331082344, 0.05887564644217491, 0.018125776201486588, 0.06056882441043854, -0.01871025376021862, -0.026148123666644096, 0.018315888941287994, 0.060013435781002045, 0.0151735944673419, 0.05421176180243492, -0.03237173333764076 ]
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, and the internal fatal exception handler function itself threw an error while attempting to handle it. This can happen, for example, if an [`'uncaughtException'`][] or `domain.on('error')` handler throws an error. \* `8`: Unused. In previous versions of Node.js, exit code 8 sometimes indicated an uncaught exception. \* `9` \*\*Invalid Argument\*\*: Either an unknown option was specified, or an option requiring a value was provided without a value. \* `10` \*\*Internal JavaScript Run-Time Failure\*\*: The JavaScript source code internal in the Node.js bootstrapping process threw an error when the bootstrapping function was called. This is extremely rare, and generally can only happen during development of Node.js itself. \* `12` \*\*Invalid Debug Argument\*\*: The `--inspect` and/or `--inspect-brk` options were set, but the port number chosen was invalid or unavailable. \* `13` \*\*Unsettled Top-Level Await\*\*: `await` was used outside of a function in the top-level code, but the passed `Promise` never settled. \* `14` \*\*Snapshot Failure\*\*: Node.js was started to build a V8 startup snapshot and it failed because certain requirements of the state of the application were not met. \* `>128` \*\*Signal Exits\*\*: If Node.js receives a fatal signal such as `SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the value of the signal code. This is a standard POSIX practice, since exit codes are defined to be 7-bit integers, and signal exits set the high-order bit, and then contain the value of the signal code. For example, signal `SIGABRT` has value `6`, so the expected exit code will be `128` + `6`, or `134`. [Advanced serialization for `child\_process`]: child\_process.md#advanced-serialization [Android building]: https://github.com/nodejs/node/blob/HEAD/BUILDING.md#android [Child Process]: child\_process.md [Cluster]: cluster.md [Duplex]: stream.md#duplex-and-transform-streams [Event Loop]: https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#understanding-processnexttick [LTS]: https://github.com/nodejs/Release [Permission Model]: permissions.md#permission-model [Readable]: stream.md#readable-streams [Signal Events]: #signal-events [Source Map]: https://tc39.es/ecma426/ [Stream compatibility]: stream.md#compatibility-with-older-nodejs-versions [TTY]: tty.md#tty [Writable]: stream.md#writable-streams [`'exit'`]: #event-exit [`'message'`]: child\_process.md#event-message [`'uncaughtException'`]: #event-uncaughtexception [`--no-deprecation`]: cli.md#--no-deprecation [`--permission`]: cli.md#--permission [`--unhandled-rejections`]: cli.md#--unhandled-rejectionsmode [`Buffer`]: buffer.md [`ChildProcess.disconnect()`]: child\_process.md#subprocessdisconnect [`ChildProcess.send()`]: child\_process.md#subprocesssendmessage-sendhandle-options-callback [`ChildProcess`]: child\_process.md#class-childprocess [`Error`]: errors.md#class-error [`EventEmitter`]: events.md#class-eventemitter [`NODE\_OPTIONS`]: cli.md#node\_optionsoptions [`Worker`]: worker\_threads.md#class-worker [`Worker` constructor]: worker\_threads.md#new-workerfilename-options [`console.error()`]: console.md#consoleerrordata-args [`console.log()`]: console.md#consolelogdata-args [`domain`]: domain.md [`module.getSourceMapsSupport()`]: module.md#modulegetsourcemapssupport [`module.isBuiltin(id)`]: module.md#moduleisbuiltinmodulename [`module.setSourceMapsSupport()`]: module.md#modulesetsourcemapssupportenabled-options [`net.Server`]: net.md#class-netserver [`net.Socket`]: net.md#class-netsocket [`os.constants.dlopen`]: os.md#dlopen-constants [`postMessageToThread()`]: worker\_threads.md#worker\_threadspostmessagetothreadthreadid-value-transferlist-timeout [`process.argv`]: #processargv [`process.config`]: #processconfig [`process.execPath`]: #processexecpath [`process.exit()`]: #processexitcode [`process.exitCode`]: #processexitcode\_1 [`process.hrtime()`]: #processhrtimetime [`process.hrtime.bigint()`]: #processhrtimebigint [`process.kill()`]: #processkillpid-signal [`process.setUncaughtExceptionCaptureCallback()`]: #processsetuncaughtexceptioncapturecallbackfn [`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Promise/catch [`queueMicrotask()`]: globals.md#queuemicrotaskcallback [`readable.read()`]: stream.md#readablereadsize [`require()`]: globals.md#require [`require.cache`]: modules.md#requirecache [`require.main`]: modules.md#accessing-the-main-module [`subprocess.kill()`]: child\_process.md#subprocesskillsignal [`v8.setFlagsFromString()`]: v8.md#v8setflagsfromstringflags [built-in modules with mandatory `node:` prefix]: modules.md#built-in-modules-with-mandatory-node-prefix [debugger]: debugger.md [deprecation code]: deprecations.md [loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require [nodejs/node#21973]: https://github.com/nodejs/node/issues/21973 [note on process I/O]: #a-note-on-process-io [process.cpuUsage]: #processcpuusagepreviousvalue [process\_emit\_warning]: #processemitwarningwarning-type-code-ctor [process\_warning]: #event-warning [program entry point]: https://nodejs.org/api/cli.html#program-entry-point [report documentation]: report.md [terminal raw mode]: tty.md#readstreamsetrawmodemode [uv\_get\_available\_memory]: https://docs.libuv.org/en/v1.x/misc.html#c.uv\_get\_available\_memory [uv\_get\_constrained\_memory]: https://docs.libuv.org/en/v1.x/misc.html#c.uv\_get\_constrained\_memory [uv\_rusage\_t]: https://docs.libuv.org/en/v1.x/misc.html#c.uv\_rusage\_t [wikipedia\_major\_fault]: https://en.wikipedia.org/wiki/Page\_fault#Major [wikipedia\_minor\_fault]: https://en.wikipedia.org/wiki/Page\_fault#Minor
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.048937439918518066, 0.033522240817546844, 0.014195841737091541, -0.06688673049211502, -0.046325214207172394, -0.06619476526975632, 0.05523291975259781, -0.01888171024620533, 0.05015319213271141, -0.030043434351682663, 0.0013402575859799981, -0.05106506869196892, -0.07904403656721115, -0.06438692659139633, -0.05236810818314552, 0.01596319116652012, 0.02982141077518463, -0.005024174228310585, -0.02585788629949093, -0.0920778438448906, -0.04334578663110733, 0.03585003688931465, 0.10336963832378387, -0.00816955603659153, -0.05449835956096649, -0.05582019314169884, -0.0072995563969016075, 0.006158848293125629, 0.06521671265363693, -0.02836918644607067, -0.012088466435670853, 0.03367950767278671, -0.09294652193784714, -0.06612952053546906, -0.03997332230210304, -0.03748555853962898, 0.01692839153110981, -0.0023155747912824154, 0.02008994296193123, 0.041262436658144, -0.007110064383596182, 0.037214960902929306, -0.05589628592133522, -0.05691635236144066, -0.023020809516310692, 0.040974099189043045, 0.15092559158802032, 0.031510233879089355, -0.022951317951083183, 0.01776408962905407, -0.019411077722907066, 0.03717435151338577, -0.013226794078946114, 0.03909420967102051, -0.0834144726395607, -0.04513182491064072, 0.1218322366476059, -0.02164146490395069, 0.0074264174327254295, -0.11382167786359787, 0.1158560961484909, 0.002064358675852418, 0.028223678469657898, 0.00029798096511512995, -0.05613132566213608, -0.04431005194783211, -0.017732661217451096, 0.02255137823522091, -0.022208400070667267, -0.009293184615671635, 0.04941892996430397, 0.0331803597509861, 0.10737277567386627, -0.08351710438728333, -0.000439430121332407, 0.08613903820514679, 0.03488689661026001, -0.1341032236814499, -0.04348074272274971, -0.014657353051006794, 0.07294569909572601, 0.0057045165449380875, -0.04370616376399994, 0.036594733595848083, 0.020730318501591682, -0.05823010578751564, -0.0320148840546608, 0.0032866448163986206, -0.022271201014518738, -0.022882575169205666, -0.034672241657972336, 0.0648408979177475, -0.0008853749604895711, -0.020623279735445976, -0.021916378289461136, 0.01355407852679491, -0.04969124123454094, -0.025737173855304718, 0.019535746425390244, 0.004333166405558586, -0.09310811758041382, 0.04099182039499283, -0.021848639473319054, 0.01267713587731123, -0.06350862234830856, 0.10456917434930801, 0.10749861598014832, 0.0695851519703865, 0.05000010132789612, 0.050936050713062286, -0.013792818412184715, 0.017385059967637062, -0.029208030551671982, 0.004776726011186838, 1.5545098897540052e-34, -0.00016620616952423006, -0.0628969669342041, 0.026284417137503624, 0.04377442225813866, 0.07487660646438599, -0.012743066065013409, -0.06753718107938766, -0.03218034654855728, -0.06336887925863266, 0.028330674394965172, 0.08075213432312012, -0.06791265308856964, 0.04182180017232895, -0.07680975645780563, 0.08440589904785156, 0.006405089050531387, 0.08941172808408737, -0.0041640144772827625, 0.02115544117987156, -0.00455953273922205, -0.009568804875016212, 0.017296090722084045, -0.010933117009699345, 0.05094049125909805, -0.019304592162370682, 0.09353742003440857, -0.000515557883772999, 0.038800448179244995, 0.07649528980255127, 0.0010289843194186687, -0.004929665010422468, -0.003798657562583685, 0.014485154300928116, 0.04998611658811569, 0.054215919226408005, -0.0020982895512133837, -0.00795845314860344, 0.014925052411854267, -0.09164860844612122, 0.012040374800562859, -0.09906237572431564, 0.050519488751888275, -0.06674056500196457, 0.02564578503370285, 0.04126819595694542, -0.14090636372566223, 0.011361513286828995, -0.010470835492014885, 0.06539174169301987, -0.005589245818555355, -0.09944279491901398, 0.07228973507881165, 0.1397237628698349, -0.028250765055418015, 0.01566111296415329, 0.037623800337314606, 0.02735799178481102, -0.038176484405994415, -0.020078297704458237, 0.019072066992521286, 0.04673996940255165, -0.0027323910035192966, -0.022564033046364784, -0.03429903835058212, -0.016069207340478897, -0.027393469586968422, -0.01536479126662016, -0.0003507607616484165, -0.04789084196090698, -0.029101325199007988, -0.015458948910236359, -0.005696692503988743, 0.03334302455186844, 0.020558349788188934, 0.06543216854333878, -0.06684773415327072, -0.007936674170196056, -0.038284625858068466, -0.010856939479708672, -0.023628508672118187, 0.014172399416565895, -0.08221476525068283, -0.03321016579866409, 0.04878997057676315, -0.02389528602361679, 0.07946060597896576, -0.01081399992108345, 0.036324940621852875, -0.02133633941411972, 0.06238754838705063, 0.08208167552947998, -0.009341029450297356, -0.09409017860889435, -0.049774449318647385, -0.049713268876075745, -4.69461623725911e-33, -0.05697895959019661, 0.0740429237484932, -0.09726442396640778, 0.036829955875873566, -0.024423478171229362, -0.09569907188415527, -0.0035941284149885178, 0.007746032904833555, 0.01790635474026203, -0.08616568893194199, -0.05065888538956642, 0.03126570209860802, 0.023694710806012154, 0.04767884314060211, -0.016397370025515556, 0.027627333998680115, -0.13406260311603546, -0.036063555628061295, 0.03009115159511566, -0.023365523666143417, 0.07281381636857986, -0.019451798871159554, -0.019166935235261917, 0.03636185824871063, -0.08222849667072296, 0.008015388622879982, -0.041497137397527695, 0.00022590250591747463, -0.09587353467941284, -0.04832984507083893, 0.051431141793727875, 0.05617189407348633, -0.004229807294905186, 0.11179361492395401, 0.04361610859632492, -0.08860041201114655, -0.011152110062539577, -0.04975141957402229, 0.011798426508903503, -0.12362802773714066, 0.03573502600193024, 0.022411826997995377, 0.0779830664396286, -0.018047872930765152, 0.0333118736743927, -0.016235997900366783, -0.051558900624513626, -0.0021209251135587692, 0.002734615933150053, 0.023483289405703545, -0.11493571847677231, -0.07107861340045929, -0.02336660772562027, 0.07231159508228302, -0.0381811261177063, 0.01804390549659729, -0.014260854572057724, 0.03190482407808304, 0.0896836593747139, 0.028514575213193893, 0.017300494015216827, -0.012122309766709805, -0.04830826073884964, 0.019690416753292084, -0.011310618370771408, 0.013181756250560284, -0.06846024096012115, 0.01916814036667347, 0.03507449850440025, -0.00621487433090806, -0.05798505246639252, 0.025443188846111298, -0.08283825218677521, -0.057774052023887634, -0.060737792402505875, 0.03979097679257393, 0.006299263332039118, -0.08871866017580032, 0.002837513340637088, 0.06335948407649994, -0.020397664979100227, 0.031877946108579636, -0.002170789521187544, 0.061048172414302826, 0.011330299079418182, -0.00048809792497195303, -0.007735018618404865, 0.06743154674768448, -0.023568566888570786, -0.014713508076965809, 0.03789699077606201, 0.026160214096307755, -0.046057768166065216, 0.014028203673660755, -0.05290906876325607, -5.2682018747418624e-8, -0.0635925829410553, 0.037496909499168396, -0.08256114274263382, -0.12098723649978638, 0.07235661149024963, -0.07180465012788773, 0.03031487576663494, 0.0027487240731716156, 0.023288479074835777, 0.06955231726169586, -0.03156779333949089, 0.06145184114575386, -0.028652217239141464, -0.024070043116807938, -0.029768573120236397, -0.05908717215061188, -0.004994269926100969, 0.11662030220031738, -0.007573776412755251, 0.010804243385791779, -0.025996249169111252, -0.03102085180580616, 0.007112269755452871, -0.01187144499272108, -0.0493607223033905, -0.019770842045545578, 0.024758482351899147, 0.07590073347091675, -0.017068639397621155, -0.03204354643821716, -0.08083926141262054, 0.04403676837682724, 0.022926589474081993, -0.0416686125099659, -0.10028170049190521, 0.12289933115243912, 0.04476947709918022, -0.0009304320556111634, 0.006424038205295801, -0.0299260001629591, 0.027559585869312286, 0.01095536071807146, 0.015567037276923656, 0.026247093454003334, -0.024486949667334557, 0.018648410215973854, -0.02648095414042473, 0.08111365884542465, 0.06683241575956345, -0.04152601957321167, -0.0019522462971508503, 0.040673185139894485, -0.06957528740167618, 0.0413895882666111, 0.036778006702661514, -0.008169464766979218, -0.043518975377082825, -0.06446496397256851, -0.029253307729959488, -0.01771971583366394, 0.11186043918132782, 0.021023504436016083, 0.05564142391085625, 0.00681060366332531 ]
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 > served by the stable [`AsyncLocalStorage`][] API. If you have a use case for > `createHook`, `AsyncHook`, or `executionAsyncResource` beyond the context > tracking need solved by [`AsyncLocalStorage`][] or diagnostics data currently > provided by [Diagnostics Channel][], please open an issue at > describing your use case so we can > create a more purpose-focused API. We strongly discourage the use of the `async\_hooks` API. Other APIs that can cover most of its use cases include: \* [`AsyncLocalStorage`][] tracks async context \* [`process.getActiveResourcesInfo()`][] tracks active resources The `node:async\_hooks` module provides an API to track asynchronous resources. It can be accessed using: ```mjs import async\_hooks from 'node:async\_hooks'; ``` ```cjs const async\_hooks = require('node:async\_hooks'); ``` ## Terminology An asynchronous resource represents an object with an associated callback. This callback may be called multiple times, such as the `'connection'` event in `net.createServer()`, or just a single time like in `fs.open()`. A resource can also be closed before the callback is called. `AsyncHook` does not explicitly distinguish between these different cases but will represent them as the abstract concept that is a resource. If [`Worker`][]s are used, each thread has an independent `async\_hooks` interface, and each thread will use a new set of async IDs. ## Overview Following is a simple overview of the public API. ```mjs import async\_hooks from 'node:async\_hooks'; // Return the ID of the current execution context. const eid = async\_hooks.executionAsyncId(); // Return the ID of the handle responsible for triggering 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. This is not an implicit // action after running the constructor, and must be explicitly run to begin // executing callbacks. asyncHook.enable(); // Disable listening for new asynchronous events. asyncHook.disable(); // // The following are the callbacks that can be passed to createHook(). // // init() is called during object construction. The resource may not have // completed construction when this callback runs. Therefore, all fields of the // resource referenced by "asyncId" may not have been populated. function init(asyncId, type, triggerAsyncId, resource) { } // before() is called just before the resource's callback is called. It can be // called 0-N times for handles (such as TCPWrap), and will be called exactly 1 // time for requests (such as FSReqCallback). function before(asyncId) { } // after() is called just after the resource's callback has finished. function after(asyncId) { } // destroy() is called when the resource is destroyed. function destroy(asyncId) { } // promiseResolve() is called only for promise resources, when the // resolve() function passed to the Promise constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ``` ```cjs const async\_hooks = require('node:async\_hooks'); // Return the ID of the current execution context. const eid = async\_hooks.executionAsyncId(); // Return the ID of the handle responsible for triggering 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. This is not an implicit
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.08388910442590714, -0.04493050277233124, 0.0464220754802227, 0.11254318058490753, -0.023865148425102234, -0.0842684730887413, -0.040587667375802994, -0.04841221496462822, -0.014893481507897377, 0.04439013451337814, 0.0575164370238781, -0.022947968915104866, -0.06624359637498856, -0.04211125150322914, -0.11925554275512695, 0.003392508951947093, -0.010559991002082825, 0.025890283286571503, -0.07178299129009247, -0.10382132232189178, 0.035956788808107376, -0.006601301487535238, 0.06566077470779419, 0.035768624395132065, -0.03371229022741318, -0.025170665234327316, -0.016988331452012062, 0.07937264442443848, -0.00009742043766891584, -0.09606138616800308, 0.0007515805773437023, -0.040460336953401566, -0.0871964767575264, -0.027422282844781876, -0.030226822942495346, -0.08246197551488876, 0.04350383207201958, -0.027083635330200195, 0.007407878525555134, -0.034719403833150864, 0.03517908602952957, -0.010148783214390278, 0.035688575357198715, 0.04661848768591881, 0.06210467591881752, -0.06257392466068268, 0.04346414655447006, 0.03974267467856407, -0.03664396330714226, -0.07607222348451614, 0.03860919550061226, -0.016811983659863472, 0.06634839624166489, 0.021256783977150917, -0.011409731581807137, 0.08948886394500732, 0.001000954769551754, -0.07103203982114792, 0.03052101843059063, -0.0043613058514893055, 0.018036440014839172, 0.020871751010417938, 0.017253033816814423, -0.0283818356692791, -0.00528700789436698, -0.014618911780416965, -0.09158561378717422, 0.030368542298674583, -0.033267177641391754, -0.04172316938638687, -0.0378071665763855, 0.023189786821603775, 0.07982690632343292, -0.002955266973003745, -0.006227449979633093, -0.00004502398951444775, 0.02227061614394188, -0.0005671046092174947, 0.040882520377635956, -0.042684271931648254, -0.023594951257109642, 0.082484170794487, 0.05466342344880104, 0.023125557228922844, 0.012127820402383804, 0.002099767327308655, 0.02448369562625885, 0.008568581193685532, 0.018825825303792953, -0.029549777507781982, 0.10329186171293259, 0.0489443838596344, -0.03199608996510506, 0.0147428372874856, -0.07577523589134216, -0.04544105753302574, 0.03927363082766533, -0.019481990486383438, 0.0513065867125988, 0.028269173577427864, 0.058644942939281464, 0.06361394375562668, 0.06713021546602249, 0.044550925493240356, -0.007609900552779436, 0.03466416522860527, 0.08237797021865845, 0.14757509529590607, -0.028574328869581223, 0.028990039601922035, -0.07244905084371567, 0.031178010627627373, 0.04688148573040962, 0.004142868332564831, 6.748708494006577e-33, 0.036170557141304016, -0.02632864937186241, 0.0011892244219779968, -0.01075628399848938, -0.008397416211664677, 0.04215896874666214, 0.015009441412985325, -0.009410844184458256, 0.008297340013086796, -0.0302459504455328, 0.03143817558884621, -0.027353256940841675, -0.03743647411465645, -0.07338763028383255, 0.010337063111364841, -0.07482887804508209, 0.015576006844639778, 0.043230943381786346, 0.015750037506222725, 0.0504620335996151, -0.010723710991442204, -0.06325899064540863, -0.09433060139417648, -0.010051033459603786, 0.04701694846153259, -0.02150805853307247, -0.026278676465153694, 0.0846356749534607, -0.04964509606361389, 0.049985840916633606, -0.0134504409506917, 0.016559084877371788, -0.08036699146032333, 0.03252580016851425, -0.05733731389045715, -0.03747940808534622, -0.10278971493244171, -0.02610265463590622, -0.01098662056028843, -0.06320545822381973, -0.030918030068278313, 0.0072861239314079285, -0.08793552964925766, -0.004547605756670237, -0.0947844386100769, -0.09129099547863007, -0.09118753671646118, 0.004698185250163078, 0.012925982475280762, -0.027954263612627983, 0.017841486260294914, 0.04388677701354027, 0.007416990119963884, -0.08268988877534866, 0.03039493039250374, -0.02499162033200264, 0.005704325158149004, -0.041823092848062515, 0.018160846084356308, 0.10134594887495041, 0.03391198813915253, -0.07742440700531006, -0.040251780301332474, -0.0334516279399395, 0.05114636942744255, 0.013921776786446571, -0.028451038524508476, 0.020288558676838875, -0.04033516347408295, -0.026355823501944542, -0.0386185497045517, 0.01918923668563366, -0.03328860551118851, 0.030472032725811005, 0.02828306332230568, -0.012405063956975937, -0.04545585811138153, 0.03502997010946274, -0.06932245939970016, -0.07503273338079453, 0.11104946583509445, 0.001120038446970284, -0.0441703125834465, 0.0826684907078743, 0.004193292930722237, 0.023884346708655357, -0.03764551877975464, -0.07030756771564484, -0.07557550817728043, 0.08110691606998444, 0.015140128321945667, 0.011097307316958904, 0.03629496693611145, -0.03890550136566162, -0.019952265545725822, -7.290361597186102e-33, 0.05243105813860893, -0.05616636574268341, -0.060338541865348816, 0.015693893656134605, 0.011053101159632206, 0.0021927242632955313, 0.012677165679633617, -0.005011400673538446, -0.05755336582660675, -0.04001383110880852, -0.03907549008727074, 0.00909010972827673, -0.04807417839765549, 0.06702856719493866, 0.08148036152124405, 0.01921035721898079, 0.02370886504650116, -0.09556357562541962, 0.08409998565912247, 0.02640695869922638, 0.02014194056391716, 0.06813652813434601, -0.019245686009526253, 0.03145553171634674, -0.055762290954589844, -0.06233428418636322, -0.031898338347673416, 0.021128252148628235, 0.009202650748193264, -0.031456973403692245, 0.018467778339982033, 0.0029786359518766403, -0.036900248378515244, 0.02823280170559883, 0.01871592178940773, -0.030804362148046494, 0.04538101330399513, 0.02353445626795292, -0.019635245203971863, -0.06213565915822983, 0.14337146282196045, 0.01772630773484707, -0.054033733904361725, -0.05158701166510582, 0.06348031014204025, -0.0007527541602030396, -0.03301383927464485, 0.07795587927103043, -0.08235105872154236, 0.00028554414166137576, -0.018814856186509132, 0.018358804285526276, -0.0179725494235754, 0.049710508435964584, -0.0286738108843565, 0.09821754693984985, 0.12663938105106354, -0.03924369439482689, 0.04477827996015549, -0.03051610291004181, -0.03764330595731735, -0.046558186411857605, 0.02374413050711155, 0.014553979970514774, 0.051373954862356186, 0.006016250234097242, 0.04598424956202507, -0.028247926384210587, 0.03644288331270218, 0.08307550102472305, 0.07812017947435379, -0.0053712124936282635, -0.08808127790689468, 0.037440225481987, 0.03402089327573776, 0.006093533243983984, -0.008721373975276947, -0.16519704461097717, -0.018618693575263023, 0.08999939262866974, -0.12153878062963486, 0.014828123152256012, 0.05919435992836952, 0.011368129402399063, 0.007114833686500788, 0.011499348096549511, 0.007855568081140518, 0.06724140048027039, 0.013070927001535892, -0.030171385034918785, -0.011724203824996948, -0.024692803621292114, -0.15146058797836304, 0.026635674759745598, -0.0004838820896111429, -5.666764479883568e-8, -0.06437420845031738, -0.00017065979773178697, -0.014362461864948273, 0.0913381576538086, 0.0014860075898468494, 0.029199127107858658, -0.0007272805087268353, -0.056412141770124435, 0.03288258984684944, -0.02417280338704586, -0.06094345077872276, -0.03485378995537758, 0.08085114508867264, 0.03344208747148514, -0.049150705337524414, -0.026451773941516876, 0.02829859033226967, 0.04830620065331459, -0.007634209468960762, -0.010844942182302475, 0.00921652652323246, 0.07024792581796646, -0.016885872930288315, -0.012629286386072636, 0.02439301647245884, 0.007952309213578701, 0.13962791860103607, 0.14791235327720642, 0.02036578208208084, -0.02584388479590416, 0.008207174018025398, 0.006648489739745855, 0.02512972056865692, -0.032415661960840225, -0.033669739961624146, 0.02446938306093216, 0.004358650650829077, -0.014082051813602448, 0.07753390818834305, 0.02681153453886509, 0.06229767948389053, 0.04893282800912857, 0.00011505597649374977, 0.05910516157746315, 0.053255170583724976, 0.014142042025923729, 0.012758368626236916, -0.044384270906448364, 0.05460575222969055, 0.007000372279435396, -0.023349519819021225, -0.07620034366846085, 0.02818192169070244, 0.07818544656038284, 0.044575467705726624, -0.04674682021141052, 0.03694182634353638, -0.07216577231884003, 0.06736553460359573, 0.0995783656835556, 0.0013789132935926318, 0.009251100942492485, 0.04886256530880928, -0.001497861696407199 ]
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. This is not an implicit // action after running the constructor, and must be explicitly run to begin // executing callbacks. asyncHook.enable(); // Disable listening for new asynchronous events. asyncHook.disable(); // // The following are the callbacks that can be passed to createHook(). // // init() is called during object construction. The resource may not have // completed construction when this callback runs. Therefore, all fields of the // resource referenced by "asyncId" may not have been populated. function init(asyncId, type, triggerAsyncId, resource) { } // before() is called just before the resource's callback is called. It can be // called 0-N times for handles (such as TCPWrap), and will be called exactly 1 // time for requests (such as FSReqCallback). function before(asyncId) { } // after() is called just after the resource's callback has finished. function after(asyncId) { } // destroy() is called when the resource is destroyed. function destroy(asyncId) { } // promiseResolve() is called only for promise resources, when the // resolve() function passed to the Promise constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ``` ## `async\_hooks.createHook(options)` \* `options` {Object} The [Hook Callbacks][] to register \* `init` {Function} The [`init` callback][]. \* `before` {Function} The [`before` callback][]. \* `after` {Function} The [`after` callback][]. \* `destroy` {Function} The [`destroy` callback][]. \* `promiseResolve` {Function} The [`promiseResolve` callback][]. \* `trackPromises` {boolean} Whether the hook should track `Promise`s. Cannot be `false` if `promiseResolve` is set. \*\*Default\*\*: `true`. \* Returns: {AsyncHook} Instance used for disabling and enabling hooks Registers functions to be called for different lifetime events of each async operation. The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the respective asynchronous event during a resource's lifetime. All callbacks are optional. For example, if only resource cleanup needs to be tracked, then only the `destroy` callback needs to be passed. The specifics of all functions that can be passed to `callbacks` is in the [Hook Callbacks][] section. ```mjs import { createHook } from 'node:async\_hooks'; const asyncHook = createHook({ init(asyncId, type, triggerAsyncId, resource) { }, destroy(asyncId) { }, }); ``` ```cjs const async\_hooks = require('node:async\_hooks'); const asyncHook = async\_hooks.createHook({ init(asyncId, type, triggerAsyncId, resource) { }, destroy(asyncId) { }, }); ``` The callbacks will be inherited via the prototype chain: ```js class MyAsyncCallbacks { init(asyncId, type, triggerAsyncId, resource) { } destroy(asyncId) {} } class MyAddedCallbacks extends MyAsyncCallbacks { before(asyncId) { } after(asyncId) { } } const asyncHook = async\_hooks.createHook(new MyAddedCallbacks()); ``` Because promises are asynchronous resources whose lifecycle is tracked via the async hooks mechanism, the `init()`, `before()`, `after()`, and `destroy()` callbacks \_must not\_ be async functions that return promises. ### Error handling If any `AsyncHook` callbacks throw, the application will print the stack trace and exit. The exit path does follow that of an uncaught exception, but all `'uncaughtException'` listeners are removed, thus forcing the process to exit. The `'exit'` callbacks will still be called unless the application is run with `--abort-on-uncaught-exception`, in which case a stack trace will be printed and the application exits, leaving a core file. 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
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.07985147088766098, -0.019314175471663475, 0.04636538401246071, 0.011443719267845154, -0.09425748884677887, -0.09983973950147629, 0.0005374871543608606, 0.029202893376350403, -0.09394899755716324, 0.054985783994197845, 0.012176325544714928, 0.07312329113483429, -0.12629978358745575, -0.005335470195859671, -0.09549356251955032, 0.029036931693553925, 0.0033685187809169292, 0.027886008843779564, -0.12500374019145966, -0.05789273977279663, -0.04444150626659393, -0.030209003016352654, 0.12733814120292664, 0.011035602539777756, 0.009114767424762249, -0.0010850607650354505, 0.07312283664941788, 0.004026919137686491, 0.04775535687804222, -0.081014484167099, -0.017486615106463432, 0.06458408385515213, 0.019535386934876442, -0.016120534390211105, -0.048962537199258804, -0.06770899891853333, 0.006245309952646494, 0.01412908360362053, 0.11140621453523636, -0.08873788267374039, 0.020370474085211754, 0.006326804403215647, -0.03772195056080818, 0.032679785043001175, 0.04669744893908501, -0.001766724861226976, 0.034177374094724655, -0.0006959061720408499, -0.02191879041492939, 0.00047012686263769865, 0.06640453636646271, 0.01590229943394661, -0.0056830598041415215, 0.007218364626169205, -0.01904151402413845, 0.03486903756856918, -0.008221388794481754, 0.0696256160736084, 0.022619172930717468, 0.050639405846595764, 0.11800515651702881, 0.06774834543466568, 0.0676703006029129, -0.040632784366607666, 0.0940425768494606, -0.007393445819616318, -0.09727807343006134, 0.033661406487226486, -0.012104499153792858, 0.03641553595662117, 0.0024672874715179205, -0.0447765551507473, 0.07823967933654785, -0.025568796321749687, -0.024978071451187134, 0.009396248497068882, 0.007408592384308577, -0.012639354914426804, -0.01378124300390482, -0.11323294788599014, 0.051707204431295395, 0.04346771538257599, 0.016479944810271263, 0.020573711022734642, -0.03681141138076782, -0.03763360157608986, -0.02126098982989788, -0.0085091358050704, -0.012475010007619858, 0.03636063635349274, 0.07433311641216278, 0.023969432339072227, -0.04354427382349968, -0.056850530207157135, -0.104778952896595, -0.09251108765602112, 0.04687495902180672, -0.008034277707338333, -0.009935914538800716, 0.01847873441874981, 0.036253754049539566, 0.027148686349391937, 0.11054433882236481, 0.052954595535993576, -0.10253696143627167, 0.045071810483932495, 0.04771902784705162, 0.15389776229858398, 0.012188688851892948, 0.019221141934394836, -0.02825554832816124, -0.04855486750602722, 0.010880730114877224, -0.0491076298058033, 2.1405990900763866e-33, 0.08593995124101639, 0.011774128302931786, 0.0014636956620961428, 0.023262154310941696, -0.011830913834273815, 0.008008748292922974, -0.016861213371157646, 0.039747871458530426, -0.04585902765393257, -0.023046020418405533, 0.03871268779039383, -0.03739505633711815, -0.009358679875731468, -0.05206171050667763, 0.036824967712163925, -0.061472274363040924, 0.05053272843360901, -0.0568028949201107, 0.022389499470591545, 0.044555410742759705, -0.042597826570272446, -0.007335667964071035, -0.045347146689891815, 0.07930710911750793, -0.010209176689386368, -0.01668587327003479, -0.04900617524981499, 0.09887577593326569, -0.11477384716272354, -0.0062368144281208515, 0.020783497020602226, -0.0022936693858355284, -0.0722561851143837, 0.014639916829764843, -0.01928875222802162, -0.05014778673648834, -0.0737270936369896, -0.027867792174220085, -0.07131773978471756, -0.06435324996709824, 0.022037262097001076, 0.01758023351430893, -0.07939103990793228, -0.020386064425110817, -0.05545446649193764, -0.06370793282985687, 0.007664458826184273, -0.04291447252035141, 0.054988786578178406, -0.003206599270924926, -0.0048269485123455524, 0.06584575027227402, 0.10873181372880936, -0.04755788668990135, 0.09180326014757156, 0.06772875785827637, -0.01443765964359045, -0.06302735209465027, 0.0031920664478093386, 0.04478304460644722, 0.06081293895840645, -0.05376012250781059, -0.02933858148753643, 0.03193281218409538, -0.04295778274536133, -0.015200763009488583, -0.021040132269263268, -0.037514664232730865, -0.019762733951210976, -0.07046367973089218, 0.016774732619524002, -0.03148019686341286, -0.0625307485461235, -0.008889936842024326, 0.038630399852991104, 0.021337119862437248, -0.021399114280939102, 0.02943376451730728, -0.03958394005894661, -0.06270889192819595, 0.015254166908562183, -0.02202172949910164, -0.05751165375113487, 0.06499654054641724, -0.02866731397807598, 0.0682768002152443, 0.017569346353411674, -0.09863997995853424, 0.0364021435379982, 0.13855195045471191, 0.03549237549304962, -0.06706053018569946, -0.03208396956324577, -0.04932047426700592, -0.02628646232187748, -5.8966646381244884e-33, 0.05879650637507439, -0.03139929100871086, -0.10257251560688019, 0.008550627157092094, -0.0451149083673954, 0.06209424510598183, -0.013435489498078823, -0.0008957351092249155, -0.045444898307323456, -0.05182882398366928, 0.047697409987449646, 0.06530068814754486, 0.014535052701830864, 0.06976920366287231, 0.03729458898305893, 0.010490041226148605, 0.026240048930048943, -0.01666627824306488, 0.049887191504240036, 0.019766617566347122, 0.05847906321287155, 0.07554855942726135, -0.001685667084529996, 0.018772166222333908, -0.07342029362916946, -0.02609851397573948, -0.06170675531029701, -0.05613143369555473, 0.006796862930059433, -0.034185007214546204, -0.023849379271268845, -0.0018336629727855325, 0.011673035100102425, 0.10368465632200241, -0.012744083069264889, -0.0740777999162674, 0.055773232132196426, -0.006326417904347181, -0.022572986781597137, -0.16036240756511688, 0.1471550315618515, -0.04992308095097542, -0.01184617169201374, -0.014271036721765995, 0.023729311302304268, -0.03633957356214523, 0.01087464950978756, 0.03679106384515762, -0.012625271454453468, -0.03445141762495041, -0.057595495134592056, -0.07210580259561539, -0.014199897646903992, 0.03762435168027878, -0.051855698227882385, 0.026398157700896263, 0.10147568583488464, -0.0922505110502243, 0.08474632352590561, 0.018725356087088585, -0.009152748622000217, -0.05720017850399017, -0.02448611706495285, -0.01732403226196766, 0.016695940867066383, -0.010224628262221813, 0.010580169036984444, -0.015849288552999496, 0.07512392103672028, 0.05766318365931511, -0.006227948237210512, -0.004214073531329632, -0.0425720140337944, -0.05518624559044838, -0.04507947713136673, 0.027632586658000946, -0.030767863616347313, -0.14505641162395477, -0.02666071616113186, -0.0007860595360398293, -0.03539862856268883, -0.022821128368377686, 0.03131943196058273, 0.05818048119544983, 0.012820392847061157, -0.0003492994583211839, -0.046283043920993805, 0.026008721441030502, -0.017462238669395447, 0.017338130623102188, -0.03933461755514145, -0.00806187093257904, -0.13736431300640106, 0.05312623083591461, -0.018680155277252197, -6.458411405674269e-8, -0.015199103392660618, 0.06446138024330139, -0.06525735557079315, 0.03112577088177204, 0.03970084711909294, -0.08034651726484299, 0.014102878049015999, -0.016887810081243515, 0.00808342918753624, -0.007358932867646217, -0.07043556869029999, 0.018610447645187378, 0.10360037535429001, -0.006067369598895311, -0.017283836379647255, 0.009054250083863735, 0.031798105686903, 0.025124650448560715, 0.01580197364091873, 0.015709497034549713, 0.0021875970996916294, 0.0030240186024457216, -0.037321269512176514, 0.009468828327953815, 0.023799419403076172, 0.017949869856238365, 0.08731406927108765, 0.03503159061074257, 0.02613362856209278, 0.04152338579297066, -0.007392234168946743, -0.007724171504378319, 0.009337466210126877, 0.028296494856476784, -0.044711120426654816, 0.00005542070357478224, -0.012035361491143703, 0.01083817146718502, 0.09838199615478516, 0.0024669861886650324, 0.07812688499689102, 0.055537592619657516, -0.03845279663801193, 0.050028230994939804, -0.02703934721648693, 0.06006310135126114, -0.06586627662181854, 0.01288706623017788, -0.017158493399620056, 0.039520666003227234, -0.06577105820178986, -0.002439378062263131, 0.017808446660637856, 0.016672398895025253, 0.014891616068780422, -0.03707629814743996, 0.019916964694857597, -0.025331486016511917, 0.025035327300429344, 0.013860209845006466, 0.0005114583182148635, -0.013187375850975513, 0.06544534862041473, 0.005464131012558937 ]
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 future. This is subject to change in the future if a comprehensive analysis is performed to ensure an exception can follow the normal control flow without unintentional side effects. ### Printing in `AsyncHook` callbacks Because printing to the console is an asynchronous operation, `console.log()` will cause `AsyncHook` callbacks to be called. Using `console.log()` or similar asynchronous operations inside an `AsyncHook` callback function will cause an infinite recursion. An easy solution to this when debugging is to use a synchronous logging operation such as `fs.writeFileSync(file, msg, flag)`. This will print to the file and will not invoke `AsyncHook` recursively because it is synchronous. ```mjs import { writeFileSync } from 'node:fs'; import { format } from 'node:util'; function debug(...args) { // Use a function like this one when debugging inside an AsyncHook callback writeFileSync('log.out', `${format(...args)}\n`, { flag: 'a' }); } ``` ```cjs const fs = require('node:fs'); const util = require('node:util'); function debug(...args) { // Use a function like this one when debugging inside an AsyncHook callback fs.writeFileSync('log.out', `${util.format(...args)}\n`, { flag: 'a' }); } ``` If an asynchronous operation is needed for logging, it is possible to keep track of what caused the asynchronous operation using the information provided by `AsyncHook` itself. The logging should then be skipped when it was the logging itself that caused the `AsyncHook` callback to be called. By doing this, the otherwise infinite recursion is broken. ## Class: `AsyncHook` The class `AsyncHook` exposes an interface for tracking lifetime events of asynchronous operations. ### `asyncHook.enable()` \* Returns: {AsyncHook} A reference to `asyncHook`. Enable the callbacks for a given `AsyncHook` instance. If no callbacks are provided, enabling is a no-op. The `AsyncHook` instance is disabled by default. If the `AsyncHook` instance should be enabled immediately after creation, the following pattern can be used. ```mjs import { createHook } from 'node:async\_hooks'; const hook = createHook(callbacks).enable(); ``` ```cjs const async\_hooks = require('node:async\_hooks'); const hook = async\_hooks.createHook(callbacks).enable(); ``` ### `asyncHook.disable()` \* Returns: {AsyncHook} A reference to `asyncHook`. Disable the callbacks for a given `AsyncHook` instance from the global pool of `AsyncHook` callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. For API consistency `disable()` also returns the `AsyncHook` instance. ### Hook callbacks Key events in the lifetime of asynchronous events have been categorized into four areas: instantiation, before/after the callback is called, and when the instance is destroyed. #### `init(asyncId, type, triggerAsyncId, resource)` \* `asyncId` {number} A unique ID for the async resource. \* `type` {string} The type of the async resource. \* `triggerAsyncId` {number} The unique ID of the async resource in whose execution context this async resource was created. \* `resource` {Object} Reference to the resource representing the async operation, needs to be released during \_destroy\_. Called when a class is constructed that has the \_possibility\_ to emit an asynchronous event. This \_does not\_ mean the instance must call `before`/`after` before `destroy` is called, only that the possibility exists. This behavior can be observed by doing something like opening a resource then 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(); }); // OR clearTimeout(setTimeout(() => {}, 10)); ``` Every new resource is assigned an ID
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.07836734503507614, -0.05183985084295273, -0.03751190006732941, -0.05495208874344826, -0.032001253217458725, -0.07640891522169113, -0.03969956189393997, 0.0022973318118602037, 0.01920238696038723, 0.023680852726101875, 0.07933028042316437, -0.037313658744096756, -0.0564727820456028, -0.03940143808722496, -0.12797512114048004, -0.029255662113428116, -0.005264531821012497, -0.00858007650822401, -0.050282057374715805, -0.04130927845835686, 0.00017392569861840457, 0.03267272561788559, 0.11918583512306213, 0.004864089656621218, -0.06533771008253098, -0.0663626566529274, -0.020506886765360832, 0.01867082342505455, 0.06881483644247055, -0.040234971791505814, -0.06376579403877258, -0.03513257950544357, -0.03840872272849083, -0.10287874937057495, -0.024477744475007057, -0.015773743391036987, 0.017837289720773697, -0.011494669131934643, 0.11688849329948425, -0.05429286137223244, -0.024256331846117973, 0.05786675959825516, 0.04135549068450928, 0.05987672507762909, 0.03848510980606079, -0.04716663062572479, 0.024524930864572525, -0.03222713991999626, -0.02235696278512478, -0.1060832142829895, -0.021654127165675163, 0.061078667640686035, 0.028747908771038055, -0.0023072785697877407, 0.018007436767220497, -0.02539401315152645, 0.09407583624124527, 0.06449037045240402, -0.001840729615651071, -0.0024400099646300077, 0.06604493409395218, 0.08294427394866943, -0.015941720455884933, 0.0027361507527530193, 0.02690977416932583, -0.021786537021398544, -0.022133802995085716, 0.030972272157669067, -0.0807039886713028, 0.0075775375589728355, -0.017275596037507057, 0.05109480023384094, -0.04696410521864891, -0.045844223350286484, 0.006264383438974619, 0.027154622599482536, 0.033606067299842834, -0.04190848767757416, -0.05839390680193901, -0.0216960571706295, 0.07288239896297455, 0.049013830721378326, 0.04729923978447914, 0.07728150486946106, 0.02967316098511219, -0.02803775668144226, -0.04308038204908371, -0.01184502337127924, 0.024588344618678093, 0.029429253190755844, 0.06446114182472229, 0.11853904277086258, 0.012724367901682854, -0.003023756667971611, -0.09136196225881577, 0.024786802008748055, -0.08817002922296524, 0.023417025804519653, -0.015292184427380562, 0.01572091318666935, 0.08860013633966446, 0.04309903085231781, 0.016344668343663216, 0.04574410617351532, 0.004993201699107885, 0.011812040582299232, 0.048399683088064194, 0.13646724820137024, 0.049261074513196945, 0.032284531742334366, -0.05345136299729347, 0.01244178507477045, -0.030896488577127457, 0.03942279517650604, 4.7113361750316186e-33, -0.035950589925050735, -0.054047562181949615, 0.0016822925535961986, 0.004267154727131128, 0.046278201043605804, 0.04913264140486717, 0.04753105714917183, -0.03869923576712608, -0.053193699568510056, -0.026058822870254517, -0.025239113718271255, -0.01938898302614689, 0.008580682799220085, -0.035618558526039124, 0.04477512836456299, -0.024439292028546333, 0.08167880773544312, -0.025099903345108032, -0.026676418259739876, 0.06627793610095978, 0.05793929845094681, -0.005117099732160568, 0.008977275341749191, -0.0037990398705005646, -0.04538346454501152, 0.003230545436963439, -0.07233531773090363, 0.004431156441569328, -0.03103048913180828, 0.041181426495313644, -0.005384278018027544, 0.024723675101995468, -0.018206095322966576, -0.02955971471965313, -0.024022875353693962, -0.026087108999490738, -0.01692664623260498, -0.050193965435028076, -0.08257948607206345, -0.02764124795794487, -0.1150515154004097, -0.007574118673801422, -0.08756369352340698, 0.04063228517770767, -0.08079246431589127, -0.07481362670660019, -0.05618428438901901, 0.0700424313545227, 0.013561513274908066, 0.08352023363113403, -0.002331729978322983, 0.07607190310955048, 0.05052066221833229, -0.024162350222468376, 0.023916095495224, 0.006699443329125643, 0.04127267748117447, -0.0475325882434845, -0.007737657520920038, -0.006719009950757027, 0.15765340626239777, -0.022524936124682426, -0.03419287130236626, -0.00003677532367873937, 0.005494813434779644, -0.012430773116648197, 0.00948780681937933, 0.08614101260900497, -0.01755128800868988, -0.01039003673940897, -0.005227997433394194, 0.02057233452796936, -0.08119679987430573, 0.0002184024779126048, 0.06261136382818222, 0.05470922589302063, -0.011718438006937504, -0.05251571908593178, -0.05629540979862213, -0.07662776112556458, 0.0843084529042244, -0.00762188108637929, -0.08125891536474228, -0.0344148725271225, -0.01550954207777977, 0.048702139407396317, 0.01874207705259323, -0.030641712248325348, 0.037595562636852264, 0.08317752927541733, -0.01902024820446968, -0.06999508291482925, 0.03926339000463486, -0.012245099991559982, -0.05101864039897919, -7.656410538032162e-33, 0.0271650068461895, -0.02161845564842224, -0.05510763078927994, -0.0024747243151068687, -0.03680478781461716, -0.015430841594934464, -0.009306087158620358, 0.023086730390787125, -0.05659811943769455, -0.06656000018119812, -0.09671478718519211, 0.03311867639422417, -0.0058784810826182365, 0.03394252061843872, 0.0509537048637867, 0.04191409796476364, -0.036989256739616394, -0.01521765161305666, 0.05210132151842117, -0.08959513157606125, 0.07047154754400253, -0.03493594378232956, 0.039537686854600906, 0.10521581768989563, -0.10913784801959991, -0.029196644201874733, -0.09637682884931564, -0.030303839594125748, 0.029104895889759064, -0.016123907640576363, 0.014358418993651867, 0.05497194826602936, 0.018632788211107254, 0.05828728526830673, 0.05020250007510185, -0.03888307884335518, 0.026594674214720726, -0.018244856968522072, 0.007956055924296379, -0.05573873966932297, 0.10291877388954163, 0.08016364276409149, 0.020922835916280746, -0.011206582188606262, 0.08404763042926788, 0.0008890010649338365, -0.07728884369134903, 0.06369191408157349, 0.016366062685847282, -0.03750249743461609, -0.032331183552742004, -0.08204381167888641, 0.054066650569438934, 0.08450785279273987, -0.07527325302362442, 0.01920183002948761, 0.03697490319609642, 0.0016359805595129728, -0.0011161090806126595, 0.03606032207608223, -0.03301182761788368, -0.07660172134637833, -0.01989554427564144, -0.05630335584282875, -0.020323028787970543, 0.022159190848469734, -0.019506186246871948, -0.021745288744568825, 0.14026004076004028, 0.01346501987427473, 0.032026588916778564, 0.005217738915234804, -0.07194933295249939, 0.007732707541435957, -0.034390367567539215, 0.0741710364818573, -0.10123815387487411, -0.11858781427145004, 0.015111122280359268, 0.06923822313547134, -0.013155356980860233, 0.033127252012491226, 0.04190294072031975, 0.09615609049797058, -0.04654625803232193, -0.06634606420993805, 0.024946928024291992, 0.06726633757352829, -0.013037635944783688, -0.05253472179174423, 0.06171126291155815, 0.008999808691442013, -0.038678985089063644, 0.033225446939468384, 0.029068641364574432, -5.495096289109824e-8, -0.02943415194749832, -0.011116070672869682, -0.04315142706036568, 0.05425848439335823, 0.05542648211121559, -0.04070236161351204, -0.013022243976593018, -0.08111458271741867, 0.03047364205121994, 0.01440640538930893, -0.06220889464020729, -0.09563916176557541, 0.05270377919077873, -0.027271408587694168, -0.034385498613119125, 0.04630127176642418, 0.04154210165143013, -0.013669623993337154, 0.030284469947218895, -0.00795544870197773, 0.019109873101115227, -0.06191697344183922, 0.030369115993380547, 0.06575488299131393, -0.12139575183391571, -0.020712105557322502, 0.07289965450763702, 0.06500779837369919, -0.05540783703327179, -0.04415452107787132, -0.031717393547296524, 0.013816792517900467, 0.015763456001877785, 0.07052670419216156, -0.08406733721494675, 0.001095817657187581, 0.06970635801553726, -0.06523814052343369, 0.08328545093536377, -0.014995632693171501, -0.00045026018051430583, 0.027826573699712753, 0.014421149156987667, 0.021600577980279922, -0.023400375619530678, -0.04149027541279793, -0.010739785619080067, 0.05251627787947655, -0.04075971990823746, 0.017428431659936905, -0.04609907045960426, -0.01192258857190609, -0.027960985898971558, 0.04905066266655922, 0.002502929186448455, -0.042202383279800415, -0.01777571253478527, -0.04706605523824692, 0.01887841895222664, 0.011007361114025116, 0.037187039852142334, 0.015798024833202362, 0.053864214569330215, -0.016327664256095886 ]
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(); }); // OR clearTimeout(setTimeout(() => {}, 10)); ``` Every new resource is assigned an ID that is unique within the scope of the current Node.js instance. ##### `type` The `type` is a string identifying the type of resource that caused `init` to be called. Generally, it will correspond to the name of the resource's constructor. The `type` of resources created by Node.js itself can change in any Node.js release. Valid values include `TLSWRAP`, `TCPWRAP`, `TCPSERVERWRAP`, `GETADDRINFOREQWRAP`, `FSREQCALLBACK`, `Microtask`, and `Timeout`. Inspect the source code of the Node.js version used to get the full list. Furthermore users of [`AsyncResource`][] create async resources independent of Node.js itself. There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them. The `Promise`s are only tracked when `trackPromises` option is set to `true`. Users are able to define their own `type` when using the public embedder API. It is possible to have type name collisions. Embedders are encouraged to use unique prefixes, such as the npm package name, to prevent collisions when listening to the hooks. ##### `triggerAsyncId` `triggerAsyncId` is the `asyncId` of the resource that caused (or "triggered") the new resource to initialize and that caused `init` to call. This is different from `async\_hooks.executionAsyncId()` that only shows \_when\_ a resource was created, while `triggerAsyncId` shows \_why\_ a resource was created. The following is a simple demonstration of `triggerAsyncId`: ```mjs import { createHook, executionAsyncId } from 'node:async\_hooks'; import { stdout } from 'node:process'; import net from 'node:net'; import fs from 'node:fs'; createHook({ init(asyncId, type, triggerAsyncId) { const eid = executionAsyncId(); fs.writeSync( stdout.fd, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); }, }).enable(); net.createServer((conn) => {}).listen(8080); ``` ```cjs const { createHook, executionAsyncId } = require('node:async\_hooks'); const { stdout } = require('node:process'); const net = require('node:net'); const fs = require('node:fs'); createHook({ init(asyncId, type, triggerAsyncId) { const eid = executionAsyncId(); fs.writeSync( stdout.fd, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); }, }).enable(); net.createServer((conn) => {}).listen(8080); ``` Output when hitting the server with `nc localhost 8080`: ```console TCPSERVERWRAP(5): trigger: 1 execution: 1 TCPWRAP(7): trigger: 5 execution: 0 ``` The `TCPSERVERWRAP` is the server which receives the connections. The `TCPWRAP` is the new connection from the client. When a new connection is made, the `TCPWrap` instance is immediately constructed. This happens outside of any JavaScript stack. (An `executionAsyncId()` of `0` means that it is being executed from C++ with no JavaScript stack above it.) With only that information, it would be impossible to link resources together in terms of what caused them to be created, so `triggerAsyncId` is given the task of propagating what resource is responsible for the new resource's existence. ##### `resource` `resource` is an object that represents the actual async resource that has been initialized. The API to access the object may be specified by the creator of the resource. Resources created by Node.js itself are internal and may change at any time. Therefore no API is specified for these. In some cases the resource object is reused for performance reasons, it is thus not safe to use it as a key in a `WeakMap` or add properties to 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` between the `before` and `after`
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.02392980456352234, -0.051104284822940826, 0.0179146695882082, 0.01952015981078148, 0.006604905705899, -0.020461618900299072, -0.04743712767958641, 0.0834156796336174, 0.029198458418250084, 0.03773309662938118, -0.0619865357875824, -0.06197226792573929, -0.05724930763244629, 0.004730830434709787, -0.03419090062379837, 0.09131757915019989, 0.01984402723610401, -0.0017267751973122358, -0.0016878984170034528, -0.13265730440616608, 0.007872517220675945, -0.04273486137390137, 0.19070419669151306, -0.02936958149075508, 0.001966191455721855, 0.005961313843727112, 0.028998905792832375, 0.09663867950439453, 0.06953699886798859, -0.054902270436286926, 0.0037403381429612637, 0.00872847344726324, 0.037709690630435944, -0.06453786790370941, -0.029458418488502502, -0.10521073639392853, -0.04872836917638779, -0.005693210754543543, -0.005469218827784061, -0.04780173301696777, -0.005478809121996164, 0.034247662872076035, 0.0012360515538603067, 0.0044432347640395164, 0.014908487908542156, -0.029398508369922638, 0.11025452613830566, 0.026958517730236053, -0.024231787770986557, 0.03492856025695801, -0.016238480806350708, 0.17700469493865967, 0.009385799057781696, -0.016011547297239304, 0.00946102850139141, 0.005740244407206774, -0.044389508664608, 0.01580812595784664, 0.030412927269935608, -0.060009609907865524, 0.07404761761426926, -0.062188249081373215, 0.007905673235654831, 0.0360032394528389, 0.034919966012239456, -0.0677851065993309, 0.015148520469665527, 0.0006736771902069449, 0.003573949681594968, -0.009993023239076138, -0.02257286012172699, -0.013168906792998314, 0.08727400749921799, 0.034176312386989594, 0.017969902604818344, 0.12082213908433914, 0.09577398747205734, -0.06888021528720856, -0.020650770515203476, -0.06333053857088089, 0.07927056401968002, 0.03196132183074951, 0.015520433895289898, 0.022005395963788033, 0.038126345723867416, -0.03231745958328247, -0.030209651216864586, 0.016625959426164627, -0.02533908188343048, 0.03309228643774986, 0.016288800165057182, 0.01516079530119896, -0.04461328685283661, -0.04490068182349205, 0.032699692994356155, -0.009148054756224155, 0.012570368126034737, -0.010177677497267723, 0.001471837516874075, -0.03155837953090668, 0.00761190801858902, -0.013543869368731976, 0.0777132585644722, 0.11317044496536255, -0.003402356756851077, 0.07465564459562302, 0.11531788855791092, 0.07988537102937698, 0.007135289255529642, -0.0054411268793046474, -0.07914118468761444, -0.05248378962278366, 0.0022936309687793255, 0.0004710403736680746, 2.1077811245113515e-33, -0.035711437463760376, -0.11590302735567093, -0.057287637144327164, 0.08429230004549026, 0.053164828568696976, -0.04517693072557449, 0.02426724322140217, 0.013156380504369736, -0.12008128315210342, 0.01843438111245632, -0.05494556576013565, 0.01964079961180687, -0.022743800655007362, -0.05312419682741165, -0.042887311428785324, -0.053582560271024704, 0.09201735258102417, 0.015955602750182152, 0.09007454663515091, -0.02071641944348812, 0.0010826780926436186, -0.0029278036672621965, 0.021483711898326874, -0.016414962708950043, 0.0683547854423523, -0.027089720591902733, 0.007985476404428482, -0.03290754556655884, -0.011457330547273159, -0.02998078055679798, 0.024928884580731392, 0.0525067038834095, -0.049165721982717514, 0.0000029532116059272084, 0.020002029836177826, -0.016074897721409798, -0.0051372773014009, 0.021167749539017677, -0.07036085426807404, -0.08797410130500793, 0.012317369692027569, 0.08414128422737122, -0.11625848710536957, 0.07609421014785767, -0.04066537693142891, -0.14202529191970825, -0.019494792446494102, -0.0666019544005394, -0.02255582995712757, -0.020333541557192802, 0.033834058791399, 0.029673177748918533, 0.03544851019978523, -0.04521409794688225, -0.0139705128967762, -0.0030217955354601145, 0.013027780689299107, -0.03642794489860535, -0.05219602212309837, -0.014198454096913338, 0.0687955915927887, -0.05688661336898804, -0.05947764590382576, 0.04736987501382828, 0.05446843057870865, -0.004429598804563284, -0.024423785507678986, -0.00848757941275835, -0.018093064427375793, -0.008772963657975197, -0.03299238532781601, -0.04910912737250328, -0.018563520163297653, 0.023834343999624252, 0.008343457244336605, -0.0005001341341994703, -0.03327035903930664, 0.011009191162884235, -0.01498335413634777, -0.037309303879737854, 0.11521145701408386, 0.029772520065307617, -0.049469590187072754, 0.03908655792474747, -0.050620920956134796, -0.02815013937652111, -0.04125579819083214, -0.015798678621649742, 0.08003903180360794, 0.02586897648870945, 0.016249479725956917, -0.005087600089609623, -0.023064130917191505, -0.0306849405169487, -0.0808965265750885, -4.696606496131846e-33, -0.01440681517124176, 0.023599568754434586, -0.048293620347976685, 0.06641358137130737, -0.05400297790765762, -0.06923606991767883, -0.04499046877026558, 0.019789619371294975, -0.0376141257584095, 0.015301725827157497, 0.04499687999486923, -0.008251750841736794, 0.04621170088648796, 0.011370023712515831, -0.044102992862463, 0.0020097000524401665, -0.022710012272000313, -0.0048403809778392315, -0.027090080082416534, 0.0014690874377265573, -0.03904283791780472, 0.003927972167730331, 0.08089626580476761, -0.029781311750411987, -0.03227373585104942, 0.031480155885219574, -0.07689987123012543, -0.00648141885176301, -0.07591280341148376, -0.04296499118208885, -0.05980262905359268, -0.03599288687109947, -0.02254021354019642, 0.025442080572247505, -0.005445338319987059, 0.00005898736708331853, -0.02259313315153122, 0.044027287513017654, 0.06944648176431656, -0.018847914412617683, 0.1446518898010254, 0.020776834338903427, -0.046336982399225235, -0.0024458824191242456, -0.008582703769207, -0.024137957021594048, -0.02821304276585579, -0.02993392013013363, -0.04015234112739563, -0.038898635655641556, -0.026529813185334206, -0.058916881680488586, 0.07594612240791321, -0.012561156414449215, 0.04156146198511124, -0.010532112792134285, 0.011548247188329697, 0.02397790551185608, 0.07606524974107742, -0.014144237153232098, 0.11485069245100021, -0.08003870397806168, -0.0637296587228775, 0.0036533267702907324, -0.026061970740556717, -0.030314916744828224, -0.04048265889286995, 0.01611943356692791, 0.0443975068628788, -0.05243012681603432, -0.04036082699894905, 0.04594603553414345, -0.04130364954471588, -0.019299471750855446, -0.046106744557619095, -0.04861174523830414, 0.02788437530398369, -0.14205174148082733, -0.023094989359378815, 0.04228665307164192, -0.060102615505456924, 0.10387986898422241, -0.07613803446292877, -0.007405520882457495, 0.05313664302229881, -0.0006973914569243789, 0.0029364952351897955, -0.015609676018357277, 0.0062091960571706295, 0.05843505635857582, -0.04172973334789276, 0.021472236141562462, -0.12703879177570343, 0.05004611983895302, -0.10016077756881714, -5.8229019828104356e-8, -0.03848271444439888, 0.042974043637514114, -0.021101076155900955, -0.025414807721972466, 0.05032885819673538, -0.044007498770952225, 0.011862927116453648, 0.04712604731321335, 0.11450912803411484, 0.06893916428089142, 0.030495991930365562, 0.02559461072087288, 0.06267299503087997, 0.009372588247060776, -0.022094449028372765, 0.01104243565350771, 0.009909608401358128, -0.050005968660116196, 0.030906852334737778, -0.03239152207970619, 0.008665062487125397, -0.02832973189651966, 0.01604364812374115, 0.07391778379678726, 0.010031952522695065, -0.05059552192687988, 0.07740898430347443, 0.04869420453906059, -0.08920317888259888, 0.023644469678401947, -0.08783961087465286, 0.034757427871227264, 0.018341906368732452, 0.06999475508928299, -0.07286560535430908, 0.10003374516963959, -0.11241423338651657, -0.0016495655290782452, 0.06164064630866051, 0.06428982317447662, 0.010697183199226856, 0.031813155859708786, -0.016666261479258537, 0.07626546174287796, -0.03619317337870598, 0.009418205358088017, -0.04647701606154442, 0.03429317846894264, -0.06455168128013611, 0.0017362345242872834, 0.033617932349443436, -0.03163709491491318, -0.0291312076151371, -0.0034193878527730703, 0.03625956177711487, -0.012537817470729351, 0.03651081770658493, -0.05023662745952606, 0.005453065037727356, -0.02562110126018524, -0.052052486687898636, 0.03114888444542885, 0.05750514939427376, -0.07166958600282669 ]
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` between the `before` and `after` calls, specifically what the callback to `listen()` will look like. The output formatting is slightly more elaborate to make calling context easier to see. ```mjs import async\_hooks from 'node:async\_hooks'; import fs from 'node:fs'; import net from 'node:net'; import { stdout } from 'node:process'; const { fd } = stdout; let indent = 0; async\_hooks.createHook({ init(asyncId, type, triggerAsyncId) { const eid = async\_hooks.executionAsyncId(); const indentStr = ' '.repeat(indent); fs.writeSync( fd, `${indentStr}${type}(${asyncId}):` + ` trigger: ${triggerAsyncId} execution: ${eid}\n`); }, before(asyncId) { const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}before: ${asyncId}\n`); indent += 2; }, after(asyncId) { indent -= 2; const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}after: ${asyncId}\n`); }, destroy(asyncId) { const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}destroy: ${asyncId}\n`); }, }).enable(); net.createServer(() => {}).listen(8080, () => { // Let's wait 10ms before logging the server started. setTimeout(() => { console.log('>>>', async\_hooks.executionAsyncId()); }, 10); }); ``` ```cjs const async\_hooks = require('node:async\_hooks'); const fs = require('node:fs'); const net = require('node:net'); const { fd } = process.stdout; let indent = 0; async\_hooks.createHook({ init(asyncId, type, triggerAsyncId) { const eid = async\_hooks.executionAsyncId(); const indentStr = ' '.repeat(indent); fs.writeSync( fd, `${indentStr}${type}(${asyncId}):` + ` trigger: ${triggerAsyncId} execution: ${eid}\n`); }, before(asyncId) { const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}before: ${asyncId}\n`); indent += 2; }, after(asyncId) { indent -= 2; const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}after: ${asyncId}\n`); }, destroy(asyncId) { const indentStr = ' '.repeat(indent); fs.writeSync(fd, `${indentStr}destroy: ${asyncId}\n`); }, }).enable(); net.createServer(() => {}).listen(8080, () => { // Let's wait 10ms before logging the server started. setTimeout(() => { console.log('>>>', async\_hooks.executionAsyncId()); }, 10); }); ``` Output from only starting the server: ```console TCPSERVERWRAP(5): trigger: 1 execution: 1 TickObject(6): trigger: 5 execution: 1 before: 6 Timeout(7): trigger: 6 execution: 6 after: 6 destroy: 6 before: 7 >>> 7 TickObject(8): trigger: 7 execution: 7 after: 7 before: 8 after: 8 ``` As illustrated in the example, `executionAsyncId()` and `execution` each specify the value of the current execution context; which is delineated by calls to `before` and `after`. Only using `execution` to graph resource allocation results in the following: ```console root(1) ^ | TickObject(6) ^ | Timeout(7) ``` The `TCPSERVERWRAP` is not part of this graph, even though it was the reason for `console.log()` being called. This is because binding to a port without a host name is a \_synchronous\_ operation, but to maintain a completely asynchronous API the user's callback is placed in a `process.nextTick()`. Which is why `TickObject` is present in the output and is a 'parent' for `.listen()` callback. The graph only shows \_when\_ a resource was created, not \_why\_, so to track the \_why\_ use `triggerAsyncId`. Which can be represented with the following graph: ```console bootstrap(1) | ˅ TCPSERVERWRAP(5) | ˅ TickObject(6) | ˅ Timeout(7) ``` #### `before(asyncId)` \* `asyncId` {number} When an asynchronous operation is initiated (such as a TCP server receiving a new connection) or completes (such as writing data to disk) a callback is called to notify the user. The `before` callback is called just before said callback is executed. `asyncId` is the unique identifier assigned to the resource 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
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.027964340522885323, 0.013986214064061642, 0.03888650983572006, 0.06729282438755035, 0.04675065726041794, -0.037539925426244736, -0.06557945162057877, -0.006982516963034868, -0.018125880509614944, 0.05953237786889076, -0.018076829612255096, -0.06137387454509735, -0.03965641185641289, -0.04260830208659172, -0.10646294057369232, 0.06907794624567032, 0.029603514820337296, 0.04939306527376175, 0.02658705599606037, -0.03596418350934982, 0.031417690217494965, -0.05093133822083473, 0.12627027928829193, 0.009851634502410889, -0.051896948367357254, -0.07200423628091812, -0.006934046279639006, 0.07725241035223007, 0.08951279520988464, -0.041666850447654724, -0.026503771543502808, 0.0010852499399334192, -0.04938582703471184, -0.07264299690723419, 0.019380168989300728, -0.10057912766933441, 0.008471108973026276, -0.009401615709066391, 0.017613239586353302, -0.0677696242928505, -0.008903438225388527, -0.021124757826328278, 0.020116927102208138, 0.08814522624015808, 0.05144853889942169, -0.042999595403671265, -0.003862539539113641, -0.0027955658733844757, -0.06888525187969208, -0.051785387098789215, 0.030998529866337776, 0.05404796078801155, 0.0801348015666008, -0.04570113494992256, 0.019998034462332726, 0.030595820397138596, 0.0038430055137723684, -0.015185550786554813, -0.0077228788286447525, 0.0068651121109724045, -0.012649988755583763, 0.012984774075448513, -0.0010563540272414684, 0.017011327669024467, 0.047809258103370667, -0.05645453557372093, -0.0049721840769052505, 0.01623300276696682, -0.046800047159194946, -0.018173841759562492, -0.028950326144695282, -0.0005947800818830729, 0.07809212058782578, -0.042387571185827255, -0.08778567612171173, 0.04054078832268715, 0.04097042232751846, -0.0715625211596489, -0.03248107060790062, -0.12814688682556152, 0.025613680481910706, 0.05601741373538971, 0.02655642479658127, 0.003136249026283622, 0.06521553546190262, -0.0003705121926032007, 0.005334021523594856, 0.032251812517642975, -0.0006589394761249423, -0.06389068812131882, 0.05232776328921318, 0.04084407165646553, -0.033643126487731934, -0.03947700187563896, -0.03443538025021553, -0.047345008701086044, 0.0024963554460555315, -0.02378024347126484, 0.04863791912794113, 0.02771485410630703, 0.056757498532533646, 0.023690514266490936, 0.04145509749650955, 0.11364232748746872, -0.013057515025138855, 0.09602424502372742, 0.07527624815702438, 0.13256537914276123, 0.022286124527454376, -0.03689037263393402, -0.052875272929668427, 0.013277271762490273, 0.029836982488632202, 0.007302817422896624, 6.28996080333864e-33, -0.02328614331781864, -0.07841358333826065, 0.002326234709471464, 0.008202597498893738, 0.04249374940991402, 0.031262628734111786, 0.023994283750653267, -0.06039993837475777, -0.02356930822134018, 0.008059553802013397, 0.003602183423936367, 0.03714240342378616, -0.01750161126255989, -0.07371294498443604, -0.0038558796513825655, -0.09519358724355698, 0.021975496783852577, -0.027846504002809525, 0.04474367946386337, 0.03999205678701401, -0.0031449380330741405, -0.00496647646650672, -0.06792038679122925, -0.0318453311920166, 0.036573994904756546, -0.028689304366707802, -0.03422355651855469, 0.050275061279535294, -0.019899746403098106, 0.02276795357465744, -0.01735433004796505, 0.04530883952975273, -0.05471070110797882, -0.006295995786786079, -0.01929127238690853, -0.02224848046898842, -0.01589031331241131, 0.0033016495872288942, -0.06342899799346924, -0.12316467612981796, 0.0013839701423421502, 0.022948134690523148, -0.07898213714361191, 0.00020126324670854956, -0.1393565833568573, -0.1196412593126297, -0.11563585698604584, 0.017907990142703056, 0.0806264579296112, -0.02924356423318386, 0.07505692541599274, 0.049885477870702744, 0.06010987609624863, -0.09819498658180237, 0.027356212958693504, 0.027572041377425194, 0.026038307696580887, -0.01694396138191223, -0.012215632013976574, 0.07604750990867615, 0.04001324623823166, -0.05799673870205879, -0.00021814298816025257, 0.01256459392607212, 0.07026800513267517, 0.013636890798807144, -0.01999753899872303, 0.018218446522951126, -0.002572553465142846, -0.03228970244526863, -0.06730464845895767, 0.04963809251785278, -0.05645965784788132, 0.05912235751748085, 0.03460250794887543, 0.03647745028138161, -0.07149054855108261, 0.037750907242298126, -0.04749305546283722, -0.07076629996299744, 0.09482431411743164, 0.03038284368813038, -0.06605882197618484, 0.10871975123882294, 0.008703951723873615, 0.03625427186489105, -0.06051018834114075, -0.10760632902383804, 0.011458140797913074, 0.011819452047348022, 0.003736204234883189, -0.043674711138010025, 0.04211646318435669, -0.03967680409550667, -0.06383540481328964, -8.024125007436544e-33, 0.0023742106277495623, 0.000784217962063849, -0.05590851232409477, 0.022079981863498688, -0.031968794763088226, -0.03737260773777962, 0.015972429886460304, 0.0105819096788764, -0.03493233397603035, 0.024959299713373184, -0.029167111963033676, 0.0018180229235440493, -0.01258940901607275, 0.09964685887098312, 0.025740381330251694, -0.027979539707303047, 0.006060318555682898, -0.05915621668100357, 0.07936114817857742, -0.0010638883104547858, 0.03967290371656418, -0.03175206109881401, 0.03256871923804283, 0.015949618071317673, -0.09339377284049988, -0.007929792627692223, -0.04930097609758377, -0.0036575477570295334, 0.008467458188533783, -0.07053568959236145, -0.03831106051802635, -0.03617168962955475, -0.00020577842951752245, 0.0427313856780529, -0.00042205885984003544, -0.059486355632543564, 0.05315156280994415, 0.08583082258701324, 0.023205775767564774, -0.0917653813958168, 0.09975934773683548, 0.03532934933900833, -0.023891447111964226, -0.016478559002280235, 0.012209783308207989, -0.005836315453052521, -0.019615568220615387, 0.08131296187639236, -0.025273464620113373, -0.028238367289304733, -0.04905277118086815, -0.00426920410245657, -0.009180420078337193, 0.05260877683758736, -0.08720186352729797, 0.023518601432442665, 0.1319347620010376, -0.07190375030040741, 0.07533790916204453, -0.018325820565223694, 0.029013410210609436, -0.09196776896715164, -0.03504751995205879, -0.04571158438920975, 0.05629412457346916, 0.01856210082769394, -0.031494755297899246, -0.09257525950670242, 0.06299878656864166, 0.04291337728500366, 0.025809939950704575, -0.006695338059216738, -0.126360684633255, 0.03061511367559433, 0.006148977670818567, 0.043898142874240875, -0.010323014110326767, -0.17195478081703186, 0.025504665449261665, 0.062113020569086075, -0.10252165049314499, -0.009481273591518402, -0.00782791431993246, 0.006520979572087526, 0.010664692148566246, 0.0035549781750887632, 0.00026041100500151515, 0.024582315236330032, 0.023972034454345703, -0.016365595161914825, -0.0010841127950698137, 0.017071738839149475, -0.1344708949327469, 0.00016609080194029957, -0.03960289806127548, -5.9396519702659134e-8, -0.09415792673826218, -0.01151928212493658, -0.025585947558283806, 0.08262563496828079, 0.02473636530339718, 0.013745722360908985, 0.0026371744461357594, -0.05794714018702507, 0.03813447803258896, -0.009617272764444351, -0.0796557366847992, -0.04351845011115074, 0.075526662170887, -0.03460986167192459, -0.02242756076157093, 0.04408106952905655, 0.00869494117796421, -0.025234859436750412, 0.020671451464295387, 0.04099807143211365, 0.03399084880948067, 0.057155780494213104, -0.013046552427113056, 0.05442868173122406, -0.010852768085896969, -0.019560448825359344, 0.11368683725595474, 0.15683577954769135, 0.02940976247191429, -0.006016163155436516, -0.04085099697113037, 0.03479296714067459, 0.021021995693445206, 0.001025082659907639, -0.10826368629932404, 0.004030067473649979, -0.018341772258281708, -0.052281610667705536, 0.09126956015825272, 0.002949208253994584, -0.0032075794879347086, 0.017606185749173164, -0.04314164072275162, 0.06139757111668587, -0.011444969102740288, 0.05710394307971001, 0.04666159674525261, -0.009519715793430805, -0.0017545410664752126, 0.02660675160586834, 0.008686818182468414, -0.05247308313846588, 0.03623977303504944, 0.02523401752114296, 0.030762461945414543, -0.029698994010686874, 0.034318577498197556, -0.06975384056568146, 0.025325078517198563, 0.07868019491434097, -0.0424620695412159, 0.014536844566464424, 0.07396132498979568, -0.018374044448137283 ]
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 the `before` callback multiple times, while other operations like `fs.open()` will call it only once. #### `after(asyncId)` \* `asyncId` {number} Called immediately after the callback specified in `before` is completed. If an uncaught exception occurs during execution of the callback, then `after` will run \_after\_ the `'uncaughtException'` event is emitted or a `domain`'s handler runs. #### `destroy(asyncId)` \* `asyncId` {number} Called after the resource corresponding to `asyncId` is destroyed. It is also called asynchronously from the embedder API `emitDestroy()`. Some resources depend on garbage collection for cleanup, so if a reference is made to the `resource` object passed to `init` it is possible that `destroy` will never be called, causing a memory leak in the application. If the resource does not depend on garbage collection, then this will not be an issue. Using the destroy hook results in additional overhead because it enables tracking of `Promise` instances via the garbage collector. #### `promiseResolve(asyncId)` \* `asyncId` {number} Called when the `resolve` function passed to the `Promise` constructor is invoked (either directly or through other means of resolving a promise). `resolve()` does not do any observable synchronous work. The `Promise` is not necessarily fulfilled or rejected at this point if the `Promise` was resolved by assuming the state of another `Promise`. ```js new Promise((resolve) => resolve(true)).then((a) => {}); ``` calls the following callbacks: ```text init for PROMISE with id 5, trigger id: 1 promise resolve 5 # corresponds to resolve(true) init for PROMISE with id 6, trigger id: 5 # the Promise returned by then() before 6 # the then() callback is entered promise resolve 6 # the then() callback resolves the promise by returning after 6 ``` ### `async\_hooks.executionAsyncResource()` \* Returns: {Object} The resource representing the current execution. Useful to store data within the resource. Resource objects returned by `executionAsyncResource()` are most often internal Node.js handle objects with undocumented APIs. Using any functions or properties on the object is likely to crash your application and should be avoided. Using `executionAsyncResource()` in the top-level execution context will return an empty object as there is no handle or request object to use, but having an object representing the top-level can be helpful. ```mjs import { open } from 'node:fs'; import { executionAsyncId, executionAsyncResource } from 'node:async\_hooks'; console.log(executionAsyncId(), executionAsyncResource()); // 1 {} open(new URL(import.meta.url), 'r', (err, fd) => { console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap }); ``` ```cjs const { open } = require('node:fs'); const { executionAsyncId, executionAsyncResource } = require('node:async\_hooks'); console.log(executionAsyncId(), executionAsyncResource()); // 1 {} open(\_\_filename, 'r', (err, fd) => { console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap }); ``` This can be used to implement continuation local storage without the use of a tracking `Map` to store the metadata: ```mjs import { createServer } from 'node:http'; import { executionAsyncId, executionAsyncResource, createHook, } from 'node:async\_hooks'; const sym = Symbol('state'); // Private symbol to avoid pollution createHook({ init(asyncId, type, triggerAsyncId, resource) { const cr = executionAsyncResource(); if (cr) { resource[sym] = cr[sym]; } }, }).enable(); const server = createServer((req, res) => { executionAsyncResource()[sym] = { 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 symbol to avoid pollution createHook({ init(asyncId, type, triggerAsyncId, resource) { const cr = executionAsyncResource(); if (cr) { resource[sym] =
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.1042899638414383, -0.005604298319667578, 0.013755476102232933, 0.04392041265964508, -0.06774263083934784, -0.11835432797670364, -0.0536421537399292, 0.055340349674224854, -0.0027165634091943502, -0.029912788420915604, -0.06079646199941635, -0.018521400168538094, -0.1235588863492012, -0.03281503915786743, -0.08442892879247665, 0.08023005723953247, 0.020080333575606346, 0.031418249011039734, -0.0545649416744709, -0.06397490203380585, 0.014144664630293846, -0.08264987915754318, 0.08913492411375046, -0.00024939983268268406, -0.046611376106739044, -0.10551813989877701, 0.0481346920132637, 0.009402737952768803, -0.017563238739967346, -0.12141837924718857, -0.037891265004873276, -0.03564457967877388, -0.06070898100733757, -0.05173800513148308, -0.06891725957393646, -0.052507732063531876, 0.01531183160841465, 0.0329815037548542, 0.054541729390621185, -0.06275314837694168, 0.04733739793300629, 0.031862515956163406, -0.014583771117031574, -0.015171864069998264, 0.0065728831104934216, -0.045663733035326004, 0.0647890567779541, 0.00629887031391263, -0.0607168972492218, -0.05865761637687683, 0.06354372203350067, 0.13646537065505981, -0.033789604902267456, -0.005068332888185978, -0.07997597754001617, 0.06873185187578201, -0.011940836906433105, -0.0006027022609487176, 0.016462931409478188, -0.04505079984664917, 0.016721393913030624, 0.05577614903450012, 0.01508832536637783, 0.006290911231189966, 0.026667075231671333, -0.007549417670816183, -0.05464813858270645, 0.07312993705272675, -0.021008649840950966, -0.05431712418794632, -0.01847887970507145, 0.05961515009403229, 0.051197219640016556, 0.004688967484980822, 0.027300138026475906, 0.0513058640062809, 0.07740899175405502, -0.06504463404417038, -0.024251021444797516, -0.06710556894540787, 0.09925462305545807, -0.019180139526724815, 0.029480643570423126, 0.03584504500031471, -0.014567753300070763, -0.002915447810664773, -0.010462861508131027, 0.025017686188220978, 0.010391375049948692, -0.016098743304610252, 0.04675757512450218, -0.0012590890983119607, -0.09699641168117523, -0.023135727271437645, 0.0033022998832166195, -0.022117627784609795, -0.04149860143661499, 0.010306764394044876, -0.03989024460315704, 0.06015891581773758, 0.038971900939941406, -0.0282677561044693, 0.019985537976026535, 0.05019424110651016, -0.012178461998701096, 0.06541725993156433, -0.0027375028003007174, 0.0986052006483078, 0.06620405614376068, 0.09909937530755997, -0.08827240765094757, -0.04241414740681648, -0.004508318845182657, 0.0019639679230749607, 8.206728503945186e-33, -0.021294457837939262, -0.08277837932109833, -0.029052430763840675, 0.005097624380141497, 0.019652800634503365, 0.0026977320667356253, 0.013773202896118164, 0.031621549278497696, -0.022639770060777664, 0.010763771831989288, 0.01229855976998806, -0.033248212188482285, 0.022562077268958092, 0.010529817081987858, -0.01503762137144804, -0.02758329175412655, 0.06803102046251297, -0.059944815933704376, 0.02657287009060383, 0.03968188911676407, 0.04346276447176933, 0.015706481412053108, 0.0070740701630711555, 0.10032028704881668, 0.048349641263484955, -0.006113458890467882, -0.040671661496162415, 0.021121840924024582, -0.09719796478748322, 0.03490368276834488, -0.01461208425462246, 0.00803909357637167, -0.11533918976783752, 0.008965983986854553, 0.04313234984874725, 0.039806898683309555, -0.026356972754001617, -0.036938559263944626, -0.07246361672878265, -0.05646329000592232, -0.05193644389510155, 0.022805454209446907, -0.13325132429599762, 0.00120974809397012, -0.04520183801651001, -0.1360100358724594, -0.06593192368745804, 0.039246030151844025, 0.07091894745826721, 0.03888241946697235, -0.018420690670609474, 0.062228791415691376, 0.11768478155136108, -0.01237663347274065, 0.06724198162555695, 0.015836616978049278, -0.0053485604003071785, -0.09413601458072662, -0.04612009599804878, 0.061142485588788986, 0.0659073144197464, -0.09253942221403122, -0.04334988445043564, -0.014950856566429138, -0.043683089315891266, 0.02110561728477478, 0.005955710541456938, 0.005710499361157417, -0.04562186822295189, -0.030362101271748543, -0.007552443537861109, 0.053099483251571655, -0.0005577636766247451, 0.009401020593941212, 0.027416812255978584, 0.0264239851385355, -0.021259305998682976, -0.030571170151233673, 0.028199411928653717, 0.006638359744101763, 0.029668083414435387, 0.0012129551032558084, -0.07614055275917053, 0.0015390204498544335, -0.050079043954610825, 0.08215321600437164, -0.0076574780978262424, -0.08122604340314865, 0.041252247989177704, 0.013483169488608837, 0.06103523448109627, -0.03664525970816612, 0.01548827812075615, 0.014040905982255936, -0.07027345895767212, -9.872478936825232e-33, 0.0470704585313797, -0.024109749123454094, -0.0571986548602581, 0.049961529672145844, -0.017221981659531593, -0.03773055598139763, -0.05581999942660332, 0.11725082248449326, -0.04396900162100792, -0.07840187102556229, -0.02143215388059616, 0.05609085038304329, 0.02309267595410347, 0.010588671080768108, 0.021500758826732635, 0.025671014562249184, -0.03063473291695118, -0.0906190425157547, 0.014364718459546566, 0.033955711871385574, 0.045939985662698746, -0.047742705792188644, 0.038597945123910904, -0.01555876899510622, -0.06127521023154259, 0.008805010467767715, -0.028121819719672203, -0.05812402442097664, -0.03659835085272789, -0.07539650052785873, 0.05546265468001366, -0.02850770205259323, -0.0041691274382174015, 0.08175016939640045, 0.028315404430031776, 0.00424616876989603, 0.09882111102342606, 0.022130165249109268, -0.019199730828404427, -0.06283333152532578, 0.12824419140815735, 0.0675281435251236, 0.010624132119119167, -0.024389322847127914, 0.004832190461456776, 0.007327750790864229, -0.11794860661029816, 0.05541253089904785, 0.01335082296282053, -0.04509301856160164, 0.05000228062272072, -0.0042398483492434025, 0.05000307783484459, 0.08077007532119751, 0.002159318421036005, -0.0038109521847218275, 0.07420492172241211, 0.004763321485370398, 0.061469726264476776, 0.060926880687475204, 0.013126176781952381, -0.072649285197258, 0.027452407404780388, -0.00015308489673770964, -0.06602828204631805, 0.020326226949691772, -0.03263092786073685, 0.018663499504327774, 0.04962921887636185, 0.011244989931583405, 0.004245100077241659, -0.0021399776451289654, -0.08344124257564545, -0.02815799042582512, -0.020032640546560287, -0.004219442140311003, -0.005952758714556694, -0.13337203860282898, 0.017443567514419556, 0.05785985663533211, -0.06681416928768158, 0.017077036201953888, -0.018087588250637054, 0.019786424934864044, -0.01159295067191124, 0.009967053309082985, 0.033826012164354324, 0.02311757206916809, 0.05261985957622528, -0.005335251800715923, -0.00968360248953104, 0.07003684341907501, -0.0890427827835083, 0.05399949476122856, 0.006723933387547731, -5.8121599977312144e-8, -0.05483197793364525, -0.020225975662469864, 0.017036836594343185, -0.00958307646214962, -0.011328623630106449, -0.057351719588041306, 0.040064737200737, -0.03625631704926491, 0.0142295453697443, -0.05539320409297943, 0.0030855198856443167, 0.034781452268362045, 0.060145486146211624, -0.03532226383686066, -0.025279197841882706, 0.059621766209602356, 0.10136242210865021, -0.019377270713448524, 0.030735814943909645, -0.012373660691082478, -0.048762060701847076, -0.03709521144628525, 0.019874772056937218, 0.04574708640575409, -0.00937141478061676, 0.004127137828618288, 0.06903295964002609, 0.12724962830543518, -0.06414218246936798, -0.054901983588933945, -0.0906841903924942, 0.05521095171570778, 0.014105918817222118, 0.05107055976986885, -0.10872197151184082, 0.05253397300839424, -0.02836846001446247, -0.0924379974603653, 0.042151737958192825, 0.0191730335354805, 0.06567390263080597, -0.009282033890485764, 0.033338259905576706, 0.028524070978164673, 0.016463708132505417, 0.0430096834897995, -0.014300964772701263, 0.018703900277614594, -0.02185012772679329, -0.028999295085668564, -0.04283515363931656, -0.008034932427108288, -0.03949370235204697, 0.041364964097738266, 0.017436880618333817, -0.030580993741750717, -0.0017811546567827463, -0.043105874210596085, 0.04117760807275772, 0.03357137739658356, 0.0047054891474545, 0.012279232032597065, 0.075111523270607, -0.03365611284971237 ]
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 symbol to avoid pollution createHook({ init(asyncId, type, triggerAsyncId, resource) { const cr = executionAsyncResource(); if (cr) { resource[sym] = cr[sym]; } }, }).enable(); const server = createServer((req, res) => { executionAsyncResource()[sym] = { state: req.url }; setTimeout(function() { res.end(JSON.stringify(executionAsyncResource()[sym])); }, 100); }).listen(3000); ``` ### `async\_hooks.executionAsyncId()` \* Returns: {number} The `asyncId` of the current execution context. Useful to track when something calls. ```mjs import { executionAsyncId } from 'node:async\_hooks'; import fs from 'node:fs'; console.log(executionAsyncId()); // 1 - bootstrap const path = '.'; fs.open(path, 'r', (err, fd) => { console.log(executionAsyncId()); // 6 - open() }); ``` ```cjs const async\_hooks = require('node:async\_hooks'); const fs = require('node:fs'); console.log(async\_hooks.executionAsyncId()); // 1 - bootstrap const path = '.'; fs.open(path, 'r', (err, fd) => { console.log(async\_hooks.executionAsyncId()); // 6 - open() }); ``` The ID returned from `executionAsyncId()` is related to execution timing, not causality (which is covered by `triggerAsyncId()`): ```js const server = net.createServer((conn) => { // Returns the ID of the server, not of the new connection, because the // callback runs in the execution scope of the server's MakeCallback(). async\_hooks.executionAsyncId(); }).listen(port, () => { // Returns the ID of a TickObject (process.nextTick()) because all // callbacks passed to .listen() are wrapped in a nextTick(). async\_hooks.executionAsyncId(); }); ``` Promise contexts may not get precise `executionAsyncIds` by default. See the section on [promise execution tracking][]. ### `async\_hooks.triggerAsyncId()` \* Returns: {number} The ID of the resource responsible for calling the callback that is currently being executed. ```js const server = net.createServer((conn) => { // The resource that caused (or triggered) this callback to be called // was that of the new connection. Thus the return value of triggerAsyncId() // is the asyncId of "conn". async\_hooks.triggerAsyncId(); }).listen(port, () => { // Even though all callbacks passed to .listen() are wrapped in a nextTick() // the callback itself exists because the call to the server's .listen() // was made. So the return value would be the ID of the server. async\_hooks.triggerAsyncId(); }); ``` Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. ### `async\_hooks.asyncWrapProviders` \* Returns: A map of provider types to the corresponding numeric id. This map contains all the event types that might be emitted by the `async\_hooks.init()` event. This feature suppresses the deprecated usage of `process.binding('async\_wrap').Providers`. See: [DEP0111][] ## Promise execution tracking By default, promise executions are not assigned `asyncId`s due to the relatively expensive nature of the [promise introspection API][PromiseHooks] provided by V8. This means that programs using promises or `async`/`await` will not get correct execution and trigger ids for promise callback contexts by default. ```mjs import { executionAsyncId, triggerAsyncId } from 'node:async\_hooks'; Promise.resolve(1729).then(() => { console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`); }); // produces: // eid 1 tid 0 ``` ```cjs const { executionAsyncId, triggerAsyncId } = require('node:async\_hooks'); Promise.resolve(1729).then(() => { console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`); }); // produces: // eid 1 tid 0 ``` Observe that the `then()` callback claims to have executed in the context of the outer scope even though there was an asynchronous hop involved. Also, the `triggerAsyncId` value is `0`, which means that we are missing context about the resource that caused (triggered) the `then()` 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.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`); }); // produces: // eid 7 tid 6 ``` ```cjs const
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.05335459113121033, -0.008788155391812325, 0.06673546135425568, 0.030179761350154877, -0.013633224181830883, -0.027266202494502068, -0.07856340706348419, 0.04020538926124573, -0.03616991266608238, 0.037829551845788956, 0.0009437901899218559, -0.032230570912361145, -0.09458327293395996, -0.004823092836886644, -0.061747536063194275, 0.026820626109838486, 0.01822076365351677, 0.08537498116493225, -0.12528367340564728, -0.09938852488994598, -0.024453287944197655, -0.029291793704032898, 0.13376577198505402, -0.036159347742795944, -0.10783063620328903, -0.029264327138662338, -0.017668377608060837, 0.09241554886102676, 0.06122259795665741, -0.056864626705646515, -0.019208170473575592, 0.040972884744405746, -0.021037491038441658, -0.04897064343094826, 0.021577350795269012, -0.04316722974181175, 0.01020385604351759, 0.015842251479625702, 0.0198199599981308, -0.10496841371059418, -0.03678286075592041, 0.013880809769034386, -0.016289226710796356, -0.02112266980111599, 0.04261152073740959, -0.03032282367348671, -0.002424604957923293, 0.006949845235794783, -0.0908145159482956, 0.06908208876848221, -0.020167939364910126, 0.04996981471776962, 0.01662312261760235, -0.014112609438598156, 0.01708482764661312, 0.017125830054283142, 0.04483548924326897, 0.001462582848034799, 0.019346004351973534, -0.047721393406391144, 0.004100113175809383, -0.040353093296289444, 0.00124188675545156, -0.018723953515291214, -0.007991695776581764, -0.10006213933229446, 0.008821303024888039, -0.04713624343276024, -0.05766606330871582, -0.04084499552845955, 0.0038206754252314568, -0.024866580963134766, 0.097852922976017, 0.0378994382917881, -0.027310354635119438, 0.014136291109025478, -0.037649914622306824, -0.0334586463868618, 0.05218096449971199, -0.09717302769422531, -0.027067499235272408, 0.00298107648268342, 0.0652107372879982, 0.008296267129480839, 0.03075704723596573, -0.03577091917395592, 0.02332531474530697, 0.02958715707063675, -0.010530068539083004, 0.01679733581840992, 0.024829335510730743, 0.04220324009656906, -0.05885254591703415, -0.009428950026631355, 0.0282877329736948, -0.01764163188636303, 0.039603374898433685, -0.040168773382902145, 0.04278402030467987, 0.05278154835104942, 0.01846357434988022, -0.04640047624707222, 0.11304985731840134, 0.10140997916460037, -0.06834618002176285, 0.03813691437244415, 0.05360328406095505, 0.1391308754682541, -0.04954241216182709, -0.04128933325409889, -0.04079103097319603, 0.018860645592212677, -0.02634909749031067, 0.08126868307590485, 5.421706513016728e-33, 0.03325248509645462, -0.018519693985581398, -0.01241567824035883, -0.003661510068923235, 0.03567874804139137, -0.030061479657888412, 0.05787685513496399, -0.03451840206980705, -0.06075510382652283, -0.034429293125867844, -0.042444150894880295, -0.061015088111162186, 0.03405417129397392, -0.06277711689472198, -0.039621300995349884, -0.09404496848583221, 0.07404972612857819, -0.02941846288740635, 0.10200828313827515, -0.015225611627101898, -0.014691618271172047, -0.10000665485858917, -0.031141165643930435, 0.015218731947243214, 0.009364434517920017, -0.05471936613321304, -0.008041094057261944, 0.11157330870628357, -0.042102161794900894, -0.03930218890309334, 0.15992122888565063, 0.07654938846826553, -0.07631560415029526, 0.018839435651898384, 0.01653883419930935, -0.09778963774442673, -0.009807060472667217, 0.059174131602048874, -0.052597951143980026, -0.0631847158074379, 0.05350753664970398, 0.04719987511634827, -0.09505932778120041, 0.03443419188261032, -0.04101532697677612, -0.09171564131975174, -0.07150450348854065, -0.10805139690637589, 0.0235737357288599, -0.02919331006705761, 0.029431156814098358, 0.044186461716890335, 0.06529931724071503, -0.03667242452502251, 0.0347701758146286, 0.02914528176188469, -0.0003459372092038393, -0.07928472012281418, -0.06961588561534882, 0.040639497339725494, 0.016995998099446297, -0.019227849319577217, 0.01651761308312416, 0.0010601335670799017, 0.0406484380364418, 0.0303849745541811, -0.01793932169675827, 0.031084131449460983, 0.04348709434270859, 0.0060084182769060135, 0.017601056024432182, -0.035307832062244415, 0.029240645468235016, 0.003998005297034979, -0.04489230737090111, 0.014551970176398754, -0.02534298598766327, -0.0013534787576645613, -0.06508665531873703, -0.06824290007352829, 0.06349975615739822, -0.07460591197013855, -0.051446057856082916, 0.10302309691905975, 0.09209129959344864, -0.027310175821185112, -0.0728997141122818, -0.05858299881219864, 0.004571157041937113, 0.07483283430337906, -0.008795715868473053, 0.021121831610798836, 0.08461777865886688, -0.0696837306022644, -0.07846386730670929, -7.630831780958269e-33, 0.047172993421554565, -0.036964692175388336, -0.02599833905696869, 0.0715683102607727, 0.021517813205718994, -0.004229171201586723, -0.005016561597585678, 0.029251663014292717, -0.03530900925397873, 0.06881741434335709, 0.016546580940485, 0.042437855154275894, 0.05155453830957413, 0.076910100877285, -0.026082096621394157, 0.02292182296514511, 0.04582026228308678, -0.05256005376577377, 0.026133472099900246, 0.03645092621445656, -0.01883707381784916, 0.05394832417368889, 0.03619210422039032, 0.007213786244392395, -0.05975065380334854, 0.024389836937189102, -0.018665358424186707, -0.02491520345211029, -0.08487153053283691, -0.07809687405824661, -0.07069198787212372, -0.002074070041999221, -0.03991972282528877, 0.11226291209459305, 0.024182628840208054, -0.08009655028581619, 0.05975746363401413, 0.09602198749780655, 0.007104367483407259, -0.00010452800779603422, 0.11615440994501114, -0.0372793935239315, -0.054511308670043945, 0.027612585574388504, -0.011502665467560291, -0.03633078560233116, -0.003783122170716524, 0.0353870615363121, -0.09145847707986832, 0.021024061366915703, -0.025353066623210907, -0.018049245700240135, 0.04666977748274803, 0.054012369364500046, 0.000047119192458922043, 0.027641618624329567, 0.056875333189964294, -0.051126912236213684, 0.03161268308758736, 0.04436369240283966, -0.005184869281947613, -0.162932351231575, -0.029451726004481316, -0.002800391288474202, 0.029059791937470436, -0.033188723027706146, -0.0781911239027977, 0.01527877151966095, 0.07606177031993866, 0.012670652940869331, 0.014049401506781578, 0.07272354513406754, -0.06194142624735832, -0.01588396541774273, 0.00018649245612323284, -0.045155808329582214, -0.040058352053165436, -0.11946262419223785, 0.002374272560700774, 0.07142951339483261, -0.11125241219997406, 0.07769764214754105, -0.044558458030223846, -0.03201119229197502, 0.059452105313539505, 0.007127187680453062, -0.09103067219257355, 0.03177599981427193, 0.001099213259294629, -0.01629561558365822, -0.025373151525855064, 0.019479773938655853, -0.08719010651111603, 0.046455420553684235, -0.015210785903036594, -5.581310347224644e-8, -0.010660315863788128, 0.04422967508435249, 0.001035777386277914, 0.043429259210824966, 0.03820358216762543, -0.010848235338926315, 0.0005889731110073626, -0.07899907976388931, 0.008659527637064457, 0.013762046582996845, -0.037095777690410614, 0.020156588405370712, 0.053644269704818726, 0.013266516849398613, -0.003287379862740636, -0.06763257086277008, -0.021844707429409027, 0.031170612201094627, -0.00835159420967102, 0.0132908895611763, 0.018262183293700218, 0.031101619824767113, -0.039931539446115494, 0.04151912033557892, 0.046146780252456665, -0.04759129136800766, 0.13800488412380219, 0.0505506731569767, -0.06274078041315079, 0.02476152591407299, -0.07685055583715439, -0.0071009621024131775, -0.006210742983967066, -0.009138825349509716, -0.05446583777666092, -0.00322301615960896, 0.0005583253223448992, -0.007782351225614548, 0.048116933554410934, 0.0363440178334713, 0.11295532435178757, 0.06787218898534775, -0.0247990470379591, 0.03573334962129593, -0.00853003840893507, 0.03150150179862976, 0.03948339447379112, 0.045822855085134506, 0.06406958401203156, 0.03735671564936638, 0.013883080333471298, -0.06481913477182388, 0.00497469725087285, -0.04993228241801262, 0.045264847576618195, -0.039074722677469254, 0.004208041820675135, -0.04301072284579277, -0.0011536533711478114, 0.06539060175418854, 0.07342991977930069, 0.020073482766747475, 0.017844613641500473, -0.04072633758187294 ]
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.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`); }); // produces: // eid 7 tid 6 ``` ```cjs const { createHook, executionAsyncId, triggerAsyncId } = require('node:async\_hooks'); createHook({ init() {} }).enable(); // forces PromiseHooks to be enabled. Promise.resolve(1729).then(() => { console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`); }); // produces: // eid 7 tid 6 ``` In this example, adding any actual hook function enabled the tracking of promises. There are two promises in the example above; the promise created by `Promise.resolve()` and the promise returned by the call to `then()`. In the example above, the first promise got the `asyncId` `6` and the latter got `asyncId` `7`. During the execution of the `then()` callback, we are executing in the context of promise with `asyncId` `7`. This promise was triggered by async resource `6`. Another subtlety with promises is that `before` and `after` callbacks are run only on chained promises. That means promises not created by `then()`/`catch()` will not have the `before` and `after` callbacks fired on them. For more details see the details of the V8 [PromiseHooks][] API. ### Disabling promise execution tracking Tracking promise execution can cause a significant performance overhead. To opt out of promise tracking, set `trackPromises` to `false`: ```cjs const { createHook } = require('node:async\_hooks'); const { writeSync } = require('node:fs'); createHook({ init(asyncId, type, triggerAsyncId, resource) { // This init hook does not get called when trackPromises is set to false. writeSync(1, `init hook triggered for ${type}\n`); }, trackPromises: false, // Do not track promises. }).enable(); Promise.resolve(1729); ``` ```mjs import { createHook } from 'node:async\_hooks'; import { writeSync } from 'node:fs'; createHook({ init(asyncId, type, triggerAsyncId, resource) { // This init hook does not get called when trackPromises is set to false. writeSync(1, `init hook triggered for ${type}\n`); }, trackPromises: false, // Do not track promises. }).enable(); Promise.resolve(1729); ``` ## JavaScript embedder API Library developers that handle their own asynchronous resources performing tasks like I/O, connection pooling, or managing callback queues may use the `AsyncResource` JavaScript API so that all the appropriate callbacks are called. ### Class: `AsyncResource` The documentation for this class has moved [`AsyncResource`][]. ## Class: `AsyncLocalStorage` The documentation for this class has moved [`AsyncLocalStorage`][]. [DEP0111]: deprecations.md#dep0111-processbinding [Diagnostics Channel]: diagnostics\_channel.md [Hook Callbacks]: #hook-callbacks [PromiseHooks]: https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH\_qaYR79FELlk/edit [`AsyncHook`]: #class-asynchook [`AsyncLocalStorage`]: async\_context.md#class-asynclocalstorage [`AsyncResource`]: async\_context.md#class-asyncresource [`Worker`]: worker\_threads.md#class-worker [`after` callback]: #afterasyncid [`before` callback]: #beforeasyncid [`createHook`]: #async\_hookscreatehookoptions [`destroy` callback]: #destroyasyncid [`executionAsyncResource`]: #async\_hooksexecutionasyncresource [`init` callback]: #initasyncid-type-triggerasyncid-resource [`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo [`promiseResolve` callback]: #promiseresolveasyncid [promise execution tracking]: #promise-execution-tracking
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.06606584042310715, 0.014466275461018085, 0.013398696668446064, -0.024903926998376846, -0.0066825756803154945, -0.07802974432706833, -0.09200231730937958, 0.00046367934555746615, -0.06429226696491241, 0.0662914365530014, 0.029926586896181107, -0.03448053449392319, -0.08988399803638458, -0.03390252962708473, -0.03760547935962677, 0.01873151771724224, 0.0031082367058843374, 0.04048699513077736, -0.0471949577331543, -0.07751965522766113, 0.006692102178931236, -0.07337602227926254, 0.1097412034869194, 0.013769413344562054, -0.04724981635808945, -0.02934987097978592, -0.027616962790489197, 0.05217478424310684, 0.07160671800374985, -0.03627035394310951, -0.08281976729631424, 0.06936322897672653, -0.04290830343961716, -0.03466709703207016, 0.010133227333426476, -0.09175140410661697, 0.0033862912096083164, 0.04511714726686478, 0.03358721360564232, -0.11308228224515915, -0.008468051441013813, -0.007967588491737843, 0.01958974078297615, 0.020218057557940483, 0.011695927940309048, 0.0273742638528347, 0.029147494584321976, -0.0037100811023265123, -0.09854872524738312, 0.06263922154903412, 0.04569868743419647, 0.01779181882739067, 0.02887081541121006, 0.008435660041868687, -0.04270792379975319, 0.0017745905788615346, 0.016935251653194427, 0.039341479539871216, -0.026700085029006004, -0.015570598654448986, 0.006237442139536142, 0.02303607203066349, 0.039345256984233856, -0.032190874218940735, 0.03162708505988121, -0.05490037798881531, -0.03206896409392357, -0.02775251865386963, -0.000857528590131551, 0.01584564708173275, -0.0050074439495801926, -0.04666556417942047, 0.09447706490755081, 0.006717662326991558, -0.02668781951069832, 0.06032991781830788, 0.02921406738460064, 0.033727459609508514, -0.02357589453458786, -0.17660841345787048, 0.024730755016207695, 0.0058404128067195415, -0.015569898299872875, 0.037447839975357056, 0.05201936885714531, -0.06980147212743759, -0.0002859216183423996, 0.00620619859546423, 0.05184950307011604, -0.02421548031270504, 0.0451161190867424, 0.04274306818842888, -0.015579117462038994, 0.031527746468782425, -0.06814467161893845, -0.08700999617576599, -0.06858079880475998, -0.005517786368727684, -0.019569605588912964, 0.0536210872232914, 0.042692266404628754, 0.0035123673733323812, 0.04791687801480293, 0.04799187183380127, -0.037743471562862396, 0.08330243825912476, 0.00872600357979536, 0.13607126474380493, 0.057259660214185715, 0.06474882364273071, -0.015195722691714764, -0.005243588238954544, 0.05380887910723686, -0.020793311297893524, 4.194557634341447e-33, 0.05923774465918541, -0.03534521535038948, 0.003821255639195442, 0.002312796888872981, 0.00648258114233613, 0.023276617750525475, 0.008340438827872276, -0.00743886549025774, -0.08548837900161743, -0.022205913439393044, -0.01132536306977272, -0.02101822942495346, 0.0041845995001494884, -0.024491650983691216, -0.0015882204752415419, -0.019888615235686302, 0.03746505454182625, -0.0817301943898201, 0.03316907212138176, 0.08055417239665985, 0.004237507935613394, -0.057365793734788895, -0.04886568337678909, -0.009199528023600578, -0.001890399493277073, 0.03793228790163994, -0.04017059877514839, 0.12431742995977402, -0.023802001029253006, -0.005625484045594931, 0.02925826981663704, 0.018137803301215172, -0.028565915301442146, 0.01912732422351837, -0.026329467073082924, -0.038557715713977814, -0.08127810806035995, -0.0032477397471666336, -0.06288860738277435, -0.0546124093234539, 0.042116373777389526, 0.06757447123527527, -0.07790859788656235, -0.00590151734650135, -0.07922204583883286, -0.10664517432451248, -0.0585469976067543, -0.04727054014801979, 0.13382172584533691, -0.04927576705813408, 0.054341379553079605, 0.0573175847530365, 0.06503302603960037, -0.11190646886825562, 0.07955446094274521, 0.0018590642139315605, -0.011855528689920902, -0.021018052473664284, -0.0060777501203119755, 0.03186913952231407, 0.06498129665851593, -0.1297685205936432, -0.031312089413404465, 0.029542088508605957, 0.016927311196923256, 0.015249514952301979, -0.06473845988512039, 0.02644944377243519, -0.07485394924879074, -0.009333459660410881, -0.002277015009894967, -0.061374641954898834, 0.012487388215959072, 0.018967606127262115, 0.027719860896468163, 0.016671566292643547, -0.04628923907876015, -0.038199469447135925, -0.029438745230436325, -0.042359981685876846, 0.02702275477349758, -0.04960982874035835, -0.06159503385424614, 0.054326143115758896, 0.06814668327569962, 0.04379783943295479, -0.055770281702280045, -0.09751606732606888, 0.0430985763669014, 0.09357334673404694, 0.028575100004673004, -0.014659910462796688, 0.043397869914770126, -0.016358712688088417, -0.06750986725091934, -7.497548353990284e-33, 0.0668218806385994, 0.05243312194943428, -0.07856402546167374, 0.02720867283642292, -0.013209568336606026, 0.035729795694351196, 0.013386337086558342, -0.044623829424381256, -0.014955262653529644, -0.039409298449754715, 0.040297552943229675, -0.0071244812570512295, 0.05979318544268608, 0.13477514684200287, 0.08946611732244492, 0.030413692817091942, 0.027525722980499268, -0.004357210360467434, 0.07861641049385071, 0.017481384798884392, 0.02183319628238678, 0.006660292390733957, 0.010602915659546852, 0.0321943499147892, -0.02906237170100212, -0.01647387631237507, -0.018547335639595985, 0.0018423026194795966, -0.06341184675693512, -0.08078742772340775, -0.03259359300136566, -0.050493814051151276, -0.08541455864906311, 0.14507347345352173, 0.007503122091293335, -0.04488419368863106, 0.04734478145837784, 0.019612904638051987, -0.058844465762376785, -0.10325860232114792, 0.09131038188934326, -0.019901912659406662, -0.09726093709468842, 0.04321424663066864, 0.047396957874298096, -0.01691051945090294, 0.014620021916925907, 0.07830830663442612, -0.025767255574464798, 0.00063375971512869, -0.04587845876812935, 0.014922569505870342, 0.01845642924308777, 0.0698077455163002, -0.03424270823597908, -0.014094407670199871, 0.15003728866577148, -0.07377371191978455, 0.06397897750139236, 0.01611771248281002, -0.0005583490710705519, -0.07193514704704285, 0.01548052579164505, -0.04653503745794296, 0.018817555159330368, 0.00007009271939750761, -0.041650399565696716, -0.005609241314232349, 0.06469276547431946, 0.03439775109291077, 0.07557416707277298, -0.03023306466639042, -0.10334509611129761, -0.055681146681308746, -0.023447632789611816, 0.010809127241373062, -0.02817179448902607, -0.13551107048988342, 0.017548272386193275, 0.050696875900030136, -0.035741228610277176, 0.018245672807097435, 0.030062846839427948, 0.014837625436484814, -0.005646507255733013, -0.0022235428914427757, 0.009034141898155212, 0.057286813855171204, -0.014585679396986961, 0.05438714846968651, 0.03054109588265419, -0.02900470793247223, -0.09891702234745026, 0.035854242742061615, 0.01660412922501564, -5.2167106190381674e-8, -0.04875854030251503, -0.0322059765458107, -0.05798307806253433, -0.04079195484519005, 0.03819187730550766, -0.04109158366918564, 0.011792291887104511, -0.0435776486992836, -0.03801695629954338, -0.07021345943212509, -0.00272801099345088, -0.024328237399458885, 0.1149960532784462, 0.03691984340548515, 0.0017727662343531847, -0.015967871993780136, -0.021298132836818695, 0.0403737798333168, -0.011271449737250805, 0.014063169248402119, -0.08655088394880295, 0.004756230395287275, 0.021799802780151367, -0.016458267346024513, -0.014042813330888748, -0.03528552129864693, 0.11830278486013412, 0.11495675146579742, -0.021323183551430702, 0.026566650718450546, -0.09816910326480865, -0.043986640870571136, 0.01585579104721546, -0.004694468807429075, -0.011155534535646439, 0.018031150102615356, 0.04187219589948654, -0.002128579653799534, 0.1023215726017952, -0.026842843741178513, 0.03696341812610626, 0.05576346814632416, 0.011004992760717869, 0.009628308936953545, -0.0050720893777906895, -0.0028678744565695524, -0.0011241903994232416, -0.005663951858878136, 0.04196659475564957, 0.04573216289281845, -0.02918940782546997, -0.045299869030714035, 0.05454583838582039, 0.02119537629187107, 0.037731364369392395, -0.05901845172047615, -0.005713572259992361, -0.0925481840968132, 0.016751734539866447, 0.04410606622695923, 0.06213027983903885, -0.0340782031416893, 0.06885603815317154, -0.05716767534613609 ]
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, or actions related to it can be controlled. For example, file system reads can be allowed while denying writes. This feature does not protect against malicious code. According to the Node.js [Security Policy][], Node.js trusts any code it is asked to run. The permission model implements a "seat belt" approach, which prevents trusted code from unintentionally changing files or using resources that access has not explicitly been granted to. It does not provide security guarantees in the presence of malicious code. Malicious code can bypass the permission model and execute arbitrary code without the restrictions imposed by the permission model. If you find a potential security vulnerability, please refer to our [Security Policy][]. ## Process-based permissions ### Permission Model > Stability: 2 - Stable The Node.js Permission Model is a mechanism for restricting access to specific resources during execution. The API exists behind a flag [`--permission`][] which when enabled, will restrict access to all available permissions. The available permissions are documented by the [`--permission`][] flag. When starting Node.js with `--permission`, the ability to access the file system through the `fs` module, access the network, spawn processes, use `node:worker\_threads`, use native addons, use WASI, and enable the runtime inspector will be restricted (the listener for SIGUSR1 won't be created). ```console $ node --permission index.js Error: Access to this API has been restricted at node:internal/main/run\_main\_module:23:47 { code: 'ERR\_ACCESS\_DENIED', permission: 'FileSystemRead', resource: '/home/user/index.js' } ``` Allowing access to spawning a process and creating worker threads can be done using the [`--allow-child-process`][] and [`--allow-worker`][] respectively. To allow network access, use [`--allow-net`][] and for allowing native addons when using permission model, use the [`--allow-addons`][] flag. For WASI, use the [`--allow-wasi`][] flag. #### Runtime API When enabling the Permission Model through the [`--permission`][] flag a new property `permission` is added to the `process` object. This property contains one function: ##### `permission.has(scope[, reference])` API call to check permissions at runtime ([`permission.has()`][]) ```js process.permission.has('fs.write'); // true process.permission.has('fs.write', '/home/rafaelgss/protected-folder'); // true process.permission.has('fs.read'); // true process.permission.has('fs.read', '/home/rafaelgss/protected-folder'); // false ``` #### File System Permissions The Permission Model, by default, restricts access to the file system through the `node:fs` module. It does not guarantee that users will not be able to access the file system through other means, such as through the `node:sqlite` module. To allow access to the file system, use the [`--allow-fs-read`][] and [`--allow-fs-write`][] flags: ```console $ node --permission --allow-fs-read=\* --allow-fs-write=\* index.js Hello world! ``` By default the entrypoints of your application are included in the allowed file system read list. For example: ```console $ node --permission index.js ``` \* `index.js` will be included in the allowed file system read list ```console $ node -r /path/to/custom-require.js --permission index.js. ``` \* `/path/to/custom-require.js` will be included in the allowed file system read list. \* `index.js` will be included in the allowed file system read list. The valid arguments for both flags are: \* `\*` - To allow all `FileSystemRead` or `FileSystemWrite` operations, respectively. \* Relative paths to the current working directory. \* Absolute paths. Example: \* `--allow-fs-read=\*` - It will allow all `FileSystemRead` operations. \* `--allow-fs-write=\*` - 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 supported too: \* `--allow-fs-read=/home/test\*` will allow read access to everything that matches the
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.015069428831338882, -0.021570269018411636, -0.012804282829165459, 0.056365370750427246, -0.007118597161024809, -0.04705943539738655, -0.008475987240672112, 0.05666371434926987, -0.027163218706846237, -0.008248505182564259, -0.03119475767016411, -0.05023198947310448, -0.014364992268383503, -0.051706213504076004, 0.009123638272285461, 0.031022809445858, -0.02804243005812168, 0.005377957597374916, -0.10430319607257843, 0.0037422021850943565, -0.009384159930050373, -0.1322045475244522, 0.0698789730668068, 0.02238958328962326, -0.1757255643606186, -0.06031191721558571, 0.03694078326225281, -0.01849755272269249, 0.0926271453499794, -0.05118943005800247, 0.031094921752810478, 0.008358670398592949, 0.012966018170118332, -0.06281763315200806, -0.07437220960855484, -0.08309949934482574, 0.02078305557370186, 0.027634792029857635, -0.020907118916511536, 0.02640794962644577, -0.03993520140647888, -0.05601862445473671, -0.0078117940574884415, -0.011022716760635376, -0.018098892644047737, -0.0040642512030899525, 0.08067459613084793, -0.03472093120217323, -0.0484488382935524, 0.04297378286719322, -0.015235821716487408, 0.08250971138477325, 0.012690837495028973, -0.05361924320459366, 0.031206391751766205, -0.016569694504141808, -0.002179574454203248, 0.11965066939592361, 0.0601833276450634, -0.013043342158198357, -0.036412227898836136, -0.005727384705096483, -0.05545997992157936, -0.031562577933073044, -0.0389045886695385, 0.0025791542138904333, -0.023879501968622208, -0.0014702525222674012, -0.024410557001829147, 0.028963619843125343, 0.025455418974161148, -0.12175017595291138, 0.0896996259689331, -0.001757729216478765, 0.004282422363758087, 0.11050006002187729, 0.05795475095510483, -0.012937749736011028, 0.004874176345765591, 0.04089464619755745, 0.04634394496679306, 0.023660648614168167, -0.0016832648543640971, 0.018851108849048615, 0.014531903900206089, -0.06277162581682205, -0.061493486166000366, 0.002956164302304387, -0.002131066517904401, 0.013512282632291317, -0.023043492808938026, 0.08873461931943893, -0.008051003329455853, 0.008731400594115257, 0.01643497496843338, -0.030163254588842392, 0.040570445358753204, 0.02643834426999092, 0.06949426233768463, -0.024195753037929535, 0.015734877437353134, 0.01144505012780428, -0.045466694980859756, 0.07693937420845032, -0.073973149061203, 0.04495295137166977, 0.09985513240098953, 0.12006376683712006, 0.046319685876369476, 0.05364399030804634, 0.011721746064722538, 0.02309243008494377, -0.08153875172138214, -0.05498097836971283, 2.7190369012419948e-33, -0.015480328351259232, -0.04138420149683952, 0.06251681596040726, 0.023509947583079338, 0.05873577669262886, -0.059213925153017044, -0.025844458490610123, -0.013745180331170559, -0.12428510189056396, 0.024478061124682426, -0.006283575668931007, 0.020338650792837143, 0.028333254158496857, -0.04611338675022125, 0.08087515085935593, 0.047910869121551514, 0.07240401953458786, -0.05574147030711174, 0.08623068779706955, 0.00742020457983017, 0.0326157845556736, -0.03221562132239342, -0.024997690692543983, 0.0849023163318634, -0.016264690086245537, -0.008938601240515709, -0.03851526603102684, 0.015252133831381798, 0.0708436667919159, 0.009837164543569088, -0.01517820917069912, 0.049836862832307816, -0.08604195713996887, 0.0160704106092453, 0.0009378105169162154, 0.04698629304766655, -0.03924429416656494, 0.026809411123394966, -0.02740418165922165, -0.011078267358243465, 0.045393116772174835, -0.012402676045894623, -0.06369063258171082, 0.03483344987034798, -0.058596983551979065, -0.07930789887905121, -0.060015562921762466, -0.012759977020323277, -0.04407242313027382, 0.10085951536893845, -0.0896301195025444, 0.04974408820271492, 0.07996409386396408, -0.05083855986595154, 0.03968032822012901, -0.023118741810321808, -0.00657389173284173, -0.057045839726924896, -0.05013313144445419, -0.009859527461230755, 0.11472737044095993, -0.01443417463451624, 0.01303956750780344, 0.0047780429013073444, -0.059305109083652496, -0.0635688528418541, 0.025529807433485985, -0.069200798869133, 0.0003322612028568983, 0.03634946048259735, -0.12026245146989822, -0.022838439792394638, 0.03316322714090347, 0.04401614889502525, -0.03132536634802818, -0.02388736978173256, -0.008326230570673943, -0.005077974405139685, 0.008020325563848019, -0.036442238837480545, -0.0026472804602235556, -0.0797380656003952, 0.0024142898619174957, 0.021809831261634827, -0.025360072031617165, -0.015528406016528606, -0.10246279090642929, 0.028805501759052277, 0.040922362357378006, 0.007881401106715202, 0.1564982384443283, -0.0276985801756382, 0.019972918555140495, -0.0069978064857423306, -0.09942539036273956, -4.886754462320859e-33, -0.0439147986471653, -0.011814518831670284, -0.08139947801828384, 0.030220746994018555, -0.04425341635942459, -0.06673406809568405, -0.07206746190786362, -0.0504053495824337, 0.046002231538295746, -0.0036267077084630728, -0.07616035640239716, 0.0668535903096199, 0.01970883458852768, 0.029696453362703323, 0.021818898618221283, -0.02141743153333664, -0.06432946026325226, -0.007989278994500637, -0.011134577915072441, -0.024042433127760887, -0.037352174520492554, 0.03524826839566231, 0.05482238903641701, 0.03478969633579254, -0.011505714617669582, -0.0018279117066413164, -0.13356204330921173, -0.036249637603759766, 0.005228651221841574, -0.009197275154292583, -0.029326021671295166, -0.011105765588581562, 0.014781376346945763, 0.020881392061710358, 0.007137143984436989, -0.11808858811855316, -0.02884341962635517, 0.06823573261499405, 0.07491946965456009, -0.052499569952487946, 0.02326788380742073, 0.010653898119926453, 0.07156462222337723, -0.03540775179862976, 0.03735116496682167, 0.07350412011146545, 0.019015390425920486, -0.030496248975396156, 0.01155371218919754, -0.060700662434101105, 0.028944598510861397, -0.027432581409811974, 0.09044397622346878, 0.06159234046936035, 0.024860098958015442, -0.056293707340955734, 0.017845770344138145, -0.01702042855322361, 0.09107255190610886, 0.03678728640079498, 0.11136023700237274, -0.031562600284814835, -0.08089183270931244, 0.010006892494857311, -0.054633431136608124, -0.02325921133160591, -0.07896607369184494, -0.036031559109687805, 0.11561319231987, 0.012211092747747898, 0.0283508263528347, -0.023429198190569878, 0.018408387899398804, 0.039128027856349945, -0.023260485380887985, 0.009006991051137447, -0.006337481550872326, -0.11811942607164383, -0.09682296961545944, 0.03412845730781555, -0.01652645319700241, 0.07558684796094894, -0.004496602341532707, 0.021373562514781952, 0.011105072684586048, 0.019713325425982475, 0.02090836875140667, -0.05949506536126137, -0.04961668699979782, -0.012574147433042526, 0.005439916625618935, 0.03251098841428757, -0.09059825539588928, -0.004178917966783047, -0.06883232295513153, -4.9313936045791706e-8, -0.01094290241599083, -0.0047243693843483925, -0.06352751702070236, -0.016061246395111084, -0.017236731946468353, -0.05439193546772003, 0.017027610912919044, 0.01061925757676363, 0.11199179291725159, 0.10971499979496002, 0.03571157902479172, -0.010186558589339256, 0.009136304259300232, -0.0642244964838028, 0.010740844532847404, 0.08316055685281754, 0.04347102716565132, 0.027833249419927597, 0.010282175615429878, -0.008216824382543564, 0.010424946434795856, -0.019430192187428474, -0.06733369827270508, 0.06455804407596588, 0.013180900365114212, -0.020643003284931183, 0.042231447994709015, 0.037776414304971695, -0.0351240299642086, 0.031523000448942184, -0.05673028528690338, -0.010561860166490078, -0.022224586457014084, 0.09098196029663086, -0.07119902223348618, 0.03224414959549904, -0.002137782983481884, -0.044926710426807404, 0.055061936378479004, 0.014568996615707874, 0.022925347089767456, 0.041292641311883926, 0.015995774418115616, 0.062234316021203995, -0.07694222033023834, -0.009637836366891861, 0.08466384559869766, -0.04746890068054199, -0.0010056629544124007, -0.0016298277769237757, 0.0548674650490284, -0.0019303277367725968, -0.09036566317081451, 0.06764135509729385, -0.015984388068318367, 0.02849733456969261, 0.05243253335356712, -0.03532800078392029, 0.014963741414248943, -0.003295044181868434, 0.04076003655791283, 0.039856329560279846, 0.0746108666062355, -0.05515022203326225 ]
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 supported too: \* `--allow-fs-read=/home/test\*` will allow read access to everything that matches the wildcard. e.g: `/home/test/file1` or `/home/test2` After passing a wildcard character (`\*`) all subsequent characters will be ignored. For example: `/home/\*.js` will work similar to `/home/\*`. When the permission model is initialized, it will automatically add a wildcard (\\*) if the specified directory exists. For example, if `/home/test/files` exists, it will be treated as `/home/test/files/\*`. However, if the directory does not exist, the wildcard will not be added, and access will be limited to `/home/test/files`. If you want to allow access to a folder that does not exist yet, make sure to explicitly include the wildcard: `/my-path/folder-do-not-exist/\*`. #### Configuration file support In addition to passing permission flags on the command line, they can also be declared in a Node.js configuration file when using the experimental \[`--experimental-config-file`]\[] flag. Permission options must be placed inside the `permission` top-level object. Example `node.config.json`: ```json { "permission": { "allow-fs-read": ["./foo"], "allow-fs-write": ["./bar"], "allow-child-process": true, "allow-worker": true, "allow-net": true, "allow-addons": false } } ``` When the `permission` namespace is present in the configuration file, Node.js automatically enables the `--permission` flag. Run with: ```console $ node --experimental-default-config-file app.js ``` #### Using the Permission Model with `npx` If you're using [`npx`][] to execute a Node.js script, you can enable the Permission Model by passing the `--node-options` flag. For example: ```bash npx --node-options="--permission" package-name ``` This sets the `NODE\_OPTIONS` environment variable for all Node.js processes spawned by [`npx`][], without affecting the `npx` process itself. \*\*FileSystemRead Error with `npx`\*\* The above command will likely throw a `FileSystemRead` invalid access error because Node.js requires file system read access to locate and execute the package. To avoid this: 1. \*\*Using a Globally Installed Package\*\* Grant read access to the global `node\_modules` directory by running: ```bash npx --node-options="--permission --allow-fs-read=$(npm prefix -g)" package-name ``` 2. \*\*Using the `npx` Cache\*\* If you are installing the package temporarily or relying on the `npx` cache, grant read access to the npm cache directory: ```bash npx --node-options="--permission --allow-fs-read=$(npm config get cache)" package-name ``` Any arguments you would normally pass to `node` (e.g., `--allow-\*` flags) can also be passed through the `--node-options` flag. This flexibility makes it easy to configure permissions as needed when using `npx`. #### Permission Model constraints There are constraints you need to know before using this system: \* The model does not inherit to a worker thread. \* When using the Permission Model the following features will be restricted: \* Native modules \* Network \* Child process \* Worker Threads \* Inspector protocol \* File system access \* WASI \* The Permission Model is initialized after the Node.js environment is set up. However, certain flags such as `--env-file` or `--openssl-config` are designed to read files before environment initialization. As a result, such flags are not subject to the rules of the Permission Model. The same applies for V8 flags that can be set via runtime through `v8.setFlagsFromString`. \* OpenSSL engines cannot be requested at runtime when the Permission Model is enabled, affecting the built-in crypto, https, and tls modules. \* Run-Time Loadable Extensions cannot be loaded 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
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.07834623754024506, -0.0397823303937912, -0.010570209473371506, -0.012888608500361443, 0.035109054297208786, -0.016222357749938965, 0.017044326290488243, -0.007757475133985281, 0.03131066635251045, 0.02688175067305565, -0.023712391033768654, 0.036820922046899796, -0.0003895325062330812, -0.06689427047967911, -0.03299899771809578, 0.013098484836518764, 0.021839888766407967, 0.0047294506803154945, -0.05057389661669731, 0.013744581490755081, 0.021298788487911224, 0.021120412275195122, 0.034828126430511475, 0.060051463544368744, -0.1158008873462677, -0.06631182879209518, 0.018115641549229622, 0.001590138883329928, 0.07894102483987808, -0.05573011934757233, -0.04168546572327614, 0.0028183620888739824, -0.04949306324124336, -0.015985410660505295, -0.04363910108804703, -0.07241789251565933, 0.07694226503372192, -0.08299147337675095, -0.03998105600476265, -0.06811624765396118, -0.009548520669341087, 0.038827843964099884, -0.03306352719664574, -0.030348874628543854, -0.030476296320557594, 0.021745463833212852, 0.027980459854006767, 0.035655032843351364, -0.08096475154161453, 0.0015200725756585598, -0.04507303237915039, 0.06272725015878677, -0.10599139332771301, -0.0688563659787178, 0.010626177303493023, 0.0010415675351396203, -0.029484139755368233, 0.034531574696302414, 0.06570646166801453, -0.04326364025473595, -0.009640340693295002, 0.01951661705970764, 0.004363183863461018, -0.04617055505514145, 0.0759989470243454, 0.051636334508657455, -0.11354704201221466, 0.04463445022702217, -0.05847152695059776, 0.06828518211841583, -0.019103044643998146, -0.022641384974122047, 0.11578674614429474, 0.02050045132637024, 0.0512566901743412, 0.10422975569963455, 0.02085789479315281, 0.0325530581176281, -0.07883778214454651, 0.004575168248265982, 0.039255328476428986, -0.044678281992673874, -0.037651773542165756, 0.0046834796667099, 0.05795540660619736, 0.03750227391719818, 0.007635514251887798, -0.020878905430436134, -0.06712030619382858, 0.0464976541697979, -0.005623622331768274, 0.050572626292705536, 0.01656053029000759, 0.01734711229801178, 0.038062747567892075, -0.01553672831505537, 0.008487735874950886, 0.01625089719891548, -0.0038722825702279806, 0.02433423511683941, 0.02103387750685215, 0.004490889608860016, 0.015862325206398964, 0.09184221178293228, -0.020067553967237473, 0.008951008319854736, 0.09345290064811707, 0.07382160425186157, -0.011366174556314945, 0.031416844576597214, 0.006530178710818291, 0.044447872787714005, 0.033999230712652206, -0.07170413434505463, 1.6936199345701042e-33, 0.08782652020454407, 0.03176708519458771, 0.027536483481526375, 0.054802946746349335, -0.012605177238583565, -0.015431049279868603, -0.09960614889860153, -0.046710867434740067, -0.08339311927556992, 0.09922954440116882, 0.008073392324149609, 0.0349244698882103, -0.03223732113838196, 0.00517294043675065, 0.054926689714193344, 0.011183335445821285, 0.05041429027915001, -0.06966835260391235, 0.04440963268280029, 0.015826137736439705, 0.004422290250658989, 0.028549175709486008, -0.06801604479551315, 0.015578135848045349, -0.03747973591089249, -0.02919906936585903, 0.05390337109565735, -0.0028208973817527294, 0.05375983566045761, 0.006415672600269318, 0.031289637088775635, -0.017886333167552948, -0.06330019235610962, 0.009606832638382912, 0.015597098506987095, 0.06805208325386047, -0.04087498039007187, -0.01902027800679207, -0.0610678568482399, -0.02176671475172043, 0.0011888185981661081, -0.02264772355556488, -0.13277027010917664, 0.015754451975226402, 0.029668055474758148, -0.03174933046102524, -0.058276914060115814, -0.021924523636698723, -0.019647030159831047, 0.09156189858913422, -0.0631212368607521, 0.05201404541730881, -0.017949938774108887, -0.059184350073337555, 0.010112341493368149, 0.014449681155383587, -0.08903734385967255, -0.1019369438290596, 0.027745472267270088, 0.027944546192884445, 0.06794146448373795, -0.01242021843791008, -0.02082533948123455, 0.008830038830637932, -0.0633557066321373, -0.011837579309940338, 0.053905896842479706, -0.02315259352326393, -0.007046503480523825, 0.05147023871541023, -0.09368743002414703, -0.004924307111650705, 0.008554274216294289, 0.0741429552435875, -0.11218057572841644, -0.0797632560133934, 0.04127593711018562, 0.054396916180849075, -0.006326301023364067, -0.05167020484805107, -0.07248667627573013, -0.025864003226161003, -0.04373377561569214, 0.02621161751449108, -0.024910379201173782, -0.0001660727139096707, -0.013481938280165195, 0.025856930762529373, -0.03358253836631775, -0.07877182215452194, 0.13841146230697632, 0.02931816875934601, -0.011072308756411076, -0.047178491950035095, -0.08191706985235214, -3.310420211288018e-33, 0.029889676719903946, -0.07287852466106415, -0.07537031173706055, -0.009305104613304138, -0.11820238083600998, -0.08040128648281097, -0.03658280149102211, -0.08084724098443985, 0.06433054804801941, -0.05216791480779648, -0.029354559257626534, 0.07181356847286224, 0.08670666813850403, -0.031739942729473114, 0.021124403923749924, -0.0575195848941803, -0.07570338249206543, -0.12161041051149368, -0.006138472817838192, 0.02335681952536106, 0.03492453694343567, 0.034653276205062866, 0.017126576974987984, 0.11495472490787506, -0.029927082359790802, 0.04431019350886345, -0.09694762527942657, -0.027627404779195786, -0.010557926259934902, -0.006543885916471481, 0.017801491543650627, -0.043742284178733826, -0.016565464437007904, -0.03982878848910332, -0.040037862956523895, -0.07827012985944748, -0.0954476073384285, 0.12931689620018005, 0.025422606617212296, 0.01336730271577835, 0.043310970067977905, -0.003626263001933694, -0.003932726103812456, 0.05306448042392731, -0.03820604830980301, 0.08638085424900055, 0.10606953501701355, -0.013320508413016796, -0.014120596460998058, 0.01128598116338253, 0.0648348405957222, -0.0165378637611866, 0.03350381180644035, -0.006019678898155689, 0.048139914870262146, -0.027383482083678246, 0.010575998574495316, -0.0843970850110054, -0.05515049770474434, 0.07790897786617279, 0.06434035301208496, -0.03901492804288864, 0.009708152152597904, -0.0008826642879284918, -0.06299734860658646, -0.07752672582864761, -0.043043967336416245, -0.02792714163661003, 0.08266180008649826, -0.022479545325040817, 0.014360025525093079, 0.001575169968418777, 0.0516289658844471, 0.0004475332098081708, 0.06520424038171768, -0.013097886927425861, -0.0786360427737236, -0.0681261494755745, -0.0012882484588772058, 0.055908747017383575, -0.08762013912200928, 0.07393556088209152, -0.06128020957112312, 0.07943620532751083, 0.026188358664512634, -0.049448948353528976, -0.07144464552402496, 0.020701434463262558, 0.052776552736759186, -0.02238594926893711, 0.07021387666463852, 0.07106085121631622, 0.019882142543792725, -0.05013987049460411, -0.049956727772951126, -4.0820442137601276e-8, -0.03372832015156746, -0.009737014770507812, -0.12904831767082214, -0.05710639804601669, -0.023968052119016647, -0.07405292242765427, 0.018238110467791557, 0.0011558334808796644, 0.05977337434887886, 0.021095573902130127, 0.05744721367955208, 0.09355979412794113, -0.042327217757701874, -0.058564599603414536, -0.042397405952215195, 0.02791490964591503, 0.06664673984050751, 0.06450360268354416, -0.052165523171424866, 0.1084069311618805, -0.03147904947400093, -0.02703583799302578, -0.06109188497066498, 0.03486473858356476, 0.019759830087423325, -0.006461258511990309, 0.04714434593915939, 0.015215381979942322, -0.06631933152675629, 0.035842929035425186, 0.03707718849182129, 0.005862858146429062, -0.029943179339170456, 0.00782543234527111, -0.08502741903066635, 0.011017909273505211, 0.02974672242999077, -0.007474489510059357, 0.03674115985631943, 0.04614897444844246, 0.05739201232790947, -0.029981335625052452, 0.05474858731031418, -0.014277059584856033, -0.12416637688875198, -0.06622622162103653, 0.07586352527141571, -0.04904494062066078, 0.000943464576266706, 0.004413606133311987, -0.019558964297175407, 0.06699419021606445, -0.02508341707289219, 0.06376294791698456, 0.04818208888173103, 0.06012600660324097, 0.06501804292201996, 0.06407032907009125, 0.022435292601585388, 0.021136339753866196, 0.0754166841506958, 0.027109142392873764, 0.045841868966817856, 0.004868710413575172 ]
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 symbolic links may allow access to arbitrary files and directories. When starting applications with the permission model enabled, you must ensure that no paths to which access has been granted contain relative symbolic links. [Security Policy]: https://github.com/nodejs/node/blob/main/SECURITY.md [`--allow-addons`]: cli.md#--allow-addons [`--allow-child-process`]: cli.md#--allow-child-process [`--allow-fs-read`]: cli.md#--allow-fs-read [`--allow-fs-write`]: cli.md#--allow-fs-write [`--allow-net`]: cli.md#--allow-net [`--allow-wasi`]: cli.md#--allow-wasi [`--allow-worker`]: cli.md#--allow-worker [`--permission`]: cli.md#--permission [`npx`]: https://docs.npmjs.com/cli/commands/npx [`permission.has()`]: process.md#processpermissionhasscope-reference
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.012964721769094467, 0.01005020271986723, 0.13032059371471405, -0.015500589273869991, -0.004289029166102409, -0.018408415839076042, 0.11601061373949051, -0.011552290059626102, 0.005920203402638435, 0.12196719646453857, 0.00661315256729722, -0.03219575062394142, -0.03371802717447281, -0.04017484188079834, 0.019544880837202072, 0.02157142572104931, 0.004065073560923338, -0.004094354342669249, -0.03536072000861168, -0.08114097267389297, 0.06095045059919357, 0.02257436513900757, 0.10725833475589752, 0.06509798020124435, -0.1476917415857315, -0.0793396458029747, -0.007920056581497192, 0.0905349850654602, 0.08439256995916367, -0.06909246742725372, -0.025583578273653984, -0.030367735773324966, -0.08619111776351929, 0.0030583778861910105, -0.04788782820105553, -0.012139086611568928, 0.006564919371157885, -0.01171313039958477, 0.030409254133701324, 0.024261076003313065, -0.04994046688079834, -0.004487294703722, 0.11406151205301285, 0.0025507549289613962, 0.0487225167453289, -0.009515508078038692, 0.05605001375079155, 0.03344462439417839, -0.0446794368326664, 0.04058697447180748, -0.10559883713722229, 0.04962046816945076, 0.04636133089661598, -0.034373752772808075, -0.020677600055933, 0.010787826031446457, -0.04594855755567551, 0.10533072054386139, 0.01737968623638153, -0.0874035507440567, -0.006635166238993406, -0.02167980559170246, 0.018148060888051987, 0.022800425067543983, 0.08884827047586441, -0.039935220032930374, -0.09959075599908829, -0.05130387842655182, -0.04735686630010605, 0.04062904417514801, -0.0059816124849021435, -0.033775996416807175, 0.06280328333377838, 0.006292307749390602, -0.013746918179094791, 0.07876375317573547, 0.06809484213590622, 0.03822668269276619, -0.05051988735795021, -0.0398983433842659, -0.01049569807946682, 0.03746762126684189, -0.04393135756254196, 0.07510931044816971, 0.08483752608299255, 0.0067901392467319965, -0.019268618896603584, -0.014792273752391338, -0.013429129496216774, -0.01811165176331997, 0.026000062003731728, 0.07892781496047974, 0.00799485668540001, 0.06801024824380875, -0.060266751796007156, -0.09242157638072968, -0.05496449023485184, 0.0001939455105457455, 0.04479653015732765, 0.0031841262243688107, -0.005242105573415756, -0.024119485169649124, -0.0381656289100647, 0.02418442629277706, -0.022005191072821617, 0.016976261511445045, 0.07379885762929916, 0.08267394453287125, 0.03449937701225281, -0.01514937449246645, 0.014335446059703827, -0.00591282220557332, -0.06030239164829254, -0.0825657770037651, 1.2117980244794953e-33, 0.01999245584011078, -0.014559224247932434, 0.08362003415822983, -0.0003047536010853946, 0.09921185672283173, -0.01498127169907093, -0.011153137311339378, 0.013539656065404415, -0.10744188725948334, 0.013853673823177814, -0.037802305072546005, 0.026024913415312767, -0.026709334924817085, -0.07226192951202393, 0.07173522561788559, 0.032888565212488174, 0.04578679800033569, -0.07123305648565292, 0.05718640238046646, -0.006254537962377071, 0.00808247085660696, -0.009222141467034817, -0.06675228476524353, 0.032055046409368515, -0.026173042133450508, -0.015282644890248775, 0.006982361897826195, 0.030980268493294716, 0.06446583569049835, -0.0016193136107176542, 0.020743733271956444, 0.008460024371743202, 0.031377632170915604, 0.028946807608008385, -0.039716076105833054, 0.053683165460824966, -0.0055043501779437065, 0.030345378443598747, -0.08700811862945557, -0.019249841570854187, 0.02812734991312027, -0.02862299606204033, -0.1035740077495575, 0.03040607087314129, -0.08171939104795456, -0.03396784886717796, -0.04770100861787796, -0.04195143282413483, -0.04416918382048607, -0.012450292706489563, -0.07128530740737915, 0.01388619001954794, 0.005493415053933859, -0.05121781677007675, 0.055083781480789185, -0.04523296281695366, -0.07968144118785858, -0.09000913798809052, -0.013207766227424145, -0.028119774535298347, 0.08497627079486847, 0.04375821724534035, 0.03076140023767948, 0.007836749777197838, 0.006963865365833044, 0.006730407476425171, 0.005023167002946138, -0.05565626546740532, 0.07460641860961914, -0.006811637431383133, -0.06076332926750183, 0.035962849855422974, 0.02936246432363987, 0.006699375342577696, -0.048365771770477295, -0.014044832438230515, -0.08174871653318405, -0.08297444880008698, 0.00007539875514339656, 0.03696972504258156, 0.007506568916141987, -0.09301724284887314, -0.05695046856999397, 0.04288464039564133, -0.02647673711180687, -0.03896355256438255, -0.11066645383834839, -0.04145871847867966, 0.006227809935808182, -0.03447059169411659, 0.1493539959192276, -0.027647417038679123, 0.07084035873413086, -0.05547064542770386, -0.0773719996213913, -3.8882778057889e-33, 0.032509516924619675, -0.026068156585097313, -0.024144483730196953, -0.02513933926820755, -0.04617929831147194, -0.026900408789515495, -0.03509041294455528, -0.06531859189271927, 0.03409918397665024, -0.022994400933384895, -0.059204619377851486, 0.06538337469100952, 0.04509258270263672, -0.051885005086660385, -0.007755042985081673, 0.0574035570025444, -0.028940055519342422, -0.007754987105727196, 0.022291745990514755, 0.0002825951378326863, 0.029358580708503723, 0.1163116842508316, 0.07258614897727966, 0.05624224990606308, -0.007111029699444771, -0.042838141322135925, -0.056572627276182175, -0.04576205462217331, -0.02841142751276493, -0.051721926778554916, -0.029534950852394104, 0.012166331522166729, -0.017574883997440338, -0.059198640286922455, -0.0010025536175817251, -0.0792703852057457, -0.09761785715818405, 0.07444499433040619, 0.06353645026683807, -0.01673661544919014, 0.017053434625267982, 0.000060179696447448805, 0.054211318492889404, 0.015236075967550278, 0.021666409447789192, -0.02025684341788292, 0.0018722126260399818, -0.02465764991939068, -0.010252614505589008, -0.01019914261996746, 0.03461650758981705, -0.03916836529970169, 0.12677210569381714, -0.013269775547087193, 0.08923040330410004, 0.03432231768965721, 0.0021041391883045435, -0.08082196116447449, 0.0027425475418567657, 0.00943373516201973, 0.07012927532196045, -0.018242260441184044, -0.10990191996097565, -0.015183848328888416, -0.06211861968040466, -0.06071189045906067, -0.111848384141922, 0.027291251346468925, 0.08655650913715363, -0.05856615677475929, -0.0245107002556324, 0.02196037769317627, 0.07577461749315262, 0.07020963728427887, 0.04075930640101433, 0.06523447483778, -0.04354195296764374, -0.009898575022816658, -0.03186784312129021, 0.04521587863564491, -0.041283924132585526, 0.06477895379066467, -0.033500783145427704, -0.027185332030057907, -0.01662568934261799, -0.05186307057738304, -0.023576391860842705, -0.04775647446513176, -0.06381604075431824, -0.019079377874732018, -0.00744151696562767, -0.03565824404358864, -0.03787492960691452, 0.06259314715862274, -0.07056107372045517, -5.0081407465540906e-8, -0.032427527010440826, 0.021324103698134422, -0.13371185958385468, -0.03822345659136772, 0.1067979484796524, -0.03171369433403015, 0.027205711230635643, 0.09139294177293777, 0.06411340087652206, 0.07696530222892761, -0.048179227858781815, 0.07053449004888535, 0.00008190961671061814, -0.006570518482476473, -0.02338716946542263, 0.01577279157936573, 0.05963721126317978, 0.004159842152148485, -0.013486604206264019, 0.016882210969924927, 0.00806588027626276, -0.011875322088599205, -0.06879378855228424, 0.10872241109609604, -0.02810700796544552, 0.010695689357817173, -0.008669042028486729, -0.012415830045938492, -0.05079474300146103, 0.07714179903268814, -0.002364563522860408, -0.00916418619453907, 0.022900188341736794, 0.07814587652683258, -0.06403706967830658, 0.015587909147143364, 0.045727018266916275, -0.009005081839859486, 0.008261298760771751, 0.0012977980077266693, 0.00352855259552598, -0.0036613228730857372, 0.018147500231862068, 0.017684947699308395, -0.07510790973901749, -0.0926419124007225, 0.027818460017442703, 0.09498142451047897, 0.011601860634982586, 0.04994180426001549, 0.048335228115320206, 0.013557987287640572, -0.04591978341341019, 0.059339739382267, 0.06945096701383591, 0.05757047235965729, 0.04018335044384003, -0.003524041036143899, -0.008596615865826607, 0.026847168803215027, 0.03175918385386467, -0.012993830256164074, 0.06649894267320633, 0.000676510448101908 ]
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: 'SHA-256', length: 256, }, true, ['sign', 'verify']); const enc = new TextEncoder(); const message = enc.encode('I love cupcakes'); const digest = await subtle.sign({ name: 'HMAC', }, key, message); })(); ``` ## Modern Algorithms in the Web Cryptography API > Stability: 1.1 - Active development Node.js provides an implementation of the following features from the [Modern Algorithms in the Web Cryptography API](https://wicg.github.io/webcrypto-modern-algos/) WICG proposal: Algorithms: \* `'AES-OCB'`[^openssl30] \* `'Argon2d'`[^openssl32] \* `'Argon2i'`[^openssl32] \* `'Argon2id'`[^openssl32] \* `'ChaCha20-Poly1305'` \* `'cSHAKE128'` \* `'cSHAKE256'` \* `'KMAC128'`[^openssl30] \* `'KMAC256'`[^openssl30] \* `'ML-DSA-44'`[^openssl35] \* `'ML-DSA-65'`[^openssl35] \* `'ML-DSA-87'`[^openssl35] \* `'ML-KEM-512'`[^openssl35] \* `'ML-KEM-768'`[^openssl35] \* `'ML-KEM-1024'`[^openssl35] \* `'SHA3-256'` \* `'SHA3-384'` \* `'SHA3-512'` Key Formats: \* `'raw-public'` \* `'raw-secret'` \* `'raw-seed'` Methods: \* [`subtle.decapsulateBits()`][] \* [`subtle.decapsulateKey()`][] \* [`subtle.encapsulateBits()`][] \* [`subtle.encapsulateKey()`][] \* [`subtle.getPublicKey()`][] \* [`SubtleCrypto.supports()`][] ## Secure Curves in the Web Cryptography API > Stability: 1.1 - Active development Node.js provides an implementation of the following features from the [Secure Curves in the Web Cryptography API](https://wicg.github.io/webcrypto-secure-curves/) WICG proposal: Algorithms: \* `'Ed448'` \* `'X448'` ## Examples ### Generating keys The {SubtleCrypto} class can be used to generate symmetric (secret) keys or asymmetric key pairs (public key and private key). #### AES keys ```js const { subtle } = globalThis.crypto; async function generateAesKey(length = 256) { const key = await subtle.generateKey({ name: 'AES-CBC', length, }, true, ['encrypt', 'decrypt']); return key; } ``` #### ECDSA key pairs ```js const { subtle } = globalThis.crypto; async function generateEcKey(namedCurve = 'P-521') { const { publicKey, privateKey, } = await subtle.generateKey({ name: 'ECDSA', namedCurve, }, true, ['sign', 'verify']); return { publicKey, privateKey }; } ``` #### Ed25519/X25519 key pairs ```js const { subtle } = globalThis.crypto; async function generateEd25519Key() { return subtle.generateKey({ name: 'Ed25519', }, true, ['sign', 'verify']); } async function generateX25519Key() { return subtle.generateKey({ name: 'X25519', }, true, ['deriveKey']); } ``` #### HMAC keys ```js const { subtle } = globalThis.crypto; async function generateHmacKey(hash = 'SHA-256') { const key = await subtle.generateKey({ name: 'HMAC', hash, }, true, ['sign', 'verify']); return key; } ``` #### RSA key pairs ```js const { subtle } = globalThis.crypto; const publicExponent = new Uint8Array([1, 0, 1]); async function generateRsaKey(modulusLength = 2048, hash = 'SHA-256') { const { publicKey, privateKey, } = await subtle.generateKey({ name: 'RSASSA-PKCS1-v1\_5', modulusLength, publicExponent, hash, }, true, ['sign', 'verify']); return { publicKey, privateKey }; } ``` ### Encryption and decryption ```js const crypto = globalThis.crypto; async function aesEncrypt(plaintext) { const ec = new TextEncoder(); const key = await generateAesKey(); const iv = crypto.getRandomValues(new Uint8Array(16)); const ciphertext = await crypto.subtle.encrypt({ name: 'AES-CBC', iv, }, key, ec.encode(plaintext)); return { key, iv, ciphertext, }; } async function aesDecrypt(ciphertext, key, iv) { const dec = new TextDecoder(); const plaintext = await crypto.subtle.decrypt({ name: 'AES-CBC', iv, }, key, ciphertext); return dec.decode(plaintext); } ``` ### Exporting and importing keys ```js const { subtle } = globalThis.crypto; async function generateAndExportHmacKey(format = 'jwk', hash = 'SHA-512') { const key = await subtle.generateKey({ name: 'HMAC', hash, }, true, ['sign', 'verify']); return subtle.exportKey(format, key); } async function importHmacKey(keyData, format = 'jwk', hash = 'SHA-512') { const key = await subtle.importKey(format, keyData, { name: 'HMAC', hash, }, 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']), subtle.generateKey({ name: 'AES-KW', length: 256, },
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.014856959693133831, 0.07874273508787155, 0.03441258519887924, -0.011221777647733688, 0.05117705836892128, -0.0017025717534124851, -0.036999862641096115, 0.05010261386632919, -0.11067207157611847, 0.07712949812412262, 0.022430501878261566, -0.007527026813477278, -0.0002924494619946927, 0.01600991003215313, 0.049543462693691254, 0.020071936771273613, -0.011770399287343025, 0.06732815504074097, 0.00878999661654234, -0.0077049913816154, 0.016359925270080566, -0.112970732152462, 0.12007559835910797, 0.030468851327896118, -0.040921181440353394, 0.016506310552358627, -0.048377569764852524, -0.03064289130270481, 0.019131923094391823, -0.09273430705070496, -0.029553653672337532, 0.0034557997714728117, -0.012046093121170998, -0.0670207068324089, 0.048995018005371094, -0.07774181663990021, 0.03210695460438728, 0.012478110380470753, -0.09548351913690567, -0.00024529246729798615, -0.01166886743158102, -0.11607763916254044, -0.03777236118912697, -0.05339343100786209, 0.033497534692287445, 0.052669625729322433, -0.015085811726748943, 0.0314340777695179, -0.014336647465825081, 0.10587957501411438, 0.00373957771807909, 0.0487833097577095, 0.009732606820762157, 0.011037209071218967, -0.023794397711753845, -0.013717124238610268, 0.0320146381855011, -0.0014123121509328485, -0.03863498196005821, -0.03688984364271164, 0.020008902996778488, -0.04181660711765289, -0.030298620462417603, -0.00925872940570116, -0.021042190492153168, -0.05660847947001457, 0.07195618003606796, -0.027911672368645668, -0.06285779178142548, 0.025567591190338135, 0.08729948848485947, 0.04314205422997475, 0.08997391909360886, 0.001642464310862124, -0.0140487439930439, -0.01179674081504345, 0.0015038010897114873, -0.029538651928305626, -0.04503839835524559, -0.000019901173800462857, 0.026129353791475296, 0.027505867183208466, -0.02270890586078167, 0.03158903494477272, 0.0699671283364296, -0.0856495276093483, 0.03680285066366196, -0.06174962595105171, 0.01145106926560402, -0.006665872875601053, -0.11081871390342712, 0.13525940477848053, 0.042771242558956146, 0.007855641655623913, -0.00738166319206357, 0.06798860430717468, 0.008655705489218235, -0.03955289348959923, 0.04820172116160393, -0.025409173220396042, -0.006835171952843666, -0.06854432076215744, 0.034434691071510315, -0.01542221661657095, -0.015369887463748455, 0.09962131828069687, 0.14926473796367645, 0.08547484129667282, 0.05900418013334274, -0.0349779948592186, 0.00014176193508319557, -0.05411798879504204, -0.018767543137073517, 0.02450629323720932, 4.09723845703687e-33, 0.007115888874977827, 0.017619511112570763, 0.03893843665719032, 0.018397822976112366, 0.03631635382771492, -0.012504828162491322, 0.06572774052619934, -0.031195852905511856, -0.14375697076320648, -0.024536030367016792, -0.021798202767968178, -0.017994163557887077, 0.031309373676776886, -0.017611555755138397, 0.027074670419096947, -0.07086716592311859, 0.053948696702718735, -0.09755656868219376, 0.11530756205320358, 0.014763816259801388, 0.0025809307117015123, 0.02047080360352993, 0.059737835079431534, -0.018645480275154114, -0.024330521002411842, 0.06300034373998642, 0.019646642729640007, 0.07122320681810379, 0.0011919797398149967, -0.0019938035402446985, 0.03715373948216438, 0.02561710774898529, -0.010726763866841793, 0.026182951405644417, 0.015066473744809628, -0.0045683737844228745, 0.010035546496510506, 0.00031445242348127067, -0.052533846348524094, -0.07641607522964478, 0.05827392637729645, 0.024842526763677597, -0.03931811451911926, -0.028331229463219643, -0.01760801300406456, -0.01602133922278881, -0.006523905321955681, 0.0174456387758255, 0.09891925007104874, 0.009187054820358753, -0.09325149655342102, 0.04982513561844826, -0.08582065999507904, 0.004132877569645643, 0.009823274798691273, -0.1038069948554039, 0.033157382160425186, -0.06865973770618439, -0.07105021178722382, 0.011484676972031593, -0.028151439502835274, -0.02013254165649414, 0.009464535862207413, -0.09377565234899521, -0.04141729697585106, 0.03281153738498688, -0.07670245319604874, -0.035141196101903915, -0.06987147033214569, 0.023733828216791153, -0.024005498737096786, -0.0012763876002281904, 0.024952195584774017, 0.03904348239302635, -0.03933947533369064, 0.0019222127739340067, -0.0783727616071701, -0.010881914757192135, 0.0032597880344837904, -0.03886856883764267, 0.06323063373565674, 0.027065837755799294, -0.027425721287727356, 0.10645084828138351, 0.0012025302276015282, 0.04180549457669258, -0.006125065963715315, -0.01610555313527584, 0.007404789794236422, 0.04676812142133713, -0.03986436501145363, -0.03961700201034546, 0.040525782853364944, -0.08492761850357056, -0.08729618042707443, -5.052927486540883e-33, -0.0376683734357357, -0.03066805563867092, -0.0895245224237442, 0.17280535399913788, -0.009771064855158329, -0.01517440751194954, -0.03401488810777664, -0.01146130170673132, 0.012655428610742092, 0.011063849553465843, 0.017462044954299927, -0.02043931931257248, 0.057906683534383774, 0.04650014638900757, 0.07140970230102539, 0.05297666788101196, -0.04403514415025711, 0.0555158406496048, 0.09095742553472519, -0.03044629469513893, 0.004944366868585348, 0.035929761826992035, -0.07847489416599274, 0.036090802401304245, 0.013887994922697544, 0.02156529203057289, -0.027903493493795395, 0.038251496851444244, 0.03083544224500656, -0.03079516440629959, -0.06373115628957748, 0.06418575346469879, -0.01196557842195034, -0.0209767185151577, 0.011333585716784, -0.11049772053956985, -0.04781990125775337, 0.0038115214556455612, 0.05821170285344124, 0.004239931236952543, 0.049653083086013794, -0.05140497535467148, -0.003949335310608149, 0.01615498587489128, 0.01975127123296261, 0.017551958560943604, -0.05799585208296776, 0.07279370725154877, 0.013240911066532135, 0.03913155943155289, 0.07600594311952591, -0.04317820072174072, -0.04541417956352234, -0.018790679052472115, -0.03401950001716614, 0.022348033264279366, -0.08235229551792145, 0.0679917111992836, 0.024990441277623177, 0.022320322692394257, -0.017026131972670555, -0.04409691318869591, 0.07181641459465027, 0.006095774471759796, 0.03998248651623726, 0.017180778086185455, -0.11411749571561813, 0.031936947256326675, 0.04908611625432968, 0.06176789849996567, 0.017167063429951668, -0.00011070107575505972, 0.03365345671772957, 0.01987532526254654, 0.037274058908224106, -0.09663285315036774, -0.016682442277669907, -0.07578351348638535, 0.0317232720553875, -0.014564834535121918, -0.023294217884540558, 0.10344695299863815, -0.018553977832198143, -0.015007775276899338, 0.09868742525577545, -0.035547755658626556, -0.020707450807094574, 0.010714785195887089, -0.10988137125968933, 0.010956667363643646, 0.01576223224401474, 0.06678630411624908, -0.043495163321495056, -0.009564711712300777, 0.08983621001243591, -5.654680990119232e-8, -0.01621829718351364, -0.06303587555885315, -0.13006393611431122, -0.026709262281656265, 0.0643608570098877, 0.024380501359701157, -0.008836060762405396, -0.11553963273763657, -0.0037143013905733824, -0.030182110145688057, 0.07139628380537033, 0.013926205225288868, -0.016821933910250664, -0.07099545001983643, -0.027982428669929504, 0.06079040840268135, -0.04682081937789917, 0.028344260528683662, -0.008906975388526917, -0.06035261228680611, 0.0074073378928005695, 0.034139927476644516, -0.07026834785938263, -0.03315258398652077, 0.05727597698569298, -0.02043825015425682, 0.08126519620418549, 0.0784870907664299, -0.06965027004480362, -0.029459204524755478, -0.08939056843519211, -0.03849593549966812, 0.07038227468729019, -0.07059546560049057, 0.007918446324765682, 0.03440239652991295, -0.10705137997865677, -0.06693512946367264, 0.07378990203142166, 0.05445646122097969, 0.05245949327945709, 0.05514366552233696, -0.06154264137148857, -0.007543157786130905, -0.03506696969270706, 0.018932878971099854, 0.10009458661079407, 0.006348065100610256, -0.023585574701428413, 0.05903994292020798, -0.01605655811727047, -0.038954537361860275, -0.000017081098121707328, -0.018224770203232765, -0.020712388679385185, 0.04184329882264137, 0.01165002305060625, -0.08806613832712173, 0.04754883050918579, 0.013852017931640148, 0.07419180870056152, -0.028876233845949173, 0.09647802263498306, -0.060873035341501236 ]
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']), subtle.generateKey({ name: 'AES-KW', length: 256, }, true, ['wrapKey', 'unwrapKey']), ]); const wrappedKey = await subtle.wrapKey(format, key, wrappingKey, 'AES-KW'); return { wrappedKey, wrappingKey }; } async function unwrapHmacKey( wrappedKey, wrappingKey, format = 'jwk', hash = 'SHA-512') { const key = await subtle.unwrapKey( format, wrappedKey, wrappingKey, 'AES-KW', { name: 'HMAC', hash }, true, ['sign', 'verify']); return key; } ``` ### Sign and verify ```js const { subtle } = globalThis.crypto; async function sign(key, data) { const ec = new TextEncoder(); const signature = await subtle.sign('RSASSA-PKCS1-v1\_5', key, ec.encode(data)); return signature; } async function verify(key, signature, data) { const ec = new TextEncoder(); const verified = await subtle.verify( 'RSASSA-PKCS1-v1\_5', key, signature, ec.encode(data)); return verified; } ``` ### Deriving bits and keys ```js const { subtle } = globalThis.crypto; async function pbkdf2(pass, salt, iterations = 1000, length = 256) { const ec = new TextEncoder(); const key = await subtle.importKey( 'raw', ec.encode(pass), 'PBKDF2', false, ['deriveBits']); const bits = await subtle.deriveBits({ name: 'PBKDF2', hash: 'SHA-512', salt: ec.encode(salt), iterations, }, key, length); return bits; } async function pbkdf2Key(pass, salt, iterations = 1000, length = 256) { const ec = new TextEncoder(); const keyMaterial = await subtle.importKey( 'raw', ec.encode(pass), 'PBKDF2', false, ['deriveKey']); const key = await subtle.deriveKey({ name: 'PBKDF2', hash: 'SHA-512', salt: ec.encode(salt), iterations, }, keyMaterial, { name: 'AES-GCM', length, }, true, ['encrypt', 'decrypt']); return key; } ``` ### Digest ```js const { subtle } = globalThis.crypto; async function digest(data, algorithm = 'SHA-512') { const ec = new TextEncoder(); const digest = await subtle.digest(algorithm, ec.encode(data)); return digest; } ``` ### Checking for runtime algorithm support [`SubtleCrypto.supports()`][] allows feature detection in Web Crypto API, which can be used to detect whether a given algorithm identifier (including its parameters) is supported for the given operation. This example derives a key from a password using Argon2, if available, or PBKDF2, otherwise; and then encrypts and decrypts some text with it using AES-OCB, if available, and AES-GCM, otherwise. ```mjs const { SubtleCrypto, crypto } = globalThis; const password = 'correct horse battery staple'; const derivationAlg = SubtleCrypto.supports?.('importKey', 'Argon2id') ? 'Argon2id' : 'PBKDF2'; const encryptionAlg = SubtleCrypto.supports?.('importKey', 'AES-OCB') ? 'AES-OCB' : 'AES-GCM'; const passwordKey = await crypto.subtle.importKey( derivationAlg === 'Argon2id' ? 'raw-secret' : 'raw', new TextEncoder().encode(password), derivationAlg, false, ['deriveKey'], ); const nonce = crypto.getRandomValues(new Uint8Array(16)); const derivationParams = derivationAlg === 'Argon2id' ? { nonce, parallelism: 4, memory: 2 \*\* 21, passes: 1, } : { salt: nonce, iterations: 100\_000, hash: 'SHA-256', }; const key = await crypto.subtle.deriveKey( { name: derivationAlg, ...derivationParams, }, passwordKey, { name: encryptionAlg, length: 256, }, false, ['encrypt', 'decrypt'], ); const plaintext = 'Hello, world!'; const iv = crypto.getRandomValues(new Uint8Array(16)); const encrypted = await crypto.subtle.encrypt( { name: encryptionAlg, iv }, key, new TextEncoder().encode(plaintext), ); const decrypted = new TextDecoder().decode(await crypto.subtle.decrypt( { name: encryptionAlg, iv }, key, encrypted, )); ``` ## Algorithm matrix The tables details the algorithms supported by the Node.js Web Crypto API implementation and the APIs supported for each: ### Key Management APIs | Algorithm | [`subtle.generateKey()`][] | [`subtle.exportKey()`][] | [`subtle.importKey()`][] | [`subtle.getPublicKey()`][] | | ------------------------------------ | -------------------------- | ------------------------ | ------------------------ | --------------------------- | | `'AES-CBC'` | ✔ | ✔ | ✔ | | | `'AES-CTR'` | ✔ | ✔ | ✔ | | | `'AES-GCM'` | ✔ | ✔ | ✔ | | | `'AES-KW'` | ✔ | ✔ | ✔ | | | `'AES-OCB'` | ✔ | ✔ | ✔ |
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.011639139614999294, 0.03337198123335838, 0.014913362450897694, -0.08293493837118149, -0.010189288295805454, -0.0628473237156868, -0.05465541407465935, 0.04496356099843979, -0.06214819848537445, 0.1087769865989685, -0.018057463690638542, 0.010038294829428196, -0.05197853595018387, 0.051607731729745865, 0.050864119082689285, 0.021527385339140892, -0.0613347552716732, 0.09178967773914337, -0.02319270931184292, -0.08423761278390884, -0.015484649688005447, -0.01678202860057354, 0.16853369772434235, -0.04210822656750679, 0.05016140639781952, 0.05301190912723541, -0.013844934292137623, 0.0357474647462368, 0.02146722935140133, -0.06939995288848877, 0.04683656617999077, 0.039625413715839386, 0.0401153638958931, -0.02984471060335636, 0.013844030909240246, -0.0456545352935791, 0.03287997096776962, 0.013939782045781612, 0.03043350577354431, -0.07658784091472626, -0.01595311425626278, -0.0563172921538353, -0.02365526370704174, -0.06045933812856674, -0.024064619094133377, 0.004585896618664265, -0.025142041966319084, 0.00847157184034586, 0.001208311878144741, 0.05063169077038765, -0.00033390536555089056, 0.034249354153871536, 0.0691291093826294, 0.021066395565867424, -0.009417682886123657, 0.01471727341413498, 0.08369029313325882, 0.007219389081001282, -0.04904452711343765, 0.020048556849360466, 0.03491619601845741, -0.030923854559659958, -0.03909406438469887, -0.035274963825941086, -0.002589925192296505, -0.013564834371209145, 0.09894340485334396, -0.1003076434135437, -0.07391997426748276, -0.018546506762504578, 0.061435893177986145, 0.02175934799015522, 0.08508126437664032, -0.008165375329554081, -0.08521923422813416, -0.018491800874471664, 0.03125174343585968, -0.0072899190708994865, -0.03285973146557808, -0.016079384833574295, 0.03567500412464142, 0.01944907009601593, 0.0041188145987689495, 0.05565350502729416, 0.06351586431264877, -0.08590001612901688, 0.05678262189030647, -0.06675329804420471, 0.008616763167083263, -0.009699858725070953, -0.12030079960823059, 0.0824773833155632, 0.011427060700953007, -0.029454099014401436, -0.07506055384874344, -0.04821993410587311, 0.0021093229297548532, -0.009768524207174778, 0.031817566603422165, -0.033427003771066666, -0.015294513665139675, 0.0014685598434880376, 0.08701713383197784, 0.0015424872981384397, 0.029232827946543694, 0.0642373114824295, 0.11260075867176056, 0.06669248640537262, 0.0663357526063919, -0.0017040163511410356, 0.05514748394489288, -0.1223783940076828, 0.015870390459895134, 0.009613878093659878, 1.6299064877166054e-33, -0.008096237666904926, -0.006453204434365034, -0.023347150534391403, 0.0006386770401149988, 0.027321867644786835, 0.022792087867856026, 0.0460391640663147, -0.03972157835960388, -0.16770058870315552, 0.02231808565557003, 0.004751867614686489, 0.01913020946085453, -0.030295729637145996, -0.033945076167583466, 0.015295100398361683, -0.06813866645097733, 0.08472265303134918, -0.02490103244781494, -0.015454787760972977, 0.023583846166729927, -0.019352801144123077, 0.027386317029595375, 0.04696018993854523, -0.10999775677919388, -0.0644465982913971, -0.023763850331306458, 0.02497599646449089, 0.05869411677122116, 0.013482279144227505, 0.0007553993491455913, 0.033524252474308014, 0.032356273382902145, -0.06727846711874008, 0.02977675572037697, 0.00971650518476963, -0.020392008125782013, -0.040843844413757324, 0.006473989225924015, -0.062123797833919525, -0.05095379054546356, 0.04299556463956833, 0.0007280793506652117, -0.06306985765695572, -0.040463514626026154, 0.004366172477602959, -0.026419829577207565, 0.0749032124876976, 0.02693074382841587, 0.11132697016000748, 0.013661223463714123, 0.0205905269831419, 0.05239845812320709, -0.04473753273487091, -0.0622541606426239, 0.012928344309329987, -0.05042216554284096, 0.06453394144773483, -0.0319148451089859, -0.018014302477240562, 0.026819687336683273, -0.04979369416832924, -0.02475564181804657, -0.01286783441901207, -0.025788312777876854, -0.015796367079019547, -0.022583430632948875, -0.015507747419178486, 0.015780191868543625, -0.06035049259662628, -0.041260551661252975, -0.033239223062992096, 0.006458110176026821, -0.023268187418580055, 0.03368820995092392, -0.05085156857967377, 0.002001544926315546, -0.06840871274471283, 0.016255201771855354, 0.038097161799669266, -0.06187252700328827, 0.06530525535345078, 0.11880241334438324, -0.03925956040620804, 0.08727080374956131, -0.005677580367773771, 0.032854754477739334, -0.02527950517833233, 0.002072443487122655, 0.020876215770840645, 0.018917253240942955, -0.03781995549798012, -0.028514396399259567, 0.022261453792452812, -0.15313780307769775, -0.04500773549079895, -3.786302568829113e-33, 0.045098282396793365, -0.01720852218568325, -0.059736218303442, 0.0815199688076973, -0.011991452425718307, 0.006546486634761095, 0.06662805378437042, 0.0320756658911705, -0.0018429075134918094, 0.05344577133655548, 0.029428940266370773, -0.004553352948278189, 0.02402617782354355, -0.03156116604804993, 0.0499705895781517, -0.002755394671112299, -0.002261590911075473, 0.09590907394886017, 0.10419530421495438, -0.031953100115060806, 0.06346207857131958, 0.041432902216911316, -0.03938351571559906, 0.08150696009397507, -0.033522527664899826, 0.020911701023578644, -0.0019048107787966728, 0.06539902836084366, -0.006647763308137655, 0.02166265808045864, -0.010004899464547634, 0.05795794352889061, -0.023633627220988274, 0.009553682059049606, -0.03807748481631279, -0.11414444446563721, 0.007169604767113924, 0.07891198992729187, -0.03571872413158417, -0.009829909540712833, 0.03758864104747772, -0.07253531366586685, -0.03652609512209892, -0.042975760996341705, 0.0033057064283639193, 0.04271898791193962, -0.03129700571298599, 0.03351350501179695, 0.01020807959139347, 0.018608784303069115, 0.06065753474831581, -0.0016600866802036762, -0.048968955874443054, -0.058029476553201675, -0.07673370093107224, 0.012002999894320965, -0.056229595094919205, -0.03539184480905533, 0.09562849253416061, 0.029480837285518646, 0.02656722627580166, -0.06636028736829758, 0.08663666993379593, -0.06686414033174515, 0.04318301007151604, -0.07019210606813431, -0.07465226203203201, -0.06646095216274261, -0.00044373422861099243, 0.01740342564880848, -0.0183806661516428, -0.01550910621881485, -0.026274804025888443, -0.06368310004472733, 0.08494637161493301, -0.08818785101175308, -0.05294536054134369, -0.05653843656182289, 0.09130600094795227, 0.013859624974429607, 0.01641283929347992, 0.01640714704990387, -0.03294914588332176, 0.05016019940376282, 0.05947592854499817, -0.06814245134592056, 0.058445367962121964, 0.04672004655003548, -0.07301400601863861, 0.0362265408039093, 0.019530080258846283, 0.01960020326077938, -0.0515981987118721, 0.022228414192795753, 0.06671684980392456, -4.626539862329082e-8, -0.019290942698717117, 0.03612195700407028, -0.0327303484082222, -0.02756008878350258, 0.005403455346822739, 0.025734402239322662, -0.019881919026374817, -0.08018101751804352, -0.006543947849422693, -0.09509455412626266, 0.04404153302311897, 0.005574432201683521, 0.00690443767234683, 0.02680354192852974, -0.07802341878414154, 0.0304558165371418, -0.07602205872535706, 0.06840644776821136, 0.019092682749032974, -0.06937270611524582, -0.026532724499702454, 0.04002874717116356, -0.042922243475914, -0.0026351790875196457, 0.024543920531868935, 0.0265862625092268, 0.08078103512525558, 0.12051161378622055, 0.04821678623557091, 0.015908462926745415, -0.04314645752310753, -0.06950122863054276, 0.08901101350784302, -0.004690804053097963, -0.08899799734354019, 0.0015822690911591053, -0.026210062205791473, -0.05860321223735809, 0.11033762991428375, 0.11450887471437454, -0.007103319279849529, 0.05714385583996773, -0.03277350962162018, 0.03144017234444618, -0.1103489026427269, 0.006096106953918934, 0.04176784306764603, 0.03475521132349968, -0.07223047316074371, 0.08979201316833496, 0.041924748569726944, -0.07298359274864197, -0.024197757244110107, -0.04365658760070801, -0.0317382737994194, 0.039837371557950974, 0.015633920207619667, -0.07777963578701019, -0.05288543924689293, 0.03430025279521942, 0.0490611232817173, -0.08984169363975525, 0.029720958322286606, -0.022299746051430702 ]
-0.054575
| | `'AES-CBC'` | ✔ | ✔ | ✔ | | | `'AES-CTR'` | ✔ | ✔ | ✔ | | | `'AES-GCM'` | ✔ | ✔ | ✔ | | | `'AES-KW'` | ✔ | ✔ | ✔ | | | `'AES-OCB'` | ✔ | ✔ | ✔ | | | `'Argon2d'` | | | ✔ | | | `'Argon2i'` | | | ✔ | | | `'Argon2id'` | | | ✔ | | | `'ChaCha20-Poly1305'`[^modern-algos] | ✔ | ✔ | ✔ | | | `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | `'Ed25519'` | ✔ | ✔ | ✔ | ✔ | | `'Ed448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | `'HKDF'` | | | ✔ | | | `'HMAC'` | ✔ | ✔ | ✔ | | | `'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] | ✔ | ✔ | ✔ | ✔ | | `'ML-KEM-1024'`[^modern-algos] | ✔ | ✔ | ✔ | ✔ | | `'PBKDF2'` | | | ✔ | | | `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | | `'RSA-PSS'` | ✔ | ✔ | ✔ | ✔ | | `'RSASSA-PKCS1-v1\_5'` | ✔ | ✔ | ✔ | ✔ | | `'X25519'` | ✔ | ✔ | ✔ | ✔ | | `'X448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | ### Crypto Operation APIs \*\*Column Legend:\*\* \* \*\*Encryption\*\*: [`subtle.encrypt()`][] / [`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()`][] / [`subtle.decapsulateBits()`][] / [`subtle.encapsulateKey()`][] / [`subtle.decapsulateKey()`][] \* \*\*Digest\*\*: [`subtle.digest()`][] | Algorithm | Encryption | Signatures and MAC | Key or Bits Derivation | Key Wrapping | Key Encapsulation | Digest | | ------------------------------------ | ---------- | ------------------ | ---------------------- | ------------ | ----------------- | ------ | | `'AES-CBC'` | ✔ | | | ✔ | | | | `'AES-CTR'` | ✔ | | | ✔ | | | | `'AES-GCM'` | ✔ | | | ✔ | | | | `'AES-KW'` | | | | ✔ | | | | `'AES-OCB'` | ✔ | | | ✔ | | | | `'Argon2d'` | | | ✔ | | | | | `'Argon2i'` | | | ✔ | | | | | `'Argon2id'` | | | ✔ | | | | | `'ChaCha20-Poly1305'`[^modern-algos] | ✔ | | | ✔ | | | | `'cSHAKE128'`[^modern-algos] | | | | | | ✔ | | `'cSHAKE256'`[^modern-algos] | | | | | | ✔ | | `'ECDH'` | | | ✔ | | | | | `'ECDSA'` | | ✔ | | | | | | `'Ed25519'` | | ✔ | | | | | | `'Ed448'`[^secure-curves] | | ✔ | | | | | | `'HKDF'` | | | ✔ | | | | | `'HMAC'` | | ✔ | | | | | | `'KMAC128'`[^modern-algos] | | ✔ | | | | | | `'KMAC256'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-44'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-65'`[^modern-algos] | | ✔ | | | | | | `'ML-DSA-87'`[^modern-algos] | | ✔ | |
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.040053267031908035, -0.05537082627415657, -0.009617935866117477, -0.12565878033638, 0.009950051084160805, -0.009612001478672028, -0.04640214890241623, 0.02747669257223606, 0.01845279335975647, -0.00971489679068327, -0.023307085037231445, -0.0076699648052453995, 0.09390700608491898, 0.054744791239500046, 0.0985494926571846, -0.0041640643030405045, -0.11233269423246384, 0.036487385630607605, 0.037976499646902084, 0.029234057292342186, 0.004824056755751371, 0.036224547773599625, 0.05634140595793724, -0.06170406937599182, 0.024853430688381195, 0.026601772755384445, 0.005745000205934048, -0.039357639849185944, -0.016375582665205002, 0.05657102167606354, -0.02961084619164467, 0.008070217445492744, 0.018381305038928986, -0.07908724993467331, 0.0013966064434498549, -0.03304560109972954, 0.006891036871820688, 0.011291314847767353, -0.0031279015820473433, -0.0595879927277565, 0.07034856826066971, 0.0032823693472892046, -0.04113663360476494, -0.13565586507320404, -0.02863917499780655, 0.03638036549091339, -0.07103661447763443, 0.0071907006204128265, 0.08221564441919327, 0.02751614898443222, 0.054217033088207245, -0.16010238230228424, 0.07396922260522842, 0.021352292969822884, -0.02874843217432499, -0.01735570840537548, 0.018139082938432693, -0.10630449652671814, 0.016023367643356323, -0.06495330482721329, 0.007927740924060345, -0.022051068022847176, 0.021945267915725708, 0.020110849291086197, -0.07524629682302475, -0.012126901187002659, -0.09671535342931747, -0.05068515986204147, 0.00894418265670538, 0.03786935284733772, 0.052104949951171875, 0.015828367322683334, 0.11542555689811707, -0.049772318452596664, -0.030166802927851677, 0.0651392936706543, -0.03701766952872276, 0.07020258158445358, -0.034884389489889145, 0.012182769365608692, 0.02268114499747753, 0.013246784918010235, -0.009887115098536015, 0.09332235157489777, 0.055870138108730316, -0.10110270977020264, 0.06642000377178192, 0.000414521578932181, -0.0016848772065714002, -0.04177775979042053, -0.07723459601402283, -0.0627630427479744, 0.0180281363427639, 0.023021956905722618, -0.001355210435576737, 0.027597099542617798, -0.012482763268053532, -0.03128839284181595, -0.019136734306812286, -0.04292138293385506, -0.11631660163402557, -0.02538839913904667, 0.00343466829508543, -0.05820515379309654, -0.0807151198387146, 0.020868636667728424, 0.01124123390763998, 0.011122537776827812, -0.043498583137989044, -0.061634521931409836, 0.019240139052271843, -0.0739675983786583, -0.016572752967476845, 0.04347992688417435, 2.074990893266156e-33, -0.014589606784284115, 0.0005683156778104603, -0.020694080740213394, -0.07344787567853928, -0.0012918522115796804, -0.0018755565397441387, 0.008620268665254116, 0.0019135087495669723, -0.061220716685056686, 0.02835806831717491, -0.1027456745505333, 0.00691697234287858, -0.061532795429229736, -0.009328078478574753, 0.06914419680833817, -0.02131417579948902, 0.0446561798453331, -0.011755170300602913, 0.03598088026046753, -0.024882914498448372, -0.002212835242971778, 0.03228669613599777, 0.009342867881059647, 0.011356542818248272, 0.04099474102258682, 0.03918037191033363, 0.07052038609981537, -0.0032100281678140163, 0.0329677015542984, 0.04525908827781677, 0.04878759756684303, -0.03976120799779892, -0.02542971819639206, -0.028405336663126945, -0.07772090286016464, 0.02927553653717041, -0.04280218482017517, -0.003061804687604308, 0.0035567223094403744, -0.0007998848450370133, -0.0009187525720335543, -0.017705023288726807, 0.041758112609386444, 0.03589729592204094, 0.0468420535326004, -0.016461510211229324, -0.039329785853624344, 0.030835766345262527, 0.05608080327510834, 0.0009594265138730407, -0.06567534804344177, 0.0325971320271492, -0.04861370101571083, -0.012164492160081863, -0.012868708930909634, -0.09234483540058136, -0.08057340234518051, 0.057250868529081345, -0.03862371668219566, 0.050630826503038406, -0.043914880603551865, 0.044599033892154694, 0.02244051918387413, -0.01783066987991333, -0.0042280531488358974, -0.027099749073386192, 0.016786104068160057, -0.027172809466719627, -0.048178981989622116, -0.013996723107993603, -0.09151612222194672, -0.008283489383757114, 0.08866998553276062, 0.07753610610961914, 0.026391813531517982, -0.04273716360330582, -0.04719419777393341, -0.00039943656884133816, 0.03981993347406387, -0.048056259751319885, -0.09351056069135666, -0.04251183941960335, -0.00885880645364523, 0.014270246028900146, 0.058802004903554916, -0.04571521282196045, 0.028365863487124443, -0.05353756994009018, -0.05208804830908775, -0.06513012945652008, -0.10286176949739456, -0.02403562143445015, -0.013950792141258717, -0.0744590163230896, -0.009360810741782188, -5.0243137499899604e-33, 0.004634641110897064, -0.017440974712371826, 0.011068487539887428, 0.005466907285153866, -0.05591711401939392, -0.02564670331776142, 0.07636214792728424, 0.0730031356215477, 0.037497177720069885, 0.03901360183954239, -0.004721784498542547, 0.013358710333704948, 0.017734739929437637, -0.09383631497621536, 0.10142309963703156, 0.012582789175212383, -0.06330853700637817, 0.013547432608902454, 0.034634705632925034, 0.01172290276736021, -0.024585755541920662, 0.0349431112408638, -0.051314420998096466, 0.0747714638710022, 0.01276308298110962, 0.05698457360267639, 0.05454416200518608, -0.014414277859032154, 0.014132152311503887, 0.017990563064813614, -0.073874332010746, 0.016696583479642868, -0.0592387318611145, 0.13719524443149567, -0.11857785284519196, -0.077124685049057, 0.08094394207000732, 0.04102955013513565, -0.056712664663791656, -0.004946631379425526, 0.006692827213555574, -0.008854714222252369, -0.022156167775392532, 0.022861450910568237, -0.03984850272536278, -0.007079872768372297, 0.027231229469180107, 0.017935050651431084, -0.04581917077302933, -0.07577940076589584, 0.03776375204324722, -0.026127256453037262, -0.013239304535090923, 0.024960514158010483, 0.04249543324112892, 0.05872374400496483, -0.014851168729364872, -0.011593811213970184, -0.11244306713342667, -0.10560690611600876, 0.03921256959438324, -0.02935970015823841, 0.07232042402029037, 0.05300547182559967, 0.040379833430051804, -0.0008127905894070864, -0.02697928249835968, 0.018978551030158997, -0.0865120217204094, -0.04244760423898697, 0.07780005037784576, -0.03585910424590111, -0.01763896271586418, -0.016355806961655617, 0.08165518194437027, -0.07005450129508972, -0.018661174923181534, 0.009752748534083366, -0.0021796738728880882, 0.044278524816036224, 0.04928099364042282, -0.007253206335008144, 0.028156207874417305, 0.09680536389350891, -0.04528501257300377, -0.06456318497657776, 0.03090827353298664, 0.0409361831843853, -0.008284997195005417, 0.03911977633833885, -0.0855991318821907, 0.0942489430308342, 0.04192492738366127, 0.06591948121786118, 0.0940835252404213, -4.2029792979292324e-8, -0.09009186178445816, -0.0629897266626358, -0.03878859058022499, -0.05170561745762825, -0.0011385849211364985, 0.0050232429057359695, -0.06291831284761429, 0.015227898955345154, -0.05602357164025307, -0.16601407527923584, 0.083723284304142, 0.021781520918011665, -0.08841271698474884, -0.025290966033935547, -0.020918039605021477, 0.007639126852154732, -0.03306109085679054, 0.03195228427648544, -0.01688423380255699, -0.06614722311496735, 0.0008737310417927802, 0.05087698623538017, 0.037998951971530914, -0.06667788326740265, -0.019136659801006317, 0.02146708406507969, -0.025450723245739937, -0.013670981861650944, 0.018442772328853607, 0.038271721452474594, -0.028372129425406456, -0.06231995299458504, 0.1060066744685173, -0.06354257464408875, 0.002305935602635145, 0.01634114794433117, -0.011331682093441486, -0.0281770508736372, -0.002769674640148878, 0.07671627402305603, -0.0012855206150561571, -0.05102739483118057, -0.01260231714695692, 0.03364492580294609, 0.07271242141723633, -0.03168654814362526, 0.06745097786188126, 0.035608209669589996, 0.05971820652484894, -0.08071527630090714, 0.025621188804507256, -0.06997296959161758, 0.03728420287370682, -0.06314120441675186, -0.09129267930984497, -0.021582532674074173, -0.020350608974695206, -0.03732037916779518, 0.07209773361682892, 0.0027462709695100784, 0.040517933666706085, 0.052353620529174805, 0.056694284081459045, 0.057237207889556885 ]
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] | | | | | ✔ | | | `'ML-KEM-1024'`[^modern-algos] | | | | | ✔ | | | `'PBKDF2'` | | | ✔ | | | | | `'RSA-OAEP'` | ✔ | | | ✔ | | | | `'RSA-PSS'` | | ✔ | | | | | | `'RSASSA-PKCS1-v1\_5'` | | ✔ | | | | | | `'SHA-1'` | | | | | | ✔ | | `'SHA-256'` | | | | | | ✔ | | `'SHA-384'` | | | | | | ✔ | | `'SHA-512'` | | | | | | ✔ | | `'SHA3-256'`[^modern-algos] | | | | | | ✔ | | `'SHA3-384'`[^modern-algos] | | | | | | ✔ | | `'SHA3-512'`[^modern-algos] | | | | | | ✔ | | `'X25519'` | | | ✔ | | | | | `'X448'`[^secure-curves] | | | ✔ | | | | ## Class: `Crypto` `globalThis.crypto` is an instance of the `Crypto` class. `Crypto` is a singleton that provides access to the remainder of the crypto API. ### `crypto.subtle` \* Type: {SubtleCrypto} Provides access to the `SubtleCrypto` API. ### `crypto.getRandomValues(typedArray)` \* `typedArray` {Buffer|TypedArray} \* Returns: {Buffer|TypedArray} Generates cryptographically strong random values. The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. The given `typedArray` must be an integer-based instance of {TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. An error will be thrown if the given `typedArray` is larger than 65,536 bytes. ### `crypto.randomUUID()` \* Returns: {string} Generates a random [RFC 4122][] version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator. ## Class: `CryptoKey` ### `cryptoKey.algorithm` \* Type: {KeyAlgorithm|RsaHashedKeyAlgorithm|EcKeyAlgorithm|AesKeyAlgorithm|HmacKeyAlgorithm|KmacKeyAlgorithm} An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. Read-only. ### `cryptoKey.extractable` \* Type: {boolean} When `true`, the {CryptoKey} can be extracted using either [`subtle.exportKey()`][] or [`subtle.wrapKey()`][]. Read-only. ### `cryptoKey.type` \* Type: {string} One of `'secret'`, `'private'`, or `'public'`. A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. ### `cryptoKey.usages` \* Type: {string\[]} An array of strings identifying the operations for which the key may be used. The possible usages are: \* `'encrypt'` - Enable using the key with [`subtle.encrypt()`][] \* `'decrypt'` - Enable using the key with [`subtle.decrypt()`][] \* `'sign'` - Enable using the key with [`subtle.sign()`][] \* `'verify'` - Enable using the key with [`subtle.verify()`][] \* `'deriveKey'` - Enable using the key with [`subtle.deriveKey()`][] \* `'deriveBits'` - Enable using the key with [`subtle.deriveBits()`][] \* `'encapsulateBits'` - Enable using the key with [`subtle.encapsulateBits()`][] \* `'decapsulateBits'` - Enable using the key with [`subtle.decapsulateBits()`][] \* `'encapsulateKey'` - Enable using the key with [`subtle.encapsulateKey()`][] \* `'decapsulateKey'` - Enable using the key with [`subtle.decapsulateKey()`][] \* `'wrapKey'` - Enable using the key with [`subtle.wrapKey()`][] \* `'unwrapKey'` - Enable using the key with [`subtle.unwrapKey()`][] Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). \*\*Column Legend:\*\* \* \*\*Encryption\*\*: [`subtle.encrypt()`][] / [`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()`][] / [`subtle.decapsulateBits()`][] / [`subtle.encapsulateKey()`][] / [`subtle.decapsulateKey()`][] | Supported Key Algorithm | Encryption | Signatures and MAC | Key or Bits Derivation | Key
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.05229998752474785, -0.061365459114313126, 0.059453077614307404, -0.0988621786236763, 0.06852244585752487, -0.012732320465147495, -0.0823129415512085, 0.04289473593235016, 0.053753502666950226, -0.04782465845346451, 0.005918738432228565, 0.051127009093761444, 0.1473083645105362, 0.01794370822608471, 0.0832873284816742, 0.019699836149811745, -0.05062953010201454, 0.020652344450354576, 0.08846794068813324, 0.09576620906591415, 0.0009969791863113642, 0.0865718275308609, 0.04460776969790459, -0.04529164731502533, -0.006674375385046005, 0.05357200279831886, 0.0033388647716492414, 0.033082254230976105, -0.0626056119799614, 0.0005771313444711268, -0.04668444022536278, 0.013842250220477581, -0.025274328887462616, -0.1221502423286438, 0.014129726216197014, 0.03019864484667778, -0.054840631783008575, -0.044360801577568054, -0.009488608688116074, -0.0696333646774292, 0.10730095207691193, 0.011126747354865074, -0.06643979996442795, -0.029484808444976807, 0.014703602530062199, 0.02623884379863739, -0.028575312346220016, -0.04562750086188316, -0.022197972983121872, -0.03293473273515701, -0.008254512213170528, -0.06082097813487053, 0.03146578371524811, 0.009962357580661774, -0.029897473752498627, 0.03533903509378433, 0.04229653999209404, -0.13204190135002136, -0.00372341088950634, -0.03903007507324219, 0.022803494706749916, -0.05270293354988098, 0.010616465471684933, -0.005884449928998947, -0.03234974667429924, -0.03067530319094658, -0.07394790649414062, -0.018114835023880005, -0.009971746243536472, 0.003156911348924041, 0.0331270806491375, -0.007475412916392088, 0.08150448650121689, -0.1042230948805809, 0.004186832346022129, 0.054822180420160294, -0.05480780825018883, 0.009700595401227474, -0.05868469551205635, -0.02601328119635582, -0.016850469633936882, -0.06591157615184784, 0.03706953302025795, 0.020920058712363243, 0.06911575049161911, 0.004652112722396851, 0.0931730568408966, -0.004689292516559362, 0.029701080173254013, -0.08790198713541031, -0.1145026907324791, -0.10852281749248505, 0.02190541848540306, 0.0006810734048485756, 0.0479358546435833, 0.036060404032468796, 0.017539402469992638, -0.023626303300261497, -0.019918693229556084, -0.005217359866946936, -0.017200414091348648, 0.000034963151847478, -0.05202696844935417, 0.024997638538479805, -0.00042114159441553056, 0.04899543896317482, 0.02240656316280365, -0.05149896815419197, -0.06936053186655045, -0.04599414020776749, -0.003139709820970893, -0.04258951544761658, -0.007990817539393902, -0.008188384585082531, 7.663082203157048e-33, 0.028417129069566727, 0.03934193029999733, 0.05543428286910057, -0.08248276263475418, -0.021575873717665672, 0.013903121463954449, -0.004835562314838171, -0.018676044419407845, -0.021023422479629517, 0.062488190829753876, -0.03701983019709587, 0.06420378386974335, -0.0966111272573471, -0.07918175309896469, 0.017211223021149635, -0.014875202439725399, 0.042847294360399246, -0.04189584404230118, 0.04307728633284569, -0.004614572506397963, 0.03335360437631607, 0.0627131387591362, 0.010125458240509033, 0.02804049476981163, 0.062403641641139984, -0.00290996883995831, 0.07678832858800888, -0.04577351734042168, 0.028717992827296257, 0.03114454634487629, 0.04881427437067032, -0.007550518028438091, -0.040439240634441376, -0.022871969267725945, -0.006286650896072388, 0.01646297611296177, -0.033617064356803894, -0.00890206079930067, -0.029630424454808235, -0.022969376295804977, -0.01626567728817463, 0.014765245839953423, -0.005736891180276871, 0.030537407845258713, 0.009006572887301445, -0.0050488002598285675, -0.0385110042989254, -0.012363188900053501, 0.1043417826294899, 0.0010113531025126576, -0.011282803490757942, 0.009667957201600075, -0.08434682339429855, 0.049931127578020096, -0.026190193369984627, -0.07807832956314087, -0.032880887389183044, 0.06637310236692429, 0.05553508177399635, 0.011899709701538086, -0.006489318795502186, 0.011625036597251892, 0.038113534450531006, -0.01731186732649803, 0.07995883375406265, -0.06689903885126114, 0.013175789266824722, -0.0013488102704286575, -0.06336162984371185, 0.05715964734554291, -0.037811871618032455, -0.018361873924732208, 0.050399050116539, 0.05314572900533676, -0.013818705454468727, -0.06590931117534637, 0.017846405506134033, 0.02030622400343418, -0.01920440047979355, 0.0020787857938557863, -0.0650506466627121, 0.01580873504281044, -0.0349135585129261, 0.044180672615766525, 0.08309562504291534, 0.00012171561684226617, -0.007714991457760334, -0.07945109903812408, -0.08182115107774734, -0.06756626069545746, -0.12545844912528992, -0.005554343573749065, -0.04271892458200455, -0.0604838952422142, -0.06834166496992111, -7.902096938877682e-33, 0.05831213295459747, 0.025374585762619972, 0.05071911960840225, -0.001964624971151352, -0.05835810676217079, -0.10162298381328583, 0.006012257654219866, 0.08296515047550201, 0.02897247113287449, 0.028735710307955742, 0.019344322383403778, -0.021153103560209274, 0.012071195989847183, -0.03798507899045944, 0.07526928931474686, 0.018331769853830338, -0.004929562099277973, 0.0925893783569336, 0.03396127372980118, 0.024137647822499275, -0.01800251007080078, 0.09803379327058792, 0.011995728127658367, 0.09368764609098434, 0.00222113449126482, -0.00833146646618843, 0.07921243458986282, 0.08960983157157898, -0.0022438063751906157, -0.023839548230171204, 0.020457446575164795, 0.02835952490568161, -0.08285758644342422, 0.0891653373837471, -0.1339280605316162, -0.021015919744968414, 0.0009242888772860169, 0.051518406718969345, 0.02286701090633869, 0.09409476816654205, -0.03295765817165375, 0.06211240217089653, -0.03682563453912735, -0.017625750973820686, -0.04719870537519455, -0.026003064587712288, 0.0718720555305481, 0.0038121482357382774, -0.0198769923299551, -0.10470393300056458, 0.08574675768613815, -0.05093963444232941, -0.12084636092185974, -0.0006958070443943143, 0.036469314247369766, -0.007366746198385954, -0.005550946108996868, -0.006838065106421709, -0.10171966999769211, -0.08705993741750717, 0.028194433078169823, -0.07374696433544159, 0.046313945204019547, -0.013744641095399857, 0.005584094673395157, 0.023053530603647232, 0.06573310494422913, 0.01785281114280224, -0.009886042214930058, -0.013612663373351097, 0.10417963564395905, -0.02174290269613266, -0.04369727522134781, 0.10518775880336761, -0.018485350534319878, -0.019455980509519577, -0.07509055733680725, 0.07455388456583023, 0.026395007967948914, 0.010224488563835621, -0.018961606547236443, -0.040627170354127884, 0.017361756414175034, 0.04853896424174309, -0.012560389004647732, -0.003224050160497427, 0.03778648376464844, 0.0229258444160223, 0.014939424581825733, 0.042587023228406906, -0.03565346449613571, 0.0582246296107769, 0.04200809821486473, 0.07422908395528793, 0.038500405848026276, -3.4796464376540825e-8, -0.03791319578886032, -0.12510105967521667, -0.030437961220741272, -0.025265568867325783, 0.06053341180086136, 0.04024619609117508, -0.05025140568614006, -0.005520384758710861, -0.04538804292678833, -0.15626220405101776, 0.10651803016662598, -0.034309208393096924, -0.10331746190786362, -0.06267201900482178, 0.002717175055295229, 0.04987890645861626, -0.03556841239333153, 0.07455049455165863, -0.03795197606086731, 0.01427299901843071, 0.08036705106496811, -0.008118786849081516, 0.08808764070272446, -0.017771365121006966, 0.019241372123360634, -0.002679205033928156, -0.037391722202301025, 0.023928890004754066, 0.0035992665216326714, 0.01904482953250408, 0.00009294972551288083, -0.03339755907654762, 0.0780152827501297, -0.10261081904172897, -0.00798132736235857, -0.04534304141998291, 0.01357222069054842, 0.0055452752858400345, -0.03319909796118736, 0.058952447026968, -0.003304150654003024, -0.050035156309604645, -0.09267006069421768, 0.054579418152570724, -0.011587800458073616, -0.0659320056438446, 0.05733446031808853, 0.025047799572348595, 0.007344251498579979, -0.053680505603551865, 0.09647887200117111, -0.039645012468099594, 0.005192937329411507, -0.04707048833370209, -0.11653946340084076, -0.037175994366407394, 0.01464350987225771, 0.046933263540267944, 0.014254583045840263, -0.03584614023566246, 0.03554243966937065, 0.005051087588071823, 0.04724864289164543, 0.015567208640277386 ]
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()`][] / [`subtle.decapsulateBits()`][] / [`subtle.encapsulateKey()`][] / [`subtle.decapsulateKey()`][] | Supported Key Algorithm | Encryption | Signatures and MAC | Key or Bits Derivation | Key Wrapping | Key Encapsulation | | ------------------------------------ | ---------- | ------------------ | ---------------------- | ------------ | ----------------- | | `'AES-CBC'` | ✔ | | | ✔ | | | `'AES-CTR'` | ✔ | | | ✔ | | | `'AES-GCM'` | ✔ | | | ✔ | | | `'AES-KW'` | | | | ✔ | | | `'AES-OCB'` | ✔ | | | ✔ | | | `'Argon2d'` | | | ✔ | | | | `'Argon2i'` | | | ✔ | | | | `'Argon2id'` | | | ✔ | | | | `'ChaCha20-Poly1305'`[^modern-algos] | ✔ | | | ✔ | | | `'ECDH'` | | | ✔ | | | | `'ECDSA'` | | ✔ | | | | | `'Ed25519'` | | ✔ | | | | | `'Ed448'`[^secure-curves] | | ✔ | | | | | `'HDKF'` | | | ✔ | | | | `'HMAC'` | | ✔ | | | | | `'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] | | | | | ✔ | | `'ML-KEM-1024'`[^modern-algos] | | | | | ✔ | | `'PBKDF2'` | | | ✔ | | | | `'RSA-OAEP'` | ✔ | | | ✔ | | | `'RSA-PSS'` | | ✔ | | | | | `'RSASSA-PKCS1-v1\_5'` | | ✔ | | | | | `'X25519'` | | | ✔ | | | | `'X448'`[^secure-curves] | | | ✔ | | | ## Class: `CryptoKeyPair` The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. ### `cryptoKeyPair.privateKey` \* Type: {CryptoKey} A {CryptoKey} whose `type` will be `'private'`. ### `cryptoKeyPair.publicKey` \* Type: {CryptoKey} A {CryptoKey} whose `type` will be `'public'`. ## Class: `SubtleCrypto` ### Static method: `SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])` > Stability: 1.1 - Active development \* `operation` {string} "encrypt", "decrypt", "sign", "verify", "digest", "generateKey", "deriveKey", "deriveBits", "importKey", "exportKey", "getPublicKey", "wrapKey", "unwrapKey", "encapsulateBits", "encapsulateKey", "decapsulateBits", or "decapsulateKey" \* `algorithm` {string|Algorithm} \* `lengthOrAdditionalAlgorithm` {null|number|string|Algorithm|undefined} Depending on the operation this is either ignored, the value of the length argument when operation is "deriveBits", the algorithm of key to be derived when operation is "deriveKey", the algorithm of key to be exported before wrapping when operation is "wrapKey", the algorithm of key to be imported after unwrapping when operation is "unwrapKey", or the algorithm of key to be imported after en/decapsulating a key when operation is "encapsulateKey" or "decapsulateKey". \*\*Default:\*\* `null` when operation is "deriveBits", `undefined` otherwise. \* Returns: {boolean} Indicating whether the implementation supports the given operation Allows feature detection in Web Crypto API, which can be used to detect whether a given algorithm identifier (including its parameters) is supported for the given operation. See [Checking for runtime algorithm support][] for an example use 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 {ArrayBuffer} upon success. A message recipient uses their asymmetric private key to decrypt an "encapsulated key" (ciphertext), thereby recovering a temporary symmetric key
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.008455273695290089, 0.059647172689437866, 0.013488241471350193, -0.05610061436891556, 0.08095303922891617, -0.007106138858944178, 0.0142277916893363, 0.014117684215307236, -0.06336429715156555, 0.0011050961911678314, -0.0314876064658165, -0.034805282950401306, 0.08005117624998093, 0.09487519413232803, 0.04130977392196655, 0.050868645310401917, -0.033282570540905, 0.017252346500754356, 0.012740411795675755, -0.02057899348437786, 0.0653499886393547, 0.050494320690631866, 0.10675579309463501, 0.09418076276779175, 0.010793516412377357, -0.03765099123120308, -0.07678242027759552, -0.04642139747738838, 0.017107432708144188, -0.032824691385030746, 0.10351752489805222, 0.01503696758300066, 0.014690550975501537, -0.004599341191351414, 0.047314535826444626, -0.09475938230752945, -0.022510115057229996, 0.0028390265069901943, 0.02667330950498581, -0.05360766872763634, 0.02857472188770771, -0.016245875507593155, -0.043467603623867035, -0.06939881294965744, -0.0008281749323941767, 0.053029973059892654, 0.013676915317773819, -0.016412118449807167, 0.011615978553891182, -0.02164425700902939, -0.005739186890423298, -0.06930186599493027, 0.08688784390687943, 0.023514801636338234, -0.012867393903434277, 0.07162951678037643, 0.03920624777674675, -0.03819471597671509, -0.07023245841264725, -0.00812444370239973, 0.007392478175461292, -0.05372322350740433, -0.0063607459887862206, -0.02796240895986557, -0.01601085066795349, -0.06654510647058487, -0.05543305724859238, -0.06523068994283676, -0.07090923935174942, 0.018974604085087776, 0.06331568956375122, 0.037547461688518524, 0.04786718264222145, -0.04133514687418938, -0.033496759831905365, 0.0052255187183618546, 0.08830375969409943, 0.012302803806960583, -0.06831739097833633, 0.04038366302847862, 0.0054171644151210785, 0.11070895195007324, -0.00008506355516146868, 0.020067594945430756, -0.015024681575596333, -0.06123678758740425, 0.08980868756771088, -0.09184935688972473, 0.0323341004550457, -0.04951070249080658, -0.11944905668497086, 0.09022229164838791, 0.08135699480772018, -0.02081131748855114, -0.04229002445936203, 0.0304696187376976, 0.02496485598385334, -0.0271019134670496, 0.026653511449694633, -0.04486024007201195, -0.013153904117643833, 0.002193705178797245, 0.04854344204068184, 0.016757270321249962, 0.03136662021279335, -0.014604546129703522, 0.022539114579558372, 0.06691907346248627, 0.0061423080042004585, 0.000999795156531036, -0.0026643099263310432, -0.024822616949677467, -0.04104666784405708, -0.03936800733208656, 5.6054491370197135e-33, -0.031218310818076134, -0.04109713435173035, -0.046035680919885635, 0.043286293745040894, 0.018223201856017113, -0.017545443028211594, 0.050300732254981995, 0.003775747260078788, -0.1505299210548401, 0.0910319983959198, -0.013484697788953781, -0.017098791897296906, -0.0597098134458065, 0.05032568797469139, 0.07268697023391724, 0.019458310678601265, 0.04596252366900444, -0.010988068766891956, 0.02794649265706539, 0.04460597038269043, 0.022871045395731926, 0.06203663721680641, -0.03306199610233307, -0.0321076400578022, -0.0603816844522953, 0.025142071768641472, 0.0072257909923791885, 0.007689364720135927, 0.07784973829984665, 0.0014313114807009697, -0.024952920153737068, -0.061381805688142776, 0.02365216799080372, -0.01807362027466297, 0.015607433393597603, -0.01826580800116062, -0.01094015222042799, -0.04466124624013901, -0.02100135013461113, -0.05495766922831535, -0.02074211835861206, -0.09400641173124313, -0.0220780111849308, -0.11664874106645584, 0.027119942009449005, -0.037274956703186035, -0.045241765677928925, 0.013578493148088455, 0.06617742031812668, 0.004405515734106302, 0.02930375747382641, 0.04316706210374832, 0.008792079985141754, -0.05890420079231262, -0.01720654033124447, -0.08503279089927673, -0.007798288017511368, 0.06848245859146118, -0.01729154773056507, 0.07956170290708542, -0.05642161890864372, 0.0367356613278389, 0.0282390508800745, -0.03076861798763275, -0.043483804911375046, 0.009524412453174591, -0.045652322471141815, -0.04295876622200012, -0.04495466500520706, 0.051692377775907516, -0.15733031928539276, 0.05639087036252022, -0.02683963254094124, 0.054127465933561325, -0.038994286209344864, -0.06594697386026382, -0.013134853914380074, 0.019616778939962387, 0.053172845393419266, -0.04787678271532059, 0.005657606292515993, 0.09289336949586868, -0.012869182042777538, 0.12236110121011734, -0.030091075226664543, 0.020504964515566826, -0.08355443179607391, -0.06666114926338196, -0.06377013772726059, -0.002373458817601204, -0.02490968257188797, -0.02103089913725853, 0.012441921047866344, -0.08153868466615677, -0.08533632755279541, -8.661198129860098e-33, 0.04467873275279999, 0.0037981278728693724, -0.06145632266998291, 0.0644150897860527, -0.11754876375198364, 0.011382818222045898, 0.0034890540409833193, -0.03092450089752674, -0.007425355259329081, -0.0733063817024231, 0.002835348481312394, 0.028109831735491753, 0.07659006118774414, -0.07883557677268982, -0.012259408831596375, 0.017512580379843712, -0.06922367960214615, 0.02876805141568184, 0.07005470246076584, 0.005704786162823439, -0.02061658352613449, 0.0507725290954113, -0.003122154623270035, 0.06765490025281906, 0.0271717831492424, 0.034979261457920074, 0.008559399284422398, 0.09893559664487839, 0.010179378092288971, 0.04037458077073097, -0.01251306664198637, 0.10976467281579971, -0.02827577479183674, -0.07890824973583221, -0.01292854268103838, -0.07327023893594742, -0.040767308324575424, 0.09433059394359589, 0.026317160576581955, -0.013906426727771759, 0.07043580710887909, -0.06156504526734352, -0.009038489311933517, -0.014262668788433075, 0.002642375184223056, 0.0191871989518404, 0.02291734889149666, 0.08413829654455185, -0.0013580479426309466, -0.022607246413826942, 0.11744819581508636, -0.0684276670217514, -0.03132494166493416, -0.0247562974691391, 0.003420148743316531, 0.04854891449213028, 0.008396988734602928, -0.043744493275880814, 0.0820995569229126, 0.015463965944945812, -0.018720978870987892, -0.07347936928272247, 0.05649995431303978, 0.0016111397417262197, 0.034097835421562195, -0.05850940942764282, -0.1112343817949295, -0.030741777271032333, -0.07811233401298523, -0.0043764482252299786, 0.07608285546302795, -0.04149803891777992, -0.028790639713406563, 0.016543224453926086, 0.1402212232351303, -0.031107205897569656, -0.00826211553066969, -0.0519048236310482, 0.025219200178980827, 0.043057143688201904, 0.033075205981731415, 0.046643391251564026, -0.015849903225898743, 0.055834878236055374, -0.018771091476082802, -0.009883897379040718, -0.03129255026578903, 0.03630951792001724, -0.007151235826313496, -0.009085681289434433, -0.047728925943374634, 0.0818222239613533, -0.010005107149481773, 0.002276880433782935, -0.008038867264986038, -4.533387354399565e-8, -0.052138831466436386, -0.05956112593412399, 0.0007336012786254287, -0.08243488520383835, -0.04719780012965202, 0.07304301112890244, -0.03002707101404667, -0.06827142089605331, -0.032186370342969894, -0.12242353707551956, 0.02135036326944828, -0.019058723002672195, -0.09141498059034348, -0.02913757972419262, -0.06857949495315552, 0.07478455454111099, -0.06939105689525604, 0.015902291983366013, -0.053389549255371094, -0.10487088561058044, -0.027369417250156403, -0.0075370194390416145, -0.016907865181565285, 0.008516439236700535, 0.023876318708062172, 0.048882097005844116, 0.05484724044799805, 0.11043095588684082, 0.0026182588189840317, 0.0516720712184906, 0.002984096761792898, -0.04251423850655556, 0.04284194856882095, 0.02545327879488468, -0.04577549546957016, 0.02408398687839508, -0.045789845287799835, 0.009090885519981384, 0.009054083377122879, 0.08837033063173294, -0.03812415152788162, -0.031864505261182785, -0.11071550101041794, -0.0027020543348044157, -0.06999517977237701, -0.006108935456722975, 0.0489409975707531, 0.049235470592975616, -0.07663145661354065, 0.052394550293684006, 0.08178988099098206, -0.04411160945892334, -0.004409890156239271, 0.033082786947488785, -0.07850272208452225, 0.04416343569755554, -0.03379620611667633, -0.05841964855790138, 0.03486837446689606, 0.031681668013334274, 0.011893508955836296, -0.00010742458107415587, 0.04716256633400917, 0.01633289083838463 ]
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 {ArrayBuffer} upon success. A message recipient uses their asymmetric private key to decrypt an "encapsulated key" (ciphertext), thereby recovering a temporary symmetric key (represented as {ArrayBuffer}) which is then used to decrypt a message. The algorithms currently supported include: \* `'ML-KEM-512'`[^modern-algos] \* `'ML-KEM-768'`[^modern-algos] \* `'ML-KEM-1024'`[^modern-algos] ### `subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, usages)` > Stability: 1.1 - Active development \* `decapsulationAlgorithm` {string|Algorithm} \* `decapsulationKey` {CryptoKey} \* `ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer} \* `sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} \* `extractable` {boolean} \* `usages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with {CryptoKey} upon success. A message recipient uses their asymmetric private key to decrypt an "encapsulated key" (ciphertext), thereby recovering a temporary symmetric key (represented as {CryptoKey}) which is then used to decrypt a message. The algorithms currently supported include: \* `'ML-KEM-512'`[^modern-algos] \* `'ML-KEM-768'`[^modern-algos] \* `'ML-KEM-1024'`[^modern-algos] ### `subtle.decrypt(algorithm, key, data)` \* `algorithm` {RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} \* `key` {CryptoKey} \* `data` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. Using the method and parameters specified in `algorithm` and the keying material provided by `key`, this method attempts to decipher the provided `data`. If successful, the returned promise will be resolved with an {ArrayBuffer} containing the plaintext result. The algorithms currently supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'RSA-OAEP'` ### `subtle.deriveBits(algorithm, baseKey[, length])` \* `algorithm` {EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params|Argon2Params} \* `baseKey` {CryptoKey} \* `length` {number|null} \*\*Default:\*\* `null` \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, this method attempts to generate `length` bits. When `length` is not provided or `null` the maximum number of bits for a given algorithm is generated. This is allowed for the `'ECDH'`, `'X25519'`, and `'X448'`[^secure-curves] algorithms, for other algorithms `length` is required to be a number. If successful, the returned promise will be resolved with an {ArrayBuffer} containing the generated data. The algorithms currently supported include: \* `'Argon2d'`[^modern-algos] \* `'Argon2i'`[^modern-algos] \* `'Argon2id'`[^modern-algos] \* `'ECDH'` \* `'HKDF'` \* `'PBKDF2'` \* `'X25519'` \* `'X448'`[^secure-curves] ### `subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)` \* `algorithm` {EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params|Argon2Params} \* `baseKey` {CryptoKey} \* `derivedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} \* `extractable` {boolean} \* `keyUsages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with a {CryptoKey} upon success. Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, this method attempts to generate a new {CryptoKey} based on the method and parameters in `derivedKeyAlgorithm`. Calling this method is equivalent to calling [`subtle.deriveBits()`][] to generate raw keying material, then passing the result into the [`subtle.importKey()`][] method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. The algorithms currently supported include: \* `'Argon2d'`[^modern-algos] \* `'Argon2i'`[^modern-algos] \* `'Argon2id'`[^modern-algos] \* `'ECDH'` \* `'HKDF'` \* `'PBKDF2'` \* `'X25519'` \* `'X448'`[^secure-curves] ### `subtle.digest(algorithm, data)` \* `algorithm` {string|Algorithm|CShakeParams} \* `data` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. Using the method identified by `algorithm`, this method attempts to generate a digest of `data`. If successful, the returned promise is resolved with an {ArrayBuffer} containing the computed digest. If `algorithm` is provided as a {string}, it must be one of: \* `'cSHAKE128'`[^modern-algos] \* `'cSHAKE256'`[^modern-algos] \* `'SHA-1'` \* `'SHA-256'` \* `'SHA-384'` \* `'SHA-512'` \* `'SHA3-256'`[^modern-algos] \* `'SHA3-384'`[^modern-algos] \* `'SHA3-512'`[^modern-algos] If `algorithm` is provided as 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} upon success. Uses a message recipient's asymmetric public key to encrypt a temporary symmetric
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.009410537779331207, -0.02624058537185192, 0.01546948216855526, 0.04314706102013588, 0.03080715984106064, -0.019717318937182426, 0.001781216822564602, 0.022486424073576927, -0.042058613151311874, -0.03296264261007309, 0.0010779423173516989, 0.025400927290320396, 0.07642469555139542, 0.0239305030554533, -0.01239378098398447, 0.01826772838830948, -0.05502605810761452, 0.02517457865178585, -0.017132636159658432, -0.017687886953353882, 0.08230544626712799, -0.12823575735092163, 0.12545712292194366, -0.03664327785372734, 0.002874871948733926, 0.05424051731824875, -0.030336584895849228, -0.06442693620920181, 0.013589761219918728, -0.09423308819532394, 0.019466202706098557, -0.027735954150557518, -0.02003750577569008, -0.04303213581442833, 0.060567475855350494, -0.07658401131629944, -0.04761252924799919, -0.04006960242986679, 0.012688873335719109, -0.03419668599963188, 0.11125575006008148, -0.03521548584103584, -0.08966740220785141, -0.08414679020643234, 0.0314040444791317, -0.02780342660844326, 0.025526663288474083, -0.0034738844260573387, -0.02695564739406109, 0.04295416176319122, 0.026775266975164413, -0.03126053512096405, 0.019573422148823738, 0.09937458485364914, -0.018067799508571625, 0.06430330872535706, 0.033822931349277496, -0.021207887679338455, -0.056746840476989746, -0.06546653062105179, -0.018652532249689102, -0.03462624549865723, 0.05751430243253708, -0.0008197061833925545, -0.03474857658147812, -0.02375551499426365, 0.012300893664360046, 0.036364901810884476, -0.008961431682109833, 0.03212397173047066, 0.06838363409042358, 0.03429615870118141, 0.057679519057273865, -0.0879901647567749, 0.0038084015250205994, 0.0013466820819303393, 0.025605062022805214, 0.0020199385471642017, -0.007083438336849213, -0.022530341520905495, 0.06028115004301071, 0.043399628251791, -0.0596454031765461, 0.04034268110990524, 0.013074065558612347, -0.0785471647977829, 0.05389682203531265, -0.02421846240758896, 0.10140515863895416, -0.01814245991408825, -0.11828767508268356, 0.05962560325860977, 0.02189255878329277, 0.041791245341300964, -0.0569874607026577, -0.09952132403850555, -0.007719352841377258, -0.04896757751703262, 0.0651598572731018, -0.01970905251801014, 0.017474336549639702, -0.013623349368572235, -0.008400295861065388, -0.038424257189035416, 0.03695181384682655, 0.06047757714986801, 0.049550026655197144, 0.0026329129468649626, 0.030612677335739136, -0.008854560554027557, 0.01053281407803297, -0.05514059215784073, -0.03364311531186104, -0.05548315495252609, 9.419997365731147e-33, -0.035605981945991516, 0.005544793792068958, -0.007654363289475441, 0.03647323325276375, -0.018967190757393837, 0.020539987832307816, -0.005896579474210739, 0.07690809667110443, -0.027632322162389755, -0.019210612401366234, 0.009780529886484146, -0.05722201615571976, 0.04536627605557442, 0.027919413521885872, 0.057568300515413284, -0.002903219312429428, -0.005541527643799782, 0.025764131918549538, 0.03167233616113663, 0.018401945009827614, 0.02126765251159668, 0.10239207744598389, -0.009398555383086205, -0.045574866235256195, -0.00731264054775238, 0.01266052108258009, 0.03732658550143242, -0.02676607109606266, -0.008600432425737381, 0.02947155199944973, -0.07604166120290756, 0.024611275643110275, 0.012078399769961834, -0.04880286380648613, 0.07375504076480865, 0.02501935139298439, 0.02052963897585869, -0.06775669008493423, -0.016469184309244156, -0.021079489961266518, -0.01710602454841137, 0.018344489857554436, -0.028021808713674545, -0.04546358808875084, -0.06330043077468872, -0.0405409038066864, -0.06612730026245117, 0.04572806507349014, 0.054817087948322296, -0.023043489083647728, 0.02978416718542576, 0.025714855641126633, -0.1014910638332367, -0.05779877305030823, -0.009942347183823586, -0.06187489256262779, 0.05068500339984894, 0.03892848268151283, 0.011279257945716381, 0.09824462234973907, -0.042686380445957184, -0.044959258288145065, 0.004213371779769659, -0.038983769714832306, 0.003496612887829542, 0.022455532103776932, -0.07803911715745926, -0.08366034179925919, -0.04955201596021652, 0.010549706406891346, -0.053448598831892014, 0.04521292820572853, 0.032256342470645905, 0.07920029759407043, -0.0459415465593338, -0.014925840310752392, -0.010102582164108753, -0.06005573272705078, 0.09174259752035141, -0.10871661454439163, 0.033682681620121, 0.02486114576458931, -0.006213103886693716, 0.027397064492106438, -0.032041825354099274, 0.021335575729608536, -0.04725142940878868, -0.07038624584674835, -0.028369061648845673, 0.005602662917226553, -0.12217368185520172, -0.05149790644645691, -0.011600193567574024, -0.07869255542755127, -0.015224556438624859, -1.0247291922740642e-32, 0.05403711274266243, -0.015684843063354492, -0.13713593780994415, 0.10644485801458359, -0.02194773405790329, 0.014119429513812065, 0.02839515171945095, 0.03596736490726471, -0.009885941632091999, -0.02883393131196499, -0.060991160571575165, 0.027260279282927513, 0.10045795142650604, 0.050030358135700226, 0.061126209795475006, 0.0013374927220866084, 0.010404898785054684, -0.013322252780199051, 0.029193757101893425, -0.03466883301734924, 0.011083095334470272, 0.05636977404356003, -0.011674193665385246, 0.08373202383518219, 0.08032907545566559, 0.04925841465592384, -0.01573285460472107, 0.13769327104091644, 0.056063685566186905, -0.045555729418992996, -0.020641420036554337, -0.02109646610915661, -0.009510993957519531, -0.06673534214496613, -0.06295491755008698, 0.01553292665630579, -0.011385207064449787, 0.02419622428715229, 0.0022526660468429327, 0.03445138782262802, 0.06409953534603119, -0.024712109938263893, -0.007258401717990637, 0.017799552530050278, 0.048860881477594376, -0.019323289394378662, -0.04485193267464638, 0.025539014488458633, 0.05019174516201019, -0.06567468494176865, 0.10562193393707275, -0.036940641701221466, -0.05240549519658089, 0.05808594450354576, 0.013062591664493084, 0.0480031743645668, -0.019281335175037384, 0.003519625635817647, 0.04708774760365486, 0.010374641045928001, -0.02717658132314682, -0.08285237103700638, 0.0885266363620758, -0.030514296144247055, 0.036708369851112366, -0.016806473955512047, -0.02230985090136528, -0.051003605127334595, -0.030576558783650398, 0.007059328258037567, 0.12549988925457, -0.03491095080971718, -0.07424411177635193, 0.020292134955525398, 0.05771616846323013, -0.028458131477236748, -0.04842003434896469, -0.10168906301259995, 0.003746351692825556, 0.021400511264801025, -0.0008627006318420172, -0.011128677055239677, 0.049789927899837494, 0.07138052582740784, 0.14781782031059265, -0.03437360003590584, 0.0336294062435627, -0.0362199991941452, -0.1058412492275238, 0.0011511779157444835, 0.009656082838773727, -0.03862282261252403, -0.06269589066505432, 0.02265624888241291, 0.07923732697963715, -6.416530595743097e-8, 0.015623689629137516, -0.04045988991856575, -0.0587972067296505, 0.05050227418541908, 0.015433962456882, -0.016850804910063744, -0.03830389305949211, -0.11296333372592926, -0.03657383471727371, -0.1600983440876007, 0.03786320984363556, -0.05347644165158272, 0.0161471925675869, 0.01538122445344925, 0.031424980610609055, 0.11366808414459229, -0.05256751924753189, -0.07123912125825882, -0.05422215536236763, -0.07830919325351715, 0.03089650720357895, -0.05260790139436722, -0.06242753192782402, -0.040431953966617584, 0.027023643255233765, 0.09431269764900208, 0.08388613164424896, 0.12126582860946655, 0.027077671140432358, 0.05007801949977875, -0.052594784647226334, -0.053385939449071884, 0.10396267473697662, -0.01992027647793293, -0.005306461825966835, 0.036430418491363525, -0.016514144837856293, -0.03573736548423767, 0.05614127218723297, 0.0702282264828682, 0.035443078726530075, 0.008803208358585835, -0.07020098716020584, 0.05515975505113602, 0.0298418290913105, 0.021928174421191216, 0.05923956632614136, 0.03153398260474205, -0.046982429921627045, 0.10460321605205536, 0.0647202879190445, -0.020068073645234108, -0.05189739540219307, 0.07475406676530838, -0.06996086239814758, -0.03763066977262497, -0.03431925177574158, -0.039463505148887634, 0.05412600189447403, 0.030100811272859573, 0.06625542789697647, 0.011153007857501507, 0.03728742524981499, -0.07224185019731522 ]
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} upon success. Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. This encrypted key is the "encapsulated key" represented as {EncapsulatedBits}. The algorithms currently supported include: \* `'ML-KEM-512'`[^modern-algos] \* `'ML-KEM-768'`[^modern-algos] \* `'ML-KEM-1024'`[^modern-algos] ### `subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, usages)` > Stability: 1.1 - Active development \* `encapsulationAlgorithm` {string|Algorithm} \* `encapsulationKey` {CryptoKey} \* `sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} \* `extractable` {boolean} \* `usages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with {EncapsulatedKey} upon success. Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. This encrypted key is the "encapsulated key" represented as {EncapsulatedKey}. The algorithms currently supported include: \* `'ML-KEM-512'`[^modern-algos] \* `'ML-KEM-768'`[^modern-algos] \* `'ML-KEM-1024'`[^modern-algos] ### `subtle.encrypt(algorithm, key, data)` \* `algorithm` {RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} \* `key` {CryptoKey} \* `data` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. Using the method and parameters specified by `algorithm` and the keying material provided by `key`, this method attempts to encipher `data`. If successful, the returned promise is resolved with an {ArrayBuffer} containing the encrypted result. The algorithms currently supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'RSA-OAEP'` ### `subtle.exportKey(format, key)` \* `format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`[^modern-algos], `'raw-public'`[^modern-algos], or `'raw-seed'`[^modern-algos]. \* `key` {CryptoKey} \* Returns: {Promise} Fulfills with an {ArrayBuffer|Object} upon success. Exports the given key into the specified format, if supported. If the {CryptoKey} is not extractable, the returned promise will reject. When `format` is either `'pkcs8'` or `'spki'` and the export is successful, the returned promise will be resolved with an {ArrayBuffer} containing the exported key data. When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a JavaScript object conforming to the [JSON Web Key][] specification. | Supported Key Algorithm | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | `'raw-secret'` | `'raw-public'` | `'raw-seed'` | | ------------------------------------ | -------- | --------- | ------- | ------- | -------------- | -------------- | ------------ | | `'AES-CBC'` | | | ✔ | ✔ | ✔ | | | | `'AES-CTR'` | | | ✔ | ✔ | ✔ | | | | `'AES-GCM'` | | | ✔ | ✔ | ✔ | | | | `'AES-KW'` | | | ✔ | ✔ | ✔ | | | | `'AES-OCB'`[^modern-algos] | | | ✔ | | ✔ | | | | `'ChaCha20-Poly1305'`[^modern-algos] | | | ✔ | | ✔ | | | | `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed25519'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'HMAC'` | | | ✔ | ✔ | ✔ | | | | `'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.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.006654960568994284, 0.052351828664541245, 0.08652845025062561, 0.05722345411777496, 0.028989238664507866, -0.06573042273521423, -0.003877099370583892, 0.031720519065856934, -0.07398485392332077, 0.005135415121912956, 0.017239609733223915, 0.01576179265975952, 0.014183634892106056, 0.0017314335564151406, 0.005550239700824022, 0.029788177460432053, -0.03514818847179413, 0.022521117702126503, -0.025890525430440903, -0.03616999462246895, 0.08994830399751663, -0.05317048355937004, 0.1642957627773285, -0.013318927027285099, -0.04087671637535095, 0.057084597647190094, -0.061374496668577194, 0.021984390914440155, 0.011519109830260277, -0.06231345608830452, -0.018075671046972275, -0.01567942090332508, 0.01193151343613863, -0.006681171245872974, 0.017237108200788498, -0.0826416090130806, -0.061494894325733185, -0.04631495475769043, -0.0648181214928627, -0.05097585916519165, 0.0867142304778099, -0.06003528833389282, -0.007562529761344194, -0.0830257311463356, 0.02423185110092163, 0.03145214542746544, -0.019309431314468384, -0.005678154528141022, -0.03619609400629997, 0.0734199583530426, 0.03981087729334831, -0.019212573766708374, -0.009519382379949093, 0.058160148561000824, -0.04441571980714798, -0.007578967604786158, 0.038907796144485474, 0.03509385138750076, -0.012656871229410172, -0.05785775184631348, 0.013215071521699429, -0.03301239013671875, 0.06526143848896027, 0.02526678517460823, -0.0015921996673569083, -0.005091381724923849, 0.0003812102659139782, 0.00665313471108675, -0.009581908583641052, -0.02176510915160179, 0.01324421726167202, 0.031330086290836334, 0.04199144244194031, -0.017900794744491577, -0.03416799008846283, -0.03863150253891945, 0.04208185151219368, -0.048053182661533356, -0.06208370625972748, 0.029335757717490196, 0.02211805060505867, 0.10253306478261948, -0.05881113186478615, 0.0069459653459489346, 0.028041327372193336, -0.08186610788106918, 0.04476204887032509, -0.08546499162912369, 0.06460672616958618, 0.0032113255001604557, -0.06289234012365341, 0.10564205050468445, 0.056056778877973557, 0.033367205411195755, -0.08224209398031235, -0.023940294981002808, -0.019774602726101875, -0.04568380117416382, 0.03362937271595001, -0.026677655056118965, -0.028789278119802475, -0.08315744996070862, -0.007838430814445019, -0.06606830656528473, 0.0005607142229564488, 0.09137392789125443, 0.05542125925421715, 0.0028674365021288395, 0.012714913114905357, 0.023987477645277977, -0.05110019072890282, -0.08600874245166779, -0.030683740973472595, -0.04329145699739456, 9.635156912969782e-33, -0.025730226188898087, -0.06833521276712418, 0.012914140708744526, 0.05426337197422981, 0.0468655563890934, 0.036880820989608765, 0.03324286267161369, 0.04000774770975113, -0.0746828094124794, -0.029570775106549263, -0.018837086856365204, -0.008593494072556496, 0.009967485442757607, 0.0002477147208992392, 0.09569630026817322, 0.02458282746374607, 0.01493791677057743, 0.041111961007118225, 0.06667297333478928, 0.018228620290756226, 0.010009505786001682, 0.08089490979909897, -0.060720957815647125, -0.02454288676381111, -0.03045578859746456, 0.034093618392944336, 0.04630404710769653, -0.06046360731124878, 0.04045311361551285, 0.03484778851270676, -0.029453467577695847, 0.056794844567775726, 0.00040818480192683637, -0.007371812593191862, 0.022527264431118965, 0.011284544132649899, 0.046161286532878876, -0.04616846889257431, 0.0018489955691620708, -0.08676525950431824, 0.06054143235087395, 0.018870802596211433, -0.02024228498339653, -0.05360126867890358, -0.06563077121973038, -0.04039870947599411, -0.02831060253083706, 0.04399627074599266, 0.09438642859458923, -0.005255153402686119, 0.008657908998429775, 0.026859018951654434, -0.08320201188325882, -0.0646253377199173, -0.009930766187608242, -0.055730126798152924, 0.023070398718118668, 0.09341210126876831, -0.0018728321883827448, 0.0364377386868, -0.10287808626890182, -0.00988634955137968, 0.040438923984766006, 0.0149437440559268, 0.020172040909528732, 0.03715670853853226, -0.024113256484270096, -0.07373300939798355, -0.037357866764068604, 0.03538994491100311, -0.04531364515423775, 0.03850419446825981, -0.05848872661590576, 0.10868672281503677, -0.03962648659944534, -0.07810039818286896, -0.007041831500828266, -0.10943486541509628, 0.032219525426626205, -0.043393172323703766, -0.005419512744992971, 0.07058582454919815, -0.04137274995446205, 0.11561786383390427, -0.08710522204637527, 0.009130483493208885, -0.0797567144036293, -0.0361567847430706, -0.011537883430719376, 0.020389802753925323, -0.0807579979300499, -0.06447361409664154, -0.07504675537347794, 0.007431930396705866, -0.0821375623345375, -1.1167444655993343e-32, 0.06470837444067001, -0.0031457883305847645, -0.1159622073173523, 0.08401805907487869, -0.038731273263692856, 0.0014580449787899852, -0.01300476398319006, -0.0010962446685880423, -0.04197061061859131, -0.005701742134988308, 0.015354407019913197, -0.007877994328737259, 0.064451664686203, 0.008393600583076477, 0.049253784120082855, -0.015552419237792492, -0.0907721146941185, -0.06605063378810883, 0.053855787962675095, -0.027476105839014053, 0.009261004626750946, 0.04807768017053604, -0.04149125888943672, 0.10681342333555222, 0.09793302416801453, 0.03841422498226166, -0.06979028880596161, 0.1105150431394577, 0.04646937921643257, -0.039118442684412, -0.05526848882436752, 0.013895101845264435, -0.06869875639677048, -0.014698317274451256, -0.08592449873685837, -0.018422329798340797, 0.012953177094459534, -0.03959433361887932, 0.04232989251613617, 0.007715382147580385, 0.06815659254789352, -0.0321815051138401, -0.013900550082325935, 0.01734176091849804, 0.055816274136304855, -0.022183023393154144, 0.0026537361554801464, -0.02109018713235855, 0.07235189527273178, -0.049724698066711426, 0.08333458751440048, -0.06733321398496628, -0.08163521438837051, 0.016864852979779243, -0.007825111038982868, 0.03383859619498253, -0.0632312223315239, -0.037155378609895706, 0.025659741833806038, 0.020254097878932953, 0.032708581537008286, -0.022467726841568947, 0.07756322622299194, 0.05532645061612129, -0.0034529927652329206, 0.012946091592311859, -0.06453812122344971, -0.047768089920282364, -0.01475497242063284, -0.04537149891257286, 0.11340856552124023, -0.047959815710783005, -0.037760086357593536, 0.017436902970075607, 0.027705300599336624, 0.0015085460618138313, -0.004686605650931597, -0.08764749765396118, 0.07119325548410416, 0.008506420999765396, -0.01659226045012474, 0.009103038348257542, -0.00016754113312344998, 0.08456466346979141, 0.06916655600070953, -0.07337673008441925, 0.08982846885919571, 0.013514092192053795, -0.09150144457817078, 0.027834536507725716, 0.014246865175664425, -0.02041683718562126, -0.09459135681390762, 0.06779278069734573, 0.012346785515546799, -6.566715882172502e-8, -0.002203134587034583, 0.04243990778923035, -0.025708286091685295, 0.04482071101665497, -0.019444664940238, 0.023233791813254356, 0.0001430527918273583, -0.07850562036037445, -0.06496211141347885, -0.08844877034425735, 0.023754602298140526, -0.016391193494200706, -0.021287813782691956, 0.023095743730664253, 0.002716539893299341, 0.0405181348323822, -0.08901841193437576, -0.008868370205163956, -0.037442032247781754, -0.031220588833093643, 0.02108178287744522, -0.07933986186981201, -0.01819871924817562, -0.04738212004303932, -0.03604038059711456, 0.048297666013240814, 0.07495740801095963, 0.12344922870397568, 0.0213250033557415, 0.13545362651348114, -0.08517821878194809, -0.025357425212860107, 0.0712846964597702, 0.0473766066133976, -0.04112700745463371, 0.05158764868974686, -0.0701097771525383, 0.015740221366286278, 0.03862745314836502, 0.06468179821968079, 0.07592563331127167, 0.023939570412039757, -0.08502219617366791, 0.015480851754546165, -0.0031604813411831856, 0.0845951959490776, 0.021856864914298058, 0.054366908967494965, -0.023934626951813698, 0.09560380131006241, 0.01431083120405674, -0.029722856357693672, -0.05446095019578934, 0.08498280495405197, -0.10968714207410812, 0.013112131506204605, -0.0029655774123966694, -0.019069138914346695, 0.04944805055856705, -0.05100559815764427, 0.05457352474331856, -0.027106503024697304, 0.010630596429109573, -0.002054649405181408 ]
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'` | ✔ | ✔ | ✔ | | | | | | `'RSASSA-PKCS1-v1\_5'` | ✔ | ✔ | ✔ | | | | | ### `subtle.getPublicKey(key, keyUsages)` > Stability: 1.1 - Active development \* `key` {CryptoKey} A private key from which to derive the corresponding public key. \* `keyUsages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with a {CryptoKey} upon success. Derives the public key from a given private key. ### `subtle.generateKey(algorithm, extractable, keyUsages)` \* `algorithm` {string|Algorithm|RsaHashedKeyGenParams|EcKeyGenParams|HmacKeyGenParams|AesKeyGenParams|KmacKeyGenParams} \* `extractable` {boolean} \* `keyUsages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with a {CryptoKey|CryptoKeyPair} upon success. Using the parameters provided in `algorithm`, this method attempts to generate new keying material. Depending on the algorithm used either a single {CryptoKey} or a {CryptoKeyPair} is generated. The {CryptoKeyPair} (public and private key) generating algorithms supported include: \* `'ECDH'` \* `'ECDSA'` \* `'Ed25519'` \* `'Ed448'`[^secure-curves] \* `'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] \* `'ML-KEM-1024'`[^modern-algos] \* `'RSA-OAEP'` \* `'RSA-PSS'` \* `'RSASSA-PKCS1-v1\_5'` \* `'X25519'` \* `'X448'`[^secure-curves] The {CryptoKey} (secret key) generating algorithms supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-KW'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'HMAC'` \* `'KMAC128'`[^modern-algos] \* `'KMAC256'`[^modern-algos] ### `subtle.importKey(format, keyData, algorithm, extractable, keyUsages)` \* `format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`[^modern-algos], `'raw-public'`[^modern-algos], or `'raw-seed'`[^modern-algos]. \* `keyData` {ArrayBuffer|TypedArray|DataView|Buffer|Object} \* `algorithm` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|KmacImportParams} \* `extractable` {boolean} \* `keyUsages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with a {CryptoKey} upon success. This method attempts to interpret the provided `keyData` as the given `format` to create a {CryptoKey} instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. If the import is successful, the returned promise will be resolved with a {CryptoKey} representation of the key material. If importing KDF algorithm keys, `extractable` must be `false`. The algorithms currently supported include: | Supported Key Algorithm | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | `'raw-secret'` | `'raw-public'` | `'raw-seed'` | | ------------------------------------ | -------- | --------- | ------- | ------- | -------------- | -------------- | ------------ | | `'AES-CBC'` | | | ✔ | ✔ | ✔ | | | | `'AES-CTR'` | | | ✔ | ✔ | ✔ | | | | `'AES-GCM'` | | | ✔ | ✔ | ✔ | | | | `'AES-KW'` | | | ✔ | ✔ | ✔ | | | | `'AES-OCB'`[^modern-algos] | | | ✔ | | ✔ | | | | `'Argon2d'`[^modern-algos] | | | | | ✔ | | | | `'Argon2i'`[^modern-algos] | | | | | ✔ | | | | `'Argon2id'`[^modern-algos] | | | | | ✔ | | | | `'ChaCha20-Poly1305'`[^modern-algos] | | | ✔ | | ✔ | | | | `'ECDH'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed25519'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'HDKF'` | | | | ✔ | ✔ | | | | `'HMAC'` | | | ✔ | ✔
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.08908989280462265, 0.01764131523668766, 0.09007490426301956, -0.06657496839761734, 0.03747047483921051, -0.04082634299993515, -0.03329360485076904, 0.015009698458015919, -0.0347028449177742, -0.022684581577777863, 0.0041089365258812904, 0.018625207245349884, 0.06532272696495056, 0.0679478794336319, 0.07203567773103714, 0.030360929667949677, -0.06864146888256073, 0.02502397447824478, 0.04366561025381088, 0.024222681298851967, 0.016993528231978416, 0.05339451879262924, 0.07414257526397705, -0.002371282549574971, 0.0011757136089727283, 0.05845604091882706, -0.005764744710177183, -0.018111953511834145, -0.033242784440517426, -0.06832364201545715, -0.06709429621696472, -0.023617742583155632, 0.012364226393401623, -0.11743895709514618, 0.025015931576490402, -0.03664908558130264, -0.07898159325122833, -0.07257214933633804, -0.03186895698308945, -0.034227658063173294, 0.03705078735947609, -0.005235100165009499, -0.059759367257356644, -0.03843060880899429, 0.047490671277046204, 0.06527142226696014, -0.05263227969408035, 0.03710543364286423, -0.017915407195687294, 0.0014224163023754954, -0.03385774791240692, -0.0921570360660553, 0.055470652878284454, 0.017501596361398697, -0.07656235247850418, 0.03929222747683525, 0.033520691096782684, -0.10054638236761093, -0.025690751150250435, -0.06498580425977707, -0.03638440743088722, -0.07440878450870514, -0.02239477075636387, -0.019625840708613396, -0.04332159087061882, -0.06561541557312012, -0.07719478756189346, 0.005156508181244135, -0.01417960412800312, -0.08423075079917908, 0.0008472615154460073, -0.012694408185780048, 0.07554582506418228, -0.05854586139321327, -0.062035366892814636, 0.08578149974346161, -0.009676066227257252, 0.036594949662685394, -0.05332421883940697, 0.026264194399118423, -0.0016274494118988514, 0.05040333420038223, -0.021687695756554604, 0.024199187755584717, 0.02395368367433548, -0.01887490414083004, 0.08181976526975632, -0.030003152787685394, 0.014127173461019993, -0.05627192184329033, -0.11177539825439453, 0.009144632145762444, 0.035940349102020264, -0.00871345680207014, -0.007939716801047325, -0.0014996642712503672, 0.018198572099208832, -0.061153922230005264, -0.018979737535119057, -0.06846295297145844, -0.02650562860071659, 0.008101832121610641, 0.013255096971988678, -0.017614945769309998, 0.04620373249053955, -0.013056579045951366, -0.01705962046980858, 0.07987746596336365, -0.013769470155239105, -0.043491508811712265, -0.018691949546337128, -0.10712161660194397, -0.042654745280742645, -0.00249234470538795, 1.020956516623497e-32, 0.01417603436857462, 0.038622353225946426, -0.045505065470933914, -0.07304352521896362, 0.011000518687069416, 0.051949892193078995, 0.07918183505535126, 0.0010077961487695575, -0.04277459904551506, -0.017558470368385315, 0.004662254359573126, 0.042364660650491714, -0.12077711522579193, -0.08443445712327957, 0.02154535986483097, -0.008057295344769955, -0.005392998922616243, -0.01594317890703678, 0.08848930150270462, 0.018259890377521515, 0.03368658199906349, 0.03984319046139717, -0.005335104651749134, -0.023198336362838745, 0.053227733820676804, 0.01319825742393732, 0.06629915535449982, 0.011337799951434135, -0.02730427123606205, 0.012391665019094944, 0.04646453261375427, 0.02693967893719673, -0.06251677125692368, -0.037642206996679306, -0.020409202203154564, -0.024676458910107613, -0.024721387773752213, -0.061231065541505814, -0.004582847934216261, -0.059314560145139694, -0.0455142967402935, 0.0070627047680318356, -0.04249196872115135, -0.03231648728251457, -0.006080960389226675, 0.018350474536418915, -0.02532096765935421, 0.07159243524074554, 0.0731063187122345, 0.015047593042254448, -0.03496411815285683, 0.007533203344792128, -0.09986661374568939, -0.04443778842687607, -0.029331380501389503, -0.12013306468725204, -0.03847695514559746, 0.08229268342256546, 0.039064161479473114, 0.022361017763614655, -0.007605699356645346, -0.039047203958034515, 0.0571744479238987, -0.0389225035905838, 0.04046807065606117, 0.027661440894007683, 0.013718752190470695, -0.025363795459270477, 0.022716691717505455, -0.009529393166303635, -0.0192263163626194, 0.013876364566385746, -0.005320742726325989, 0.06769967824220657, -0.029260490089654922, -0.10021838545799255, -0.007693336810916662, 0.03090476058423519, -0.01892465353012085, 0.00887246336787939, -0.08309455215930939, 0.09538014978170395, -0.08196549117565155, 0.06206764280796051, 0.051504019647836685, 0.06286256015300751, -0.01102497149258852, -0.03916670009493828, -0.09001369029283524, -0.027513453736901283, -0.08683772385120392, -0.014956848695874214, -0.02988414466381073, -0.003836284624412656, -0.04343259707093239, -1.2938159387562126e-32, 0.02993898093700409, 0.005966491997241974, -0.04294466972351074, 0.05512749031186104, -0.032128408551216125, -0.045304346829652786, -0.07587359100580215, 0.031817346811294556, -0.023559458553791046, 0.05981029197573662, -0.04970022663474083, -0.032411422580480576, 0.005602987017482519, -0.009731258265674114, 0.07044073939323425, 0.016438407823443413, -0.03671432286500931, 0.04537007957696915, 0.03483003005385399, 0.0308734979480505, -0.0046641631051898, 0.12534798681735992, -0.06481075286865234, 0.10301761329174042, 0.05333763733506203, 0.008922019973397255, -0.03350289538502693, 0.1067788153886795, -0.046638693660497665, 0.004689635708928108, 0.059462253004312515, 0.016312457621097565, -0.10721992701292038, 0.04365818202495575, -0.12532806396484375, -0.07059594988822937, -0.017033683136105537, 0.013270413503050804, 0.04114266857504845, 0.133668452501297, 0.007706110365688801, 0.0036046660970896482, 0.0001619115937501192, -0.043661195784807205, -0.06474447250366211, -0.012933903373777866, 0.12413056194782257, -0.0004247183969710022, -0.06832362711429596, -0.11074098199605942, 0.14211797714233398, -0.022086698561906815, -0.08798729628324509, 0.015290671959519386, 0.014882885850965977, 0.07302012294530869, -0.005106878466904163, 0.023067623376846313, -0.05655110627412796, -0.07630778104066849, 0.08595313876867294, -0.05643623322248459, 0.07473483681678772, 0.07178798317909241, 0.02054694853723049, -0.016156088560819626, 0.09039578586816788, 0.002826899057254195, -0.02109108492732048, -0.0320657454431057, 0.06271956115961075, -0.05225023627281189, 0.033390115946531296, 0.04706571251153946, 0.05424657464027405, 0.009826893918216228, -0.09643487632274628, 0.04404075816273689, 0.05561322718858719, 0.012515679933130741, -0.04159017279744148, -0.0023767813108861446, 0.029905593022704124, 0.016151057556271553, -0.03870569169521332, -0.03241361677646637, 0.06668026745319366, 0.01687317155301571, 0.012910166755318642, 0.02474062144756317, -0.03991561755537987, 0.04326091706752777, 0.0020229171495884657, 0.06552417576313019, 0.05149812623858452, -5.6082669175339106e-8, 0.015874730423092842, -0.08152765780687332, -0.055678028613328934, 0.03265191242098808, 0.04658892750740051, -0.020753072574734688, -0.06600072234869003, -0.020933108404278755, -0.04526929929852486, -0.09025928378105164, 0.056901298463344574, -0.05058510974049568, -0.054593224078416824, -0.008424568921327591, -0.013323426246643066, 0.003518736222758889, -0.05148853361606598, 0.07565416395664215, -0.0456574521958828, -0.02012632042169571, 0.08657830953598022, -0.08177449554204941, 0.044818367809057236, -0.013381761498749256, 0.035891611129045486, -0.009202348068356514, 0.02506530098617077, 0.05013026297092438, 0.04610874876379967, 0.058307237923145294, 0.02983558177947998, -0.06204673647880554, 0.09504184871912003, -0.07706502079963684, -0.023005491122603416, -0.010450590401887894, -0.012968297116458416, -0.004696092568337917, -0.0037006516940891743, 0.09915472567081451, -0.016415975987911224, -0.07687242329120636, -0.06914278119802475, 0.04077833890914917, -0.03641282767057419, 0.012039882130920887, 0.028309952467679977, -0.052218206226825714, -0.022542431950569153, -0.015222669579088688, 0.02616548351943493, -0.05770550295710564, 0.028701964765787125, 0.0006935872952453792, -0.10752756148576736, -0.02126111090183258, -0.019211938604712486, 0.08257309347391129, 0.039897702634334564, -0.0504704974591732, 0.02739994414150715, 0.04357251152396202, 0.0016029922990128398, 0.03348372504115105 ]
0.055231
| `'Ed25519'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'Ed448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'HDKF'` | | | | ✔ | ✔ | | | | `'HMAC'` | | | ✔ | ✔ | ✔ | | | | `'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] | ✔ | ✔ | | | | ✔ | ✔ | | `'ML-KEM-1024'`[^modern-algos] | ✔ | ✔ | | | | ✔ | ✔ | | `'PBKDF2'` | | | | ✔ | ✔ | | | | `'RSA-OAEP'` | ✔ | ✔ | ✔ | | | | | | `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | `'RSASSA-PKCS1-v1\_5'` | ✔ | ✔ | ✔ | | | | | | `'X25519'` | ✔ | ✔ | ✔ | ✔ | | ✔ | | | `'X448'`[^secure-curves] | ✔ | ✔ | ✔ | ✔ | | ✔ | | ### `subtle.sign(algorithm, key, data)` \* `algorithm` {string|Algorithm|RsaPssParams|EcdsaParams|ContextParams|KmacParams} \* `key` {CryptoKey} \* `data` {ArrayBuffer|TypedArray|DataView|Buffer} \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. Using the method and parameters given by `algorithm` and the keying material provided by `key`, this method attempts to generate a cryptographic signature of `data`. If successful, the returned promise is resolved with an {ArrayBuffer} containing the generated signature. The algorithms currently supported include: \* `'ECDSA'` \* `'Ed25519'` \* `'Ed448'`[^secure-curves] \* `'HMAC'` \* `'KMAC128'`[^modern-algos] \* `'KMAC256'`[^modern-algos] \* `'ML-DSA-44'`[^modern-algos] \* `'ML-DSA-65'`[^modern-algos] \* `'ML-DSA-87'`[^modern-algos] \* `'RSA-PSS'` \* `'RSASSA-PKCS1-v1\_5'` ### `subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)` \* `format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`[^modern-algos], `'raw-public'`[^modern-algos], or `'raw-seed'`[^modern-algos]. \* `wrappedKey` {ArrayBuffer|TypedArray|DataView|Buffer} \* `unwrappingKey` {CryptoKey} \* `unwrapAlgo` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} \* `unwrappedKeyAlgo` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|KmacImportParams} \* `extractable` {boolean} \* `keyUsages` {string\[]} See [Key usages][]. \* Returns: {Promise} Fulfills with a {CryptoKey} upon success. In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. This method attempts to decrypt a wrapped key and create a {CryptoKey} instance. It is equivalent to calling [`subtle.decrypt()`][] first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) then passing the results to the [`subtle.importKey()`][] method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. If successful, the returned promise is resolved with a {CryptoKey} object. The wrapping algorithms currently supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-KW'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'RSA-OAEP'` The unwrapped key algorithms supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-KW'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'ECDH'` \* `'ECDSA'` \* `'Ed25519'` \* `'Ed448'`[^secure-curves] \* `'HMAC'` \* `'KMAC128'`[^secure-curves] \* `'KMAC256'`[^secure-curves] \* `'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] \* `'ML-KEM-1024'`[^modern-algos]v \* `'RSA-OAEP'` \* `'RSA-PSS'` \* `'RSASSA-PKCS1-v1\_5'` \* `'X25519'` \* `'X448'`[^secure-curves] ### `subtle.verify(algorithm, key, signature, data)` \* `algorithm` {string|Algorithm|RsaPssParams|EcdsaParams|ContextParams|KmacParams} \* `key` {CryptoKey} \* `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 cryptographic signature of `data`. The returned promise is resolved with either
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.07847150415182114, -0.07512259483337402, 0.02286267839372158, -0.14407801628112793, 0.05081820487976074, -0.030074801295995712, -0.03662892431020737, 0.03085610643029213, 0.021163245663046837, -0.008510350249707699, -0.010624181479215622, 0.026466557756066322, 0.09486549347639084, 0.03916163742542267, 0.11050113290548325, -0.001270187203772366, -0.08795499801635742, 0.016138747334480286, 0.0732029527425766, 0.06146940961480141, 0.013352799229323864, 0.09255839884281158, 0.04567639157176018, -0.05141193047165871, -0.014879465103149414, 0.006560528185218573, -0.04730454087257385, -0.01071033626794815, -0.06563080847263336, 0.07050565630197525, -0.0372963584959507, 0.03607892990112305, -0.030762357637286186, -0.10734168440103531, -0.019289596006274223, 0.00348173757083714, 0.00878243800252676, -0.011678769253194332, -0.005487017799168825, -0.04936559870839119, 0.08675618469715118, 0.013996748253703117, -0.03487541526556015, -0.07756175100803375, 0.04166374355554581, 0.06046236678957939, -0.0028399755246937275, -0.021700963377952576, 0.009550291113555431, -0.017032798379659653, -0.016544383019208908, -0.10812709480524063, 0.03553911671042442, 0.0030299746431410313, -0.05155244469642639, 0.00334235280752182, 0.028786497190594673, -0.11341658979654312, -0.032247211784124374, -0.04258619248867035, 0.005229047499597073, 0.0036595084238797426, 0.0032958686351776123, 0.009861329570412636, -0.03932500630617142, -0.03569427877664566, -0.1151575818657875, -0.03780767321586609, 0.02200213074684143, 0.02125491201877594, 0.04113271087408066, -0.0007299192948266864, 0.06833875179290771, -0.08618970215320587, -0.020183218643069267, 0.09155470877885818, -0.07962250709533691, 0.013668742030858994, -0.05045149475336075, -0.09187152236700058, 0.0031345358584076166, -0.06984423100948334, 0.013102407567203045, 0.05792262405157089, 0.07724335789680481, -0.039066165685653687, 0.10548582673072815, 0.014345383271574974, -0.012859971262514591, -0.059488460421562195, -0.09738817065954208, -0.08453517407178879, 0.013298493809998035, 0.008561056107282639, 0.0787358209490776, -0.022046366706490517, -0.005427496507763863, -0.007106392178684473, -0.032528359442949295, -0.049835316836833954, -0.04070135951042175, 0.01017181295901537, -0.06615432351827621, -0.003731048433110118, -0.03631484881043434, 0.016362544149160385, -0.01435745321214199, -0.041015151888132095, -0.0593455471098423, -0.02115144580602646, -0.0392477847635746, -0.08758405596017838, -0.031193887814879417, 0.0038966501597315073, 7.053239407370291e-33, 0.0044100028462708, 0.02100101113319397, 0.006935812532901764, -0.06430929154157639, -0.006016351282596588, -0.026053527370095253, -0.009135781787335873, 0.0005107048200443387, -0.054328445345163345, 0.03210614621639252, -0.06378165632486343, 0.043027352541685104, -0.10471323132514954, -0.033741261810064316, 0.021568257361650467, -0.05547959730029106, 0.067167729139328, -0.024687204509973526, 0.02854587696492672, -0.005148356780409813, 0.019157836213707924, 0.06225336343050003, 0.0052977316081523895, -0.023314153775572777, 0.06488128751516342, 0.04759383946657181, 0.06743090599775314, -0.009609059430658817, 0.023814262822270393, 0.05216873809695244, 0.0016231972258538008, -0.035755448043346405, 0.0046307798475027084, -0.06877972930669785, -0.021505184471607208, 0.025295019149780273, -0.07713925838470459, -0.0019247963791713119, -0.030261700972914696, -0.01079416275024414, 0.02528292126953602, 0.008143767714500427, 0.015881970524787903, -0.0036613771226257086, 0.015112862922251225, 0.03208128735423088, -0.010156076401472092, 0.03660288825631142, 0.08525373786687851, -0.004436721093952656, -0.05420573428273201, -0.0233487356454134, -0.056431543081998825, 0.0030074745882302523, -0.011219276115298271, -0.04329466074705124, -0.03790505975484848, 0.06352096050977707, 0.014075962826609612, 0.04813995584845543, -0.025028079748153687, 0.05581927299499512, 0.04691121727228165, 0.001487924950197339, 0.06684715300798416, -0.027009939774870872, 0.04288329556584358, -0.03330883011221886, -0.06298325955867767, 0.04728804901242256, -0.08326304703950882, 0.015806222334504128, 0.0554732009768486, 0.05986786633729935, 0.02730403281748295, -0.0704813078045845, -0.010224051773548126, 0.04102012515068054, 0.008436847478151321, -0.032631732523441315, -0.07261751592159271, -0.01921885833144188, -0.04400334879755974, 0.023986609652638435, 0.049339409917593, 0.0069579193368554115, 0.017535673454403877, -0.05047784745693207, -0.07553692162036896, -0.06284038722515106, -0.12476229667663574, -0.024489907547831535, -0.06670883297920227, -0.09339895844459534, -0.06352511793375015, -8.134243848853637e-33, 0.05812446400523186, 0.03247437998652458, 0.05894489958882332, 0.025469264015555382, -0.03914608806371689, -0.042420536279678345, 0.01620997115969658, 0.08086061477661133, 0.03948880359530449, 0.03185080736875534, 0.07220697402954102, -0.023250680416822433, 0.006890776101499796, -0.09932827949523926, 0.08401389420032501, 0.015930436551570892, -0.04137495532631874, 0.02835153043270111, 0.022631537169218063, 0.010282144881784916, -0.037866223603487015, 0.07856766879558563, -0.03284382075071335, 0.08992445468902588, -0.006430230103433132, 0.016974730417132378, 0.04547974839806557, 0.09634941071271896, -0.0031227911822497845, -0.002359523670747876, -0.04048783704638481, 0.025925254449248314, -0.06793166697025299, 0.08171971142292023, -0.06836965680122375, -0.01426140870898962, 0.04424479603767395, 0.07883394509553909, -0.0010831067338585854, 0.04129289090633392, 0.0008069006726145744, 0.034217022359371185, -0.04527832195162773, -0.017519047483801842, -0.0631551742553711, -0.028772620484232903, 0.0827697217464447, 0.029081853106617928, -0.019457750022411346, -0.07640226930379868, 0.10264507681131363, -0.061735041439533234, -0.07678848505020142, 0.02465256117284298, 0.014204572886228561, 0.0661286786198616, 0.006664082873612642, 0.008157146163284779, -0.13322646915912628, -0.09594244509935379, 0.017746180295944214, -0.09809800237417221, 0.05691069737076759, 0.0043240562081336975, 0.01568429544568062, -0.005139940418303013, 0.013191542588174343, 0.01562309917062521, -0.06129954382777214, -0.002293715486302972, 0.08715441077947617, -0.023699110373854637, 0.03320714831352234, 0.021243035793304443, 0.04719749838113785, -0.06396420300006866, -0.04454631358385086, 0.044835034757852554, 0.05138688161969185, 0.018553996458649635, 0.03302996978163719, -0.015336412936449051, 0.05162239819765091, 0.12220216542482376, -0.007242102175951004, -0.0379001721739769, 0.010976572521030903, 0.04554390907287598, 0.0012883319286629558, 0.0166518222540617, -0.06342696398496628, 0.04948880523443222, 0.006946200504899025, 0.09419750422239304, 0.01707691326737404, -4.169357836758536e-8, -0.030257442966103554, -0.07965443283319473, -0.061023686081171036, -0.046751461923122406, 0.015576919540762901, 0.04436981678009033, -0.05061578378081322, -0.0016568489372730255, -0.04708082601428032, -0.14681482315063477, 0.11679460108280182, -0.023661024868488312, -0.11704480648040771, -0.051289573311805725, -0.06532169878482819, 0.030536357313394547, -0.04898515343666077, 0.12513789534568787, -0.03228210657835007, 0.022151021286845207, 0.04165273904800415, 0.010551468469202518, 0.09104277193546295, -0.04138586297631264, 0.018402691930532455, 0.012378043495118618, -0.030537324026226997, 0.021319149062037468, -0.0027158705051988363, 0.017067406326532364, -0.007220705505460501, -0.0604519248008728, 0.0720042884349823, -0.02485572174191475, 0.020609281957149506, -0.0016629064921289682, -0.02986276149749756, 0.009548542089760303, -0.02402522787451744, 0.09551079571247101, 0.009888717904686928, -0.044388655573129654, -0.09272532165050507, 0.05493660643696785, 0.017115097492933273, -0.04884965717792511, 0.061711862683296204, 0.04480579122900963, -0.0040511214174330235, -0.033232200890779495, 0.06639786809682846, -0.012390786781907082, 0.0062624309211969376, -0.05565374717116356, -0.10604171454906464, -0.043997135013341904, 0.000534254068043083, 0.025920797139406204, -0.005628688260912895, 0.010815786197781563, 0.023079223930835724, 0.02603323943912983, 0.08281724900007248, 0.02620776928961277 ]
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 cryptographic signature of `data`. The returned promise is resolved with either `true` or `false`. The algorithms currently supported include: \* `'ECDSA'` \* `'Ed25519'` \* `'Ed448'`[^secure-curves] \* `'HMAC'` \* `'KMAC128'`[^secure-curves] \* `'KMAC256'`[^secure-curves] \* `'ML-DSA-44'`[^modern-algos] \* `'ML-DSA-65'`[^modern-algos] \* `'ML-DSA-87'`[^modern-algos] \* `'RSA-PSS'` \* `'RSASSA-PKCS1-v1\_5'` ### `subtle.wrapKey(format, key, wrappingKey, wrapAlgo)` \* `format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`[^modern-algos], `'raw-public'`[^modern-algos], or `'raw-seed'`[^modern-algos]. \* `key` {CryptoKey} \* `wrappingKey` {CryptoKey} \* `wrapAlgo` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} \* Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. This method exports the keying material into the format identified by `format`, then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. It is the equivalent to calling [`subtle.exportKey()`][] using `format` and `key` as the arguments, then passing the result to the [`subtle.encrypt()`][] method using `wrappingKey` and `wrapAlgo` as inputs. If successful, the returned promise will be resolved with an {ArrayBuffer} containing the encrypted key data. The wrapping algorithms currently supported include: \* `'AES-CBC'` \* `'AES-CTR'` \* `'AES-GCM'` \* `'AES-KW'` \* `'AES-OCB'`[^modern-algos] \* `'ChaCha20-Poly1305'`[^modern-algos] \* `'RSA-OAEP'` ## Algorithm parameters The algorithm parameter objects define the methods and parameters used by the various {SubtleCrypto} methods. While described here as "classes", they are simple JavaScript dictionary objects. ### Class: `Algorithm` #### `Algorithm.name` \* Type: {string} ### Class: `AeadParams` #### `aeadParams.additionalData` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} Extra input that is not encrypted but is included in the authentication of the data. The use of `additionalData` is optional. #### `aeadParams.iv` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} The initialization vector must be unique for every encryption operation using a given key. #### `aeadParams.name` \* Type: {string} Must be `'AES-GCM'`, `'AES-OCB'`, or `'ChaCha20-Poly1305'`. #### `aeadParams.tagLength` \* Type: {number} The size in bits of the generated authentication tag. ### Class: `AesDerivedKeyParams` #### `aesDerivedKeyParams.name` \* Type: {string} Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, `'AES-OCB'`, or `'AES-KW'` #### `aesDerivedKeyParams.length` \* Type: {number} The length of the AES key to be derived. This must be either `128`, `192`, or `256`. ### Class: `AesCbcParams` #### `aesCbcParams.iv` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} Provides the initialization vector. It must be exactly 16-bytes in length and should be unpredictable and cryptographically random. #### `aesCbcParams.name` \* Type: {string} Must be `'AES-CBC'`. ### Class: `AesCtrParams` #### `aesCtrParams.counter` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} The initial value of the counter block. This must be exactly 16 bytes long. The `AES-CTR` method uses the rightmost `length` bits of the block as the counter and the remaining bits as the nonce. #### `aesCtrParams.length` \* Type: {number} The number of bits in the `aesCtrParams.counter` that are to be used as the counter. #### `aesCtrParams.name` \* Type: {string} Must be `'AES-CTR'`. ### Class: `AesKeyAlgorithm` #### `aesKeyAlgorithm.length` \* Type: {number} The length of the AES key in bits. #### `aesKeyAlgorithm.name` \* Type: {string} ### Class: `AesKeyGenParams` #### `aesKeyGenParams.length` \* Type: {number} The length of the AES key to be generated. This must be either `128`, `192`, or `256`. #### `aesKeyGenParams.name` \* Type: {string} Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, or `'AES-KW'` ### Class: `Argon2Params` #### `argon2Params.associatedData` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} Represents 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|TypedArray|DataView|Buffer} Represents the nonce, which is a
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.00496771140024066, 0.003494035452604294, -0.024475811049342155, -0.0656258836388588, -0.04512781277298927, -0.01602863520383835, -0.008671076036989689, 0.01058256532996893, 0.007799127139151096, -0.01321481168270111, -0.01172380056232214, -0.022717583924531937, 0.07302024215459824, 0.03339733928442001, -0.014564733020961285, 0.010319840162992477, -0.04716547578573227, 0.061004091054201126, 0.019785622134804726, -0.03094586543738842, 0.02662508748471737, -0.0018293354660272598, 0.10015612095594406, 0.019085289910435677, -0.04666049778461456, 0.03387587517499924, -0.00925211701542139, 0.0068694292567670345, -0.014873329550027847, -0.07758694142103195, -0.007775588426738977, 0.0058524771593511105, -0.007525242865085602, -0.047139521688222885, -0.009124193340539932, -0.09096692502498627, 0.006872531492263079, -0.06716770678758621, -0.020118258893489838, -0.04079786315560341, 0.05736500397324562, -0.032383423298597336, -0.11601661145687103, -0.07238660007715225, 0.03561410307884216, 0.03149271011352539, -0.03075149469077587, 0.04101597145199776, -0.029726417735219002, 0.008687335066497326, 0.029262948781251907, -0.003474997356534004, 0.05678100511431694, 0.04953956604003906, -0.09195996820926666, 0.04363514110445976, 0.047391943633556366, 0.00038093628245405853, -0.023122062906622887, -0.04543546959757805, 0.021044867113232613, -0.002457522554323077, 0.042258910834789276, 0.006735768634825945, -0.07570280879735947, -0.0012080998858436942, -0.10184402018785477, -0.057134464383125305, -0.0797005295753479, -0.05897898972034454, 0.03693617135286331, 0.017238104715943336, 0.042200636118650436, -0.1303625851869583, -0.06350789964199066, 0.03538813069462776, -0.018298402428627014, 0.07969674468040466, -0.014530575834214687, -0.06090567260980606, 0.03858098387718201, 0.0026824879460036755, -0.05102786421775818, 0.04652346670627594, 0.014341680333018303, -0.014595662243664265, 0.06148512288928032, -0.06468861550092697, 0.05915362760424614, -0.00000562634249945404, -0.08354122936725616, 0.0561068132519722, 0.024169014766812325, 0.008246004581451416, -0.08293134719133377, -0.08253585547208786, -0.01767951436340809, -0.013813616707921028, 0.022536763921380043, 0.013767128810286522, 0.022428322583436966, -0.043170265853405, -0.03076351247727871, -0.10741166770458221, 0.01681944914162159, -0.037712857127189636, -0.04180232435464859, -0.009313847869634628, -0.0075116632506251335, 0.044899165630340576, 0.033135972917079926, -0.03924652189016342, -0.04102223739027977, -0.06214385852217674, 5.357433787991627e-33, 0.015499081462621689, 0.03203510865569115, 0.028244854882359505, -0.07627390325069427, -0.02842223085463047, -0.003849018830806017, -0.008318586274981499, 0.05199923366308212, -0.0363781563937664, 0.008738203905522823, -0.008666996844112873, -0.02505265176296234, 0.013112067244946957, 0.015270215459167957, 0.07074837386608124, 0.07104670256376266, 0.05109773203730583, -0.01790805719792843, -0.04022404924035072, 0.07150978595018387, 0.09516265243291855, 0.026302319020032883, 0.02419494464993477, -0.04025312140583992, -0.039640795439481735, 0.006490661296993494, 0.05019669234752655, 0.03673801198601723, 0.02682829461991787, 0.0069030700251460075, -0.04028803110122681, -0.030318742617964745, 0.04373263940215111, -0.004402222111821175, 0.059038229286670685, 0.002643887186422944, -0.002135428600013256, -0.012865028344094753, -0.08498459309339523, -0.040852755308151245, 0.015805784612894058, 0.03950712829828262, 0.012599448673427105, 0.011610752902925014, 0.020571252331137657, -0.008281350135803223, -0.0773182362318039, 0.03614753112196922, 0.14043955504894257, 0.02976684644818306, -0.014127731323242188, -0.01049650926142931, -0.01979556493461132, -0.021090807393193245, -0.01024108286947012, -0.07568282634019852, -0.01963803917169571, 0.06505859643220901, -0.0006104363710619509, 0.08683235198259354, -0.01167676318436861, -0.06442683190107346, -0.0035420143976807594, -0.0427534393966198, -0.06596644967794418, 0.04867749288678169, -0.04967143014073372, 0.0026227557100355625, 0.03593931719660759, 0.053851161152124405, -0.02011089026927948, 0.04381212219595909, 0.0054514347575604916, 0.08672010898590088, 0.018178211525082588, -0.1059182807803154, -0.0132016371935606, -0.008873886428773403, 0.053824834525585175, -0.08691111952066422, 0.0065029077231884, 0.025766925886273384, 0.0065839858725667, 0.08039151877164841, 0.040509339421987534, 0.01772097498178482, -0.04879695922136307, -0.05036283656954765, -0.055640242993831635, -0.027376068755984306, -0.08635896444320679, 0.0015723734395578504, -0.014900000765919685, -0.07139243930578232, -0.025474747642874718, -8.01396800156147e-33, 0.06143553927540779, -0.009425096213817596, 0.01970599964261055, 0.12315455824136734, -0.03067793697118759, -0.051281850785017014, 0.008065402507781982, 0.028021538630127907, 0.0214889757335186, -0.018572546541690826, 0.07707267254590988, -0.02723003551363945, 0.06341390311717987, -0.036505505442619324, 0.04262735694646835, -0.07199098914861679, -0.08145689219236374, -0.041992321610450745, 0.06830579787492752, -0.0009003650047816336, 0.020186427980661392, 0.021693909540772438, 0.007181176450103521, 0.09837183356285095, 0.0059101334773004055, 0.02174738049507141, -0.003911077976226807, 0.04728683829307556, 0.009769167751073837, 0.0347907729446888, 0.008433589711785316, 0.08983658254146576, -0.09428037703037262, -0.048089805990457535, -0.022644096985459328, -0.0518452487885952, 0.04412837326526642, 0.06406035274267197, -0.0056314291432499886, 0.018129602074623108, 0.04252363368868828, 0.013363558799028397, -0.007322594523429871, 0.007647768594324589, 0.015359513461589813, -0.012313375249505043, 0.04585413634777069, 0.10298693925142288, -0.005546672269701958, -0.07249724864959717, 0.12417867034673691, -0.05826504901051521, -0.012548989616334438, 0.050697509199380875, 0.07875733077526093, 0.05380641296505928, 0.03655625507235527, 0.017271464690566063, -0.019231239333748817, 0.027717432007193565, -0.013722432777285576, -0.05225563049316406, 0.070492684841156, -0.005867303814738989, 0.011227509006857872, -0.019037296995520592, 0.01653176173567772, -0.011146263219416142, 0.02675207518041134, 0.03097742423415184, 0.08394629508256912, -0.02810817025601864, -0.07491156458854675, 0.022599074989557266, 0.020584749057888985, -0.053255077451467514, -0.06637556850910187, -0.09310244768857956, 0.07060686498880386, 0.05689775571227074, 0.016068512573838234, 0.014029411599040031, 0.035288598388433456, 0.1098385751247406, 0.0967608392238617, -0.015917478129267693, 0.00023364955268334597, -0.08035141229629517, -0.12935128808021545, 0.08788511902093887, 0.00658029830083251, 0.011623096652328968, -0.00911254808306694, 0.003877324052155018, 0.008966758847236633, -5.73838825346229e-8, -0.016516339033842087, -0.06310398131608963, -0.0478455126285553, -0.06422051787376404, 0.008646216243505478, -0.04481766000390053, -0.04049400985240936, -0.06702639907598495, -0.010653220117092133, -0.17555376887321472, 0.11073736101388931, -0.00811851117759943, -0.08859236538410187, -0.01948259025812149, 0.007783317472785711, -0.04343291372060776, -0.06086517125368118, -0.011198692955076694, -0.11327536404132843, -0.0699421688914299, -0.007525034248828888, -0.032511234283447266, -0.0592036098241806, -0.07320065796375275, 0.06295375525951385, 0.050287775695323944, 0.06745456904172897, 0.11476221680641174, 0.001606689183972776, 0.009889482520520687, -0.025692299008369446, -0.08523158729076385, 0.14938461780548096, -0.051775459200143814, 0.03155636787414551, 0.0005806168774142861, 0.06604964286088943, 0.01961308903992176, 0.0005960731068626046, 0.06296970695257187, 0.01695963181555271, -0.010979762300848961, -0.04468326270580292, 0.022768767550587654, 0.030956827104091644, 0.009269076399505138, 0.035954248160123825, 0.09184985607862473, -0.03179755061864853, 0.03219352290034294, 0.03421245142817497, -0.06416244804859161, -0.005802361760288477, -0.0028327845502644777, -0.08059169352054596, -0.04396786540746689, -0.05076325312256813, -0.01432797685265541, 0.10246821492910385, 0.003282727673649788, 0.15609119832515717, -0.03065481036901474, 0.07880862802267075, -0.03434332087635994 ]
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|TypedArray|DataView|Buffer} Represents the nonce, which is a salt for password hashing applications. #### `argon2Params.parallelism` \* Type: {number} Represents the degree of parallelism. #### `argon2Params.passes` \* Type: {number} Represents the number of passes. #### `argon2Params.secretValue` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} Represents the optional secret value. #### `argon2Params.version` \* Type: {number} Represents the Argon2 version number. The default and currently only defined version is `19` (`0x13`). ### Class: `ContextParams` #### `contextParams.name` \* Type: {string} Must be `Ed448`[^secure-curves], `'ML-DSA-44'`[^modern-algos], `'ML-DSA-65'`[^modern-algos], or `'ML-DSA-87'`[^modern-algos]. #### `contextParams.context` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} The `context` member represents the optional context data to associate with the message. ### Class: `CShakeParams` #### `cShakeParams.customization` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} The `customization` member represents the customization string. The Node.js Web Crypto API implementation only supports zero-length customization which is equivalent to not providing customization at all. #### `cShakeParams.functionName` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} The `functionName` member represents represents the function name, used by NIST to define functions based on cSHAKE. The Node.js Web Crypto API implementation only supports zero-length functionName which is equivalent to not providing functionName at all. #### `cShakeParams.length` \* Type: {number} represents the requested output length in bits. #### `cShakeParams.name` \* Type: {string} Must be `'cSHAKE128'`[^modern-algos] or `'cSHAKE256'`[^modern-algos] ### Class: `EcdhKeyDeriveParams` #### `ecdhKeyDeriveParams.name` \* Type: {string} Must be `'ECDH'`, `'X25519'`, or `'X448'`[^secure-curves]. #### `ecdhKeyDeriveParams.public` \* Type: {CryptoKey} ECDH key derivation operates by taking as input one parties private key and another parties public key -- using both to generate a common shared secret. The `ecdhKeyDeriveParams.public` property is set to the other parties public key. ### Class: `EcdsaParams` #### `ecdsaParams.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 be one of the above listed values. #### `ecdsaParams.name` \* Type: {string} Must be `'ECDSA'`. ### Class: `EcKeyAlgorithm` #### `ecKeyAlgorithm.name` \* Type: {string} #### `ecKeyAlgorithm.namedCurve` \* Type: {string} ### Class: `EcKeyGenParams` #### `ecKeyGenParams.name` \* Type: {string} Must be one of `'ECDSA'` or `'ECDH'`. #### `ecKeyGenParams.namedCurve` \* Type: {string} Must be one of `'P-256'`, `'P-384'`, `'P-521'`. ### Class: `EcKeyImportParams` #### `ecKeyImportParams.name` \* Type: {string} Must be one of `'ECDSA'` or `'ECDH'`. #### `ecKeyImportParams.namedCurve` \* Type: {string} Must be one of `'P-256'`, `'P-384'`, `'P-521'`. ### Class: `EncapsulatedBits` A temporary symmetric secret key (represented as {ArrayBuffer}) for message encryption and the ciphertext (that can be transmitted to the message recipient along with the message) encrypted by this shared key. The recipient uses their private key to determine what the shared key is which then allows them to decrypt the message. #### `encapsulatedBits.ciphertext` \* Type: {ArrayBuffer} #### `encapsulatedBits.sharedKey` \* Type: {ArrayBuffer} ### Class: `EncapsulatedKey` A temporary symmetric secret key (represented as {CryptoKey}) for message encryption and the ciphertext (that can be transmitted to the message recipient along with the message) encrypted by this shared key. The recipient uses their private key to determine what the shared key is which then allows them to decrypt the message. #### `encapsulatedKey.ciphertext` \* Type: {ArrayBuffer} #### `encapsulatedKey.sharedKey` \* Type: {CryptoKey} ### Class: `HkdfParams` #### `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 be one of the above listed values. #### `hkdfParams.info` \* Type:
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.07686269283294678, -0.011809790506958961, 0.037077877670526505, -0.0351671427488327, -0.07066845893859863, -0.037330083549022675, -0.07254943996667862, 0.09427649527788162, -0.002085302257910371, -0.022607864812016487, -0.021088944748044014, -0.002529013901948929, 0.04951776936650276, 0.08451241254806519, 0.025586336851119995, 0.0025365808978676796, -0.02953413315117359, 0.048101574182510376, 0.04741422459483147, -0.07022039592266083, 0.0841396301984787, -0.03593284264206886, 0.08149156719446182, -0.04462325572967529, 0.010107429698109627, -0.02866155095398426, -0.01748468354344368, 0.014331856742501259, 0.11495579779148102, -0.11497051268815994, 0.011635202914476395, -0.11093895137310028, 0.023356536403298378, -0.029023684561252594, -0.05556975677609444, -0.037932246923446655, 0.013997979462146759, -0.028598355129361153, 0.03227657824754715, -0.009583319537341595, 0.02298595756292343, 0.027127956971526146, -0.06111620366573334, -0.0877043679356575, 0.004572093486785889, -0.02317536436021328, -0.012258781120181084, 0.008972696959972382, -0.04073374345898628, 0.05386807769536972, 0.010002575814723969, -0.060031622648239136, -0.010221615433692932, 0.08381139487028122, -0.001843743259087205, 0.07983104884624481, -0.027989206835627556, -0.06851097196340561, 0.08560631424188614, -0.04692825675010681, -0.023081276565790176, -0.03120492212474346, 0.031195135787129402, 0.006836452055722475, -0.07675754278898239, -0.00033231303677894175, -0.14003928005695343, -0.03724842891097069, 0.008077268488705158, -0.010999945923686028, 0.08637773990631104, 0.05674515292048454, 0.052930474281311035, -0.044435445219278336, -0.004232080187648535, -0.022212674841284752, -0.022298021242022514, 0.039553962647914886, -0.038076240569353104, -0.0033859838731586933, 0.03068578615784645, 0.07087119668722153, 0.05233410373330116, -0.02583007514476776, 0.021897926926612854, -0.15291129052639008, 0.03706606477499008, -0.006365754641592503, 0.024862490594387054, 0.05715177580714226, -0.030930720269680023, 0.07911836355924606, -0.003267026739194989, 0.09329699724912643, -0.04446727782487869, -0.040837518870830536, 0.050674520432949066, 0.03305274620652199, 0.13535836338996887, -0.028758740052580833, -0.014923548325896263, 0.0166110061109066, 0.03627987578511238, -0.021341100335121155, -0.06406726688146591, -0.032612111419439316, 0.03555793687701225, -0.004998769145458937, -0.014404351823031902, -0.03537431359291077, 0.017262326553463936, -0.0410582534968853, 0.0016884231008589268, -0.0793408676981926, 7.55831773850795e-33, 0.021593093872070312, 0.00028803054010495543, -0.02349531464278698, 0.0006664624088443816, -0.03183060884475708, 0.017462152987718582, 0.04367668926715851, 0.014580782502889633, 0.017334524542093277, 0.035071440041065216, -0.12918920814990997, -0.05479869619011879, 0.016844788566231728, -0.006886081770062447, 0.043724626302719116, -0.019817817956209183, 0.025860002264380455, 0.041130971163511276, 0.028331462293863297, -0.016193626448512077, 0.061190832406282425, 0.06779362261295319, -0.04804707318544388, -0.009301050566136837, -0.017269205302000046, -0.035302598029375076, 0.020732305943965912, -0.0691811740398407, 0.002132825320586562, 0.008036615327000618, 0.057459212839603424, -0.028892144560813904, 0.021441655233502388, 0.06557034701108932, 0.06752447783946991, -0.07374635338783264, 0.030640702694654465, 0.011329677887260914, 0.02258855476975441, -0.06478729844093323, -0.022255418822169304, -0.0194864384829998, 0.030707452446222305, -0.04038185253739357, -0.04487557336688042, -0.1617145538330078, -0.027160393074154854, 0.06013016030192375, 0.03692414611577988, 0.047598134726285934, -0.013508622534573078, 0.03601968288421631, 0.042924121022224426, -0.035312801599502563, 0.011841652914881706, -0.08248396217823029, -0.032855771481990814, 0.013288473710417747, 0.05034511163830757, 0.06437387317419052, -0.10692255944013596, 0.023010602220892906, 0.0140309389680624, 0.04033568128943443, -0.05228748545050621, 0.009043499827384949, 0.0273081474006176, -0.05323847383260727, 0.020767129957675934, 0.011613029055297375, -0.082879438996315, -0.003776121884584427, -0.04190407693386078, 0.006699437275528908, -0.050392504781484604, -0.04184843599796295, 0.006901343818753958, -0.05160418897867203, 0.00701025128364563, -0.001333252526819706, -0.006492985412478447, -0.05349349230527878, -0.0156843438744545, 0.06453806161880493, -0.04358302801847458, -0.03587186709046364, 0.030384764075279236, -0.07530955970287323, -0.040175605565309525, -0.023826850578188896, 0.010794572532176971, 0.0004865223017986864, -0.07568995654582977, -0.11658500134944916, 0.011040047742426395, -8.348464469979552e-33, 0.08470464497804642, 0.02010955661535263, -0.042802732437849045, 0.039828669279813766, 0.02428339794278145, 0.012588291428983212, 0.06717445701360703, 0.023466892540454865, -0.11494290828704834, -0.11030082404613495, -0.016370680183172226, 0.07722368091344833, 0.03189642354846001, -0.05222132429480553, 0.06296533346176147, 0.002911420539021492, -0.0442252941429615, 0.03606022894382477, 0.04162782430648804, -0.05507321283221245, -0.06288787722587585, 0.04810236394405365, 0.017971433699131012, 0.02194778434932232, -0.056521251797676086, 0.014760359190404415, -0.013874146156013012, -0.001658935914747417, 0.0625273734331131, 0.04255896806716919, 0.04052780941128731, 0.03822159394621849, -0.020521678030490875, 0.014974860474467278, -0.04966438561677933, -0.10737354308366776, 0.11039626598358154, -0.003925723023712635, -0.083103708922863, 0.03663412109017372, 0.06025448814034462, 0.016295980662107468, 0.05077885463833809, 0.020301545038819313, -0.006548972800374031, 0.04965159296989441, -0.00024698724155314267, 0.012371150776743889, -0.06229295954108238, -0.11931688338518143, 0.03162309154868126, -0.06869082152843475, -0.006530659273266792, 0.051560744643211365, 0.059933196753263474, 0.003203069092705846, -0.025484908372163773, -0.014008556492626667, 0.00930340401828289, 0.009280682541429996, -0.032806407660245895, -0.07478923350572586, 0.05554575100541115, -0.040993254631757736, 0.009868075139820576, -0.0009005246101878583, -0.04724836349487305, -0.052251074463129044, -0.07515203207731247, 0.08329188078641891, -0.0006674189353361726, -0.00985038559883833, -0.0155213363468647, 0.006876706145703793, 0.0131751149892807, -0.06438173353672028, 0.005363114178180695, -0.008784284815192223, 0.08772311359643936, 0.019258208572864532, 0.053245801478624344, -0.0029597117099910975, 0.0060631646774709225, 0.09285642951726913, 0.03610493242740631, -0.0019305088790133595, 0.0019062291830778122, 0.06469777226448059, -0.06991124153137207, -0.014253252185881138, -0.023487424477934837, 0.07014558464288712, -0.09254075586795807, 0.03645244240760803, 0.06933260709047318, -5.434711880525356e-8, 0.010122733190655708, -0.004967766813933849, 0.016416020691394806, 0.03046128898859024, 0.037540584802627563, -0.006581306457519531, -0.07671844959259033, -0.01749636046588421, 0.016355343163013458, -0.010339168831706047, 0.06732926517724991, 0.003323866054415703, 0.004330099560320377, -0.04122548550367355, 0.03995310887694359, 0.013422801159322262, 0.012317033484578133, -0.05034371837973595, -0.010921873152256012, -0.05763750895857811, -0.0518876351416111, -0.039614591747522354, -0.09134151041507721, -0.040688201785087585, 0.11202448606491089, 0.04104948043823242, 0.1246553510427475, 0.030862020328640938, 0.044526103883981705, 0.03467625379562378, 0.007953946478664875, -0.033579643815755844, 0.1053299605846405, -0.05540377274155617, -0.01031412836164236, 0.10684210062026978, 0.011777614243328571, 0.046154655516147614, 0.056640803813934326, 0.011545458808541298, -0.07637281715869904, 0.04988051950931549, 0.00957528967410326, 0.02000102773308754, 0.0301748588681221, -0.01742861419916153, 0.03906278312206268, 0.036769747734069824, -0.011107644997537136, -0.005153823643922806, -0.023025311529636383, 0.028002243489027023, 0.07207777351140976, 0.08942922204732895, -0.09841814637184143, 0.01795070990920067, -0.07088832557201385, -0.08381213247776031, 0.07330967485904694, 0.007678827736526728, 0.11587342619895935, 0.013867275789380074, -0.1072416678071022, 0.010551832616329193 ]
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 be one of the above listed values. #### `hkdfParams.info` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} Provides application-specific contextual input to the HKDF algorithm. This can be zero-length but must be provided. #### `hkdfParams.name` \* Type: {string} Must be `'HKDF'`. #### `hkdfParams.salt` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} The salt value significantly improves the strength of the HKDF algorithm. It should be random or pseudorandom and should be the same length as the output of the digest function (for instance, if using `'SHA-256'` as the digest, the salt should be 256-bits of random data). ### Class: `HmacImportParams` #### `hmacImportParams.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 be one of the above listed values. #### `hmacImportParams.length` \* Type: {number} The optional number of bits in the HMAC key. This is optional and should be omitted for most cases. #### `hmacImportParams.name` \* Type: {string} Must be `'HMAC'`. ### Class: `HmacKeyAlgorithm` #### `hmacKeyAlgorithm.hash` \* Type: {Algorithm} #### `hmacKeyAlgorithm.length` \* Type: {number} The length of the HMAC key in bits. #### `hmacKeyAlgorithm.name` \* Type: {string} ### Class: `HmacKeyGenParams` #### `hmacKeyGenParams.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 be one of the above listed values. #### `hmacKeyGenParams.length` \* Type: {number} The number of bits to generate for the HMAC key. If omitted, the length will be determined by the hash algorithm used. This is optional and should be omitted for most cases. #### `hmacKeyGenParams.name` \* Type: {string} Must be `'HMAC'`. ### Class: `KeyAlgorithm` #### `keyAlgorithm.name` \* Type: {string} ### Class: `KmacImportParams` #### `kmacImportParams.length` \* Type: {number} The optional number of bits in the KMAC key. This is optional and should be omitted for most cases. #### `kmacImportParams.name` \* Type: {string} Must be `'KMAC128'` or `'KMAC256'`. ### Class: `KmacKeyAlgorithm` #### `kmacKeyAlgorithm.length` \* Type: {number} The length of the KMAC key in bits. #### `kmacKeyAlgorithm.name` \* Type: {string} ### Class: `KmacKeyGenParams` #### `kmacKeyGenParams.length` \* Type: {number} The number of bits to generate for the KMAC key. If omitted, the length will be determined by the KMAC algorithm used. This is optional and should be omitted for most cases. #### `kmacKeyGenParams.name` \* Type: {string} Must be `'KMAC128'` or `'KMAC256'`. ### Class: `KmacParams` #### `kmacParams.algorithm` \* Type: {string} Must be `'KMAC128'` or `'KMAC256'`. #### `kmacParams.customization` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} The `customization` member represents the optional customization string. #### `kmacParams.length` \* Type: {number} The length of the output in bytes. This must be a positive integer. ### Class: `Pbkdf2Params` #### `pbkdf2Params.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 be one of the above listed values. #### `pbkdf2Params.iterations` \* Type: {number} The number of iterations the PBKDF2 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|Algorithm} If represented as a {string}, the value must be one of: \* `'SHA-1'` \*
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.030992042273283005, 0.005291404668241739, 0.05387209728360176, -0.018599480390548706, -0.07290737330913544, -0.07743720710277557, 0.02617151290178299, 0.054669082164764404, 0.004319504369050264, -0.02679409459233284, -0.03750466927886009, -0.014944979920983315, 0.08803486078977585, 0.03673330321907997, -0.03186904639005661, 0.010875394567847252, 0.04870093986392021, 0.029119405895471573, 0.009551351889967918, -0.01327910739928484, 0.08775367587804794, 0.03629481419920921, 0.042516279965639114, -0.06234581395983696, 0.020560050383210182, -0.032514262944459915, -0.027798710390925407, 0.046940919011831284, 0.03511371463537216, -0.0507490299642086, -0.012231969274580479, -0.0606408528983593, -0.008786903694272041, -0.011998740024864674, -0.06396225839853287, -0.015213792212307453, 0.018103957176208496, -0.08542673289775848, -0.0011359609197825193, 0.013303691521286964, -0.010973348282277584, 0.05866813287138939, -0.07390624284744263, -0.05082829296588898, 0.11004161089658737, -0.00657431036233902, -0.027067381888628006, -0.032719023525714874, -0.04755028709769249, 0.0801238864660263, -0.0036206801887601614, 0.01631396822631359, 0.040698349475860596, 0.06393883377313614, -0.052804432809352875, 0.03212648630142212, -0.06046959012746811, -0.1452515870332718, 0.047156695276498795, 0.011806946247816086, 0.009243856184184551, -0.04745195060968399, 0.02637792006134987, 0.017338724806904793, -0.038493528962135315, -0.041292738169431686, -0.10099063813686371, -0.019444307312369347, -0.014788785018026829, -0.018183423206210136, 0.05346684157848358, 0.03625606372952461, -0.017224201932549477, -0.09827963262796402, -0.019432632252573967, 0.013762329705059528, 0.06422539055347443, -0.03554614633321762, -0.014217820018529892, -0.057538893073797226, 0.009485400281846523, 0.12040980160236359, 0.05045421048998833, -0.029097817838191986, 0.004101860336959362, -0.07461504638195038, 0.06138050928711891, -0.038996510207653046, 0.010272420011460781, -0.016878195106983185, 0.0018240513745695353, 0.06654013693332672, -0.008414983749389648, 0.019797716289758682, -0.035440925508737564, -0.07946363836526871, 0.07887038588523865, 0.06863106042146683, 0.09519996494054794, -0.0330386683344841, -0.08435595035552979, -0.04084215685725212, -0.05954746529459953, -0.03012038767337799, -0.032799798995256424, -0.07740262150764465, 0.011367241851985455, -0.02660144679248333, -0.04892706871032715, -0.044633183628320694, -0.033916205167770386, -0.02409466728568077, 0.0145129868760705, -0.0166594497859478, 5.5888423405784716e-33, -0.020535195246338844, -0.051058579236269, 0.03451975807547569, 0.00352940964512527, 0.0024140297900885344, -0.05271800979971886, 0.027903711423277855, 0.05792979896068573, 0.02411537803709507, -0.06219376251101494, -0.015855925157666206, 0.033070411533117294, -0.026733875274658203, -0.09820369631052017, 0.05846303328871727, 0.023314502090215683, 0.07300218939781189, 0.03747278451919556, -0.00041407428216189146, -0.047292713075876236, 0.05422976240515709, 0.08384016156196594, -0.024893593043088913, -0.11523237079381943, -0.11143690347671509, 0.04188549891114235, 0.06367231905460358, -0.0854036957025528, 0.0305122472345829, 0.01985429972410202, -0.011474446393549442, -0.047781165689229965, 0.016953980550169945, -0.0003512137627694756, 0.021214153617620468, -0.036949414759874344, 0.009971901774406433, -0.009028174914419651, 0.011055933311581612, -0.04640790820121765, 0.027599507942795753, -0.027853498235344887, 0.07559821009635925, -0.010705574415624142, -0.05298325791954994, -0.06427586078643799, -0.06444843113422394, 0.003169616684317589, 0.021071821451187134, 0.05809788033366203, -0.017856765538454056, -0.0037948135286569595, -0.03944019600749016, 0.0048447465524077415, -0.054013676941394806, -0.09678857773542404, -0.07087918370962143, -0.018208138644695282, -0.01329027023166418, 0.05157608166337013, -0.09610031545162201, 0.038619838654994965, 0.011969329789280891, 0.04045175015926361, 0.00434083491563797, -0.06010890752077103, 0.09201977401971817, -0.025586212053894997, 0.001388968899846077, 0.003765346249565482, -0.0355025939643383, 0.01590174436569214, 0.02785099297761917, 0.03057917393743992, -0.024595554918050766, -0.03730025514960289, 0.017167313024401665, -0.06097690016031265, -0.061741720885038376, -0.03485314920544624, 0.01608802191913128, -0.0029102563858032227, 0.03621397167444229, 0.04388945549726486, -0.04269792512059212, 0.013939280062913895, -0.030099572613835335, 0.010019732639193535, 0.021840158849954605, -0.08330375701189041, -0.07780393213033676, -0.06431131064891815, -0.06554549932479858, -0.09954651445150375, -0.011927132494747639, -7.793206489057198e-33, 0.1552252620458603, -0.0408676415681839, -0.016152743250131607, 0.027827583253383636, 0.04163510724902153, -0.036051999777555466, 0.04011361300945282, 0.0809529721736908, -0.08935133367776871, -0.047649070620536804, -0.0245977770537138, 0.025075474753975868, 0.06509040296077728, -0.03583307936787605, 0.00893622450530529, 0.06361321359872818, -0.06255537271499634, 0.02451929822564125, 0.03960566595196724, -0.038116343319416046, 0.013219201005995274, 0.05365169048309326, -0.011073864996433258, 0.0655534565448761, -0.044229548424482346, 0.011511211283504963, 0.02502785064280033, 0.03223063051700592, 0.0188971646130085, 0.05840947479009628, -0.024579674005508423, 0.08829614520072937, -0.06467822194099426, -0.007420451380312443, -0.09503466635942459, -0.056714292615652084, 0.06419152766466141, -0.0130218006670475, -0.030258215963840485, 0.10925356298685074, 0.02794332057237625, -0.025625402107834816, -0.04417024552822113, -0.04683738201856613, 0.016231035813689232, 0.031505897641181946, 0.05166873708367348, 0.053294673562049866, 0.05083419382572174, -0.04324772581458092, 0.07335221022367477, -0.04673377797007561, -0.056244395673274994, 0.025700461119413376, 0.012472664006054401, 0.06404994428157806, 0.06261070817708969, -0.08721960335969925, -0.07524589449167252, 0.04577827453613281, -0.026778897270560265, -0.06790587306022644, 0.050063975155353546, -0.034557465463876724, -0.016307368874549866, 0.06850101053714752, 0.034114982932806015, -0.09858255088329315, 0.003285865532234311, -0.057183269411325455, 0.017570290714502335, -0.02850547432899475, -0.010605179704725742, -0.016501575708389282, 0.017385758459568024, 0.037819456309080124, 0.05523698404431343, 0.03550558537244797, 0.10185206681489944, 0.05119539797306061, 0.07588504254817963, 0.05887741968035698, 0.018008656799793243, 0.09001222997903824, 0.08828694373369217, -0.04807233065366745, 0.0020832428708672523, 0.0330524668097496, -0.08935743570327759, -0.03316066786646843, -0.06387370824813843, 0.019194480031728745, -0.00677376426756382, 0.02485954575240612, -0.00598092470318079, -5.381842527185654e-8, -0.05707293376326561, 0.03654979541897774, -0.037441790103912354, 0.06184498593211174, 0.025553179904818535, 0.09814754128456116, -0.09759945422410965, -0.004106040112674236, 0.044188492000103, -0.08194499462842941, 0.06049465760588646, -0.015560307539999485, -0.06728421151638031, -0.00398962153121829, 0.02330048568546772, -0.01333363726735115, -0.07309781759977341, -0.009802637621760368, -0.04800479859113693, -0.009319182485342026, 0.0046567246317863464, -0.05708913877606392, -0.06213315948843956, -0.0562501884996891, 0.07342007011175156, 0.0546657033264637, 0.013803322799503803, 0.05429060757160187, 0.03360848128795624, 0.12161693722009659, -0.026120033115148544, -0.008539712987840176, 0.050272464752197266, 0.02846326120197773, -0.05282564461231232, 0.007002171128988266, 0.06863683462142944, 0.025095732882618904, 0.031512875109910965, 0.03533622622489929, 0.020458074286580086, 0.032597389072179794, -0.06574396789073944, 0.035257548093795776, 0.08563580363988876, 0.05270356684923172, 0.03331046923995018, 0.09410226345062256, -0.012482551857829094, 0.08395525813102722, 0.011295084841549397, 0.0484837181866169, 0.025180557742714882, 0.04227421060204506, -0.08518562465906143, 0.0039267102256417274, -0.02466791309416294, -0.0476408377289772, 0.02496347576379776, 0.04178064316511154, 0.11313986033201218, -0.0346997044980526, -0.02204960212111473, 0.031045230105519295 ]
-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|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 be one of the above listed values. #### `rsaHashedImportParams.name` \* Type: {string} Must be one of `'RSASSA-PKCS1-v1\_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`. ### Class: `RsaHashedKeyAlgorithm` #### `rsaHashedKeyAlgorithm.hash` \* Type: {Algorithm} #### `rsaHashedKeyAlgorithm.modulusLength` \* Type: {number} The length in bits of the RSA modulus. #### `rsaHashedKeyAlgorithm.name` \* Type: {string} #### `rsaHashedKeyAlgorithm.publicExponent` \* Type: {Uint8Array} The RSA public exponent. ### Class: `RsaHashedKeyGenParams` #### `rsaHashedKeyGenParams.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 be one of the above listed values. #### `rsaHashedKeyGenParams.modulusLength` \* Type: {number} The length in bits of the RSA modulus. As a best practice, this should be at least `2048`. #### `rsaHashedKeyGenParams.name` \* Type: {string} Must be one of `'RSASSA-PKCS1-v1\_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`. #### `rsaHashedKeyGenParams.publicExponent` \* Type: {Uint8Array} The RSA public exponent. This must be a {Uint8Array} containing a big-endian, unsigned integer that must fit within 32-bits. The {Uint8Array} may contain an arbitrary number of leading zero-bits. The value must be a prime number. Unless there is reason to use a different value, use `new Uint8Array([1, 0, 1])` (65537) as the public exponent. ### Class: `RsaOaepParams` #### `rsaOaepParams.label` \* Type: {ArrayBuffer|TypedArray|DataView|Buffer} An additional collection of bytes that will not be encrypted, but will be bound to the generated ciphertext. The `rsaOaepParams.label` parameter is optional. #### `rsaOaepParams.name` \* Type: {string} must be `'RSA-OAEP'`. ### Class: `RsaPssParams` #### `rsaPssParams.name` \* Type: {string} Must be `'RSA-PSS'`. #### `rsaPssParams.saltLength` \* Type: {number} The length (in bytes) of the random salt to use. [^secure-curves]: See [Secure Curves in the Web Cryptography API][] [^modern-algos]: See [Modern Algorithms in the Web Cryptography API][] [^openssl30]: Requires OpenSSL >= 3.0 [^openssl32]: Requires OpenSSL >= 3.2 [^openssl35]: Requires OpenSSL >= 3.5 [Checking for runtime algorithm support]: #checking-for-runtime-algorithm-support [JSON Web Key]: https://tools.ietf.org/html/rfc7517 [Key usages]: #cryptokeyusages [Modern Algorithms in the Web Cryptography API]: #modern-algorithms-in-the-web-cryptography-api [RFC 4122]: https://www.rfc-editor.org/rfc/rfc4122.txt [Secure Curves in the Web Cryptography API]: #secure-curves-in-the-web-cryptography-api [Web Crypto API]: https://www.w3.org/TR/WebCryptoAPI/ [`SubtleCrypto.supports()`]: #static-method-subtlecryptosupportsoperation-algorithm-lengthoradditionalalgorithm [`subtle.decapsulateBits()`]: #subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext [`subtle.decapsulateKey()`]: #subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-usages [`subtle.decrypt()`]: #subtledecryptalgorithm-key-data [`subtle.deriveBits()`]: #subtlederivebitsalgorithm-basekey-length [`subtle.deriveKey()`]: #subtlederivekeyalgorithm-basekey-derivedkeyalgorithm-extractable-keyusages [`subtle.digest()`]: #subtledigestalgorithm-data [`subtle.encapsulateBits()`]: #subtleencapsulatebitsencapsulationalgorithm-encapsulationkey [`subtle.encapsulateKey()`]: #subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-usages [`subtle.encrypt()`]: #subtleencryptalgorithm-key-data [`subtle.exportKey()`]: #subtleexportkeyformat-key [`subtle.generateKey()`]: #subtlegeneratekeyalgorithm-extractable-keyusages [`subtle.getPublicKey()`]: #subtlegetpublickeykey-keyusages [`subtle.importKey()`]: #subtleimportkeyformat-keydata-algorithm-extractable-keyusages [`subtle.sign()`]: #subtlesignalgorithm-key-data [`subtle.unwrapKey()`]: #subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgo-unwrappedkeyalgo-extractable-keyusages [`subtle.verify()`]: #subtleverifyalgorithm-key-signature-data [`subtle.wrapKey()`]: #subtlewrapkeyformat-key-wrappingkey-wrapalgo
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.04489567503333092, -0.03090936690568924, 0.03574737533926964, 0.004885048605501652, -0.0529702752828598, -0.04374793544411659, -0.010691540315747261, 0.066744863986969, 0.026288868859410286, -0.003116282168775797, -0.03560378775000572, 0.03518301248550415, 0.079231396317482, 0.056176505982875824, 0.04590890556573868, 0.05136676877737045, -0.032310403883457184, 0.07030123472213745, 0.048454828560352325, -0.016114620491862297, 0.05246518924832344, 0.027718212455511093, 0.07201957702636719, -0.08918197453022003, -0.0007450112025253475, 0.023696064949035645, 0.02602536976337433, 0.0010100732324644923, 0.023287350311875343, -0.028470296412706375, 0.013232344761490822, -0.03506314754486084, 0.04680944234132767, -0.05089534446597099, 0.003232782008126378, 0.015499038621783257, -0.05619782581925392, -0.09014847874641418, -0.02053913101553917, -0.005387498531490564, 0.05201639235019684, 0.021002281457185745, -0.09178003668785095, -0.0761130228638649, 0.04513460025191307, -0.026773517951369286, -0.030768346041440964, -0.03390304744243622, -0.011878126300871372, 0.048094552010297775, -0.024254856631159782, 0.02078789845108986, -0.004824858624488115, 0.09937852621078491, -0.04312000423669815, 0.007117728237062693, -0.007093030959367752, -0.08327282965183258, 0.07112040370702744, -0.0573112778365612, 0.08986996859312057, -0.04712595045566559, 0.04774990305304527, 0.01994396559894085, -0.05201410502195358, -0.0534219816327095, -0.09218013286590576, -0.08917531371116638, -0.08546828478574753, 0.014986183494329453, 0.062063198536634445, 0.012653208337724209, -0.019230389967560768, -0.05832935869693756, 0.017935099080204964, 0.028121842071413994, 0.030801402404904366, -0.07571627199649811, 0.007506183814257383, 0.004210950806736946, 0.005384043790400028, 0.10416046530008316, 0.04888405278325081, -0.02658819779753685, 0.009875232353806496, -0.0475001186132431, 0.0908094123005867, -0.08537205308675766, 0.03171387314796448, 0.018662068992853165, -0.07748102396726608, 0.028787147253751755, -0.01038957666605711, -0.004147633910179138, -0.005739063024520874, -0.07130152732133865, 0.016201641410589218, 0.08001928776502609, 0.1016903892159462, -0.07470352947711945, -0.0700753852725029, -0.023270258679986, -0.025358008220791817, -0.07937529683113098, -0.04611826315522194, -0.04953944683074951, -0.05568443238735199, -0.018435074016451836, 0.012756073847413063, -0.04188074544072151, 0.0037179042119532824, -0.029436537995934486, -0.04075752571225166, -0.05574047565460205, 9.14062203147503e-33, -0.009899718686938286, -0.014166700653731823, 0.02558010071516037, -0.012350448407232761, -0.011754268780350685, 0.032327838242053986, 0.018770862370729446, 0.07101665437221527, 0.031071439385414124, -0.01955435797572136, -0.07767342776060104, -0.006938785780221224, -0.009909912943840027, -0.07200965285301208, 0.11170142889022827, -0.018439415842294693, 0.0650518536567688, -0.022484293207526207, -0.04154375568032265, -0.013668566942214966, 0.04931620880961418, 0.0616239532828331, -0.025182152166962624, -0.09827213734388351, -0.11386781185865402, 0.04099214822053909, 0.06990756094455719, -0.11509927362203598, 0.0495736226439476, 0.016048191115260124, -0.032259851694107056, -0.03465525805950165, 0.02593367174267769, -0.035638485103845596, 0.07671234756708145, -0.04555307328701019, -0.013880218379199505, -0.0019175043562427163, -0.015692194923758507, -0.015445202589035034, 0.008854364044964314, -0.02371618151664734, 0.03463457524776459, -0.005486356094479561, -0.053959984332323074, -0.04348057880997658, -0.021313535049557686, 0.035611823201179504, 0.006786975543946028, 0.06374449282884598, 0.003172091906890273, 0.00949890911579132, 0.005247667897492647, 0.026406973600387573, -0.047143470495939255, -0.09548543393611908, -0.002073528477922082, 0.010202084667980671, -0.02707979641854763, 0.09763634204864502, -0.05491872876882553, 0.03314090520143509, 0.07291366904973984, 0.044144947081804276, 0.01731778495013714, -0.026166599243879318, 0.09124699234962463, -0.006000845693051815, 0.001607318758033216, 0.09359169006347656, -0.06320323795080185, 0.0010504177771508694, 0.0020103121642023325, 0.052107639610767365, -0.011184374801814556, -0.016426078975200653, 0.015131482854485512, -0.051483891904354095, -0.025622764602303505, -0.0668986514210701, -0.0013354861875995994, 0.004435617011040449, 0.06156078726053238, 0.029102550819516182, -0.053177379071712494, 0.018359588459134102, 0.01081248838454485, -0.08470786362886429, -0.07573583722114563, -0.046094346791505814, -0.07845001667737961, -0.039656806737184525, -0.023583602160215378, -0.10076338797807693, -0.012880676425993443, -1.1517477486309449e-32, 0.07866191864013672, 0.023001831024885178, -0.01848338171839714, 0.1172323226928711, 0.02570411004126072, -0.07463180273771286, 0.02775546908378601, 0.024693451821804047, -0.03573859483003616, -0.03539109230041504, -0.0020190097857266665, 0.004107173997908831, 0.06824015825986862, -0.07395193725824356, 0.02674773707985878, 0.033120278269052505, -0.07715264707803726, 0.012355788610875607, 0.01494086068123579, 0.006369454320520163, -0.022099124267697334, 0.1248529702425003, -0.00464793061837554, 0.05034249275922775, 0.006604121066629887, 0.026413781568408012, 0.02355208620429039, 0.029769292101264, 0.022960901260375977, 0.050930388271808624, -0.0562332458794117, 0.041658490896224976, -0.07740586996078491, -0.05568481981754303, -0.1412840336561203, -0.03587299957871437, 0.057300176471471786, 0.01985960826277733, 0.025091420859098434, 0.09273871779441833, 0.027283642441034317, 0.02625192143023014, -0.039362359791994095, 0.004806120414286852, 0.015491384081542492, 0.0033652696292847395, -0.019586188718676567, 0.07205633819103241, 0.03454600274562836, -0.0956447646021843, 0.1060025617480278, -0.0006069277878850698, -0.0009771845070645213, 0.018023746088147163, 0.042858533561229706, 0.0523674301803112, -0.11458110809326172, -0.024679522961378098, -0.029453353956341743, 0.07191672921180725, -0.07201027125120163, -0.08921217918395996, 0.04615975543856621, -0.024701347574591637, -0.029795173555612564, 0.020297832787036896, -0.020504062995314598, -0.09872975200414658, -0.019036203622817993, 0.015945522114634514, 0.06942687928676605, -0.01374712586402893, -0.04779325798153877, 0.026742413640022278, -0.03338531404733658, 0.04909905791282654, 0.004059882368892431, 0.05349353328347206, 0.09312967211008072, 0.07984642684459686, 0.05722660943865776, 0.05604900047183037, -0.005183854140341282, 0.06877637654542923, 0.09670490026473999, -0.06488139182329178, -0.003429663134738803, 0.00019467566744424403, -0.06376258283853531, -0.032443638890981674, -0.05286629498004913, 0.0426797978579998, -0.013355370610952377, 0.04354849085211754, 0.018913153558969498, -6.582080658290579e-8, 0.029745865613222122, -0.015468723140656948, -0.030365105718374252, 0.06039847061038017, 0.09366880357265472, 0.044796641916036606, -0.0911622866988182, -0.041052885353565216, -0.0013692689826712012, -0.09210284799337387, 0.07614273577928543, -0.005286883562803268, -0.050006985664367676, 0.01811355911195278, 0.0232608150690794, 0.022704340517520905, -0.044845495373010635, -0.014661579392850399, -0.08411774784326553, -0.0011919569224119186, 0.00909724272787571, -0.10590264201164246, -0.06213344633579254, -0.047586604952812195, 0.0733141228556633, 0.02290242910385132, 0.04049796983599663, -0.00022689801699016243, 0.027443358674645424, 0.12433592975139618, 0.022483695298433304, -0.030300909653306007, 0.07398693263530731, -0.041295163333415985, -0.010304420255124569, 0.06353922188282013, -0.021820640191435814, 0.027912313118577003, 0.0420331135392189, 0.04687514156103134, -0.005540717393159866, 0.03285276144742966, -0.05568242818117142, 0.039597153663635254, -0.007747332565486431, 0.0035985619761049747, 0.023107366636395454, 0.033000554889440536, -0.06491369009017944, 0.05398079380393028, 0.03707031160593033, 0.040130287408828735, 0.0033793379552662373, -0.04055081307888031, -0.09882699698209763, 0.017118768766522408, -0.03329194337129593, -0.05077645555138588, 0.017293985933065414, -0.024381114169955254, 0.10945281386375427, 0.01552904024720192, -0.0030488730408251286, -0.01689356006681919 ]
-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 across many JavaScript environments. There are three primary types of objects: \* `ReadableStream` - Represents a source of streaming data. \* `WritableStream` - Represents a destination for streaming data. \* `TransformStream` - Represents an algorithm for transforming streaming data. ### Example `ReadableStream` This example creates a simple `ReadableStream` that pushes the current `performance.now()` timestamp once every second forever. An async iterable is used to read the data from the stream. ```mjs import { ReadableStream, } from 'node:stream/web'; import { setInterval as every, } from 'node:timers/promises'; import { performance, } from 'node:perf\_hooks'; const SECOND = 1000; const stream = new ReadableStream({ async start(controller) { for await (const \_ of every(SECOND)) controller.enqueue(performance.now()); }, }); for await (const value of stream) console.log(value); ``` ```cjs const { ReadableStream, } = require('node:stream/web'); const { setInterval: every, } = require('node:timers/promises'); const { performance, } = require('node:perf\_hooks'); const SECOND = 1000; const stream = new ReadableStream({ async start(controller) { for await (const \_ of every(SECOND)) controller.enqueue(performance.now()); }, }); (async () => { for await (const value of stream) console.log(value); })(); ``` ### Node.js streams interoperability Node.js streams can be converted to web streams and vice versa via the `toWeb` and `fromWeb` methods present on [`stream.Readable`][], [`stream.Writable`][] and [`stream.Duplex`][] objects. For more details refer to the relevant documentation: \* [`stream.Readable.toWeb`][] \* [`stream.Readable.fromWeb`][] \* [`stream.Writable.toWeb`][] \* [`stream.Writable.fromWeb`][] \* [`stream.Duplex.toWeb`][] \* [`stream.Duplex.fromWeb`][] ## API ### Class: `ReadableStream` #### `new ReadableStream([underlyingSource [, strategy]])` \* `underlyingSource` {Object} \* `start` {Function} A user-defined function that is invoked immediately when the `ReadableStream` is created. \* `controller` {ReadableStreamDefaultController|ReadableByteStreamController} \* Returns: `undefined` or a promise fulfilled with `undefined`. \* `pull` {Function} A user-defined function that is called repeatedly when the `ReadableStream` internal queue is not full. The operation may be sync or async. If async, the function will not be called again until the previously returned promise is fulfilled. \* `controller` {ReadableStreamDefaultController|ReadableByteStreamController} \* Returns: A promise fulfilled with `undefined`. \* `cancel` {Function} A user-defined function that is called when the `ReadableStream` is canceled. \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. \* `type` {string} Must be `'bytes'` or `undefined`. \* `autoAllocateChunkSize` {number} Used only when `type` is equal to `'bytes'`. When set to a non-zero value a view buffer is automatically allocated to `ReadableByteStreamController.byobRequest`. When not set one must use stream's internal queues to transfer data via the default reader `ReadableStreamDefaultReader`. \* `strategy` {Object} \* `highWaterMark` {number} The maximum internal queue size before backpressure is applied. \* `size` {Function} A user-defined function used to identify the size of each chunk of data. \* `chunk` {any} \* Returns: {number} #### `readableStream.locked` \* Type: {boolean} Set to `true` if there is an active reader for this {ReadableStream}. The `readableStream.locked` property is `false` by default, and is switched to `true` while there is an active reader consuming the stream's data. #### `readableStream.cancel([reason])` \* `reason` {any} \* Returns: A promise fulfilled with `undefined` once cancelation has been completed. #### `readableStream.getReader([options])` \* `options` {Object} \* `mode` {string} `'byob'` or `undefined` \* Returns: {ReadableStreamDefaultReader|ReadableStreamBYOBReader} ```mjs import { ReadableStream } 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 `readableStream.locked` to be `true`. #### `readableStream.pipeThrough(transform[, options])` \* `transform` {Object} \* `readable` {ReadableStream} The `ReadableStream`
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.018884342163801193, 0.0005905396537855268, -0.03820614144206047, 0.022800274193286896, 0.02198866941034794, -0.03539564833045006, -0.10266207158565521, 0.06695602834224701, -0.03968304395675659, -0.004844327922910452, 0.01000138372182846, -0.017825191840529442, 0.04583217203617096, -0.05040016770362854, -0.025407636538147926, 0.07413288950920105, -0.014506771229207516, -0.016058586537837982, -0.0746956318616867, -0.11351620405912399, 0.018859896808862686, -0.13149195909500122, 0.04949264973402023, 0.04385029152035713, -0.07717444747686386, -0.05237691104412079, -0.008916977792978287, 0.11855776607990265, 0.03332148492336273, -0.07699739933013916, -0.0734148845076561, -0.04180288687348366, 0.025618303567171097, -0.050702132284641266, -0.010235650464892387, -0.14634476602077484, 0.04859621077775955, -0.07546018064022064, -0.021862681955099106, -0.07722453773021698, 0.07346560060977936, 0.01967756263911724, 0.019716929644346237, -0.03683047741651535, 0.022162707522511482, -0.024712035432457924, 0.0032484005205333233, 0.011647874489426613, -0.03352728858590126, 0.058061953634023666, 0.009345725178718567, 0.04704319313168526, -0.01597844623029232, -0.03681621327996254, 0.08482712507247925, 0.1218269020318985, -0.03586024418473244, -0.04207123443484306, 0.037717726081609726, -0.008313199505209923, -0.015538390725851059, -0.04409850016236305, -0.12996521592140198, 0.034478846937417984, 0.05033591389656067, -0.03520810231566429, 0.05410251393914223, -0.029966743662953377, -0.04139769449830055, -0.01130360085517168, 0.020045489072799683, -0.01424223929643631, 0.041171830147504807, 0.029088757932186127, 0.05568690970540047, 0.010611618869006634, 0.008874833583831787, -0.11326872557401657, 0.016700467094779015, 0.014769574627280235, 0.06187915802001953, -0.02056102082133293, 0.09476973116397858, 0.05874527990818024, 0.03405468910932541, 0.015381813049316406, -0.011881086975336075, 0.04823678359389305, 0.04685506597161293, 0.060273125767707825, 0.018284762278199196, 0.05808939039707184, -0.12402578443288803, 0.008895853534340858, 0.07137520611286163, -0.0031835148110985756, -0.017569132149219513, -0.029406316578388214, 0.08150409907102585, -0.008677019737660885, -0.024908429011702538, -0.031655341386795044, 0.024783894419670105, -0.06668176501989365, -0.0006693165050819516, 0.06858380883932114, 0.14598141610622406, 0.10161836445331573, 0.04481566324830055, 0.018891114741563797, -0.002799364970996976, 0.09695036709308624, 0.02734973654150963, 0.07154759764671326, 3.506648789348644e-33, -0.045301035046577454, -0.057355523109436035, -0.01951923966407776, 0.03457484394311905, 0.01494585070759058, 0.006867134943604469, 0.03683967515826225, 0.0032433411106467247, -0.05947868898510933, -0.05219188332557678, -0.003285651560872793, 0.06200997531414032, -0.042622003704309464, 0.04966249316930771, -0.002678714692592621, -0.07767634093761444, 0.016666173934936523, -0.04515749588608742, 0.09871628135442734, 0.0012642614310607314, 0.0846261978149414, 0.006039842963218689, -0.02454090490937233, -0.02668013609945774, 0.037254590541124344, -0.022319646552205086, -0.03118743933737278, 0.052766527980566025, -0.05789579823613167, 0.03421833738684654, 0.021807745099067688, 0.018381724134087563, -0.08047660440206528, -0.05664578452706337, 0.08239694684743881, -0.08526512235403061, -0.01827305369079113, -0.04751339182257652, -0.06323285400867462, -0.06483791768550873, -0.02149125188589096, 0.043208710849285126, -0.07571865618228912, -0.04145227000117302, -0.09090615063905716, -0.07383154332637787, -0.08307994157075882, 0.00904298759996891, -0.039081547409296036, -0.04670516774058342, -0.002763917902484536, 0.05361644923686981, 0.03700624778866768, -0.02369697205722332, 0.03098139539361, 0.0009304303675889969, 0.06942038983106613, -0.010689446702599525, -0.05512266606092453, 0.06117554381489754, 0.047715507447719574, 0.03552656248211861, 0.007299956399947405, -0.025003835558891296, 0.015868021175265312, 0.023382797837257385, 0.010345365852117538, 0.04111679270863533, 0.027749281376600266, -0.021572522819042206, -0.0325021967291832, 0.02420312538743019, -0.003005889942869544, 0.021047165617346764, -0.03339946269989014, -0.03462868183851242, 0.007075277157127857, -0.05527961999177933, -0.0374765619635582, -0.0035426197573542595, 0.017094826325774193, -0.008930806070566177, -0.00692337891086936, 0.0677104964852333, -0.003963935188949108, 0.006704868283122778, -0.023603640496730804, -0.07676215469837189, 0.004400427453219891, 0.018645459786057472, -0.031163223087787628, 0.0403730608522892, 0.07323364913463593, -0.10121524333953857, -0.04931499809026718, -4.507227009374683e-33, 0.0005396275082603097, -0.015163654461503029, -0.07470955699682236, 0.12263555824756622, 0.012252149172127247, -0.050744980573654175, -0.017483310773968697, 0.05985690653324127, 0.08175160735845566, -0.0063902949914336205, -0.056262120604515076, -0.021318582817912102, -0.06930578500032425, -0.017486730590462685, 0.020837930962443352, 0.015073152258992195, -0.038091350346803665, -0.1323881596326828, 0.03780301287770271, -0.06941445171833038, -0.042405541986227036, -0.010298890061676502, 0.00045050098560750484, -0.003849649801850319, -0.012850262224674225, 0.020462943241000175, -0.018341103568673134, 0.031606826931238174, -0.04357718303799629, -0.07810704410076141, -0.0031440749298781157, -0.052814554423093796, -0.0005379518261179328, -0.025423623621463776, 0.005394106265157461, -0.052284661680459976, 0.059980325400829315, 0.06323894113302231, 0.018369045108556747, -0.01921367272734642, 0.10277929157018661, 0.015978047624230385, 0.013648799620568752, -0.044315628707408905, 0.03225094452500343, 0.10073690116405487, -0.08848252147436142, 0.06975498795509338, -0.05380259081721306, 0.023477831855416298, 0.005016722250729799, -0.06011214107275009, -0.007817581295967102, 0.02806016616523266, 0.020911632105708122, -0.035066649317741394, 0.06598439812660217, -0.021831626072525978, 0.038848187774419785, 0.016184046864509583, 0.006252450402826071, -0.10332584381103516, -0.027445511892437935, 0.024450302124023438, 0.0039799935184419155, 0.014042777009308338, -0.040240220725536346, -0.08435839414596558, -0.00496751070022583, -0.008825181983411312, 0.048229146748781204, -0.06416967511177063, -0.04116256162524223, -0.013967775739729404, -0.00591671047732234, -0.0270046666264534, -0.020462948828935623, -0.01650075986981392, -0.017646748572587967, 0.04439155012369156, -0.03910334035754204, 0.12346808612346649, -0.013524557463824749, 0.011891483329236507, 0.06506291031837463, 0.021282408386468887, 0.05256884917616844, -0.029121067374944687, 0.019931918010115623, -0.02773434668779373, 0.04531241953372955, 0.04665384814143181, -0.20350003242492676, 0.02494029328227043, -0.007127098273485899, -4.613523074681325e-8, -0.11489473283290863, -0.06020849198102951, -0.09380374103784561, 0.050449155271053314, -0.01889689266681671, -0.0029298525769263506, 0.005847360473126173, 0.02476467192173004, 0.11564690619707108, -0.009844734333455563, 0.08118566870689392, -0.03486914560198784, 0.03438998758792877, -0.04606638848781586, 0.04500161111354828, 0.013688755221664906, 0.02209002524614334, -0.026807552203536034, -0.009590737521648407, 0.014383991248905659, 0.023221105337142944, 0.008437375538051128, -0.005040302406996489, 0.02279387228190899, 0.028845585882663727, 0.029526665806770325, 0.11376070231199265, 0.06704910099506378, 0.01396915316581726, -0.05578206852078438, -0.06151118874549866, 0.04606199637055397, 0.10239752382040024, 0.04686163365840912, -0.0017445728881284595, 0.007581493817269802, -0.04020712524652481, 0.015714596956968307, -0.008158561773598194, 0.06010705977678299, 0.0894421637058258, 0.014908063225448132, -0.029998542740941048, 0.03750241547822952, 0.04059150815010071, 0.008196154609322548, 0.0045610819943249226, 0.05711710825562477, 0.009418852627277374, 0.0667462944984436, -0.004421517252922058, -0.00519311148673296, -0.007490181364119053, 0.011421932838857174, 0.0036699576303362846, -0.046985868364572525, 0.009885852225124836, -0.1242472305893898, -0.026088999584317207, 0.00673961965367198, 0.09350532293319702, 0.06901891529560089, 0.0352182574570179, 0.02099880389869213 ]
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 `readableStream.locked` to be `true`. #### `readableStream.pipeThrough(transform[, options])` \* `transform` {Object} \* `readable` {ReadableStream} The `ReadableStream` to which `transform.writable` will push the potentially modified data it receives from this `ReadableStream`. \* `writable` {WritableStream} The `WritableStream` to which this `ReadableStream`'s data will be written. \* `options` {Object} \* `preventAbort` {boolean} When `true`, errors in this `ReadableStream` will not cause `transform.writable` to be aborted. \* `preventCancel` {boolean} When `true`, errors in the destination `transform.writable` do not cause this `ReadableStream` to be canceled. \* `preventClose` {boolean} When `true`, closing this `ReadableStream` does not cause `transform.writable` to be closed. \* `signal` {AbortSignal} Allows the transfer of data to be canceled using an {AbortController}. \* Returns: {ReadableStream} From `transform.readable`. Connects this {ReadableStream} to the pair of {ReadableStream} and {WritableStream} provided in the `transform` argument such that the data from this {ReadableStream} is written in to `transform.writable`, possibly transformed, then pushed to `transform.readable`. Once the pipeline is configured, `transform.readable` is returned. Causes the `readableStream.locked` to be `true` while the pipe operation is active. ```mjs import { ReadableStream, TransformStream, } from 'node:stream/web'; const stream = new ReadableStream({ start(controller) { controller.enqueue('a'); }, }); const transform = new TransformStream({ transform(chunk, controller) { controller.enqueue(chunk.toUpperCase()); }, }); const transformedStream = stream.pipeThrough(transform); for await (const chunk of transformedStream) console.log(chunk); // Prints: A ``` ```cjs const { ReadableStream, TransformStream, } = require('node:stream/web'); const stream = new ReadableStream({ start(controller) { controller.enqueue('a'); }, }); const transform = new TransformStream({ transform(chunk, controller) { controller.enqueue(chunk.toUpperCase()); }, }); const transformedStream = stream.pipeThrough(transform); (async () => { for await (const chunk of transformedStream) console.log(chunk); // Prints: A })(); ``` #### `readableStream.pipeTo(destination[, options])` \* `destination` {WritableStream} A {WritableStream} to which this `ReadableStream`'s data will be written. \* `options` {Object} \* `preventAbort` {boolean} When `true`, errors in this `ReadableStream` will not cause `destination` to be aborted. \* `preventCancel` {boolean} When `true`, errors in the `destination` will not cause this `ReadableStream` to be canceled. \* `preventClose` {boolean} When `true`, closing this `ReadableStream` does not cause `destination` to be closed. \* `signal` {AbortSignal} Allows the transfer of data to be canceled using an {AbortController}. \* Returns: A promise fulfilled with `undefined` Causes the `readableStream.locked` to be `true` while the pipe operation is active. #### `readableStream.tee()` \* Returns: {ReadableStream\[]} Returns a pair of new {ReadableStream} instances to which this `ReadableStream`'s data will be forwarded. Each will receive the same data. Causes the `readableStream.locked` to be `true`. #### `readableStream.values([options])` \* `options` {Object} \* `preventCancel` {boolean} When `true`, prevents the {ReadableStream} from being closed when the async iterator abruptly terminates. \*\*Default\*\*: `false`. Creates and returns an async iterator usable for consuming this `ReadableStream`'s data. Causes the `readableStream.locked` to be `true` while the async iterator is active. ```mjs import { Buffer } from 'node:buffer'; const stream = new ReadableStream(getSomeSource()); for await (const chunk of stream.values({ preventCancel: true })) console.log(Buffer.from(chunk).toString()); ``` #### Async Iteration The {ReadableStream} object supports the async iterator protocol using `for await` syntax. ```mjs import { Buffer } from 'node:buffer'; const stream = new ReadableStream(getSomeSource()); for await (const chunk of stream) console.log(Buffer.from(chunk).toString()); ``` The async iterator will consume the {ReadableStream} until it terminates. By default, if the async iterator exits early (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 have an existing
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.01066337339580059, -0.026383308693766594, -0.05775660276412964, -0.05674869567155838, 0.06696800142526627, -0.04144599288702011, -0.03485605865716934, 0.044602081179618835, -0.025461817160248756, -0.01628192700445652, -0.009197630919516087, 0.00394083745777607, 0.03401217609643936, -0.049796298146247864, -0.01781187579035759, 0.015054548159241676, -0.020170940086245537, -0.02734183892607689, -0.05781738832592964, -0.13560786843299866, 0.010064504109323025, -0.07197710871696472, 0.09980013966560364, 0.009878043085336685, -0.13167697191238403, -0.0362648107111454, -0.034705858677625656, 0.10630281269550323, 0.0870416983962059, -0.11558087170124054, -0.03467920050024986, -0.0074792420491576195, -0.007904973812401295, -0.05748877674341202, 0.017894987016916275, -0.0872398242354393, 0.06241297721862793, -0.10187012702226639, 0.010287406854331493, -0.04572145268321037, 0.05548654869198799, 0.00026081001851707697, 0.013804437592625618, -0.0002905362634919584, 0.02901543490588665, 0.05906318128108978, -0.023925136774778366, -0.042225588113069534, -0.013797727413475513, 0.08351274579763412, 0.00010570650192676112, 0.012625867500901222, -0.00463941041380167, -0.014719092287123203, 0.06443076580762863, 0.07211064547300339, -0.022213108837604523, 0.01705790124833584, 0.04206916317343712, -0.041816599667072296, -0.020756350830197334, -0.033875130116939545, -0.10419130325317383, -0.003706520888954401, 0.041600488126277924, -0.025314752012491226, 0.0832194983959198, -0.0411786288022995, -0.0676744282245636, 0.021858762949705124, 0.0493352897465229, -0.056652892380952835, 0.10557930916547775, -0.01788436993956566, 0.02286788448691368, 0.0017806972609832883, 0.032521460205316544, -0.1254560798406601, -0.023707281798124313, -0.004408162087202072, 0.05937310680747032, 0.004101748112589121, 0.06103098765015602, 0.04041874036192894, 0.04466856271028519, -0.03545601665973663, -0.01805032230913639, 0.03230012580752373, 0.07564841955900192, 0.059209275990724564, -0.009544347412884235, 0.043087929487228394, -0.09159953147172928, 0.03485093638300896, 0.021012241020798683, -0.020276088267564774, -0.018712997436523438, 0.01596885547041893, 0.10478463768959045, 0.02070201374590397, -0.035361211746931076, -0.053598470985889435, -0.010425789281725883, -0.03297429904341698, -0.012360062450170517, -0.0003832153743132949, 0.16691459715366364, 0.06188773363828659, -0.018772142007946968, -0.011621396988630295, 0.031033795326948166, 0.056993063539266586, -0.04408421367406845, 0.0963120087981224, 1.0072055286062801e-33, -0.000726333528291434, -0.07929592579603195, -0.00043149650446139276, 0.07064897567033768, 0.04448015242815018, -0.012093259021639824, 0.04896607622504234, -0.012539487332105637, -0.130672425031662, -0.044465795159339905, 0.006530656013637781, -0.002990495413541794, -0.0024780218955129385, 0.012907725758850574, -0.009438815526664257, -0.03819048032164574, 0.052449628710746765, -0.060993492603302, 0.060722675174474716, 0.02915242686867714, 0.06614530086517334, -0.017078520730137825, -0.031633101403713226, -0.03454981744289398, -0.026847247034311295, -0.07086656242609024, -0.053758133202791214, 0.05570710450410843, -0.002167154336348176, -0.0047782547771930695, 0.034200988709926605, 0.039990805089473724, 0.0062051271088421345, 0.031079959124326706, 0.04448291286826134, -0.12036409974098206, 0.04005866497755051, -0.028151672333478928, -0.1191541850566864, -0.04449240118265152, 0.04647248238325119, -0.015772797167301178, -0.027357319369912148, 0.008856981061398983, -0.025545736774802208, -0.03012285940349102, -0.08841333538293839, -0.0278128981590271, -0.01041239034384489, -0.0380181260406971, -0.02593276835978031, 0.09387664496898651, 0.011728087440133095, -0.02547832950949669, 0.038805942982435226, -0.017640957608819008, 0.026252927258610725, -0.02319653332233429, -0.03646876662969589, 0.013006444089114666, 0.05978640541434288, 0.09794621169567108, 0.0356811061501503, -0.01779930852353573, 0.03207274526357651, 0.01329080481082201, -0.029264230281114578, -0.03396172821521759, 0.0349765345454216, -0.08004248887300491, -0.1394685059785843, -0.06334017217159271, -0.006971463095396757, 0.05274572595953941, -0.04362978786230087, 0.039892591536045074, -0.030503222718834877, -0.06514778733253479, -0.0005201867315918207, -0.05634421110153198, 0.027432642877101898, -0.029275404289364815, 0.03397649526596069, 0.08335458487272263, 0.004830983001738787, -0.012954779900610447, -0.08676080405712128, -0.0253829974681139, 0.027281619608402252, 0.025118671357631683, 0.05690548196434975, -0.012259121984243393, 0.04623614251613617, -0.1110588014125824, -0.023840976879000664, -4.5055835213354395e-33, -0.03401733562350273, -0.008002790622413158, -0.08258071541786194, 0.06263015419244766, 0.010691789910197258, -0.0008738518226891756, -0.057505808770656586, 0.008854924701154232, 0.06421975046396255, -0.03229661285877228, -0.04285775125026703, 0.05484974756836891, -0.04408678039908409, 0.0378221832215786, -0.002620319603011012, 0.012809461914002895, -0.04018189013004303, -0.06256382912397385, -0.034831032156944275, -0.05188947543501854, -0.00030971594969742, -0.022156627848744392, 0.04225391894578934, 0.0579594261944294, -0.034770771861076355, 0.04334826022386551, -0.04528331756591797, 0.01670547015964985, -0.02953786589205265, -0.06059250235557556, -0.009580756537616253, 0.02515401877462864, -0.04464116320014, 0.06388579308986664, 0.017896555364131927, -0.09662783890962601, 0.009360551834106445, 0.08789052814245224, 0.011274567805230618, 0.006439832970499992, 0.059373460710048676, 0.01670781895518303, -0.011564754880964756, -0.061490438878536224, 0.05892767384648323, -0.0018539191223680973, 0.006027210969477892, -0.011063281446695328, -0.006488196086138487, 0.03849396854639053, 0.01711704209446907, -0.011659595184028149, 0.04325982928276062, 0.03712822496891022, 0.05965520069003105, -0.006611092947423458, 0.0772537887096405, -0.07966592162847519, 0.06652364879846573, -0.03215625509619713, 0.011643667705357075, -0.08954514563083649, -0.04733319208025932, 0.0043250881135463715, 0.025213610380887985, -0.029106544330716133, -0.04640127345919609, -0.006842753849923611, 0.05304475128650665, 0.0012010481441393495, 0.016894904896616936, -0.003181647742167115, 0.03268999606370926, 0.010735230520367622, 0.11347001791000366, -0.03328106924891472, -0.04384639114141464, -0.018546827137470245, -0.024674925953149796, 0.07241158187389374, 0.04202546179294586, 0.08519763499498367, -0.06651273369789124, 0.03969181701540947, 0.09062498807907104, -0.022542940452694893, 0.013561670668423176, -0.07766159623861313, -0.01602010615170002, -0.024129820987582207, -0.002823090413585305, 0.02640290930867195, -0.20130890607833862, -0.027556871995329857, -0.0016259985277429223, -4.646215856496383e-8, -0.06588711589574814, -0.04422132670879364, -0.15027831494808197, 0.06296666711568832, 0.057706620544195175, -0.0314115434885025, -0.011747458949685097, -0.04959794133901596, 0.03593212738633156, 0.0025018274318426847, -0.035154715180397034, 0.004661191254854202, 0.02941894344985485, -0.06734131276607513, -0.005577755160629749, -0.030744601041078568, -0.010657744482159615, -0.04191040247678757, 0.0019303029403090477, -0.02085617557168007, 0.014745810069143772, -0.035104043781757355, -0.024066094309091568, 0.10065993666648865, 0.03076229803264141, -0.012577356770634651, 0.10768581926822662, -0.014279777184128761, -0.007216934114694595, 0.05343744531273842, -0.07186269760131836, 0.037122417241334915, 0.1024663895368576, 0.07273780554533005, -0.051991209387779236, 0.01990857534110546, 0.011901910416781902, 0.032605044543743134, -0.012165402993559837, 0.04832062870264053, 0.12583473324775696, 0.04364835098385811, -0.030322089791297913, 0.041455067694187164, -0.04361402988433838, -0.048934224992990494, 0.06257826089859009, 0.0582226924598217, 0.026125982403755188, 0.03262907639145851, 0.0150642991065979, 0.05186023563146591, -0.03188961371779442, 0.053685516119003296, -0.04649382084608078, -0.03162233904004097, 0.012560304254293442, -0.10608571022748947, -0.05080098286271095, 0.0120417270809412, 0.0809117928147316, 0.0284856129437685, 0.020232973620295525, 0.0015795085346326232 ]
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 have an existing active reader). During the async iteration, the {ReadableStream} will be locked. #### Transferring with `postMessage()` A {ReadableStream} instance can be transferred using a {MessagePort}. ```js const stream = new ReadableStream(getReadableSourceSomehow()); const { port1, port2 } = new MessageChannel(); port1.onmessage = ({ data }) => { data.getReader().read().then((chunk) => { console.log(chunk); }); }; port2.postMessage(stream, [stream]); ``` ### `ReadableStream.from(iterable)` \* `iterable` {Iterable} Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. A utility method that creates a new {ReadableStream} from an iterable. ```mjs import { ReadableStream } from 'node:stream/web'; async function\* asyncIterableGenerator() { yield 'a'; yield 'b'; yield 'c'; } const stream = ReadableStream.from(asyncIterableGenerator()); for await (const chunk of stream) console.log(chunk); // Prints: 'a', 'b', 'c' ``` ```cjs const { ReadableStream } = require('node:stream/web'); async function\* asyncIterableGenerator() { yield 'a'; yield 'b'; yield 'c'; } (async () => { const stream = ReadableStream.from(asyncIterableGenerator()); for await (const chunk of stream) console.log(chunk); // Prints: 'a', 'b', 'c' })(); ``` To pipe the resulting {ReadableStream} into a {WritableStream} the {Iterable} should yield a sequence of {Buffer}, {TypedArray}, or {DataView} objects. ```mjs import { ReadableStream } from 'node:stream/web'; import { Buffer } from 'node:buffer'; async function\* asyncIterableGenerator() { yield Buffer.from('a'); yield Buffer.from('b'); yield Buffer.from('c'); } const stream = ReadableStream.from(asyncIterableGenerator()); await stream.pipeTo(createWritableStreamSomehow()); ``` ```cjs const { ReadableStream } = require('node:stream/web'); const { Buffer } = require('node:buffer'); async function\* asyncIterableGenerator() { yield Buffer.from('a'); yield Buffer.from('b'); yield Buffer.from('c'); } const stream = ReadableStream.from(asyncIterableGenerator()); (async () => { await stream.pipeTo(createWritableStreamSomehow()); })(); ``` ### Class: `ReadableStreamDefaultReader` By default, calling `readableStream.getReader()` with no arguments will return an instance of `ReadableStreamDefaultReader`. The default reader treats the chunks of data passed through the stream as opaque values, which allows the {ReadableStream} to work with generally any JavaScript value. #### `new ReadableStreamDefaultReader(stream)` \* `stream` {ReadableStream} Creates a new {ReadableStreamDefaultReader} that is locked to the given {ReadableStream}. #### `readableStreamDefaultReader.cancel([reason])` \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. Cancels the {ReadableStream} and returns a promise that is fulfilled when the underlying stream has been canceled. #### `readableStreamDefaultReader.closed` \* Type: {Promise} Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing. #### `readableStreamDefaultReader.read()` \* Returns: A promise fulfilled with an object: \* `value` {any} \* `done` {boolean} Requests the next chunk of data from the underlying {ReadableStream} and returns a promise that is fulfilled with the data once it is available. #### `readableStreamDefaultReader.releaseLock()` Releases this reader's lock on the underlying {ReadableStream}. ### Class: `ReadableStreamBYOBReader` The `ReadableStreamBYOBReader` is an alternative consumer for byte-oriented {ReadableStream}s (those that are created with `underlyingSource.type` set equal to `'bytes'` when the `ReadableStream` was created). The `BYOB` is short for "bring your own buffer". This is a pattern that allows for more efficient reading of byte-oriented data that avoids extraneous copying. ```mjs import { open, } from 'node:fs/promises'; import { ReadableStream, } from 'node:stream/web'; import { Buffer } from 'node:buffer'; class Source { type = 'bytes'; autoAllocateChunkSize = 1024; async start(controller) { this.file = await open(new URL(import.meta.url)); this.controller = 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); } } const stream = new ReadableStream(new Source()); async function read(stream) { const reader = stream.getReader({ mode:
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.015788307413458824, -0.010516165755689144, -0.03013339638710022, 0.029111765325069427, -0.020672902464866638, -0.019918451085686684, -0.0030206702649593353, 0.05611303821206093, -0.028317177668213844, -0.00608081417158246, 0.00198826240375638, 0.0038914878387004137, 0.026787633076310158, -0.04132800176739693, -0.06024108827114105, -0.02432735078036785, -0.026937756687402725, -0.013350021094083786, -0.09702742844820023, -0.13706499338150024, 0.04619235917925835, -0.10114909708499908, 0.08879109472036362, 0.0312067661434412, -0.019363733008503914, -0.030448375269770622, -0.0021369317546486855, 0.08867732435464859, 0.06751465052366257, -0.13540315628051758, -0.022828569635748863, -0.011722837574779987, -0.04432514309883118, -0.05985720083117485, 0.040202297270298004, -0.030062051489949226, 0.02167065255343914, -0.09242500364780426, 0.016688067466020584, -0.07519301772117615, 0.10482341051101685, 0.004274064674973488, 0.01832512579858303, 0.012347638607025146, 0.04141748324036598, 0.0015759385423734784, 0.02444199100136757, 0.02880140021443367, -0.008576573804020882, 0.019174493849277496, -0.0006757205119356513, 0.028321897611021996, -0.06754924356937408, 0.020220400765538216, 0.08439585566520691, 0.036721158772706985, 0.04881329461932182, -0.024856891483068466, 0.009497962892055511, -0.013642027974128723, 0.024838261306285858, 0.013436153531074524, -0.03067675232887268, -0.08075271546840668, 0.0378272719681263, -0.0757390707731247, 0.07546941190958023, -0.011719764210283756, -0.07563542574644089, -0.0379086434841156, -0.020969998091459274, -0.07405752688646317, 0.07175012677907944, -0.02737974375486374, 0.03365066275000572, 0.010056821629405022, -0.04438405856490135, -0.08258911222219467, 0.039624955505132675, 0.018983902409672737, 0.08693955838680267, 0.003930986858904362, 0.023936986923217773, 0.022874662652611732, 0.09465417265892029, 0.00878299679607153, -0.03548794612288475, 0.06222866103053093, 0.03250734135508537, 0.047297392040491104, 0.06373333185911179, 0.01990577019751072, -0.11891704797744751, 0.030577410012483597, -0.04437324404716492, -0.005880957469344139, -0.021071061491966248, 0.01229067426174879, 0.11914874613285065, 0.012541621923446655, 0.048421986401081085, -0.04296989366412163, 0.06870119273662567, -0.038205716758966446, -0.003733208170160651, 0.05375027656555176, 0.06866762042045593, 0.05865878984332085, -0.049558740109205246, 0.05456433445215225, 0.01907612569630146, 0.07812563329935074, -0.008692285977303982, 0.05288233235478401, 1.0049601507252173e-33, -0.02917828969657421, -0.02738269791007042, -0.015293880365788937, 0.07411374896764755, 0.014535120688378811, 0.014535034075379372, 0.00586193660274148, -0.003736507147550583, -0.025964563712477684, -0.06134256348013878, -0.07277802377939224, -0.01591278240084648, -0.0020968466997146606, -0.033171720802783966, -0.012600701302289963, -0.057040024548769, 0.02578871138393879, -0.03200818970799446, 0.09974084794521332, 0.0419032908976078, 0.07203827798366547, -0.05074692517518997, -0.0009282557293772697, 0.0044673350639641285, 0.009028516709804535, -0.06686078011989594, -0.033085424453020096, -0.004055705387145281, 0.009400509297847748, 0.007888521999120712, 0.03108941949903965, 0.03770652785897255, -0.011559620499610901, 0.06663726270198822, 0.022175665944814682, -0.08144155144691467, -0.008855770342051983, -0.022767921909689903, -0.013032128103077412, -0.05948697030544281, -0.020433709025382996, -0.03681978955864906, -0.08765576034784317, 0.02039484493434429, -0.07514798641204834, -0.08538636565208435, -0.06080803647637367, -0.03033178113400936, -0.015522205270826817, -0.03751335293054581, -0.0005431588506326079, -0.015482021495699883, -0.013312075287103653, -0.05521925166249275, 0.03483918681740761, 0.018150074407458305, 0.02824036218225956, 0.009028851985931396, -0.04251958802342415, 0.10689027607440948, 0.008086387999355793, 0.026578256860375404, 0.04467987269163132, -0.02272075228393078, 0.08362778276205063, 0.04409532994031906, -0.053836576640605927, -0.02539529837667942, -0.010019921697676182, -0.10459239035844803, -0.09186442196369171, 0.00790347345173359, 0.011902529746294022, 0.02151479572057724, 0.01025550439953804, 0.045841898769140244, -0.04174994304776192, -0.0025587568525224924, -0.00780606921762228, -0.07554101943969727, 0.004619552753865719, -0.025850385427474976, -0.0569794625043869, 0.0799633264541626, 0.0012181660858914256, 0.0280150193721056, -0.03907351568341255, -0.04040132462978363, -0.029615797102451324, 0.08245424181222916, -0.04557251185178757, 0.029664436355233192, 0.07543430477380753, -0.08817435055971146, 0.04187100753188133, -2.9956200690729247e-33, -0.02238665334880352, -0.05082466080784798, -0.0509946271777153, 0.04469381645321846, 0.06584721803665161, 0.04623757302761078, 0.03748399391770363, 0.01801236905157566, -0.008923606015741825, 0.005785943008959293, -0.06772387772798538, 0.05811711400747299, -0.013899119570851326, 0.03170187026262283, -0.06513310223817825, -0.02201693132519722, 0.04878554120659828, -0.013585702516138554, -0.029740799218416214, -0.034767672419548035, 0.008008921518921852, -0.028837071731686592, 0.07614684104919434, 0.054637692868709564, -0.057996150106191635, 0.022950081154704094, -0.03306020423769951, 0.017071092501282692, -0.02089313417673111, -0.07217617332935333, 0.05451292172074318, -0.0023715151473879814, 0.07717037945985794, -0.006393107585608959, -0.009726796299219131, -0.012180414982140064, 0.038499876856803894, 0.07153116166591644, 0.02265096828341484, 0.05114688724279404, 0.10535408556461334, -0.019247926771640778, -0.05648152902722359, -0.07137458771467209, 0.04753878712654114, 0.0276984553784132, -0.09497588872909546, 0.04087817668914795, -0.06256912648677826, 0.03516567498445511, 0.0016261712880805135, -0.01026191096752882, -0.004872876685112715, 0.03298201411962509, 0.054897088557481766, -0.001999071566388011, 0.12223165482282639, -0.01846696250140667, 0.09307859092950821, -0.011842300184071064, 0.01999494805932045, -0.11019902676343918, 0.008136266842484474, -0.04648314416408539, 0.1082758754491806, -0.03600633516907692, 0.019803838804364204, -0.008931143209338188, 0.056189414113759995, 0.08724276721477509, 0.012265842407941818, 0.0240143034607172, -0.026359574869275093, 0.041529249399900436, 0.1098136305809021, -0.03701406344771385, -0.1130734533071518, -0.09964904189109802, -0.0011186471674591303, -0.004552571102976799, -0.02688322402536869, 0.0513712614774704, -0.030463047325611115, 0.05232217535376549, 0.11719633638858795, 0.012026519514620304, 0.07439915835857391, -0.03583643212914467, -0.01544815395027399, -0.06582530587911606, -0.005188982933759689, -0.004420342389494181, -0.10872296243906021, -0.04546036571264267, -0.013094010762870312, -4.7571823813541414e-8, -0.04523981362581253, -0.0313483327627182, -0.06154227629303932, 0.03897688165307045, 0.02660188265144825, -0.034483157098293304, -0.07011638581752777, -0.0287771113216877, 0.15722672641277313, -0.009337171912193298, -0.0835549533367157, 0.018405731767416, 0.09643304347991943, -0.03810300678014755, -0.022779470309615135, -0.04922034591436386, 0.04376586154103279, -0.09127461165189743, 0.009714534506201744, -0.04326046258211136, 0.0728694424033165, -0.02257767878472805, -0.048001501709222794, 0.0928204357624054, 0.05096665769815445, -0.013815926387906075, 0.1354840099811554, 0.022629952058196068, 0.02293606847524643, -0.07723671197891235, -0.07273425161838531, -0.011242160573601723, 0.07914096862077713, 0.0460539311170578, -0.06190316751599312, 0.009750190190970898, 0.04538751393556595, -0.00393278943374753, 0.06120236963033676, 0.04438956454396248, 0.10043061524629593, -0.003108084434643388, -0.07870260626077652, 0.035569824278354645, 0.03376156464219093, 0.03721653297543526, 0.025037823244929314, 0.01641756109893322, -0.03130986914038658, 0.09364071488380432, -0.009429940022528172, 0.007718469016253948, 0.00867026299238205, 0.010029006749391556, -0.04846091568470001, -0.10880649089813232, -0.03638773038983345, -0.07883886992931366, 0.026981746777892113, 0.036170247942209244, 0.050873830914497375, 0.05971022695302963, -0.00013977331400383264, -0.008174714632332325 ]
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); } } const stream = new ReadableStream(new Source()); async function read(stream) { const reader = stream.getReader({ mode: 'byob' }); const chunks = []; let result; do { result = await reader.read(Buffer.alloc(100)); if (result.value !== undefined) chunks.push(Buffer.from(result.value)); } while (!result.done); return Buffer.concat(chunks); } const data = await read(stream); console.log(Buffer.from(data).toString()); ``` #### `new ReadableStreamBYOBReader(stream)` \* `stream` {ReadableStream} Creates a new `ReadableStreamBYOBReader` that is locked to the given {ReadableStream}. #### `readableStreamBYOBReader.cancel([reason])` \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. Cancels the {ReadableStream} and returns a promise that is fulfilled when the underlying stream has been canceled. #### `readableStreamBYOBReader.closed` \* Type: {Promise} Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing. #### `readableStreamBYOBReader.read(view[, options])` \* `view` {Buffer|TypedArray|DataView} \* `options` {Object} \* `min` {number} When set, the returned promise will only be fulfilled as soon as `min` number of elements are available. When not set, the promise fulfills when at least one element is available. \* Returns: A promise fulfilled with an object: \* `value` {TypedArray|DataView} \* `done` {boolean} Requests the next chunk of data from the underlying {ReadableStream} and returns a promise that is fulfilled with the data once it is available. Do not pass a pooled {Buffer} object instance in to this method. Pooled `Buffer` objects are created using `Buffer.allocUnsafe()`, or `Buffer.from()`, or are often returned by various `node:fs` module callbacks. These types of `Buffer`s use a shared underlying {ArrayBuffer} object that contains all of the data from all of the pooled `Buffer` instances. When a `Buffer`, {TypedArray}, or {DataView} is passed in to `readableStreamBYOBReader.read()`, the view's underlying `ArrayBuffer` is \_detached\_, invalidating all existing views that may exist on that `ArrayBuffer`. This can have disastrous consequences for your application. #### `readableStreamBYOBReader.releaseLock()` Releases this reader's lock on the underlying {ReadableStream}. ### Class: `ReadableStreamDefaultController` Every {ReadableStream} has a controller that is responsible for the internal state and management of the stream's queue. The `ReadableStreamDefaultController` is the default controller implementation for `ReadableStream`s that are not byte-oriented. #### `readableStreamDefaultController.close()` Closes the {ReadableStream} to which this controller is associated. #### `readableStreamDefaultController.desiredSize` \* Type: {number} Returns the amount of data remaining to fill the {ReadableStream}'s queue. #### `readableStreamDefaultController.enqueue([chunk])` \* `chunk` {any} Appends a new chunk of data to the {ReadableStream}'s queue. #### `readableStreamDefaultController.error([error])` \* `error` {any} Signals an error that causes the {ReadableStream} to error and close. ### Class: `ReadableByteStreamController` Every {ReadableStream} has a controller that is responsible for the internal state and management of the stream's queue. The `ReadableByteStreamController` is for byte-oriented `ReadableStream`s. #### `readableByteStreamController.byobRequest` \* Type: {ReadableStreamBYOBRequest} #### `readableByteStreamController.close()` Closes the {ReadableStream} to which this controller is associated. #### `readableByteStreamController.desiredSize` \* Type: {number} Returns the amount of data remaining to fill the {ReadableStream}'s queue. #### `readableByteStreamController.enqueue(chunk)` \* `chunk` {Buffer|TypedArray|DataView} Appends a new chunk of data to the {ReadableStream}'s queue. #### `readableByteStreamController.error([error])` \* `error` {any} Signals an error that causes the {ReadableStream} to error and close. ### Class: `ReadableStreamBYOBRequest` When using `ReadableByteStreamController` in byte-oriented streams, and when using the `ReadableStreamBYOBReader`, the `readableByteStreamController.byobRequest` property provides access to a `ReadableStreamBYOBRequest` instance that represents the current read request. The 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 been written to `readableStreamBYOBRequest.view`. #### `readableStreamBYOBRequest.respondWithNewView(view)` \*
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.018675513565540314, -0.062316156923770905, -0.0054650334641337395, -0.04558194801211357, 0.019985975697636604, -0.06991574913263321, 0.005131748970597982, 0.06831130385398865, 0.02219121716916561, -0.009322438389062881, -0.014385874383151531, 0.01859654299914837, 0.03860096633434296, -0.05156935006380081, -0.08595432341098785, -0.006640590261667967, -0.017518283799290657, 0.07269065082073212, -0.08730413764715195, -0.07670360803604126, -0.022233761847019196, -0.02872927486896515, 0.0007005457300692797, -0.024806737899780273, -0.08233534544706345, -0.014520028606057167, -0.0007978029898367822, 0.08885696530342102, 0.10038543492555618, -0.08475272357463837, 0.010904904454946518, 0.0738372877240181, 0.010270103812217712, -0.04056060314178467, 0.01594301126897335, 0.03159259259700775, 0.01168286707252264, -0.10779932886362076, 0.05893746763467789, -0.11037412285804749, 0.08080334961414337, 0.01245660800486803, -0.046922508627176285, 0.0032413052394986153, 0.020239170640707016, -0.055857736617326736, 0.041919250041246414, -0.027445470914244652, -0.057017311453819275, 0.019240498542785645, 0.021163085475564003, 0.07974640280008316, -0.004136865492910147, 0.005540584214031696, 0.07879451662302017, 0.048005588352680206, -0.03387628495693207, -0.01726653426885605, 0.046600278466939926, 0.01868397183716297, 0.03395092114806175, -0.055260833352804184, -0.10467246174812317, 0.015917105600237846, 0.06570560485124588, -0.03632053732872009, 0.01243746466934681, -0.07030203938484192, -0.041027721017599106, 0.032616037875413895, -0.026369770988821983, -0.03434790298342705, 0.06418550759553909, 0.003846728941425681, 0.05321132019162178, -0.04366118088364601, -0.009512453339993954, -0.08831474930047989, 0.07686461508274078, -0.05793483927845955, 0.07102756202220917, 0.003311899257823825, 0.06607060134410858, 0.05745817348361015, 0.0036646921653300524, 0.017153771594166756, -0.009956585243344307, -0.03998418524861336, 0.06301409751176834, -0.016401605680584908, 0.002119816141203046, -0.033578552305698395, -0.1170152798295021, 0.06509784609079361, 0.06744526326656342, -0.050945863127708435, -0.009766435250639915, 0.01771572045981884, 0.05262147635221481, -0.003281096462160349, 0.0180048830807209, 0.05050361528992653, -0.08222348242998123, 0.0058627440594136715, -0.01827576570212841, 0.009074641391634941, 0.07133705914020538, 0.09522693604230881, -0.02986805886030197, -0.06708414107561111, 0.04441767558455467, 0.1118202656507492, -0.01101118978112936, 0.08827896416187286, 3.894782697652763e-33, -0.01912357285618782, -0.04187959060072899, 0.03254951164126396, 0.08498825877904892, -0.012589584104716778, -0.00908269640058279, 0.04522803798317909, -0.029979590326547623, -0.09891078621149063, -0.021451717242598534, -0.04753439873456955, -0.07080807536840439, 0.03352309763431549, -0.011386655271053314, -0.03128287196159363, -0.08809641003608704, 0.037332963198423386, -0.0480974055826664, 0.032112013548612595, 0.040015559643507004, 0.023338140919804573, -0.005904949735850096, -0.02311721071600914, -0.02484368532896042, -0.05037114769220352, -0.0723457783460617, -0.0255314689129591, 0.050449445843696594, -0.07711120694875717, -0.014207731932401657, 0.08902383595705032, -0.010625825263559818, -0.04317494481801987, -0.019371358677744865, 0.05986954644322395, -0.10854212939739227, 0.025836816057562828, 0.024831628426909447, -0.10891246050596237, 0.0026120138354599476, 0.03817852586507797, -0.010472613386809826, -0.0457552969455719, 0.018546858802437782, -0.06758120656013489, -0.07083197683095932, 0.013694753870368004, -0.026496851816773415, -0.0618758387863636, -0.026247384026646614, 0.03703524172306061, 0.05825792998075485, 0.010869086720049381, -0.0009075766429305077, 0.046002671122550964, -0.048846304416656494, 0.0036687804386019707, 0.0040093716233968735, -0.017733611166477203, 0.07766350358724594, 0.033408235758543015, -0.006239308975636959, 0.02012384869158268, 0.018601389601826668, -0.0012104493798688054, -0.013123453594744205, 0.030598293989896774, -0.015455363318324089, 0.014602585695683956, -0.06845972687005997, -0.07014693319797516, -0.08077339082956314, 0.08384926617145538, -0.048678867518901825, -0.02838394232094288, 0.0550115667283535, -0.08672183752059937, -0.016073379665613174, 0.009220657870173454, -0.08623642474412918, 0.011298992671072483, 0.038721565157175064, 0.03468279168009758, 0.019658556208014488, -0.0002881153195630759, 0.07710499316453934, -0.030246231704950333, -0.08570826798677444, 0.05565422773361206, 0.002437813440337777, -0.07383228093385696, -0.035289425402879715, 0.05466432124376297, -0.1533813327550888, 0.08356326818466187, -3.6140030149893974e-33, 0.08179785311222076, -0.016898291185498238, -0.01701463758945465, -0.009014429524540901, 0.05946565046906471, 0.02738182432949543, 0.013066592626273632, 0.09587188810110092, 0.03323994576931, 0.01878361962735653, -0.03461451828479767, 0.02856428176164627, -0.04030410945415497, 0.02502497285604477, -0.03738142177462578, -0.012608402408659458, 0.0909271240234375, -0.09561998397111893, 0.03836968168616295, -0.05092350393533707, 0.024786844849586487, -0.05074124038219452, 0.10206082463264465, 0.0014681979082524776, -0.031452592462301254, 0.076909139752388, -0.015882322564721107, 0.019246287643909454, -0.007021705154329538, -0.05074569582939148, -0.0272917989641428, -0.05594900622963905, 0.007489121053367853, -0.043294571340084076, 0.02777007594704628, -0.0129555594176054, 0.03816760703921318, 0.0629621148109436, -0.0526699498295784, 0.04121973738074303, 0.03304461017251015, -0.03861342743039131, 0.0060462127439677715, -0.06668632477521896, 0.07918351888656616, -0.05050230398774147, 0.0205059926956892, 0.06528520584106445, -0.036970142275094986, 0.016311155632138252, 0.022283852100372314, 0.008094299584627151, -0.028006747364997864, 0.03142527863383293, 0.04934309795498848, 0.015638042241334915, 0.05993415787816048, -0.08656395971775055, 0.0902278870344162, -0.030441073700785637, 0.006032791920006275, -0.06068217009305954, 0.005767356138676405, -0.05384928733110428, 0.0779728963971138, 0.021855730563402176, 0.0559195950627327, -0.022196738049387932, 0.033831022679805756, 0.05816102400422096, -0.05958205834031105, -0.019056979566812515, 0.029010072350502014, 0.01898655854165554, 0.08983588963747025, -0.028860514983534813, -0.07015881687402725, -0.03975469991564751, 0.042709238827228546, 0.08759354054927826, 0.003931577783077955, 0.037053462117910385, -0.023997200652956963, 0.1205422431230545, 0.1265503317117691, 0.052120741456747055, -0.021671267226338387, -0.03719251602888107, -0.013676146045327187, -0.049986738711595535, -0.0062064179219305515, -0.0030115381814539433, 0.007037023082375526, 0.005077057052403688, 0.022791121155023575, -4.9292108172949156e-8, -0.0636504665017128, -0.06091608107089996, -0.050098687410354614, 0.08695104718208313, 0.025560222566127777, -0.00882643274962902, -0.08367662131786346, -0.05649633705615997, 0.0709948018193245, -0.03607412800192833, 0.04252726584672928, -0.05172983929514885, 0.03926391899585724, -0.010626859031617641, 0.03112323209643364, -0.05558176711201668, 0.08235080540180206, -0.10193759948015213, -0.011903277598321438, -0.028559979051351547, 0.06270773708820343, -0.0046665905974805355, 0.008073787204921246, 0.010627247393131256, 0.08177311718463898, 0.014550209045410156, 0.04065375402569771, 0.03719928115606308, 0.015032781288027763, -0.062003981322050095, -0.022715101018548012, 0.03397174924612045, 0.07290490716695786, 0.050211429595947266, 0.02415148913860321, -0.0009936485439538956, 0.0844736248254776, 0.04116426408290863, 0.020784545689821243, 0.0420803464949131, 0.0892634466290474, 0.015426837839186192, 0.053690288215875626, 0.07926300913095474, 0.00459743058308959, -0.04443788528442383, 0.0003235273761674762, 0.02193932980298996, -0.010811911895871162, 0.022333087399601936, -0.01108983252197504, -0.01907036080956459, -0.034984663128852844, 0.06918590515851974, -0.06301479786634445, -0.11833100020885468, 0.022339798510074615, -0.1056695282459259, -0.05990230664610863, 0.07935678213834763, 0.06252112239599228, 0.006970289628952742, -0.06050655245780945, 0.027177494019269943 ]
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 been written to `readableStreamBYOBRequest.view`. #### `readableStreamBYOBRequest.respondWithNewView(view)` \* `view` {Buffer|TypedArray|DataView} Signals that the request has been fulfilled with bytes written to a new `Buffer`, `TypedArray`, or `DataView`. #### `readableStreamBYOBRequest.view` \* Type: {Buffer|TypedArray|DataView} ### Class: `WritableStream` The `WritableStream` is a destination to which stream data is sent. ```mjs import { WritableStream, } from 'node:stream/web'; const stream = new WritableStream({ write(chunk) { console.log(chunk); }, }); await stream.getWriter().write('Hello World'); ``` #### `new WritableStream([underlyingSink[, strategy]])` \* `underlyingSink` {Object} \* `start` {Function} A user-defined function that is invoked immediately when the `WritableStream` is created. \* `controller` {WritableStreamDefaultController} \* Returns: `undefined` or a promise fulfilled with `undefined`. \* `write` {Function} A user-defined function that is invoked when a chunk of data has been written to the `WritableStream`. \* `chunk` {any} \* `controller` {WritableStreamDefaultController} \* Returns: A promise fulfilled with `undefined`. \* `close` {Function} A user-defined function that is called when the `WritableStream` is closed. \* Returns: A promise fulfilled with `undefined`. \* `abort` {Function} A user-defined function that is called to abruptly close the `WritableStream`. \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. \* `type` {any} The `type` option is reserved for future use and \_must\_ be undefined. \* `strategy` {Object} \* `highWaterMark` {number} The maximum internal queue size before backpressure is applied. \* `size` {Function} A user-defined function used to identify the size of each chunk of data. \* `chunk` {any} \* Returns: {number} #### `writableStream.abort([reason])` \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. Abruptly terminates the `WritableStream`. All queued writes will be canceled with their associated promises rejected. #### `writableStream.close()` \* Returns: A promise fulfilled with `undefined`. Closes the `WritableStream` when no additional writes are expected. #### `writableStream.getWriter()` \* Returns: {WritableStreamDefaultWriter} Creates and returns a new writer instance that can be used to write data into the `WritableStream`. #### `writableStream.locked` \* Type: {boolean} The `writableStream.locked` property is `false` by default, and is switched to `true` while there is an active writer attached to this `WritableStream`. #### Transferring with postMessage() A {WritableStream} instance can be transferred using a {MessagePort}. ```js const stream = new WritableStream(getWritableSinkSomehow()); const { port1, port2 } = new MessageChannel(); port1.onmessage = ({ data }) => { data.getWriter().write('hello'); }; port2.postMessage(stream, [stream]); ``` ### Class: `WritableStreamDefaultWriter` #### `new WritableStreamDefaultWriter(stream)` \* `stream` {WritableStream} Creates a new `WritableStreamDefaultWriter` that is locked to the given `WritableStream`. #### `writableStreamDefaultWriter.abort([reason])` \* `reason` {any} \* Returns: A promise fulfilled with `undefined`. Abruptly terminates the `WritableStream`. All queued writes will be canceled with their associated promises rejected. #### `writableStreamDefaultWriter.close()` \* Returns: A promise fulfilled with `undefined`. Closes the `WritableStream` when no additional writes are expected. #### `writableStreamDefaultWriter.closed` \* Type: {Promise} Fulfilled with `undefined` when the associated {WritableStream} is closed or rejected if the stream errors or the writer's lock is released before the stream finishes closing. #### `writableStreamDefaultWriter.desiredSize` \* Type: {number} The amount of data required to fill the {WritableStream}'s queue. #### `writableStreamDefaultWriter.ready` \* Type: {Promise} Fulfilled with `undefined` when the writer is ready to be used. #### `writableStreamDefaultWriter.releaseLock()` Releases this writer's lock on the underlying {ReadableStream}. #### `writableStreamDefaultWriter.write([chunk])` \* `chunk` {any} \* Returns: 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 to signal that an error has occurred while processing the `WritableStream` data. When called, the {WritableStream} will
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.011657706461846828, -0.030159730464220047, -0.03262091800570488, -0.0016338732093572617, -0.04135546833276749, -0.02391992136836052, -0.0006566242664121091, 0.09887290000915527, -0.014152186922729015, -0.01948031596839428, -0.051827169954776764, -0.013268114998936653, 0.04100309684872627, 0.00827622227370739, -0.02792440913617611, 0.06379874050617218, -0.018578479066491127, 0.0005446421564556658, 0.002690765541046858, -0.058060310781002045, 0.07110542058944702, -0.10306315124034882, 0.05943571776151657, 0.017930803820490837, -0.10685864090919495, -0.07313480973243713, -0.017907990142703056, 0.06463244557380676, 0.08309046924114227, -0.10931362956762314, 0.012867754325270653, -0.055206362158060074, 0.03208464756608009, -0.030484480783343315, -0.02771778032183647, -0.07867252081632614, -0.024335987865924835, -0.08894608169794083, 0.037412311881780624, -0.10150591284036636, 0.09034418314695358, 0.04210064187645912, -0.03791647031903267, -0.014804010279476643, 0.0463249497115612, -0.0014772496651858091, -0.0195341557264328, -0.04878973215818405, -0.02044738456606865, 0.11168628185987473, 0.031916841864585876, -0.004231349099427462, -0.05578162148594856, -0.0005266849766485393, 0.08487942069768906, 0.06530135869979858, -0.06258099526166916, 0.004684473853558302, 0.049564119428396225, -0.059792909771203995, -0.010922474786639214, -0.022401640191674232, -0.11632420122623444, 0.04659441113471985, 0.002850027522072196, -0.011767554096877575, 0.03452279418706894, -0.049261633306741714, -0.021881593391299248, -0.01605008728802204, 0.06724660843610764, -0.007722130976617336, 0.05339180678129196, -0.028312960639595985, 0.04243410751223564, -0.008236574940383434, 0.052933454513549805, -0.06794361025094986, -0.0006231932202354074, -0.03510724753141403, 0.10258769243955612, -0.04195469990372658, 0.030775241553783417, 0.07079564034938812, 0.002270587021484971, -0.031580742448568344, 0.012326827272772789, 0.03669792786240578, 0.0887596383690834, 0.028915327042341232, 0.02172437310218811, -0.00007761037704767659, -0.06690792739391327, 0.028481539338827133, 0.02144651487469673, -0.03112223371863365, 0.0017647546483203769, -0.005759100429713726, 0.042367491871118546, -0.020636532455682755, 0.035400476306676865, -0.05328240618109703, -0.05328809842467308, -0.03670520707964897, 0.0283562783151865, -0.0003736984799616039, 0.08606144040822983, 0.041488904505968094, -0.03860502690076828, -0.027679186314344406, -0.018949465826153755, 0.08580078929662704, -0.07104162871837616, 0.02214951626956463, 3.6920286565771345e-33, 0.016969827935099602, -0.06139232590794563, -0.03735363483428955, 0.047210514545440674, 0.01506583858281374, 0.022464517503976822, 0.056658726185560226, 0.066422238945961, -0.04357481375336647, -0.05227264016866684, -0.062270164489746094, -0.006615851540118456, 0.03454672917723656, 0.07648684084415436, 0.02029264159500599, 0.023604024201631546, -0.009139987640082836, -0.009021416306495667, 0.008892069570720196, 0.07141317427158356, 0.04957956820726395, 0.04997135326266289, -0.003981876652687788, -0.04285971447825432, -0.06997904181480408, -0.0037592709995806217, -0.05254676938056946, -0.021212153136730194, -0.04918123781681061, 0.015835238620638847, -0.008807414211332798, -0.0029079720843583345, -0.022563518956303596, -0.028315715491771698, 0.04854724928736687, -0.10683097690343857, 0.06368935108184814, -0.022647874429821968, -0.1048099547624588, -0.10045779496431351, 0.013643286190927029, 0.006677417550235987, -0.028376799076795578, -0.030711369588971138, -0.09441383183002472, -0.08614280819892883, -0.06668383628129959, 0.017747702077031136, -0.022913021966814995, 0.023502754047513008, -0.0408993698656559, 0.007393354550004005, 0.06455370783805847, -0.033453308045864105, -0.045046616345644, -0.016656337305903435, 0.009883209131658077, -0.011104482226073742, -0.022398686036467552, 0.024506529793143272, 0.01506403274834156, 0.05903629586100578, 0.06474580615758896, 0.03264966607093811, 0.01258903369307518, 0.025785911828279495, 0.015642479062080383, 0.0019910151604562998, 0.05984855443239212, -0.0514509491622448, -0.08292526751756668, 0.028185514733195305, -0.017547808587551117, 0.04352552443742752, -0.054629337042570114, 0.01968209631741047, -0.05050746351480484, -0.06562827527523041, 0.004583748988807201, -0.008577072992920876, 0.0670444667339325, -0.040831223130226135, 0.010116017423570156, 0.01083468459546566, -0.044398240745067596, 0.03569812700152397, 0.003878777613863349, -0.11811364442110062, 0.005126310978084803, -0.01092301681637764, -0.024520590901374817, -0.049768779426813126, -0.012229088693857193, -0.15894044935703278, -0.04529103264212608, -7.2748127456606e-33, 0.04158775880932808, 0.029362021014094353, -0.10833481699228287, 0.03183939680457115, -0.0182199664413929, -0.023134717717766762, -0.014317517168819904, 0.046123482286930084, 0.006406072061508894, -0.03336164727807045, -0.06763369590044022, 0.05532360449433327, 0.012452937662601471, -0.003826666623353958, -0.03291281685233116, -0.03389531746506691, -0.057369690388441086, -0.08484359085559845, -0.055119216442108154, -0.11441449820995331, -0.06992511451244354, -0.025445451959967613, 0.07903888076543808, -0.0014562056167051196, -0.04190722107887268, 0.024579349905252457, -0.050463732331991196, 0.03471996635198593, -0.003492786316201091, -0.022688081488013268, -0.002399735851213336, -0.03708421066403389, -0.05409223958849907, -0.024537067860364914, -0.0029092824552208185, -0.005167743656784296, 0.09107781201601028, 0.06426982581615448, -0.01060494128614664, 0.01335956808179617, 0.13947834074497223, 0.042114969342947006, 0.03982068970799446, 0.01560311857610941, 0.02754986099898815, 0.0055747064761817455, -0.05132376030087471, 0.08512658625841141, 0.024210847914218903, -0.04701009392738342, 0.03443486616015434, -0.0152470413595438, 0.028351373970508575, 0.04940976947546005, 0.023898905143141747, 0.050998982042074203, 0.060276471078395844, -0.05764221400022507, 0.09704698622226715, 0.014481775462627411, 0.0038649635389447212, -0.08050817251205444, -0.0515468530356884, 0.007079493720084429, -0.0034661665558815002, -0.03212069720029831, -0.010589530691504478, -0.08059268444776535, 0.053315501660108566, -0.011080644093453884, 0.009288886561989784, -0.0008524909499101341, 0.024529466405510902, 0.012016264721751213, 0.07926862686872482, 0.01538732461631298, -0.06611938774585724, -0.045285359025001526, 0.004453607369214296, 0.09668483585119247, 0.013364813290536404, 0.034909773617982864, -0.014478384517133236, 0.08990355581045151, 0.09028220921754837, -0.05034177750349045, 0.02053103782236576, -0.03977055475115776, -0.07002129405736923, -0.05224861204624176, -0.016424551606178284, 0.07764697819948196, -0.1396157294511795, -0.0031726397573947906, -0.026192069053649902, -4.9086203546266916e-8, -0.06815483421087265, -0.07000530511140823, -0.06842715293169022, 0.09011141210794449, 0.03447173163294792, -0.022357888519763947, -0.03988135978579521, -0.025341158732771873, 0.08171778172254562, -0.05805402621626854, 0.0546124167740345, -0.05497292801737785, -0.024644633755087852, -0.05246831104159355, 0.0697396919131279, 0.0144876129925251, 0.018687961623072624, -0.0984545350074768, -0.05768166109919548, -0.00783800520002842, 0.04648546874523163, -0.12522763013839722, -0.07254853844642639, 0.04443664103746414, 0.0652427077293396, 0.018924763426184654, 0.06418071687221527, 0.07222187519073486, -0.049052972346544266, 0.012069670483469963, -0.017767809331417084, 0.060375750064849854, 0.11194369196891785, 0.10135231912136078, 0.020784953609108925, 0.03302565589547157, 0.014468558132648468, 0.021709322929382324, -0.005097680259495974, 0.06140682101249695, 0.06883196532726288, 0.01162554882466793, -0.011924645863473415, 0.06598848849534988, 0.03817719966173172, 0.005685569252818823, 0.001967471092939377, 0.04893059656023979, -0.023893993347883224, 0.03166060149669647, 0.03663470596075058, 0.016346214339137077, -0.024519305676221848, 0.033302582800388336, -0.08058148622512817, -0.04926031455397606, -0.011361329816281796, -0.07583523541688919, -0.035849954932928085, 0.0238446407020092, 0.06739053130149841, 0.14243198931217194, 0.01063540205359459, -0.0424797460436821 ]
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 to signal that an error has occurred while processing the `WritableStream` data. When called, the {WritableStream} will be aborted, with currently pending writes canceled. #### `writableStreamDefaultController.signal` \* Type: {AbortSignal} An `AbortSignal` that can be used to cancel pending write or close operations when a {WritableStream} is aborted. ### Class: `TransformStream` A `TransformStream` consists of a {ReadableStream} and a {WritableStream} that are connected such that the data written to the `WritableStream` is received, and potentially transformed, before being pushed into the `ReadableStream`'s queue. ```mjs import { TransformStream, } from 'node:stream/web'; const transform = new TransformStream({ transform(chunk, controller) { controller.enqueue(chunk.toUpperCase()); }, }); await Promise.all([ transform.writable.getWriter().write('A'), transform.readable.getReader().read(), ]); ``` #### `new TransformStream([transformer[, writableStrategy[, readableStrategy]]])` \* `transformer` {Object} \* `start` {Function} A user-defined function that is invoked immediately when the `TransformStream` is created. \* `controller` {TransformStreamDefaultController} \* Returns: `undefined` or a promise fulfilled with `undefined` \* `transform` {Function} A user-defined function that receives, and potentially modifies, a chunk of data written to `transformStream.writable`, before forwarding that on to `transformStream.readable`. \* `chunk` {any} \* `controller` {TransformStreamDefaultController} \* Returns: A promise fulfilled with `undefined`. \* `flush` {Function} A user-defined function that is called immediately before the writable side of the `TransformStream` is closed, signaling the end of the transformation process. \* `controller` {TransformStreamDefaultController} \* Returns: A promise fulfilled with `undefined`. \* `readableType` {any} the `readableType` option is reserved for future use and \_must\_ be `undefined`. \* `writableType` {any} the `writableType` option is reserved for future use and \_must\_ be `undefined`. \* `writableStrategy` {Object} \* `highWaterMark` {number} The maximum internal queue size before backpressure is applied. \* `size` {Function} A user-defined function used to identify the size of each chunk of data. \* `chunk` {any} \* Returns: {number} \* `readableStrategy` {Object} \* `highWaterMark` {number} The maximum internal queue size before backpressure is applied. \* `size` {Function} A user-defined function used to identify the size of each chunk of data. \* `chunk` {any} \* Returns: {number} #### `transformStream.readable` \* Type: {ReadableStream} #### `transformStream.writable` \* Type: {WritableStream} #### Transferring with postMessage() A {TransformStream} instance can be transferred using a {MessagePort}. ```js const stream = new TransformStream(); const { port1, port2 } = new MessageChannel(); port1.onmessage = ({ data }) => { const { writable, readable } = data; // ... }; port2.postMessage(stream, [stream]); ``` ### Class: `TransformStreamDefaultController` The `TransformStreamDefaultController` manages the internal state of the `TransformStream`. #### `transformStreamDefaultController.desiredSize` \* Type: {number} The amount of data required to fill the readable side's queue. #### `transformStreamDefaultController.enqueue([chunk])` \* `chunk` {any} Appends a chunk of data to the readable side's queue. #### `transformStreamDefaultController.error([reason])` \* `reason` {any} Signals to both the readable and writable side that an error has occurred while processing the transform data, causing both sides to be abruptly closed. #### `transformStreamDefaultController.terminate()` Closes the readable side of the transport and causes the writable side to be abruptly closed with an error. ### Class: `ByteLengthQueuingStrategy` #### `new ByteLengthQueuingStrategy(init)` \* `init` {Object} \* `highWaterMark` {number} #### `byteLengthQueuingStrategy.highWaterMark` \* Type: {number} #### `byteLengthQueuingStrategy.size` \* Type: {Function} \* `chunk` {any} \* Returns: {number} ### Class: `CountQueuingStrategy` #### `new CountQueuingStrategy(init)` \* `init` {Object} \* `highWaterMark` {number} #### `countQueuingStrategy.highWaterMark` \* Type: {number} #### `countQueuingStrategy.size` \* 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: {ReadableStream} #### `textEncoderStream.writable` \* Type: {WritableStream} ### Class: `TextDecoderStream` #### `new TextDecoderStream([encoding[, options]])` \* `encoding`
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.005283480044454336, -0.04347977787256241, -0.04576725512742996, -0.06649981439113617, -0.030481455847620964, -0.07181725651025772, 0.0031841015443205833, 0.14896810054779053, 0.050905827432870865, -0.03212898224592209, 0.08403023332357407, 0.007788949646055698, 0.00656026229262352, -0.0738382413983345, -0.08238756656646729, 0.016345273703336716, -0.015708090737462044, -0.02863207459449768, -0.024005001410841942, -0.09641125053167343, -0.0365973524749279, -0.031516287475824356, 0.07113927602767944, 0.015160652808845043, -0.09190519899129868, -0.02803785353899002, -0.051847681403160095, 0.14641490578651428, 0.04666869342327118, -0.09754229336977005, 0.01865396648645401, -0.024308182299137115, 0.002471787156537175, -0.003098307177424431, -0.032657504081726074, -0.12525823712348938, 0.03504880517721176, -0.053960468620061874, 0.05361050367355347, -0.05466531589627266, 0.0901559442281723, 0.036145374178886414, -0.01872653141617775, -0.015752166509628296, 0.007383448071777821, 0.0013221605913713574, 0.004037489648908377, -0.02179792709648609, 0.00014652572281192988, 0.02481788769364357, 0.0053972783498466015, 0.00965635385364294, -0.023053782060742378, 0.06633567810058594, 0.0361250638961792, 0.0857149288058281, 0.01725602149963379, 0.04039204493165016, -0.006245166528970003, -0.042412541806697845, 0.03935989737510681, -0.00009499303996562958, -0.06044824793934822, 0.002382629318162799, -0.013738722540438175, -0.032266344875097275, 0.019342195242643356, -0.04169860854744911, -0.09525631368160248, 0.024817369878292084, -0.0024542410392314196, -0.021686764433979988, 0.05105327069759369, -0.0015027417102828622, -0.016736630350351334, 0.060591768473386765, -0.015271930024027824, -0.1008680909872055, -0.010700364597141743, 0.014484706334769726, 0.039705611765384674, 0.020308496430516243, -0.021387742832303047, 0.056511640548706055, -0.03819314390420914, -0.07312256842851639, 0.0023728387895971537, 0.002788451500236988, 0.0794445276260376, 0.05784280225634575, -0.04317645728588104, 0.00786434207111597, -0.052724648267030716, -0.0292464941740036, 0.01885819062590599, -0.07925048470497131, -0.06226896494626999, -0.0005179750151000917, -0.005659951362758875, 0.0627734512090683, -0.002852236619219184, 0.0516139417886734, 0.026193831115961075, -0.05844792351126671, 0.02601032145321369, -0.02177891507744789, 0.0900476947426796, 0.06861196458339691, 0.027265038341283798, 0.020162658765912056, -0.00291074370034039, 0.06158742308616638, -0.03297058865427971, 0.05517933890223503, 3.8116917774389356e-33, 0.03171985223889351, -0.06723485887050629, -0.0943216010928154, 0.1037103533744812, 0.07463295012712479, 0.04114518314599991, 0.03981799632310867, 0.015427474863827229, -0.06300035119056702, -0.018968258053064346, 0.030324850231409073, -0.04743266478180885, -0.014395558275282383, 0.06827404350042343, 0.001536148483864963, -0.04725431650876999, 0.07566794008016586, -0.03211108595132828, 0.04781782254576683, 0.0733155906200409, 0.1199667751789093, 0.02301492728292942, -0.06633879989385605, -0.02709532342851162, -0.054534733295440674, -0.0001544064871268347, -0.06279189884662628, 0.012406526133418083, 0.036178071051836014, 0.013089057058095932, -0.011263362132012844, 0.023480787873268127, -0.009598426520824432, -0.037958066910505295, 0.05179908126592636, -0.07617300748825073, 0.010801698081195354, -0.049871671944856644, -0.07765740156173706, -0.027303190901875496, 0.01163057517260313, 0.042619235813617706, -0.11908179521560669, 0.016723185777664185, -0.016476262360811234, -0.12432879954576492, -0.0018752602627500892, 0.033273469656705856, 0.06987038999795914, 0.013837143778800964, 0.013491264544427395, 0.045241981744766235, 0.06249793618917465, -0.04556230455636978, 0.028033271431922913, -0.002250645076856017, 0.041389551013708115, -0.006002131383866072, -0.008975663222372532, -0.022858189418911934, 0.05674942955374718, -0.025972072035074234, -0.04249119758605957, -0.03919679671525955, -0.003912458196282387, 0.000028515180019894615, -0.0485164113342762, -0.05395837128162384, 0.038108184933662415, -0.07149207592010498, -0.09219744056463242, -0.025831498205661774, 0.009299161843955517, 0.04844169318675995, 0.008687659166753292, -0.014811648987233639, -0.04415515437722206, -0.0468573123216629, -0.0288151316344738, -0.0278142262250185, 0.009407688863575459, -0.07041569799184799, -0.03138094022870064, 0.036009471863508224, -0.0016186360735446215, 0.036276087164878845, -0.011454904451966286, -0.08392424136400223, -0.06655265390872955, -0.008122525177896023, -0.02084978111088276, 0.000449766666861251, 0.084760881960392, -0.050343263894319534, 0.008845355361700058, -6.655992111769438e-33, 0.046341054141521454, -0.00834380928426981, -0.06072623282670975, 0.06869212538003922, 0.034985922276973724, -0.02829902432858944, 0.018161486834287643, 0.029893364757299423, 0.029776062816381454, -0.13010309636592865, -0.09197835624217987, 0.04562842473387718, 0.04564322158694267, 0.038267672061920166, -0.011666698381304741, -0.0323561392724514, 0.00838072132319212, -0.11145035922527313, -0.03631623089313507, -0.01945352368056774, 0.006838751025497913, -0.008812128566205502, 0.0347805954515934, 0.0717206746339798, -0.030771462246775627, 0.06166122481226921, -0.03797970712184906, 0.05169866234064102, -0.014007939025759697, -0.05710136890411377, 0.05346078425645828, -0.07608473300933838, -0.04004737362265587, -0.030690312385559082, 0.019485266879200935, -0.044145405292510986, 0.05229877680540085, 0.06964170187711716, -0.12695187330245972, -0.04013959318399429, 0.17549613118171692, 0.00809011422097683, -0.015151318162679672, 0.0007512884913012385, 0.06798151135444641, -0.03598596528172493, 0.05903279408812523, -0.03890238702297211, 0.006019774358719587, 0.00118267722427845, 0.013826309703290462, -0.020565863698720932, 0.0046993764117360115, 0.09852394461631775, 0.07995279878377914, -0.021328691393136978, 0.11794712394475937, -0.042825840413570404, 0.02958240732550621, 0.019764835014939308, -0.009031976573169231, -0.032245419919490814, 0.08208309859037399, -0.009419109672307968, 0.0355343259871006, -0.009941748343408108, -0.0033129630610346794, 0.0051675820723176, 0.12848354876041412, 0.05466844141483307, 0.0802190825343132, 0.020134031772613525, -0.03250235319137573, -0.02087980881333351, 0.0512983538210392, -0.011604636907577515, -0.03252359479665756, -0.07475614547729492, 0.02086106687784195, 0.06723533570766449, -0.017512423917651176, 0.022997213527560234, 0.0017257309518754482, 0.07334350049495697, 0.05235865339636803, -0.01877923309803009, 0.06429954618215561, -0.04721362143754959, -0.024162575602531433, -0.011937129311263561, -0.03242423012852669, 0.011427927762269974, -0.07865011692047119, 0.014528881758451462, -0.020675435662269592, -5.279001058511312e-8, -0.07238391041755676, -0.013880368322134018, -0.09656365215778351, 0.02210910990834236, 0.039798785001039505, -0.06515086442232132, -0.012536615133285522, -0.056871447712183, -0.007427207659929991, -0.03134571388363838, 0.03310222178697586, -0.021752092987298965, 0.025109559297561646, -0.03224397823214531, 0.04873066022992134, -0.04779289662837982, -0.008792911656200886, 0.007010461762547493, -0.041887104511260986, -0.04367021843791008, -0.04158831015229225, -0.04519997909665108, -0.08555492758750916, -0.01007916871458292, -0.026949919760227203, -0.0002819982182700187, 0.09724678099155426, 0.028618942946195602, -0.009876430034637451, -0.003661599475890398, -0.06537825614213943, 0.024384554475545883, 0.15123116970062256, 0.05987633392214775, -0.054094597697257996, 0.011804625391960144, 0.07616956532001495, 0.03229101747274399, 0.00012516116839833558, 0.014364976435899734, 0.0795452669262886, 0.0420764684677124, -0.009336436167359352, 0.0467204749584198, 0.05377443879842758, -0.03904576227068901, 0.005136455409228802, 0.030969111248850822, -0.03306460380554199, 0.03604491427540779, -0.012124061584472656, 0.03453977778553963, -0.07392111420631409, 0.08209545910358429, -0.0419781468808651, -0.06387970596551895, -0.00816543959081173, -0.11768192797899246, -0.047560691833496094, -0.021159034222364426, 0.12477142363786697, -0.017771827057003975, 0.023116622120141983, -0.0163895133882761 ]
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: {ReadableStream} #### `textEncoderStream.writable` \* Type: {WritableStream} ### Class: `TextDecoderStream` #### `new TextDecoderStream([encoding[, options]])` \* `encoding` {string} Identifies the `encoding` that this `TextDecoder` instance supports. \*\*Default:\*\* `'utf-8'`. \* `options` {Object} \* `fatal` {boolean} `true` if decoding failures are fatal. \* `ignoreBOM` {boolean} When `true`, the `TextDecoderStream` will include the byte order mark in the decoded result. When `false`, the byte order mark will be removed from the output. This option is only used when `encoding` is `'utf-8'`, `'utf-16be'`, or `'utf-16le'`. \*\*Default:\*\* `false`. Creates a new `TextDecoderStream` instance. #### `textDecoderStream.encoding` \* Type: {string} The encoding supported by the `TextDecoderStream` instance. #### `textDecoderStream.fatal` \* Type: {boolean} The value will be `true` if decoding errors result in a `TypeError` being thrown. #### `textDecoderStream.ignoreBOM` \* Type: {boolean} The value will be `true` if the decoding result will include the byte order mark. #### `textDecoderStream.readable` \* Type: {ReadableStream} #### `textDecoderStream.writable` \* Type: {WritableStream} ### Class: `CompressionStream` #### `new CompressionStream(format)` \* `format` {string} One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`. #### `compressionStream.readable` \* Type: {ReadableStream} #### `compressionStream.writable` \* Type: {WritableStream} ### Class: `DecompressionStream` #### `new DecompressionStream(format)` \* `format` {string} One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`. #### `decompressionStream.readable` \* Type: {ReadableStream} #### `decompressionStream.writable` \* Type: {WritableStream} ### Utility Consumers The utility consumer functions provide common options for consuming streams. They are accessed using: ```mjs import { arrayBuffer, blob, buffer, json, text, } from 'node:stream/consumers'; ``` ```cjs const { arrayBuffer, blob, buffer, json, text, } = require('node:stream/consumers'); ``` #### `streamConsumers.arrayBuffer(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with an `ArrayBuffer` containing the full contents of the stream. ```mjs import { arrayBuffer } from 'node:stream/consumers'; import { Readable } from 'node:stream'; import { TextEncoder } from 'node:util'; const encoder = new TextEncoder(); const dataArray = encoder.encode('hello world from consumers!'); const readable = Readable.from(dataArray); const data = await arrayBuffer(readable); console.log(`from readable: ${data.byteLength}`); // Prints: from readable: 76 ``` ```cjs const { arrayBuffer } = require('node:stream/consumers'); const { Readable } = require('node:stream'); const { TextEncoder } = require('node:util'); const encoder = new TextEncoder(); const dataArray = encoder.encode('hello world from consumers!'); const readable = Readable.from(dataArray); arrayBuffer(readable).then((data) => { console.log(`from readable: ${data.byteLength}`); // Prints: from readable: 76 }); ``` #### `streamConsumers.blob(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with a {Blob} containing the full contents of the stream. ```mjs import { blob } from 'node:stream/consumers'; const dataBlob = new Blob(['hello world from consumers!']); const readable = dataBlob.stream(); const data = await blob(readable); console.log(`from readable: ${data.size}`); // Prints: from readable: 27 ``` ```cjs const { blob } = require('node:stream/consumers'); const dataBlob = new Blob(['hello world from consumers!']); const readable = dataBlob.stream(); blob(readable).then((data) => { console.log(`from readable: ${data.size}`); // Prints: from readable: 27 }); ``` #### `streamConsumers.buffer(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with a {Buffer} containing the full contents of the stream. ```mjs import { buffer } from 'node:stream/consumers'; import { Readable } from 'node:stream'; import { Buffer } from 'node:buffer'; const dataBuffer = Buffer.from('hello world from consumers!'); const readable = Readable.from(dataBuffer); const data = await buffer(readable); console.log(`from readable: ${data.length}`); // Prints: from readable: 27 ``` ```cjs const { buffer } = require('node:stream/consumers'); const { Readable } = 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(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with a {Uint8Array} containing the full contents of the stream.
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.031025461852550507, 0.06948211044073105, -0.0188304353505373, -0.011664718389511108, 0.00031869151280261576, -0.03985430672764778, -0.032573338598012924, 0.07790706306695938, 0.022755540907382965, -0.013639669865369797, 0.048580352216959, 0.0606204979121685, 0.018406685441732407, -0.05952916666865349, 0.04477148503065109, 0.08702165633440018, -0.014614327810704708, 0.04765716567635536, -0.048192039132118225, 0.007475182879716158, 0.06666665524244308, 0.025483818724751472, 0.11134734004735947, -0.011642814613878727, -0.08550945669412613, -0.07405784726142883, 0.0039443569257855415, 0.01762288622558117, 0.04744536802172661, -0.0413430780172348, -0.013451021164655685, -0.0432000458240509, 0.03720041364431381, 0.007058390416204929, -0.004251264967024326, -0.11252907663583755, -0.06887534260749817, -0.026121053844690323, 0.0959102064371109, -0.008935411460697651, 0.010277044959366322, 0.08570882678031921, -0.07199658453464508, 0.012433909811079502, 0.0237839724868536, -0.06230445206165314, -0.004013164434581995, -0.05600934475660324, 0.01379289198666811, 0.06209903210401535, -0.01892162300646305, -0.01531639602035284, -0.014649760909378529, 0.003996771760284901, 0.0700128972530365, 0.010240064933896065, -0.016250643879175186, -0.020168161019682884, 0.006400757003575563, -0.06365225464105606, 0.09851305186748505, 0.016489341855049133, 0.05728643760085106, 0.014024200849235058, 0.056835729628801346, 0.0132580092176795, -0.001626762910746038, -0.04024896398186684, -0.09055345505475998, 0.04695850610733032, 0.09535422921180725, -0.0074676694348454475, 0.03254207596182823, -0.020525876432657242, 0.08229903131723404, 0.012229284271597862, 0.1371663510799408, -0.08933459222316742, -0.05186082050204277, 0.07863014191389084, 0.03846846893429756, -0.0008242821786552668, 0.009857432916760445, 0.016562242060899734, 0.04134167358279228, -0.03078337386250496, -0.008544082753360271, -0.0533951036632061, 0.01860017515718937, 0.09937413036823273, -0.027924254536628723, 0.020289016887545586, -0.01566586270928383, 0.06736084073781967, 0.00731512438505888, 0.07057277113199234, -0.06247703731060028, 0.020638614892959595, 0.011334539391100407, -0.02366584911942482, -0.08623941987752914, -0.012887712568044662, 0.01009746827185154, -0.026932958513498306, -0.028396818786859512, 0.0251271054148674, 0.1567496806383133, 0.0340743251144886, -0.05724000558257103, -0.08251295983791351, 0.0097073158249259, 0.012136639095842838, -0.02293388918042183, 0.008768047206103802, 8.780558560926563e-33, 0.024006312713027, -0.07101131975650787, -0.04331168904900551, 0.047052424401044846, 0.008169885724782944, -0.025608595460653305, -0.015654465183615685, 0.05654757842421532, -0.0732404887676239, -0.04080764204263687, -0.02312404476106167, -0.08065935224294662, -0.02005486749112606, 0.11467349529266357, 0.042468778789043427, -0.05859486386179924, -0.0041411262936890125, -0.03924274072051048, -0.0034776467364281416, 0.02712973766028881, 0.0035252633970230818, 0.0043935938738286495, -0.04509621858596802, -0.06529449671506882, -0.054593492299318314, 0.05328625813126564, 0.013357077725231647, -0.09338296949863434, -0.011805962771177292, -0.0057721370831131935, -0.0931297168135643, -0.08448383212089539, -0.021504348143935204, 0.018999867141246796, -0.012485080398619175, -0.043271634727716446, -0.0340002067387104, 0.021280808374285698, -0.13599061965942383, 0.008394533768296242, 0.06386277079582214, 0.02311289682984352, -0.04561109468340874, -0.030671721324324608, 0.023298164829611778, -0.07611614465713501, -0.09282691031694412, 0.03868233039975166, -0.017533108592033386, 0.021840617060661316, 0.05327426269650459, 0.1164853498339653, -0.006239634472876787, 0.01678547076880932, 0.030283460393548012, -0.04273054376244545, 0.017730679363012314, 0.000746721460018307, 0.06353454291820526, -0.030421031638979912, -0.03348064422607422, 0.04575968161225319, 0.07896707206964493, 0.008036483079195023, 0.08982358127832413, -0.00121434370521456, 0.06948459893465042, -0.06885302811861038, -0.031660690903663635, -0.02885422855615616, -0.09270337224006653, 0.007939722388982773, -0.03562317416071892, 0.03837402164936066, -0.010224399156868458, 0.0217097457498312, -0.005499504506587982, -0.11376412212848663, -0.013134957291185856, -0.06845828145742416, 0.0006007360643707216, -0.02591799758374691, 0.004588084761053324, 0.01313027460128069, -0.07478579133749008, 0.011701755225658417, 0.006631429772824049, -0.10672912746667862, 0.04483557119965553, 0.026024488732218742, -0.0018745537381619215, -0.1333116590976715, 0.03554844483733177, -0.13449572026729584, -0.0365753099322319, -1.0340394748745613e-32, 0.028796738013625145, 0.0035278380382806063, -0.07108665257692337, 0.037153296172618866, -0.048186372965574265, -0.022698331624269485, -0.012252697721123695, 0.09019256383180618, -0.008266646414995193, -0.055009111762046814, -0.03193099796772003, 0.024298377335071564, 0.09089206159114838, 0.02503591775894165, -0.0059441677294671535, 0.011547068133950233, -0.08604579418897629, -0.015374643728137016, 0.06747637689113617, 0.026112189516425133, 0.021794697269797325, 0.03482905030250549, 0.007316822651773691, 0.09139267355203629, 0.009534784592688084, 0.029819658026099205, -0.014312157407402992, 0.05165993794798851, 0.017303187400102615, -0.05767347291111946, 0.017321504652500153, 0.1116642877459526, -0.04704129695892334, -0.02207000181078911, -0.07658698409795761, -0.002965472871437669, 0.030436836183071136, 0.04257696121931076, -0.0369984470307827, 0.05181095749139786, 0.15998472273349762, 0.002660679165273905, -0.023867452517151833, 0.022921796888113022, 0.006298935040831566, -0.00411980552598834, -0.011572928167879581, -0.01705978997051716, 0.03743326663970947, -0.006505628116428852, 0.03463888540863991, 0.028526773676276207, -0.057521380484104156, 0.04539874568581581, 0.027104424312710762, -0.06035246700048447, 0.015391374006867409, -0.061305444687604904, -0.04543085768818855, -0.012414924800395966, -0.04166605323553085, -0.04889468103647232, -0.003692799713462591, -0.03987889736890793, 0.034404169768095016, -0.10783129930496216, -0.03987107425928116, -0.0039764102548360825, -0.07098577171564102, -0.0685267448425293, 0.06676680594682693, -0.09176236391067505, 0.015953222289681435, 0.05638899654150009, 0.03589285910129547, 0.020125247538089752, -0.0181515421718359, 0.006684823427349329, 0.007688046433031559, 0.11841341853141785, 0.04691392555832863, 0.025283347815275192, -0.020522991195321083, 0.08718939125537872, 0.04695117101073265, -0.023758046329021454, -0.020589791238307953, 0.04654228687286377, -0.0942833423614502, -0.060483381152153015, 0.013896973803639412, 0.051350079476833344, -0.04153289273381233, 0.04547690600156784, -0.053603172302246094, -5.6647696311529216e-8, -0.04665236547589302, -0.11880752444267273, -0.16387201845645905, 0.031544532626867294, -0.04486101120710373, -0.022021034732460976, -0.07644200325012207, -0.008041143417358398, -0.014873727224767208, -0.03909396007657051, 0.058948494493961334, -0.004044589586555958, -0.055978838354349136, -0.026272447779774666, 0.035177089273929596, -0.0024655130691826344, -0.008854527957737446, 0.003877692623063922, -0.014857231639325619, -0.008672921918332577, 0.0028945908416062593, -0.028847578912973404, -0.07514051347970963, -0.04939805343747139, -0.01297339703887701, 0.0015003681182861328, 0.031581953167915344, 0.11154206842184067, -0.038139164447784424, -0.006301320623606443, 0.018824292346835136, 0.09676425904035568, 0.048101235181093216, 0.00011237335274927318, -0.03299592807888985, 0.03633281588554382, 0.01180826872587204, 0.045047979801893234, 0.061263587325811386, 0.006491478066891432, 0.10653234273195267, -0.01379916537553072, -0.11050646752119064, 0.009318138472735882, -0.02628183364868164, -0.05489836633205414, 0.027301672846078873, -0.013890656642615795, -0.019176403060555458, -0.04073811694979668, -0.011153490282595158, 0.06274902075529099, 0.03196989744901657, 0.04969092085957527, -0.019656550139188766, 0.03830035403370857, -0.0021096139680594206, -0.007860581390559673, -0.0034753172658383846, 0.004990946967154741, 0.057630810886621475, 0.007818756625056267, 0.09769900143146515, -0.012519191019237041 ]
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(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with a {Uint8Array} containing the full contents of the stream. ```mjs import { bytes } from 'node:stream/consumers'; import { Readable } from 'node:stream'; import { Buffer } from 'node:buffer'; const dataBuffer = Buffer.from('hello world from consumers!'); const readable = Readable.from(dataBuffer); const data = await bytes(readable); console.log(`from readable: ${data.length}`); // Prints: from readable: 27 ``` ```cjs const { bytes } = require('node:stream/consumers'); const { Readable } = require('node:stream'); const { Buffer } = require('node:buffer'); const dataBuffer = Buffer.from('hello world from consumers!'); const readable = Readable.from(dataBuffer); bytes(readable).then((data) => { console.log(`from readable: ${data.length}`); // Prints: from readable: 27 }); ``` #### `streamConsumers.json(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with the contents of the stream parsed as a UTF-8 encoded string that is then passed through `JSON.parse()`. ```mjs import { json } from 'node:stream/consumers'; import { Readable } from 'node:stream'; const items = Array.from( { length: 100, }, () => ({ message: 'hello world from consumers!', }), ); const readable = Readable.from(JSON.stringify(items)); const data = await json(readable); console.log(`from readable: ${data.length}`); // Prints: from readable: 100 ``` ```cjs const { json } = require('node:stream/consumers'); const { Readable } = require('node:stream'); const items = Array.from( { length: 100, }, () => ({ message: 'hello world from consumers!', }), ); const readable = Readable.from(JSON.stringify(items)); json(readable).then((data) => { console.log(`from readable: ${data.length}`); // Prints: from readable: 100 }); ``` #### `streamConsumers.text(stream)` \* `stream` {ReadableStream|stream.Readable|AsyncIterator} \* Returns: {Promise} Fulfills with the contents of the stream parsed as a UTF-8 encoded string. ```mjs import { text } from 'node:stream/consumers'; import { Readable } from 'node:stream'; const readable = Readable.from('Hello world from consumers!'); const data = await text(readable); console.log(`from readable: ${data.length}`); // Prints: from readable: 27 ``` ```cjs const { text } = require('node:stream/consumers'); const { Readable } = require('node:stream'); const readable = Readable.from('Hello world from consumers!'); text(readable).then((data) => { console.log(`from readable: ${data.length}`); // Prints: from readable: 27 }); ``` [Streams]: stream.md [WHATWG Streams Standard]: https://streams.spec.whatwg.org/ [`stream.Duplex.fromWeb`]: stream.md#streamduplexfromwebpair-options [`stream.Duplex.toWeb`]: stream.md#streamduplextowebstreamduplex-options [`stream.Duplex`]: stream.md#class-streamduplex [`stream.Readable.fromWeb`]: stream.md#streamreadablefromwebreadablestream-options [`stream.Readable.toWeb`]: stream.md#streamreadabletowebstreamreadable-options [`stream.Readable`]: stream.md#class-streamreadable [`stream.Writable.fromWeb`]: stream.md#streamwritablefromwebwritablestream-options [`stream.Writable.toWeb`]: stream.md#streamwritabletowebstreamwritable [`stream.Writable`]: stream.md#class-streamwritable
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.029153773561120033, -0.018368959426879883, -0.06387002766132355, 0.005306069739162922, 0.00013155319902580231, -0.005942757707089186, -0.06527701020240784, 0.08545946329832077, -0.012349057011306286, -0.005452476441860199, -0.012744558043777943, -0.02538982592523098, 0.045152049511671066, -0.08926504850387573, -0.046905647963285446, 0.054056182503700256, -0.0324290469288826, 0.05053633078932762, -0.04784844070672989, -0.0625581294298172, -0.008002049289643764, -0.06989219039678574, 0.09011216461658478, -0.012815333902835846, -0.0932743027806282, -0.0312129445374012, -0.01688370108604431, 0.1313145011663437, 0.09153378009796143, -0.11095424741506577, 0.00956033356487751, 0.033209428191185, -0.015772029757499695, -0.0237168800085783, 0.008853218518197536, -0.04545753449201584, 0.07235950231552124, -0.08386697620153427, 0.02004011906683445, -0.10195507854223251, 0.09273636341094971, 0.04463430866599083, -0.01344254333525896, -0.0370461568236351, 0.011733234860002995, -0.0028471366968005896, -0.011968467384576797, -0.051686931401491165, -0.07748638093471527, 0.08348604291677475, 0.004813166335225105, 0.07466642558574677, -0.04461585730314255, -0.02992388978600502, 0.15845106542110443, 0.052309535443782806, -0.003827278036624193, 0.028109319508075714, 0.011997798457741737, -0.025990577414631844, 0.00489059230312705, -0.040557824075222015, -0.0639687329530716, 0.041088953614234924, 0.03913716971874237, -0.03467446565628052, 0.05256062373518944, -0.0491236187517643, -0.043624408543109894, 0.009222595021128654, -0.02120015025138855, -0.02943633683025837, 0.10032717138528824, -0.035180311650037766, -0.002989398315548897, -0.027503453195095062, -0.023596126586198807, -0.0765567347407341, 0.021797336637973785, -0.1076698899269104, 0.06074113771319389, -0.002754663582891226, -0.00004622633059625514, 0.05336429178714752, -0.015380469150841236, 0.00014098708925303072, 0.013045012019574642, 0.02339170128107071, 0.08608248829841614, 0.06295416504144669, 0.04258531704545021, -0.017615266144275665, -0.09675391018390656, -0.029506362974643707, 0.036489710211753845, -0.08288439363241196, -0.011762340553104877, -0.005876750219613314, 0.06787332892417908, 0.02597346156835556, 0.03700975701212883, 0.02433532476425171, -0.055485546588897705, -0.07391198724508286, -0.05446875840425491, 0.07076485455036163, 0.0943107083439827, 0.06420823186635971, -0.0019059715559706092, 0.004386356100440025, 0.04066869989037514, 0.07554759085178375, 0.011109426617622375, 0.07367586344480515, 4.1219414708194005e-33, -0.0121427858248353, -0.04004693031311035, 0.01638762466609478, 0.049580127000808716, 0.002729489468038082, -0.008867171593010426, 0.058419059962034225, -0.010233570821583271, -0.11723780632019043, -0.01849052868783474, -0.046960752457380295, -0.0100938118994236, -0.02535683661699295, 0.014841851778328419, -0.007625911850482225, -0.003792964620515704, 0.03771847486495972, -0.0581623911857605, 0.08898500353097916, 0.07548181712627411, 0.0302363820374012, 0.0317487008869648, -0.04122321680188179, -0.05481032282114029, -0.05364319682121277, -0.09568508714437485, -0.04177587479352951, 0.03657732903957367, -0.010925752110779285, -0.014758854173123837, 0.03351616859436035, 0.03038710355758667, 0.0032070486340671778, -0.026897603645920753, 0.05621275678277016, -0.12166274338960648, 0.028781399130821228, -0.014074084348976612, -0.15101028978824615, -0.033414728939533234, 0.044095154851675034, 0.06728576123714447, 0.04829246178269386, 0.023716917261481285, -0.08316051959991455, -0.0828595981001854, -0.037569962441921234, -0.05561447516083717, 0.029193446040153503, -0.009662049822509289, 0.003348365193232894, 0.0462108850479126, 0.016892189159989357, -0.016844281926751137, 0.043941233307123184, -0.02060338668525219, 0.03094497136771679, 0.003746666945517063, -0.006853325758129358, 0.016832828521728516, -0.005917913746088743, 0.01332030538469553, 0.02229759842157364, 0.005271091125905514, 0.020663322880864143, 0.04542628303170204, -0.04799101874232292, 0.022492818534374237, 0.054694849997758865, -0.03370325639843941, -0.06247229129076004, -0.0372810959815979, -0.0012491694651544094, 0.03511187806725502, 0.009973370470106602, 0.0383329801261425, -0.07982011139392853, -0.05998796224594116, 0.0013046906096860766, -0.04781869426369667, 0.036502718925476074, 0.00626183720305562, -0.00343718403019011, 0.13749176263809204, -0.028890037909150124, 0.04778878018260002, -0.0022310838103294373, -0.09467891603708267, 0.04025353118777275, 0.014239217154681683, -0.039010100066661835, 0.0014223817270249128, 0.07570996880531311, -0.12623274326324463, -0.048455771058797836, -5.261432633727909e-33, 0.06364554166793823, 0.027472538873553276, -0.030477851629257202, 0.07450829446315765, 0.016548659652471542, 0.0042574964463710785, 0.05469915643334389, 0.029714364558458328, 0.038174744695425034, 0.010687763802707195, -0.05556759983301163, 0.06081278994679451, 0.06186152622103691, 0.012625725008547306, -0.003005260368809104, 0.002875897102057934, 0.026228155940771103, -0.08584027737379074, 0.045500561594963074, -0.0851372703909874, -0.01211747620254755, -0.07077865302562714, 0.06266774237155914, 0.026357237249612808, -0.050393857061862946, 0.0570877380669117, -0.010194076225161552, 0.00350557710044086, -0.0403161346912384, -0.09028304368257523, -0.03535213693976402, -0.0525788888335228, -0.047512851655483246, -0.00659994687885046, 0.0069814398884773254, -0.05074921250343323, 0.0280742384493351, 0.08787039667367935, -0.07983528077602386, 0.006555301137268543, 0.0856286957859993, 0.01743961125612259, -0.03742058575153351, -0.06190597265958786, 0.023508530110120773, -0.04429493099451065, 0.04786497727036476, -0.005994313396513462, -0.00849048513919115, 0.02067587897181511, 0.006702144164592028, -0.008712196722626686, -0.03583144396543503, 0.035691145807504654, 0.005019956734031439, -0.016551870852708817, 0.12640613317489624, -0.012721850536763668, 0.13502556085586548, -0.03038928098976612, 0.008375466801226139, -0.08056078851222992, -0.024048129096627235, -0.056518759578466415, 0.019541539251804352, -0.04175562784075737, -0.010648059658706188, -0.0354795828461647, 0.06531864404678345, 0.0039783744141459465, -0.002373706316575408, 0.009423060342669487, -0.012568498030304909, -0.0009669123683124781, 0.08562445640563965, -0.014200587756931782, -0.08515539020299911, -0.04720831289887428, 0.03457547724246979, 0.0841127336025238, -0.022419391199946404, 0.09261901676654816, -0.027874857187271118, 0.060616385191679, 0.14597086608409882, -0.030135732144117355, 0.029841991141438484, -0.08981248736381531, -0.02819337137043476, 0.009755796752870083, 0.04427752643823624, 0.004130623769015074, -0.13817082345485687, -0.023312320932745934, 0.008036944083869457, -4.7520963164515706e-8, -0.06671144813299179, -0.07599499821662903, -0.06771916896104813, 0.05727284401655197, 0.026220357045531273, -0.0841401144862175, -0.00852920487523079, -0.0532013364136219, 0.06486105173826218, -0.027048924937844276, 0.03217453509569168, -0.052231427282094955, 0.0438251867890358, -0.05631543695926666, 0.023730743676424026, -0.011158652603626251, 0.034647148102521896, -0.07042420655488968, -0.04036468639969826, -0.026762254536151886, -0.003960328176617622, 0.022599251940846443, -0.06579487770795822, 0.007689662277698517, 0.040753643959760666, 0.016617270186543465, 0.08537144213914871, 0.03395209088921547, 0.0066852145828306675, -0.023747269064188004, -0.029483702033758163, 0.00840508472174406, 0.11219403147697449, 0.014270635321736336, 0.016628099605441093, -0.048199113458395004, -0.006217391230165958, 0.04625285044312477, 0.030609995126724243, 0.037043437361717224, 0.03360028937458992, 0.0033534104004502296, -0.00043088075472041965, 0.04351455718278885, 0.019820543006062508, -0.052443910390138626, 0.012493434362113476, 0.024355361238121986, 0.024083634838461876, 0.03886955603957176, 0.0456862635910511, -0.046228498220443726, -0.013037607073783875, 0.009181472472846508, 0.01782025583088398, -0.13659735023975372, 0.0009689753060229123, -0.09903127700090408, -0.04239863529801369, -0.022645482793450356, 0.10391075909137726, 0.03325578197836876, 0.04261186346411705, -0.05110480636358261 ]
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 on it to run untrusted code.** The WASI API provides an implementation of the [WebAssembly System Interface][] specification. WASI gives WebAssembly applications access to the underlying operating system via a collection of POSIX-like functions. ```mjs import { readFile } from 'node:fs/promises'; import { WASI } from 'node:wasi'; import { argv, env } from 'node:process'; const wasi = new WASI({ version: 'preview1', args: argv, env, preopens: { '/local': '/some/real/path/that/wasm/can/access', }, }); const wasm = await WebAssembly.compile( await readFile(new URL('./demo.wasm', import.meta.url)), ); const instance = await WebAssembly.instantiate(wasm, wasi.getImportObject()); wasi.start(instance); ``` ```cjs 'use strict'; const { readFile } = require('node:fs/promises'); const { WASI } = require('node:wasi'); const { argv, env } = require('node:process'); const { join } = require('node:path'); const wasi = new WASI({ version: 'preview1', args: argv, env, preopens: { '/local': '/some/real/path/that/wasm/can/access', }, }); (async () => { const wasm = await WebAssembly.compile( await readFile(join(\_\_dirname, 'demo.wasm')), ); const instance = await WebAssembly.instantiate(wasm, wasi.getImportObject()); wasi.start(instance); })(); ``` To run the above example, create a new WebAssembly text format file named `demo.wat`: ```text (module ;; Import the required fd\_write WASI function which will write the given io vectors to stdout ;; The function signature for fd\_write is: ;; (File Descriptor, \*iovs, iovs\_len, nwritten) -> Returns number of bytes written (import "wasi\_snapshot\_preview1" "fd\_write" (func $fd\_write (param i32 i32 i32 i32) (result i32))) (memory 1) (export "memory" (memory 0)) ;; Write 'hello world\n' to memory at an offset of 8 bytes ;; Note the trailing newline which is required for the text to appear (data (i32.const 8) "hello world\n") (func $main (export "\_start") ;; Creating a new io vector within linear memory (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov\_base - This is a pointer to the start of the 'hello world\n' string (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov\_len - The length of the 'hello world\n' string (call $fd\_write (i32.const 1) ;; file\_descriptor - 1 for stdout (i32.const 0) ;; \*iovs - The pointer to the iov array, which is stored at memory location 0 (i32.const 1) ;; iovs\_len - We're printing 1 string stored in an iov - so one. (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written ) drop ;; Discard the number of bytes written from the top of the stack ) ) ``` Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm` ```bash wat2wasm demo.wat ``` ## Security WASI provides a capabilities-based model through which applications are provided their own custom `env`, `preopens`, `stdin`, `stdout`, `stderr`, and `exit` capabilities. \*\*The current Node.js threat model does not provide secure sandboxing as is present in some WASI runtimes.\*\* While the capability features are supported, they do not form a security model in Node.js. For example, the file system sandboxing can be escaped with various techniques. The project is exploring whether these security guarantees could be added in future. ## Class: `WASI` The `WASI` class provides the WASI system call API and additional convenience methods for working with WASI-based applications. Each `WASI` instance represents a distinct environment. ### `new 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 application will see as its
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.05436410754919052, 0.0017777588218450546, -0.025485781952738762, 0.03968662768602371, -0.005081063602119684, -0.0012448413763195276, 0.024097342044115067, 0.06757386773824692, -0.01225980930030346, 0.006268579978495836, -0.0552254244685173, -0.0569700263440609, -0.023086924105882645, -0.03780337795615196, 0.02519933320581913, 0.0011433345498517156, -0.10202445834875107, 0.07155660539865494, 0.021117648109793663, -0.02335578389465809, -0.04332011565566063, 0.016317158937454224, 0.14172865450382233, 0.06318828463554382, -0.17885643243789673, -0.035275500267744064, -0.050064604729413986, 0.03501131013035774, 0.12876300513744354, -0.029980499297380447, -0.030630681663751602, -0.022435171529650688, -0.08336762338876724, 0.018186824396252632, -0.044669996947050095, -0.041494179517030716, 0.005940333474427462, -0.06539653241634369, -0.019014861434698105, 0.048327166587114334, -0.007019122131168842, 0.02331114187836647, -0.01023564487695694, 0.011926458217203617, 0.0008905181312002242, -0.023566603660583496, 0.027745256200432777, -0.014557471498847008, -0.013961332850158215, 0.10434585809707642, -0.025489099323749542, 0.04558132588863373, 0.11300665885210037, 0.022880997508764267, 0.00542466389015317, 0.017922282218933105, -0.09588358551263809, -0.05587361752986908, 0.0007171670440584421, -0.046929746866226196, 0.034410905092954636, -0.02974409982562065, -0.049488890916109085, -0.007726355921477079, 0.06059177964925766, 0.013165466487407684, -0.018498696386814117, -0.03135339170694351, -0.029753392562270164, 0.05566442385315895, 0.02235279604792595, -0.03812439739704132, 0.09416791796684265, 0.0018943309551104903, 0.02674083039164543, 0.09835083782672882, 0.012280690483748913, -0.0394703671336174, -0.06728878617286682, -0.016098275780677795, 0.014490068890154362, 0.10517365485429764, -0.0519813671708107, 0.036936067044734955, 0.04455232992768288, -0.024336466565728188, 0.02055899240076542, -0.036109477281570435, -0.056235961616039276, 0.02964204177260399, -0.032676175236701965, 0.03403094783425331, 0.008890466764569283, 0.0409211702644825, -0.009390230290591717, 0.029203755781054497, -0.014902829192578793, -0.05422428995370865, -0.03611304610967636, -0.010415087454020977, 0.00512823648750782, 0.013508548028767109, -0.021230250597000122, 0.047335654497146606, -0.0012643529335036874, 0.03963371366262436, 0.043057847768068314, 0.11812716722488403, 0.046757131814956665, 0.09590217471122742, 0.05419225990772247, 0.060964323580265045, -0.0627882108092308, 0.07087034732103348, 5.672709821747811e-33, -0.010462050326168537, -0.056715790182352066, -0.0024796307552605867, 0.061121951788663864, 0.09071308374404907, -0.13039016723632812, 0.09783053398132324, -0.022588646039366722, -0.14789341390132904, -0.013376482762396336, -0.032473739236593246, 0.05421976000070572, 0.02469857595860958, -0.04693591594696045, 0.08956371992826462, -0.013349230401217937, -0.026357468217611313, -0.07083110511302948, 0.09853973239660263, 0.025425085797905922, 0.018087690696120262, -0.0034905888605862856, 0.0036713078152388334, -0.057638298720121384, 0.02168707735836506, -0.06315109878778458, -0.032388851046562195, 0.06219419464468956, 0.09857051074504852, -0.014904734678566456, 0.07782741636037827, 0.0018085538176819682, -0.005731542594730854, 0.014799105003476143, -0.021907968446612358, -0.02840866893529892, -0.05204091966152191, -0.015273618511855602, -0.09070571511983871, -0.07507290691137314, 0.0952812135219574, -0.017597440630197525, -0.02195802889764309, 0.01123051531612873, -0.03321331366896629, -0.1047961637377739, -0.14050546288490295, -0.03989052399992943, 0.027791433036327362, -0.050721678882837296, -0.050233036279678345, 0.058394286781549454, 0.07633592933416367, -0.047985631972551346, -0.013385345228016376, -0.007260746788233519, 0.05368836224079132, -0.009440521709620953, -0.00784827396273613, 0.05186041072010994, -0.004544303752481937, 0.01462090015411377, 0.022477563470602036, 0.017693011090159416, -0.062102846801280975, -0.006184314843267202, 0.013047728687524796, -0.03151636943221092, 0.03448157757520676, 0.023121461272239685, -0.08196897059679031, -0.061605483293533325, 0.015550351701676846, 0.03958506882190704, -0.07631930708885193, 0.02349526435136795, -0.026416175067424774, -0.000780166476033628, -0.0004459855845198035, -0.05662502348423004, 0.07476461678743362, -0.016282865777611732, 0.0024327458813786507, 0.08281209319829941, 0.002356397220864892, -0.03833647817373276, -0.08082136511802673, -0.04246561601758003, 0.017477212473750114, -0.0015251602744683623, 0.07890509814023972, -0.04168400913476944, 0.06673355400562286, -0.040970418602228165, -0.02665882371366024, -7.425453816086414e-33, -0.01859942637383938, -0.027614930644631386, -0.03485426306724548, 0.04897528886795044, -0.06736435741186142, 0.03116738796234131, 0.0018897581612691283, -0.008051887154579163, -0.002892907476052642, 0.0175530593842268, -0.03640712797641754, 0.026113389059901237, 0.05371258035302162, 0.0008229076047427952, 0.061633892357349396, 0.06701063364744186, -0.019969001412391663, -0.09407693147659302, 0.04566873237490654, -0.04614250734448433, -0.016099292784929276, 0.044641830027103424, 0.10736535489559174, -0.00054295698646456, -0.02420603483915329, 0.0443091094493866, -0.020397638902068138, 0.018470659852027893, -0.06581065058708191, -0.05568592995405197, -0.047288358211517334, 0.000009623826372262556, -0.08031447976827621, -0.05101415514945984, 0.007566890213638544, -0.08049695938825607, -0.041734155267477036, 0.049314841628074646, 0.007804978638887405, -0.06794780492782593, 0.03247404098510742, 0.0039645894430577755, -0.015994027256965637, -0.005029786378145218, -0.0012250037398189306, 0.03388448432087898, -0.052523422986269, 0.029149377718567848, 0.010290798731148243, -0.013870034366846085, -0.08047516644001007, -0.016645731404423714, 0.08310160785913467, -0.004284121096134186, 0.02416563592851162, 0.01692896895110607, 0.058783140033483505, -0.015533666126430035, -0.018822429701685905, 0.03038058988749981, 0.07429134845733643, -0.10809025168418884, -0.02799050137400627, -0.0034155321773141623, -0.04877304658293724, 0.0033612623810768127, -0.12293396890163422, -0.09545602649450302, 0.01988491788506508, 0.023036591708660126, 0.054745979607105255, -0.030177496373653412, 0.015142564661800861, 0.05938776582479477, 0.042829692363739014, -0.00036528875352814794, -0.0016551860608160496, -0.08535922318696976, 0.0050588506273925304, 0.052378397434949875, -0.06532061100006104, 0.08074003458023071, -0.0711793452501297, 0.016928406432271004, 0.0637103021144867, -0.09139210730791092, -0.00776219367980957, -0.005133165046572685, 0.05048317834734917, 0.0025153025053441525, -0.046009231358766556, 0.003533367533236742, -0.07864408940076828, -0.024236537516117096, -0.01956239715218544, -5.1139465995220235e-8, -0.005325243808329105, -0.05348172411322594, -0.06928610056638718, 0.037442516535520554, -0.01635778322815895, 0.01957506313920021, 0.0055746217258274555, -0.055663540959358215, 0.024171780794858932, 0.03656795620918274, 0.05896751582622528, -0.027249660342931747, -0.04557953029870987, -0.03836257383227348, -0.0406014658510685, 0.06928859651088715, 0.018618345260620117, 0.05535821616649628, -0.017205718904733658, -0.06473960727453232, 0.06842505931854248, -0.019411055371165276, 0.025324925780296326, 0.08903206884860992, 0.04672714322805405, 0.048200689256191254, 0.07989829033613205, 0.007841735146939754, -0.06167329475283623, 0.03708239644765854, -0.06745500862598419, -0.017184842377901077, 0.00823561754077673, 0.05424781143665314, -0.09442412108182907, 0.04482370615005493, -0.015430014580488205, 0.07806628197431564, 0.08257032185792923, 0.0011204261099919677, 0.019649391993880272, 0.098720021545887, -0.019257860258221626, 0.022120535373687744, 0.03519643098115921, 0.023216737434267998, -0.05436084046959877, 0.01434323750436306, 0.018202103674411774, -0.03506241738796234, -0.011201743967831135, -0.035262495279312134, -0.04973827302455902, 0.11768965423107147, -0.012869562022387981, -0.0028335030656307936, 0.011001352220773697, -0.0473366416990757, 0.0498681515455246, 0.07354368269443512, 0.061928391456604004, -0.03027956746518612, 0.07715251296758652, -0.026211554184556007 ]
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 application will see as its environment. \*\*Default:\*\* `{}`. \* `preopens` {Object} This object represents the WebAssembly application's local directory structure. The string keys of `preopens` are treated as directories within the file system. The corresponding values in `preopens` are the real paths to those directories on the host machine. \* `returnOnExit` {boolean} By default, when WASI applications call `\_\_wasi\_proc\_exit()` `wasi.start()` will return with the exit code specified rather than terminating the process. Setting this option to `false` will cause the Node.js process to exit with the specified exit code instead. \*\*Default:\*\* `true`. \* `stdin` {integer} The file descriptor used as standard input in the WebAssembly application. \*\*Default:\*\* `0`. \* `stdout` {integer} The file descriptor used as standard output in the WebAssembly application. \*\*Default:\*\* `1`. \* `stderr` {integer} The file descriptor used as standard error in the WebAssembly application. \*\*Default:\*\* `2`. \* `version` {string} The version of WASI requested. Currently the only supported versions are `unstable` and `preview1`. This option is mandatory. ### `wasi.getImportObject()` Return an import object that can be passed to `WebAssembly.instantiate()` if no other WASM imports are needed beyond those provided by WASI. If version `unstable` was passed into the constructor it will return: ```json { wasi\_unstable: wasi.wasiImport } ``` If version `preview1` was passed into the constructor or no version was specified it will return: ```json { wasi\_snapshot\_preview1: wasi.wasiImport } ``` ### `wasi.start(instance)` \* `instance` {WebAssembly.Instance} Attempt to begin execution of `instance` as a WASI command by invoking its `\_start()` export. If `instance` does not contain a `\_start()` export, or if `instance` contains an `\_initialize()` export, then an exception is thrown. `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named `memory`. If `instance` does not have a `memory` export an exception is thrown. If `start()` is called more than once, an exception is thrown. ### `wasi.initialize(instance)` \* `instance` {WebAssembly.Instance} Attempt to initialize `instance` as a WASI reactor by invoking its `\_initialize()` export, if it is present. If `instance` contains a `\_start()` export, then an exception is thrown. `initialize()` requires that `instance` exports a [`WebAssembly.Memory`][] named `memory`. If `instance` does not have a `memory` export an exception is thrown. If `initialize()` is called more than once, an exception is thrown. ### `wasi.finalizeBindings(instance[, options])` \* `instance` {WebAssembly.Instance} \* `options` {Object} \* `memory` {WebAssembly.Memory} \*\*Default:\*\* `instance.exports.memory`. Set up WASI host bindings to `instance` without calling `initialize()` or `start()`. This method is useful when the WASI module is instantiated in child threads for sharing the memory across threads. `finalizeBindings()` requires that either `instance` exports a [`WebAssembly.Memory`][] named `memory` or user specify a [`WebAssembly.Memory`][] object in `options.memory`. If the `memory` is invalid an exception is thrown. `start()` and `initialize()` will call `finalizeBindings()` internally. If `finalizeBindings()` is called more than once, an exception is thrown. ### `wasi.wasiImport` \* Type: {Object} `wasiImport` is an object that implements the WASI system call API. This object should be passed as the `wasi\_snapshot\_preview1` import during the instantiation of a [`WebAssembly.Instance`][]. [WebAssembly System Interface]: https://wasi.dev/ [`WebAssembly.Instance`]: https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript\_interface/Instance [`WebAssembly.Memory`]: https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript\_interface/Memory
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.006532860919833183, 0.013697698712348938, 0.025498436763882637, 0.025067977607250214, -0.09858271479606628, -0.06713097542524338, 0.07878807932138443, 0.06769394874572754, 0.041090574115514755, -0.035172224044799805, -0.08101395517587662, -0.04097224026918411, -0.03462764248251915, -0.00623715715482831, 0.02554459683597088, 0.060234300792217255, -0.03694272041320801, 0.02677876316010952, 0.09781421720981598, 0.003101405454799533, -0.04598519951105118, 0.1023789718747139, 0.18235310912132263, 0.07150878012180328, -0.0740441381931305, -0.04065261408686638, -0.03902268782258034, 0.09870922565460205, 0.05636962503194809, -0.05107000842690468, -0.010685109533369541, -0.07162575423717499, -0.03863969445228577, -0.024215180426836014, -0.029372166842222214, -0.01907808519899845, -0.045485977083444595, -0.06442052870988846, 0.03089069575071335, 0.02884889766573906, -0.021970828995108604, 0.06531558185815811, 0.0002717377501539886, 0.04860552027821541, 0.00908939354121685, -0.017028598114848137, -0.0040219747461378574, -0.01984638348221779, -0.004324900917708874, 0.03575138375163078, 0.007349590305238962, 0.02455216832458973, 0.0795326828956604, 0.0014436430064961314, -0.06671150028705597, 0.019829299300909042, -0.10408386588096619, -0.06357083469629288, 0.0012762746773660183, -0.09816282987594604, 0.01055857352912426, -0.0035099342931061983, 0.0023309795651584864, 0.041402459144592285, 0.07361695170402527, -0.009232528507709503, -0.10340673476457596, -0.0038995977956801653, -0.05659280717372894, 0.02339552342891693, 0.039175067096948624, 0.012930089607834816, 0.06843826174736023, -0.03404996916651726, -0.03007400408387184, 0.1388641893863678, 0.05756799131631851, -0.03822093829512596, -0.12785664200782776, -0.012028137221932411, 0.021972915157675743, 0.07191234081983566, -0.02942652814090252, 0.03813543915748596, 0.037025731056928635, 0.057110294699668884, 0.02724524959921837, 0.03115237131714821, -0.11089053004980087, 0.030208971351385117, -0.024104295298457146, -0.030227316543459892, -0.05191770941019058, 0.04734295979142189, -0.003350807586684823, 0.060501620173454285, -0.026569217443466187, -0.04403247684240341, -0.08465457707643509, 0.08091939985752106, -0.03346133232116699, -0.03797263652086258, 0.031450703740119934, 0.050903089344501495, 0.05084517225623131, -0.011054969392716885, 0.007293261121958494, 0.0204852893948555, 0.021271131932735443, 0.12119749933481216, 0.02837638556957245, 0.025328585878014565, -0.05807116627693176, -0.014977256767451763, 4.864640566681511e-34, 0.01728973537683487, -0.10433316975831985, -0.013835744932293892, -0.0065351626835763454, 0.028435206040740013, -0.06866912543773651, 0.02269049547612667, 0.050271134823560715, -0.019390136003494263, 0.021627265959978104, -0.005454746540635824, 0.004058562219142914, 0.005626033525913954, 0.03459273651242256, 0.05905652418732643, -0.022823268547654152, -0.013670122250914574, 0.011365844868123531, 0.00880980771034956, 0.007972903549671173, 0.03675767406821251, 0.017497573047876358, -0.009519757702946663, -0.049263082444667816, -0.012504649348556995, -0.030822480097413063, -0.02459600567817688, 0.031112272292375565, 0.04026614874601364, -0.0030427612364292145, 0.03830238804221153, -0.053074128925800323, -0.0106948371976614, 0.033545561134815216, 0.013885480351746082, 0.060877978801727295, -0.04561556875705719, 0.008009364828467369, -0.09677521139383316, -0.0458492636680603, 0.027623938396573067, 0.03725322708487511, -0.03983553126454353, 0.010799516923725605, -0.0071481443010270596, -0.14069300889968872, -0.10822916775941849, -0.036907829344272614, 0.027595022693276405, -0.014530527405440807, -0.05685153231024742, 0.026027074083685875, 0.12898647785186768, 0.017782459035515785, -0.08345412462949753, 0.025745876133441925, 0.07495258003473282, -0.027605485171079636, -0.004061785992234945, 0.037868283689022064, -0.02661626785993576, 0.06636626273393631, -0.02534618228673935, 0.07690153270959854, -0.04441726952791214, 0.01714819297194481, 0.11035474389791489, -0.05795791745185852, 0.04598729684948921, 0.017200877889990807, -0.12755605578422546, -0.026641804724931717, -0.011792208068072796, 0.011335632763803005, -0.05969182774424553, 0.05297470837831497, -0.026545071974396706, -0.008914940059185028, 0.010835605673491955, -0.0432584173977375, 0.048909034579992294, 0.044976551085710526, -0.07259254157543182, -0.019751783460378647, -0.0457732230424881, -0.03661637753248215, -0.08105503022670746, -0.08456596732139587, -0.00011185937182744965, -0.05884948745369911, 0.0866469144821167, -0.04974512383341789, -0.011266336776316166, 0.005036341492086649, -0.004769223276525736, -4.668260919229705e-33, 0.0573231540620327, -0.002898638369515538, -0.008824045769870281, -0.04513218626379967, -0.09581238776445389, 0.0028174794279038906, 0.021650154143571854, -0.012610145844519138, -0.025829067453742027, -0.05422147735953331, 0.05602408945560455, 0.04133549705147743, 0.0589299313724041, 0.02846659906208515, 0.05954425781965256, 0.08434584736824036, 0.016776161268353462, -0.07476260513067245, 0.04987960681319237, -0.021056905388832092, 0.06670870631933212, -0.00202175579033792, 0.025410102680325508, -0.008682974614202976, -0.040292657911777496, -0.0007848073146305978, 0.03808043897151947, -0.0004821598995476961, 0.02028275839984417, -0.02174573391675949, 0.01324474811553955, 0.04280104115605354, -0.08832413703203201, -0.0019419929012656212, -0.028263060376048088, -0.04286365211009979, -0.09673777222633362, -0.00873009953647852, 0.0477755181491375, -0.062339700758457184, 0.06329663097858429, 0.02630370855331421, 0.003531010588631034, 0.04441334679722786, -0.07038623839616776, 0.08391968160867691, -0.08095269650220871, -0.027764609083533287, 0.038662318140268326, -0.05198349058628082, -0.04081161320209503, -0.00700647197663784, 0.05551886931061745, 0.02012387290596962, 0.007039838004857302, -0.0026187000330537558, 0.017013635486364365, -0.041651103645563126, -0.07317417860031128, -0.0006508466904051602, 0.06968317925930023, -0.03818964958190918, 0.014917759224772453, -0.03266826644539833, -0.12175770103931427, 0.029007498174905777, -0.0632072240114212, -0.05074697732925415, -0.05238911509513855, -0.07825946807861328, 0.016279079020023346, -0.06638935208320618, -0.03729630261659622, 0.018210196867585182, -0.05632219836115837, 0.008917278610169888, -0.018649116158485413, -0.03853769600391388, 0.026303933933377266, 0.0483325831592083, -0.05498063191771507, 0.04980454593896866, -0.08608398586511612, 0.03562503308057785, 0.009407789446413517, -0.09080114960670471, -0.04919775202870369, 0.057150449603796005, 0.028078777715563774, 0.03033081628382206, -0.019811518490314484, 0.037532027810811996, -0.016012651845812798, 0.028049660846590996, -0.053007327020168304, -4.8292019272366815e-8, -0.0379222109913826, -0.10412314534187317, 0.010156677104532719, 0.020288610830903053, -0.018626779317855835, -0.06933191418647766, 0.01789047010242939, 0.008337571285665035, 0.01420618500560522, 0.029240263625979424, 0.04386504739522934, 0.05599350109696388, -0.07046378403902054, -0.06023313105106354, -0.03063320741057396, 0.032058849930763245, -0.04089377075433731, -0.004093748517334461, 0.04494406282901764, -0.07389217615127563, 0.07758975774049759, -0.11159024387598038, 0.025152891874313354, 0.027939990162849426, 0.05866532772779465, 0.011943601071834564, 0.019181691110134125, 0.020848842337727547, -0.10505218803882599, 0.0201861634850502, 0.03126738220453262, 0.045545291155576706, -0.0061011421494185925, 0.055997587740421295, -0.09176148474216461, 0.09782122075557709, -0.024210676550865173, 0.0469648502767086, 0.04469851776957512, 0.0015165358781814575, 0.01104993000626564, 0.053056731820106506, -0.03659497946500778, -0.015579141676425934, 0.06512825191020966, 0.056074678897857666, -0.037043873220682144, 0.10226535052061081, -0.017990106716752052, -0.09423589706420898, -0.10279309749603271, 0.0400940366089344, -0.014227560721337795, 0.09289766103029251, 0.01830144226551056, 0.07217688113451004, -0.01737523078918457, -0.01569780521094799, 0.020042818039655685, 0.12992151081562042, 0.04074708744883537, -0.006437605246901512, 0.007139940280467272, -0.04701469466090202 ]
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. When parsed, a URL object is returned containing properties for each of these components. The `node:url` module provides two APIs for working with URLs: a legacy API that is Node.js specific, and a newer API that implements the same [WHATWG URL Standard][] used by web browsers. A comparison between the WHATWG and legacy APIs is provided below. Above the URL `'https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'`, properties of an object returned by the legacy `url.parse()` are shown. Below it are properties of a WHATWG `URL` object. WHATWG URL's `origin` property includes `protocol` and `host`, but not `username` or `password`. ```text ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ href │ ├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤ │ protocol │ │ auth │ host │ path │ hash │ │ │ │ ├─────────────────┬──────┼──────────┬────────────────┤ │ │ │ │ │ hostname │ port │ pathname │ search │ │ │ │ │ │ │ │ ├─┬──────────────┤ │ │ │ │ │ │ │ │ │ query │ │ " https: // user : pass @ sub.example.com : 8080 /p/a/t/h ? query=string #hash " │ │ │ │ │ hostname │ port │ │ │ │ │ │ │ │ ├─────────────────┴──────┤ │ │ │ │ protocol │ │ username │ password │ host │ │ │ │ ├──────────┴──┼──────────┴──────────┼────────────────────────┤ │ │ │ │ origin │ │ origin │ pathname │ search │ hash │ ├─────────────┴─────────────────────┴────────────────────────┴──────────┴────────────────┴───────┤ │ href │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (All spaces in the "" line should be ignored. They are purely for formatting.) ``` Parsing the URL string using the WHATWG API: ```js const myURL = new URL('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` Parsing the URL string using the legacy API: ```mjs import url from 'node:url'; const myURL = url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` ```cjs const url = require('node:url'); const myURL = url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'); ``` ### Constructing a URL from component parts and getting the constructed string It is possible to construct a WHATWG URL from component parts using either the property setters or a template literal string: ```js const myURL = new URL('https://example.org'); myURL.pathname = '/a/b/c'; myURL.search = '?d=e'; myURL.hash = '#fgh'; ``` ```js const pathname = '/a/b/c'; const search = '?d=e'; const hash = '#fgh'; const myURL = new URL(`https://example.org${pathname}${search}${hash}`); ``` To get the constructed URL string, use the `href` property accessor: ```js console.log(myURL.href); ``` ## The WHATWG URL API ### Class: `URL` Browser-compatible `URL` class, implemented by following the WHATWG URL Standard. [Examples of parsed URLs][] may be found in the Standard itself. The `URL` class is also available on the global object. In accordance with browser conventions, all properties of `URL` objects are implemented as getters and setters on the class prototype, rather than as data properties on the object itself. Thus, unlike [legacy `urlObject`][]s, using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still return `true`. #### `new URL(input[, base])` \* `input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is [converted to a string][] first. \* `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
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.001614243839867413, 0.04260674864053726, 0.07663953304290771, -0.000779170251917094, 0.10073692351579666, -0.020175248384475708, -0.0355040617287159, 0.08986570686101913, 0.016995517536997795, 0.03153304010629654, -0.02028086967766285, -0.03687713295221329, -0.02886040136218071, -0.01628575660288334, 0.02992527186870575, 0.06107313185930252, -0.012506927363574505, 0.03664405643939972, -0.020746445283293724, -0.11388248950242996, 0.046822093427181244, -0.07801999896764755, 0.08968448638916016, -0.0013579456135630608, -0.10831891745328903, 0.0033787772990763187, -0.045204464346170425, 0.024002740159630775, 0.09606430679559708, -0.048100750893354416, -0.050485871732234955, 0.00004553694452624768, 0.012468398548662663, -0.08092082291841507, 0.018492596223950386, -0.13106022775173187, -0.020931195467710495, -0.027967309579253197, -0.04554790258407593, -0.06409036368131638, -0.010460283607244492, 0.026114031672477722, 0.044895000755786896, -0.10346090793609619, 0.026764269918203354, 0.0204413291066885, 0.06623709201812744, 0.004113136790692806, -0.05639830231666565, 0.05976739525794983, -0.019479304552078247, 0.016647303476929665, 0.006996179465204477, -0.06570505350828171, -0.023066211491823196, 0.048001885414123535, -0.033998992294073105, -0.10216408222913742, -0.036936890333890915, -0.04073234274983406, 0.04976457357406616, -0.05199694633483887, -0.037739142775535583, -0.020093796774744987, 0.006936701480299234, -0.0643664300441742, 0.00382764870300889, 0.01834496296942234, -0.057423580437898636, -0.0223830658942461, 0.09152419120073318, 0.06187417358160019, 0.060923051089048386, 0.0007326698978431523, -0.013590613380074501, 0.030151765793561935, 0.04728280380368233, -0.014429775066673756, -0.08581662178039551, 0.006122472696006298, 0.01929006725549698, 0.03406351059675217, 0.030599035322666168, 0.023084452375769615, 0.01769474893808365, -0.043990109115839005, -0.004128520376980305, 0.02669537253677845, 0.009567735716700554, 0.0932149663567543, -0.0753161683678627, 0.04647934064269066, -0.008649403229355812, 0.044260792434215546, 0.09641879796981812, 0.056730717420578, 0.020878031849861145, -0.03565371409058571, 0.014990347437560558, -0.04914814606308937, -0.04562923684716225, -0.07958786934614182, -0.06361222267150879, 0.058133844286203384, -0.023752784356474876, 0.08675418049097061, 0.07262727618217468, 0.04987053945660591, 0.03658540919423103, 0.022280042991042137, -0.021008795127272606, 0.016440769657492638, -0.04555923491716385, 0.06562867015600204, 4.759815031427468e-33, 0.001235862961038947, 0.028034677729010582, 0.0028830738738179207, 0.0413922443985939, -0.017129341140389442, 0.008256849832832813, 0.06002656742930412, 0.00005231796967564151, -0.051192108541727066, -0.05647841468453407, -0.05866430699825287, 0.05841602385044098, -0.020345095545053482, -0.07274259626865387, -0.0345056988298893, 0.005496026016771793, 0.026441119611263275, 0.008262149058282375, 0.05667628347873688, 0.0217641219496727, 0.0008287836681120098, 0.06506336480379105, 0.04787104204297066, 0.004485518205910921, 0.10151143372058868, -0.04190792888402939, 0.03237530589103699, -0.011789729818701744, -0.06759852170944214, -0.002126262988895178, 0.06523656100034714, 0.027502166107296944, -0.029104873538017273, -0.009150167927145958, 0.06839853525161743, -0.006835315842181444, 0.03625265508890152, 0.008362461812794209, -0.1489550620317459, -0.03747693821787834, -0.054230254143476486, 0.031547944992780685, -0.01837124302983284, 0.015260187909007072, -0.07317756116390228, -0.10926083475351334, -0.07979226857423782, -0.03671170771121979, -0.005983415525406599, 0.0025645424611866474, -0.05025167390704155, 0.010263417847454548, 0.03050762414932251, -0.03904343023896217, 0.02060927078127861, -0.0320553332567215, 0.027120670303702354, -0.034827761352062225, -0.07765397429466248, 0.044526588171720505, 0.01899562031030655, 0.02830965258181095, -0.009648241102695465, -0.02801329642534256, -0.022389627993106842, 0.018034905195236206, -0.04146454110741615, 0.04366583377122879, -0.04498638957738876, 0.08049417287111282, 0.015738172456622124, 0.019543351605534554, -0.019638704136013985, -0.012062151916325092, -0.07617290318012238, -0.0383746474981308, -0.12597626447677612, -0.015315154567360878, 0.01830691285431385, -0.017203418537974358, -0.0083869444206357, -0.07898158580064774, -0.019139064475893974, 0.11453387141227722, -0.000166917045135051, 0.02009301818907261, -0.015503301285207272, -0.03613539785146713, 0.06677917391061783, -0.017501916736364365, 0.052218999713659286, 0.01124524138867855, -0.02958649955689907, -0.03644175827503204, -0.04763174057006836, -5.7647356010538414e-33, 0.05482672154903412, -0.015372233465313911, -0.0260427575558424, 0.17752191424369812, -0.07040324062108994, -0.0852966383099556, 0.018086276948451996, -0.012921544723212719, 0.0015172477578744292, 0.02700227126479149, -0.001430951408110559, 0.07094388455152512, 0.01233680173754692, -0.05605669319629669, 0.04818502813577652, 0.09487074613571167, -0.07234911620616913, -0.09662829339504242, -0.01174694113433361, -0.01444901991635561, -0.05318637564778328, 0.045492324978113174, -0.03013894334435463, -0.002596494508907199, -0.056537702679634094, 0.04989873617887497, 0.01101196650415659, -0.0499194972217083, -0.01934685930609703, -0.04237833619117737, 0.0001520228834124282, -0.01270141452550888, 0.017192957922816277, -0.005933808162808418, 0.013859612867236137, -0.00821748934686184, -0.027544695883989334, 0.11339732259511948, 0.0685279369354248, -0.10906258970499039, 0.06762022525072098, 0.020754262804985046, -0.01606503501534462, 0.05200875550508499, 0.033995095640420914, -0.014670044183731079, -0.0321345329284668, 0.06403528153896332, -0.025361644104123116, -0.008860775269567966, 0.016097910702228546, -0.0526815764605999, 0.062468521296978, -0.02599719725549221, -0.030812537297606468, -0.0515223927795887, -0.06760143488645554, 0.03529749810695648, -0.05292316526174545, 0.028811711817979813, 0.022799959406256676, -0.03431811183691025, -0.048189420253038406, 0.07934784144163132, -0.01884983293712139, -0.003401171648874879, -0.14643923938274384, -0.02944648638367653, -0.000566025439184159, -0.06055758148431778, -0.0057152034714818, -0.056673336774110794, 0.006953471805900335, -0.006779696326702833, 0.053659453988075256, -0.04595886915922165, 0.06973760575056076, 0.0027198591269552708, 0.038508087396621704, 0.05829484388232231, -0.08197518438100815, 0.09227927774190903, -0.012884944677352905, 0.013571258634328842, 0.05655220150947571, -0.011967864818871021, -0.06095660477876663, 0.08888449519872665, 0.0022273340728133917, 0.004364904947578907, 0.020561406388878822, 0.10177154839038849, -0.15773092210292816, -0.009883626364171505, -0.0029092123731970787, -5.492135102258544e-8, -0.08468081802129745, 0.05921163037419319, -0.1126202642917633, 0.03711847960948944, -0.0023536209482699633, 0.028234174475073814, 0.02861226163804531, 0.07213965803384781, 0.08460639417171478, 0.11374927312135696, 0.03951498493552208, 0.00212847045622766, -0.06631781905889511, -0.004774292465299368, -0.02422763779759407, 0.03354594111442566, -0.03433162719011307, 0.04102066904306412, -0.0036511258222162724, 0.006911054719239473, -0.06749658286571503, -0.011011186987161636, -0.02541622892022133, 0.04753086715936661, 0.06822921335697174, -0.042359400540590286, -0.00291998079046607, 0.05714888125658035, -0.07216279208660126, -0.01601865328848362, -0.059322576969861984, 0.042858321219682693, 0.0077280462719500065, -0.011043213307857513, -0.007376324851065874, 0.08743224292993546, -0.030030997470021248, -0.01631593517959118, 0.02372552454471588, 0.05109398812055588, 0.058813292533159256, 0.013530073687434196, 0.022247757762670517, 0.025787321850657463, -0.0028854222036898136, -0.009578774683177471, 0.06482888758182526, 0.034102149307727814, 0.03847986087203026, 0.030961407348513603, 0.03933566436171532, -0.0763549879193306, -0.045461855828762054, -0.02684163488447666, -0.01717144437134266, 0.03512521833181381, -0.02462535910308361, -0.09806931018829346, 0.016238629817962646, 0.023181157186627388, 0.11162237077951431, 0.016552278771996498, 0.05154222622513771, 0.017458343878388405 ]
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 = new URL('/foo', 'https://example.org/'); // https://example.org/foo ``` The URL constructor is accessible as a property on the global object. It can also be imported from the built-in url module: ```mjs import { URL } from 'node:url'; console.log(URL === globalThis.URL); // Prints 'true'. ``` ```cjs console.log(URL === require('node:url').URL); // Prints 'true'. ``` A `TypeError` will be thrown if the `input` or `base` are not valid URLs. Note that an effort will be made to coerce the given values into strings. For instance: ```js const myURL = new URL({ toString: () => 'https://example.org/' }); // https://example.org/ ``` Unicode characters appearing within the host name of `input` will be automatically converted to ASCII using the [Punycode][] algorithm. ```js const myURL = new URL('https://測試'); // https://xn--g6w251d/ ``` In cases where it is not known in advance if `input` is an absolute URL and a `base` is provided, it is advised to validate that the `origin` of the `URL` object is what is expected. ```js let myURL = new URL('http://Example.com/', 'https://example.org/'); // http://example.com/ myURL = new URL('https://Example.com/', 'https://example.org/'); // https://example.com/ myURL = new URL('foo://Example.com/', 'https://example.org/'); // foo://Example.com/ myURL = new URL('http:Example.com/', 'https://example.org/'); // http://example.com/ myURL = new URL('https:Example.com/', 'https://example.org/'); // https://example.org/Example.com/ myURL = new URL('foo:Example.com/', 'https://example.org/'); // foo:Example.com/ ``` #### `url.hash` \* Type: {string} Gets and sets the fragment portion of the URL. ```js const myURL = new URL('https://example.org/foo#bar'); console.log(myURL.hash); // Prints #bar myURL.hash = 'baz'; console.log(myURL.href); // Prints https://example.org/foo#baz ``` Invalid URL characters included in the value assigned to the `hash` property are [percent-encoded][]. The selection of which characters to percent-encode may vary somewhat from what the [`url.parse()`][] and [`url.format()`][] methods would produce. #### `url.host` \* Type: {string} Gets and sets the host portion of the URL. ```js const myURL = new URL('https://example.org:81/foo'); console.log(myURL.host); // Prints example.org:81 myURL.host = 'example.com:82'; console.log(myURL.href); // Prints https://example.com:82/foo ``` Invalid host values assigned to the `host` property are ignored. #### `url.hostname` \* Type: {string} Gets and sets the host name portion of the URL. The key difference between `url.host` and `url.hostname` is that `url.hostname` does \_not\_ include the port. ```js const myURL = new URL('https://example.org:81/foo'); console.log(myURL.hostname); // Prints example.org // Setting the hostname does not change the port myURL.hostname = 'example.com'; console.log(myURL.href); // Prints https://example.com:81/foo // Use myURL.host to change the hostname and port myURL.host = 'example.org:82'; console.log(myURL.href); // Prints https://example.org:82/foo ``` Invalid host name values assigned to the `hostname` property are ignored. #### `url.href` \* Type: {string} Gets and sets the serialized URL. ```js const myURL = new URL('https://example.org/foo'); console.log(myURL.href); // Prints https://example.org/foo myURL.href = 'https://example.com/bar'; console.log(myURL.href); // Prints https://example.com/bar ``` Getting the value of the `href` property is equivalent to calling [`url.toString()`][]. Setting the value of this property to a new value is equivalent to creating a new `URL` object using [`new URL(value)`][`new URL()`]. Each of the `URL` object's properties will be modified. If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown. #### `url.origin` \* Type: {string} Gets the 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--g6w251d ``` #### `url.password` \* Type: {string} Gets and sets the password portion of the URL. ```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.04536557197570801, 0.060547225177288055, 0.033687934279441833, -0.029750186949968338, 0.10162722319364548, -0.01937522552907467, -0.04097278416156769, 0.16219669580459595, 0.0012848109472543001, -0.010068858973681927, -0.007655438967049122, -0.02750181220471859, -0.05874420329928398, 0.0024284478276968002, 0.02427159622311592, 0.08702417463064194, 0.013562103733420372, 0.027948589995503426, 0.0037033692933619022, -0.04367413371801376, 0.054676156491041183, -0.0491986982524395, 0.10360778868198395, -0.007137133274227381, -0.08167456090450287, 0.007695942651480436, -0.05665019527077675, 0.0526307038962841, 0.06022803857922554, -0.002302024979144335, -0.07127195596694946, 0.019712742418050766, 0.05598878860473633, -0.05455251410603523, 0.0639931857585907, -0.10607735067605972, -0.0074683246202766895, -0.03279181197285652, -0.07354126125574112, -0.0740317851305008, -0.001574101741425693, 0.01021593064069748, 0.07328078895807266, -0.05448782071471214, 0.009114301763474941, 0.0396881029009819, -0.001868896302767098, 0.004984217695891857, -0.06177274137735367, 0.1014636754989624, -0.06096687912940979, 0.08539170771837234, -0.04148644953966141, -0.04864000901579857, 0.0832052156329155, 0.012852532789111137, -0.011312153190374374, -0.045036714524030685, -0.007890721783041954, -0.019900308921933174, 0.06580356508493423, -0.0413612499833107, -0.05859234184026718, -0.022818822413682938, 0.019779160618782043, -0.013155165128409863, 0.04576551541686058, 0.036039870232343674, -0.08454915881156921, 0.06141076609492302, 0.03409525379538536, 0.051575466990470886, 0.051839735358953476, 0.00381580856628716, 0.04319028556346893, 0.006014571990817785, 0.04774812236428261, -0.0651894137263298, -0.12106306105852127, -0.03545038402080536, -0.006509574130177498, 0.07586570084095001, 0.00201979698613286, -0.019176429137587547, -0.019685998558998108, -0.015600881539285183, -0.013009019196033478, 0.0347866490483284, -0.0023962226696312428, 0.08128651231527328, -0.09988444298505783, 0.05468052625656128, 0.051262132823467255, -0.0031391282100230455, 0.03736652433872223, 0.017487041652202606, -0.021716957911849022, -0.04848766699433327, -0.011835426092147827, -0.044472720474004745, -0.04323400557041168, -0.0753779336810112, -0.041300155222415924, 0.08150027692317963, -0.05917409434914589, 0.05661977082490921, 0.045562077313661575, 0.046189017593860626, -0.001892481348477304, 0.030915111303329468, -0.019002320244908333, -0.04419310763478279, -0.039489421993494034, 0.035057853907346725, -6.627826532439767e-34, 0.026368819177150726, 0.05060732737183571, -0.009789303876459599, 0.03846442699432373, -0.023034285753965378, 0.016747625544667244, 0.060248635709285736, 0.08349611610174179, -0.04382898285984993, -0.03556377813220024, -0.09010862559080124, 0.07244659215211868, 0.0055555300787091255, -0.08120936900377274, -0.015962189063429832, -0.000040865463233785704, 0.039984241127967834, -0.0002581604348961264, 0.06204603612422943, 0.04215487837791443, 0.0027257988695055246, 0.11117736250162125, -0.010082585737109184, -0.04052571952342987, 0.03157294541597366, -0.03918829560279846, -0.0064317905344069, -0.04684123024344444, -0.07892630249261856, -0.04979099705815315, 0.06497099995613098, -0.004798915237188339, -0.03658189997076988, 0.016525225713849068, 0.09357660263776779, 0.017428632825613022, 0.10601744800806046, 0.05063893273472786, -0.18008358776569366, -0.09055280685424805, -0.01805444248020649, -0.011767283082008362, 0.034636516124010086, 0.052386872470378876, -0.0035384895745664835, -0.0632069930434227, -0.10450722277164459, -0.07478287070989609, 0.04258248209953308, -0.03238101303577423, -0.04283455014228821, 0.03427501767873764, 0.018507592380046844, -0.05346805602312088, 0.05119527131319046, -0.017148423939943314, -0.04779337719082832, -0.02347780019044876, -0.053020089864730835, -0.02081049419939518, -0.022412536665797234, -0.01204534899443388, -0.04553087800741196, 0.09115161001682281, -0.06310959905385971, 0.040117084980010986, -0.027727613225579262, 0.008237949572503567, 0.01024417020380497, 0.06872301548719406, 0.008629939518868923, 0.029220301657915115, -0.06900228559970856, -0.007601813413202763, -0.025019384920597076, 0.04453999549150467, -0.09252233803272247, -0.006751662120223045, -0.020255612209439278, -0.014758696779608727, -0.010262662544846535, -0.03314638137817383, 0.029237696900963783, 0.11107325553894043, 0.0316423624753952, 0.03232976421713829, -0.019157443195581436, -0.030996838584542274, 0.08893528580665588, -0.03238571807742119, 0.011050248518586159, -0.07044639438390732, -0.06580621004104614, 0.0070440866984426975, -0.02172638289630413, -2.0717059375685848e-33, 0.09350437670946121, 0.05956456437706947, 0.02993086166679859, 0.1431204229593277, -0.06472234427928925, -0.01879306696355343, 0.01799018122255802, -0.022923311218619347, -0.025425666943192482, 0.038980986922979355, -0.026844484731554985, 0.0763172134757042, 0.08704918622970581, -0.014204648323357105, 0.003811934730038047, -0.0050330874510109425, -0.07396886497735977, -0.09729775041341782, -0.009331305511295795, -0.043408654630184174, -0.024550072848796844, 0.011369499377906322, -0.0011363013181835413, 0.0021095415577292442, -0.06143096834421158, 0.07014749199151993, -0.03693332150578499, -0.06063474714756012, -0.013179615139961243, 0.026474466547369957, -0.046785615384578705, 0.010209006257355213, -0.014143702574074268, 0.048474401235580444, -0.013312196359038353, 0.043019913136959076, -0.07886344939470291, 0.1013852134346962, 0.06811276078224182, -0.08248119801282883, 0.03588717058300972, 0.026725782081484795, -0.0969991609454155, 0.06247511878609657, 0.005299513693898916, -0.07385791838169098, -0.02313721552491188, 0.052525416016578674, -0.01677069067955017, -0.0360446572303772, -0.0048815286718308926, -0.06496480107307434, 0.006448035128414631, -0.03297293931245804, -0.006769668776541948, -0.012915208004415035, -0.08483074605464935, 0.019578101113438606, -0.04608991742134094, 0.04988816753029823, 0.032023265957832336, -0.06204375624656677, -0.09553266316652298, 0.056923165917396545, -0.1067628413438797, -0.018231842666864395, -0.11139808595180511, 0.03053746372461319, 0.017272433266043663, -0.007270967122167349, -0.02530616521835327, 0.029443006962537766, -0.0016472963616251945, 0.0054176561534404755, 0.03350383788347244, -0.024256255477666855, 0.059465643018484116, -0.011188541539013386, 0.01576957479119301, 0.03409363329410553, -0.03293691948056221, 0.036199331283569336, -0.011744900606572628, -0.0017196309054270387, 0.07440438121557236, -0.056106869131326675, 0.003566871164366603, 0.05283825099468231, -0.03514692559838295, 0.007360536139458418, 0.0009236765909008682, 0.0834512710571289, -0.15639890730381012, -0.04794754087924957, -0.04409781098365784, -5.085745513611073e-8, -0.06916869431734085, 0.09679622203111649, -0.07774865627288818, 0.011539934203028679, -0.04166476055979729, -0.029777269810438156, 0.052019763737916946, -0.010503537021577358, 0.06347516179084778, 0.1187528520822525, -0.04139954224228859, 0.0021656884346157312, -0.006836225278675556, -0.03957347944378853, -0.029609432443976402, 0.05449829250574112, -0.015694042667746544, 0.02305309846997261, 0.009423522278666496, 0.05201359838247299, -0.014345168136060238, 0.0118600744754076, -0.04478294029831886, 0.016959073022007942, 0.04166186973452568, -0.046743351966142654, -0.018032565712928772, 0.038507524877786636, -0.04758848249912262, 0.04996494948863983, -0.027016211301088333, 0.08808161318302155, -0.026292866095900536, 0.0171322301030159, -0.03964175283908844, 0.05607247352600098, -0.02714511752128601, -0.022473163902759552, 0.04751874879002571, 0.0074021704494953156, 0.06957633048295975, 0.03807515278458595, -0.023172710090875626, -0.00032166403252631426, -0.04451710730791092, -0.051499128341674805, 0.03061683475971222, 0.04342655465006828, 0.023989198729395866, 0.011335172690451145, 0.05853245407342911, -0.012446179986000061, -0.05950499325990677, -0.03839445486664772, 0.021375427022576332, 0.030069701373577118, -0.04131583124399185, -0.059095174074172974, -0.035785701125860214, -0.02552187815308571, 0.040671493858098984, 0.017882362008094788, 0.07431221753358841, -0.031243186444044113 ]
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--g6w251d ``` #### `url.password` \* Type: {string} Gets and sets the password portion of the URL. ```js const myURL = new URL('https://abc:xyz@example.com'); console.log(myURL.password); // Prints xyz myURL.password = '123'; console.log(myURL.href); // Prints https://abc:123@example.com/ ``` Invalid URL characters included in the value assigned to the `password` property are [percent-encoded][]. The selection of which characters to percent-encode may vary somewhat from what the [`url.parse()`][] and [`url.format()`][] methods would produce. #### `url.pathname` \* Type: {string} Gets and sets the path portion of the URL. ```js const myURL = new URL('https://example.org/abc/xyz?123'); console.log(myURL.pathname); // Prints /abc/xyz myURL.pathname = '/abcdef'; console.log(myURL.href); // Prints https://example.org/abcdef?123 ``` Invalid URL characters included in the value assigned to the `pathname` property are [percent-encoded][]. The selection of which characters to percent-encode may vary somewhat from what the [`url.parse()`][] and [`url.format()`][] methods would produce. #### `url.port` \* Type: {string} Gets and sets the port portion of the URL. The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will result in the `port` value becoming the empty string (`''`). The port value can be an empty string in which case the port depends on the protocol/scheme: | protocol | port | | -------- | ---- | | "ftp" | 21 | | "file" | | | "http" | 80 | | "https" | 443 | | "ws" | 80 | | "wss" | 443 | Upon assigning a value to the port, the value will first be converted to a string using `.toString()`. If that string is invalid but it begins with a number, the leading number is assigned to `port`. If the number lies outside the range denoted above, it is ignored. ```js const myURL = new URL('https://example.org:8888'); console.log(myURL.port); // Prints 8888 // Default ports are automatically transformed to the empty string // (HTTPS protocol's default port is 443) myURL.port = '443'; console.log(myURL.port); // Prints the empty string console.log(myURL.href); // Prints https://example.org/ myURL.port = 1234; console.log(myURL.port); // Prints 1234 console.log(myURL.href); // Prints https://example.org:1234/ // Completely invalid port strings are ignored myURL.port = 'abcd'; console.log(myURL.port); // Prints 1234 // Leading numbers are treated as a port number myURL.port = '5678abcd'; console.log(myURL.port); // Prints 5678 // Non-integers are truncated myURL.port = 1234.5678; console.log(myURL.port); // Prints 1234 // Out-of-range numbers which are not represented in scientific notation // will be ignored. myURL.port = 1e10; // 10000000000, will be range-checked as described below console.log(myURL.port); // Prints 1234 ``` Numbers which contain a decimal point, such as floating-point numbers or numbers in scientific notation, are not an exception to this rule. Leading numbers up to the decimal point will be set as the URL's port, assuming they are valid: ```js myURL.port = 4.567e21; console.log(myURL.port); // Prints 4 (because it is the leading number in the string '4.567e21') ``` #### `url.protocol` \* Type: {string} Gets and sets the protocol portion of the URL. ```js const myURL = new URL('https://example.org'); console.log(myURL.protocol); // Prints https: myURL.protocol = 'ftp'; console.log(myURL.href); // Prints ftp://example.org/ ``` Invalid URL protocol values assigned to the `protocol` property are ignored. ##### Special 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
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.006142979953438044, -0.005456607323139906, 0.019913768395781517, -0.09151280671358109, 0.09082302451133728, -0.041343916207551956, -0.02747984603047371, 0.12729491293430328, -0.033040858805179596, 0.004603949375450611, -0.009390153922140598, -0.029320644214749336, -0.021286776289343834, 0.045962799340486526, 0.015903621912002563, 0.045208439230918884, -0.004489723592996597, 0.034108005464076996, -0.0851115807890892, -0.07657521963119507, -0.011838113889098167, -0.07440028339624405, 0.07375343143939972, 0.011577043682336807, -0.07983773946762085, 0.04978716000914574, -0.027829047292470932, 0.02649461291730404, 0.11373845487833023, -0.04101371392607689, 0.04444751888513565, -0.028528226539492607, 0.03191850334405899, -0.09761515259742737, 0.01730164885520935, -0.1102784126996994, 0.060929905623197556, -0.0000493098959850613, -0.02029096707701683, 0.003604429541155696, -0.0066830674186348915, -0.015441573224961758, -0.030256671831011772, -0.08434155583381653, 0.011385702528059483, 0.0750812292098999, 0.0021005584858357906, 0.0075850216671824455, 0.007484699599444866, 0.08205872029066086, 0.018170004710555077, -0.015226790681481361, -0.02557528205215931, -0.04580581933259964, 0.07896159589290619, -0.007616310380399227, 0.0036682842765003443, -0.05756193771958351, -0.006591631565243006, -0.05754123628139496, 0.03667301684617996, -0.013020921498537064, -0.04613861069083214, -0.011639588512480259, -0.03847414627671242, -0.054765861481428146, 0.028950104489922523, 0.015890860930085182, -0.07473435997962952, 0.01154154259711504, 0.054373107850551605, 0.05556203052401543, 0.07354681193828583, -0.03322224318981171, 0.03293502330780029, 0.03459728881716728, 0.05332617834210396, -0.028510941192507744, -0.03629007935523987, -0.006389335263520479, 0.0034317185636609793, 0.0807095617055893, 0.04160510376095772, 0.02795584313571453, 0.02397865243256092, -0.046602580696344376, 0.01731535792350769, 0.08353426307439804, 0.07216300070285797, 0.0924091562628746, 0.004630617331713438, 0.05570497363805771, 0.00889092031866312, 0.02321522869169712, 0.116493821144104, 0.020985685288906097, 0.03555605933070183, 0.013375535607337952, 0.05198539420962334, 0.0033360859379172325, 0.013529332354664803, -0.09038954228162766, 0.025317247956991196, 0.04790225625038147, -0.006356833502650261, 0.03923428803682327, 0.04004128277301788, 0.07488881051540375, -0.044754765927791595, -0.020716896280646324, 0.03149403631687164, -0.014964979141950607, -0.01977609656751156, 0.03788137808442116, 9.026685404811656e-34, 0.004492331761866808, 0.06416814774274826, -0.02623211406171322, -0.025473473593592644, -0.03635188937187195, -0.017523886635899544, 0.009267251007258892, 0.06109734624624252, -0.03810543939471245, 0.01315937377512455, -0.06440982222557068, 0.013424698263406754, -0.012416260316967964, -0.09691876173019409, -0.03886402025818825, 0.028478743508458138, 0.014875534921884537, -0.007815646007657051, 0.02771628089249134, 0.07803407311439514, 0.022118136286735535, 0.07316253334283829, 0.07349512726068497, -0.040038492530584335, -0.046977486461400986, -0.05109267681837082, -0.011212282814085484, 0.011181607842445374, -0.1293499916791916, -0.017571430653333664, 0.06883694231510162, -0.03994185850024223, -0.05233171954751015, 0.012921749614179134, 0.08070405572652817, -0.03305137902498245, 0.13244594633579254, 0.021123483777046204, -0.11352334171533585, 0.002668319270014763, 0.014423667453229427, -0.08089105039834976, -0.02912711165845394, 0.05866052955389023, -0.008125605061650276, -0.04660743474960327, -0.1111072525382042, -0.060697250068187714, -0.007011407520622015, -0.0018056437838822603, -0.10422804951667786, 0.025930307805538177, -0.08752172440290451, -0.08263945579528809, 0.0606989823281765, -0.06078954041004181, -0.04929688945412636, -0.07418695837259293, -0.0927891880273819, -0.03775206208229065, 0.01791256293654442, 0.005177400074899197, -0.0029946425929665565, 0.04952223226428032, -0.02062956802546978, -0.05549733340740204, 0.011928625404834747, 0.00470528332516551, -0.04868575558066368, 0.03030860610306263, -0.06755486875772476, -0.006700212601572275, -0.019540030509233475, 0.05591912940144539, -0.05591142922639847, 0.03278519585728645, -0.049684468656778336, 0.08947832137346268, 0.06691046059131622, -0.008438914082944393, 0.07270825654268265, -0.003030183259397745, -0.04560144990682602, 0.13851921260356903, -0.047944579273462296, 0.07474153488874435, 0.026700250804424286, -0.012704971246421337, 0.019889773800969124, -0.03530404716730118, 0.019090278074145317, -0.06138308346271515, -0.03045259416103363, -0.09001373499631882, -0.06452284008264542, -4.118445844493643e-33, 0.02903028391301632, -0.012025853618979454, 0.08058400452136993, 0.08629336208105087, -0.08016455918550491, -0.029077909886837006, 0.08031158149242401, 0.003298745024949312, -0.062374960631132126, -0.008642257191240788, 0.04321218654513359, 0.07891948521137238, 0.000023667957066209055, -0.0015027353074401617, 0.06886763125658035, 0.046116314828395844, -0.027865247800946236, -0.019711244851350784, -0.03905371576547623, -0.08383188396692276, 0.009532838128507137, 0.0005036336951889098, -0.0390828475356102, 0.04594878852367401, -0.025571171194314957, 0.033934831619262695, -0.016534000635147095, -0.041862424463033676, -0.02426866441965103, -0.042131055146455765, -0.030001111328601837, 0.0952533408999443, 0.02207239344716072, 0.036436039954423904, -0.03429591283202171, -0.01167187001556158, -0.008661377243697643, 0.14360134303569794, -0.028710419312119484, -0.02750593237578869, 0.044453635811805725, 0.018579214811325073, -0.023972637951374054, 0.05997650325298309, 0.011593510396778584, -0.016803929582238197, -0.06450007110834122, -0.0011102745775133371, 0.04077237844467163, 0.0554523840546608, 0.02514933981001377, -0.04141039028763771, 0.04447530210018158, -0.07764224708080292, 0.04427322372794151, -0.02723720856010914, -0.068534255027771, 0.00018070757505483925, -0.07759780436754227, 0.03712310269474983, 0.00016368985234294087, -0.08231957256793976, -0.04435858502984047, -0.0008662928594276309, -0.05342487618327141, -0.07481221109628677, -0.04818166792392731, 0.04985861852765083, 0.0522579662501812, -0.015316352248191833, 0.016731176525354385, -0.002723084995523095, 0.009352701716125011, -0.01363470871001482, 0.08378472924232483, -0.027895238250494003, -0.00040452464600093663, -0.085037961602211, -0.00136947026476264, 0.054755330085754395, 0.04761264845728874, 0.025893695652484894, -0.02781238965690136, -0.014328635297715664, 0.10371480882167816, -0.04775859788060188, -0.045721132308244705, 0.07079967856407166, -0.05019431933760643, -0.0401419997215271, -0.0004004302609246224, 0.1346214860677719, -0.12024251371622086, -0.04577624797821045, 0.0015196835156530142, -5.3204360028757947e-8, -0.04850362241268158, -0.012701017782092094, -0.060496482998132706, -0.015454641543328762, -0.04577115178108215, 0.03235381841659546, -0.08709412813186646, -0.07950367033481598, -0.004851114470511675, 0.006318812724202871, -0.02414570190012455, 0.021929729729890823, 0.0006542732007801533, -0.01971154473721981, -0.10287629812955856, 0.02478216588497162, -0.04544837027788162, -0.04615462198853493, 0.042315490543842316, -0.0004759934381581843, -0.04345995560288429, 0.025853293016552925, -0.059203702956438065, -0.049830153584480286, 0.07759224623441696, -0.07904165238142014, -0.006157967261970043, 0.06937089562416077, -0.0013710183557122946, -0.01601882465183735, -0.03702685609459877, 0.0658959224820137, 0.0055215684697031975, -0.03539661690592766, -0.07339196652173996, 0.08309619128704071, -0.009520376101136208, -0.0644320547580719, 0.015873342752456665, -0.028218869119882584, 0.12158238142728806, 0.006972152274101973, 0.02246403507888317, 0.04799496755003929, -0.05112934857606888, -0.031115524470806122, 0.09454866498708725, 0.054509807378053665, 0.05230461433529854, -0.028845464810729027, 0.03052816353738308, -0.014814331196248531, 0.03245743364095688, -0.02798568271100521, -0.043350644409656525, -0.013818150386214256, -0.053020261228084564, -0.0311204232275486, 0.014953321777284145, 0.027569053694605827, 0.06021672859787941, 0.003255031071603298, 0.03917912766337395, -0.00220524612814188 ]
-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 protocol, and vice versa. For instance, changing from `http` to `https` works: ```js const u = new URL('http://example.org'); u.protocol = 'https'; console.log(u.href); // https://example.org/ ``` However, changing from `http` to a hypothetical `fish` protocol does not because the new protocol is not special. ```js const u = new URL('http://example.org'); u.protocol = 'fish'; console.log(u.href); // http://example.org/ ``` Likewise, changing from a non-special protocol to a special protocol is also not permitted: ```js const u = new URL('fish://example.org'); u.protocol = 'http'; console.log(u.href); // fish://example.org ``` According to the WHATWG URL Standard, special protocol schemes are `ftp`, `file`, `http`, `https`, `ws`, and `wss`. #### `url.search` \* Type: {string} Gets and sets the serialized query portion of the URL. ```js const myURL = new URL('https://example.org/abc?123'); console.log(myURL.search); // Prints ?123 myURL.search = 'abc=xyz'; console.log(myURL.href); // Prints https://example.org/abc?abc=xyz ``` Any invalid URL characters appearing in the value assigned the `search` property will be [percent-encoded][]. The selection of which characters to percent-encode may vary somewhat from what the [`url.parse()`][] and [`url.format()`][] methods would produce. #### `url.searchParams` \* Type: {URLSearchParams} Gets the [`URLSearchParams`][] object representing the query parameters of the URL. This property is read-only but the `URLSearchParams` object it provides can be used to mutate the URL instance; to replace the entirety of query parameters of the URL, use the [`url.search`][] setter. See [`URLSearchParams`][] documentation for details. Use care when using `.searchParams` to modify the `URL` because, per the WHATWG specification, the `URLSearchParams` object uses different rules to determine which characters to percent-encode. For instance, the `URL` object will not percent encode the ASCII tilde (`~`) character, while `URLSearchParams` will always encode it: ```js const myURL = new URL('https://example.org/abc?foo=~bar'); console.log(myURL.search); // prints ?foo=~bar // Modify the URL via searchParams... myURL.searchParams.sort(); console.log(myURL.search); // prints ?foo=%7Ebar ``` #### `url.username` \* Type: {string} Gets and sets the username portion of the URL. ```js const myURL = new URL('https://abc:xyz@example.com'); console.log(myURL.username); // Prints abc myURL.username = '123'; console.log(myURL.href); // Prints https://123:xyz@example.com/ ``` Any invalid URL characters appearing in the value assigned the `username` property will be [percent-encoded][]. The selection of which characters to percent-encode may vary somewhat from what the [`url.parse()`][] and [`url.format()`][] methods would produce. #### `url.toString()` \* Returns: {string} The `toString()` method on the `URL` object returns the serialized URL. The value returned is equivalent to that of [`url.href`][] and [`url.toJSON()`][]. #### `url.toJSON()` \* Returns: {string} The `toJSON()` method on the `URL` object returns the serialized URL. The value returned is equivalent to that of [`url.href`][] and [`url.toString()`][]. This method is automatically called when an `URL` object is serialized with [`JSON.stringify()`][]. ```js const myURLs = [ new URL('https://www.example.com'), new URL('https://test.example.org'), ]; console.log(JSON.stringify(myURLs)); // Prints ["https://www.example.com/","https://test.example.org/"] ``` #### `URL.createObjectURL(blob)` \* `blob` {Blob} \* Returns: {string} Creates a `'blob:nodedata:...'` URL string that represents the given {Blob} object and can be used to retrieve the `Blob` later. ```js const { Blob, resolveObjectURL, } = require('node:buffer'); const blob = new Blob(['hello']); const id = URL.createObjectURL(blob); // later... const otherBlob = resolveObjectURL(id); console.log(otherBlob.size); ``` The data stored by the registered {Blob} will be 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:nodedata:...` URL string returned by
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.10746060311794281, 0.10179191827774048, 0.015374526381492615, 0.033157385885715485, 0.02002534456551075, -0.03587314859032631, 0.0702289417386055, 0.12610943615436554, -0.02002156898379326, -0.010812520049512386, 0.005230003036558628, -0.01693427376449108, -0.07800319790840149, -0.006196307018399239, 0.011095814406871796, 0.058927711099386215, 0.005931074731051922, -0.012596696615219116, -0.02190474607050419, -0.11926838010549545, -0.028371170163154602, -0.08263064920902252, 0.02927575074136257, -0.0007935932953841984, -0.07222583144903183, -0.0075287227518856525, 0.04798300564289093, -0.01871769316494465, 0.004992019385099411, -0.09617777913808823, 0.002254447201266885, -0.05505191907286644, 0.011145996861159801, -0.08618348836898804, 0.004804003518074751, -0.15620048344135284, 0.007272291928529739, -0.03834545984864235, 0.0021679922938346863, -0.06854154169559479, 0.003306160680949688, 0.0542827732861042, -0.030730385333299637, -0.09264412522315979, 0.04312509670853615, 0.04837769269943237, -0.0005116194952279329, -0.005209189839661121, -0.035336632281541824, 0.0073699248023331165, 0.005185563117265701, -0.00002689816574275028, -0.07944075018167496, -0.06819149106740952, 0.061653099954128265, 0.020827211439609528, 0.005555762443691492, -0.07884704321622849, -0.04689284786581993, -0.021204058080911636, 0.04666959121823311, 0.004095569718629122, -0.04579939693212509, 0.012765906751155853, 0.0323350690305233, -0.004621972795575857, -0.04684441164135933, 0.027838710695505142, -0.09106159955263138, 0.014039968140423298, 0.013540646061301231, 0.10069523006677628, 0.08100201934576035, -0.04867417365312576, -0.003377616871148348, 0.04363443702459335, -0.003976927604526281, -0.028333473950624466, -0.054067254066467285, 0.024510666728019714, 0.015498829074203968, 0.0490865483880043, 0.006341210566461086, 0.03819248825311661, -0.007509560789912939, -0.02245340123772621, 0.009262044914066792, 0.027896417304873466, 0.010766842402517796, 0.05528121441602707, -0.07431914657354355, 0.014671874232590199, 0.013056674972176552, 0.02338813617825508, 0.08581095933914185, 0.05814576894044876, 0.03404271602630615, -0.030783792957663536, 0.003146805800497532, -0.02107187546789646, -0.09356024861335754, -0.14947931468486786, -0.004489635583013296, -0.06086129695177078, -0.05930160731077194, 0.016827767714858055, 0.06169205531477928, 0.02515445463359356, 0.02566380240023136, 0.06355234235525131, 0.03838781267404556, -0.04120464250445366, -0.01522662304341793, 0.07513075321912766, 2.1765570949260558e-33, 0.038018397986888885, -0.0022626451682299376, -0.07505184412002563, -0.02890920639038086, 0.03569783270359039, -0.004924836568534374, -0.016611579805612564, -0.028246622532606125, -0.004062446299940348, -0.03889046609401703, 0.05693983659148216, 0.09025358408689499, -0.012859012931585312, 0.02214287593960762, 0.0067006852477788925, 0.021091919392347336, 0.06845216453075409, 0.03443509712815285, 0.13346846401691437, 0.02954874187707901, 0.028606757521629333, 0.11191946268081665, 0.03927499055862427, -0.024171549826860428, 0.013579788617789745, 0.02304706908762455, -0.02764836698770523, 0.018080800771713257, -0.004251823294907808, 0.016666017472743988, 0.05981814116239548, -0.04551008716225624, 0.008257069624960423, -0.01231312844902277, 0.1209309920668602, 0.02411651611328125, 0.07259804010391235, -0.03351336717605591, -0.09551090747117996, -0.042375557124614716, 0.019115811213850975, 0.029250159859657288, -0.050812527537345886, 0.09245438873767853, 0.05440163239836693, -0.054933857172727585, -0.01681681163609028, 0.008644891902804375, -0.06462244689464569, -0.016519952565431595, -0.10136685520410538, 0.03702837973833084, 0.04398469999432564, -0.045817602425813675, 0.02603643201291561, -0.030573444440960884, -0.015826689079403877, -0.01389826089143753, -0.06656505167484283, -0.0043189977295696735, -0.033716026693582535, 0.06732401996850967, -0.027390524744987488, -0.03365851193666458, -0.0564589761197567, 0.03603651747107506, -0.039642754942178726, 0.0491437129676342, -0.011751750484108925, 0.06235366687178612, -0.060710616409778595, 0.10732635110616684, -0.0570710152387619, 0.04215218871831894, -0.06450556218624115, -0.05288565531373024, 0.0009220155770890415, 0.04052414745092392, 0.00824376754462719, -0.04295677691698074, -0.07729943841695786, -0.01624041609466076, -0.0033754019532352686, 0.1464390605688095, -0.048165369778871536, 0.04623829945921898, 0.04795273765921593, 0.008200032636523247, 0.04171789810061455, 0.04470694065093994, 0.03694344311952591, -0.011639694683253765, -0.012242223136126995, -0.035592492669820786, 0.062303122133016586, -4.9996592253494015e-33, 0.011773712001740932, 0.042313676327466965, -0.04127306491136551, 0.15999969840049744, -0.053436893969774246, -0.029061269015073776, 0.1186002790927887, -0.04977564141154289, 0.042863715440034866, -0.0077119446359574795, 0.055865801870822906, 0.031550806015729904, 0.0259265024214983, -0.08908319473266602, 0.020344052463769913, -0.013885152526199818, -0.0836317241191864, -0.02668119966983795, 0.004212483298033476, -0.037855248898267746, 0.03781299293041229, 0.009032661095261574, -0.06149376183748245, 0.06006518378853798, 0.02482723444700241, 0.02388368919491768, -0.045122627168893814, -0.09495008736848831, -0.025477295741438866, -0.05184580385684967, 0.013693762943148613, 0.029423736035823822, -0.02990090847015381, 0.07928851991891861, 0.02613212540745735, 0.038373444229364395, -0.01962139829993248, 0.17617112398147583, 0.02908559888601303, -0.11800172179937363, 0.08111336827278137, -0.057036932557821274, 0.002751381602138281, 0.08218995481729507, -0.01589188352227211, 0.014506768435239792, -0.06455866992473602, 0.0173684973269701, -0.0010830749524757266, -0.08252584934234619, 0.018455328419804573, -0.09943646192550659, 0.034226395189762115, -0.1082552894949913, 0.012438979931175709, 0.0017658245051279664, -0.004980706609785557, -0.03094264678657055, -0.02276352047920227, 0.04606908932328224, 0.03455295041203499, -0.015229868702590466, -0.04321719706058502, 0.04721282050013542, 0.009166683070361614, 0.009037653915584087, -0.11542762815952301, -0.02071763388812542, 0.03652682155370712, -0.04394034296274185, 0.03009635955095291, -0.03592885658144951, -0.02937201038002968, -0.03682761266827583, 0.03629040718078613, -0.09049823135137558, 0.02270030416548252, -0.048407357186079025, -0.0018867769977077842, 0.06436464190483093, 0.012059757485985756, 0.08579380065202713, -0.003622991032898426, -0.061454057693481445, 0.09778036177158356, 0.05532369762659073, -0.06350266188383102, 0.043327007442712784, -0.05112624540925026, -0.02476106770336628, -0.012668361887335777, 0.09312030673027039, -0.08914539963006973, 0.01370883546769619, -0.03002159856259823, -5.271630243441905e-8, -0.02828419767320156, 0.030723093077540398, -0.041652705520391464, 0.0005883891135454178, -0.024018455296754837, -0.021126646548509598, -0.020044779404997826, -0.07719291746616364, 0.03545531630516052, 0.04615221545100212, -0.04800274223089218, 0.052098944783210754, -0.012451504357159138, -0.008594938553869724, 0.0024816165678203106, -0.02280394919216633, -0.035472579300403595, -0.028592268005013466, -0.0037169023416936398, 0.00033907900797203183, -0.08778911083936691, 0.009682604111731052, -0.08300366252660751, -0.03223102539777756, 0.029006700962781906, -0.00670174416154623, 0.02467387355864048, 0.03711724653840065, 0.014579273760318756, 0.01586879789829254, 0.0042817131616175175, -0.023431740701198578, -0.026638973504304886, 0.04600959271192551, -0.033573657274246216, 0.03164954483509064, -0.09461265802383423, 0.003698932472616434, 0.029691264033317566, -0.027310198172926903, 0.08215346932411194, -0.026536574587225914, -0.012437326833605766, 0.030582310631871223, -0.04712926596403122, -0.001537805306725204, 0.07101395726203918, 0.012048388831317425, 0.03355993703007698, 0.03290634974837303, 0.00973639264702797, -0.026542389765381813, 0.016490846872329712, -0.05121036618947983, -0.017968911677598953, 0.05292830616235733, -0.03010667860507965, -0.12876825034618378, 0.018886234611272812, -0.06110948324203491, 0.08645591884851456, -0.01461814995855093, 0.05535983666777611, 0.052945032715797424 ]
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:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. Removes the stored {Blob} identified by the given ID. Attempting to revoke a ID that isn't registered will silently fail. #### `URL.canParse(input[, base])` \* `input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is [converted to a string][] first. \* `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. \* Returns: {boolean} Checks if an `input` relative to the `base` can be parsed to a `URL`. ```js const isValid = URL.canParse('/foo', 'https://example.org/'); // true const isNotValid = URL.canParse('/foo'); // false ``` #### `URL.parse(input[, base])` \* `input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is [converted to a string][] first. \* `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. \* Returns: {URL|null} Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs. Returns `null` if the parameters can't be resolved to a valid URL. ### Class: `URLPattern` > Stability: 1 - Experimental The `URLPattern` API provides an interface to match URLs or parts of URLs against a pattern. ```js const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/\*.html'); console.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html')); // Prints: // { // "hash": { "groups": { "0": "" }, "input": "" }, // "hostname": { "groups": {}, "input": "nodejs.org" }, // "inputs": [ // "https://nodejs.org/docs/latest/api/dns.html" // ], // "password": { "groups": { "0": "" }, "input": "" }, // "pathname": { "groups": { "0": "dns" }, "input": "/docs/latest/api/dns.html" }, // "port": { "groups": {}, "input": "" }, // "protocol": { "groups": {}, "input": "https" }, // "search": { "groups": { "0": "" }, "input": "" }, // "username": { "groups": { "0": "" }, "input": "" } // } console.log(myPattern.test('https://nodejs.org/docs/latest/api/dns.html')); // Prints: true ``` #### `new URLPattern()` Instantiate a new empty `URLPattern` object. #### `new URLPattern(string[, baseURL][, options])` \* `string` {string} A URL string \* `baseURL` {string | undefined} A base URL string \* `options` {Object} Options Parse the `string` as a URL, and use it to instantiate a new `URLPattern` object. 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. #### `new URLPattern(obj[, baseURL][, options])` \* `obj` {Object} An input pattern \* `baseURL` {string | undefined} A base URL string \* `options` {Object} Options Parse the `Object` as an input pattern, and use it to instantiate a new `URLPattern` object. The object members can be any of `protocol`, `username`, `password`, `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(input[, baseURL])` \* `input` {string | Object} A
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.0339830182492733, -0.06464054435491562, 0.07699830830097198, -0.020397037267684937, 0.021792735904455185, -0.057183679193258286, -0.006567766889929771, 0.03909402713179588, 0.0580962672829628, -0.016640769317746162, 0.05039957910776138, 0.018844634294509888, -0.06774624437093735, 0.0309645626693964, -0.01666560396552086, 0.056247416883707047, -0.05200213938951492, 0.07146027684211731, -0.02753329649567604, -0.07966458052396774, -0.03948112577199936, 0.0977386012673378, 0.08994598686695099, 0.0010746506741270423, -0.11803560703992844, -0.028868936002254486, -0.06869558990001678, 0.06703898310661316, 0.08267456293106079, -0.12052685022354126, 0.01178361102938652, -0.05484314262866974, 0.0715976133942604, -0.06452880799770355, 0.00556529825553298, -0.061775341629981995, -0.03756195679306984, -0.03552417829632759, -0.016155794262886047, -0.07639019936323166, 0.07552985846996307, 0.028924768790602684, 0.012118561193346977, -0.01630803756415844, -0.019539618864655495, -0.006712557282298803, 0.09149184823036194, 0.06294415891170502, -0.054109249264001846, 0.08188517391681671, -0.06199623644351959, 0.026916764676570892, 0.013593613170087337, 0.023768670856952667, -0.05596102401614189, 0.058334480971097946, -0.022514790296554565, 0.040193282067775726, 0.03973683714866638, -0.08312873542308807, 0.09264873713254929, -0.01449204795062542, 0.01411211397498846, -0.0032329403329640627, -0.017172502353787422, -0.0909627303481102, -0.030623873695731163, 0.031514644622802734, -0.07109861075878143, 0.08473039418458939, 0.039825115352869034, 0.0030562151223421097, 0.0017170716309919953, -0.035136669874191284, 0.030796391889452934, 0.05400710552930832, 0.02288885787129402, -0.03194262832403183, -0.044461674988269806, 0.10159897804260254, 0.0033506948966532946, 0.13677465915679932, -0.029321923851966858, -0.0034196956548839808, 0.04209595173597336, -0.04657013341784477, 0.018477441743016243, -0.031286630779504776, -0.023742562159895897, 0.01709817722439766, -0.03707631677389145, 0.02750498615205288, 0.014843583106994629, -0.0009440353605896235, 0.032363563776016235, 0.054122988134622574, -0.019372733309864998, -0.03515278920531273, 0.056084003299474716, 0.012938055209815502, 0.10596145689487457, -0.061219826340675354, -0.005989378783851862, 0.08785109966993332, 0.04917863756418228, -0.04828426241874695, 0.08165503293275833, 0.06788719445466995, -0.005842697340995073, -0.003505961038172245, -0.045039113610982895, -0.08438709378242493, -0.023183202371001244, -0.0022732061333954334, 4.4245445734477664e-33, 0.04273556172847748, -0.01703767478466034, -0.0035424232482910156, -0.01103703211992979, 0.021424252539873123, -0.012615117244422436, 0.0499698705971241, 0.025433940812945366, -0.017850356176495552, -0.07002564519643784, -0.08761799335479736, -0.03367401286959648, 0.005467773415148258, -0.06835266947746277, -0.004753538873046637, 0.005445109214633703, 0.030948428437113762, 0.06835876405239105, 0.054782744497060776, -0.006793846841901541, 0.00032121397089213133, 0.09500525146722794, -0.08514183014631271, -0.050605691969394684, -0.027527237311005592, -0.018857397139072418, -0.006218035239726305, -0.08843827247619629, -0.005223407410085201, 0.010221835225820541, -0.0027270514983683825, 0.01772507093846798, -0.09008268266916275, 0.06268530339002609, 0.018294967710971832, -0.03431099280714989, 0.01691446453332901, -0.01451758574694395, -0.14397254586219788, -0.07717021554708481, -0.003898927243426442, 0.048485543578863144, -0.0980563536286354, 0.058672741055488586, -0.03288039192557335, -0.1373082548379898, -0.027221186086535454, -0.03764423355460167, -0.01825788989663124, 0.019591201096773148, 0.05067123845219612, 0.019504325464367867, 0.03667547181248665, -0.046097226440906525, -0.02873116172850132, -0.07536555081605911, 0.011182376183569431, -0.03252653405070305, 0.015156906098127365, 0.046769216656684875, 0.09113820642232895, 0.07154066860675812, -0.023471901193261147, 0.058332040905952454, 0.014679189771413803, -0.018941441550850868, 0.06382382661104202, -0.004327025264501572, -0.08231598138809204, -0.006148756481707096, -0.03700649365782738, 0.0010962830856442451, -0.07206886261701584, -0.055669330060482025, -0.12730778753757477, -0.05350447818636894, -0.02730128914117813, -0.05792473629117012, -0.08563539385795593, -0.014757801778614521, 0.08460434526205063, -0.04942471906542778, 0.019546644762158394, -0.019091717898845673, -0.0317847765982151, 0.013818144798278809, 0.01436611171811819, -0.08655808866024017, 0.011127580888569355, 0.0032551416661590338, 0.08484286069869995, -0.013649891130626202, -0.08006242662668228, -0.00849978532642126, -0.027037762105464935, -5.3683684568481665e-33, 0.03304864466190338, -0.015813445672392845, -0.024670032784342766, 0.062089983373880386, -0.004957343451678753, -0.04742204025387764, 0.06231364980340004, 0.027959566563367844, -0.10242093354463577, -0.0677664503455162, -0.00890417117625475, -0.012154137715697289, 0.01613704487681389, -0.03727055341005325, 0.059869423508644104, -0.01943030208349228, -0.028635524213314056, -0.06989134848117828, -0.0911175012588501, 0.010456659831106663, -0.026029478758573532, 0.0583520382642746, 0.08275878429412842, 0.016648123040795326, -0.08584313094615936, 0.03450337424874306, -0.027562694624066353, -0.005270175635814667, 0.04077330231666565, -0.03520743176341057, 0.017463894560933113, 0.04256025701761246, -0.007142662536352873, -0.037097565829753876, -0.0034875173587352037, -0.019074903801083565, -0.06483292579650879, 0.0835534855723381, 0.041292354464530945, -0.04741906374692917, 0.06961265951395035, 0.07542194426059723, -0.04630129784345627, 0.07034888863563538, 0.031076624989509583, -0.05535328388214111, -0.0115711260586977, 0.04782620444893837, 0.03186769410967827, 0.031741466373205185, -0.006227731239050627, -0.028999947011470795, 0.06863285601139069, 0.0194112416356802, 0.017957627773284912, -0.04536294937133789, 0.02149406261742115, -0.06938864290714264, -0.017247304320335388, 0.010986348614096642, 0.090126171708107, -0.03492661193013191, -0.017440637573599815, 0.06271514296531677, -0.004016328603029251, -0.004135212395340204, -0.027634907513856888, 0.004419994540512562, -0.027537966147065163, -0.020717767998576164, 0.06496572494506836, 0.049888975918293, -0.0003647698322311044, 0.03423260524868965, 0.03561653196811676, -0.04004301503300667, -0.037582043558359146, 0.005488601978868246, -0.0364648662507534, 0.04652480408549309, -0.06042006239295006, 0.08485493063926697, 0.03176812827587128, 0.029111871495842934, 0.0492476224899292, -0.08915229886770248, -0.037334125488996506, 0.05670635402202606, -0.035111889243125916, 0.035568442195653915, -0.023304933682084084, -0.023571621626615524, -0.0672779232263565, 0.026650987565517426, 0.018016278743743896, -5.09684845440006e-8, -0.04493800178170204, 0.04882292076945305, -0.051265716552734375, 0.07232903689146042, 0.045774906873703, -0.09543085843324661, -0.0855870321393013, 0.055920325219631195, 0.10534993559122086, 0.0299387089908123, 0.02227112092077732, -0.021127622574567795, -0.02403445355594158, -0.030355000868439674, -0.021517064422369003, 0.03671788424253464, 0.025513170287013054, -0.05391593277454376, 0.030854329466819763, 0.006701594218611717, -0.029520301148295403, -0.07802659273147583, -0.06127228960394859, 0.040697310119867325, -0.008341208100318909, -0.018323618918657303, 0.11169123649597168, 0.06839586049318314, -0.0324089415371418, 0.01723664253950119, -0.06386369466781616, -0.0143870385363698, 0.028391879051923752, 0.03181561827659607, -0.046177033334970474, 0.11757031828165054, -0.009759615175426006, -0.00009275069169234484, -0.03302348032593727, 0.02072024531662464, 0.04008890688419342, 0.05936132371425629, 0.027794847264885902, 0.013508917763829231, 0.01796761155128479, -0.03992413729429245, 0.003197579877451062, 0.07293011248111725, -0.02518671564757824, 0.03324179723858833, -0.008296909742057323, -0.06529907137155533, -0.028652748093008995, 0.084422267973423, -0.004540272522717714, 0.0214700847864151, 0.017340846359729767, -0.0925886407494545, -0.0158609077334404, 0.1016271561384201, 0.10834237188100815, 0.06154206395149231, 0.04008837044239044, -0.008417211472988129 ]
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(input[, baseURL])` \* `input` {string | Object} A URL or URL parts \* `baseURL` {string | undefined} A base URL string Input can be a string or an object providing the individual URL parts. The object members can be any of `protocol`, `username`, `password`, `hostname`, `port`, `pathname`, `search`, `hash` or `baseURL`. If `baseURL` is not specified, it will default to `undefined`. Returns an object with an `inputs` key containing the array of arguments passed into the function and keys of the URL components which contains the matched input and matched groups. ```js const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/\*.html'); console.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html')); // Prints: // { // "hash": { "groups": { "0": "" }, "input": "" }, // "hostname": { "groups": {}, "input": "nodejs.org" }, // "inputs": [ // "https://nodejs.org/docs/latest/api/dns.html" // ], // "password": { "groups": { "0": "" }, "input": "" }, // "pathname": { "groups": { "0": "dns" }, "input": "/docs/latest/api/dns.html" }, // "port": { "groups": {}, "input": "" }, // "protocol": { "groups": {}, "input": "https" }, // "search": { "groups": { "0": "" }, "input": "" }, // "username": { "groups": { "0": "" }, "input": "" } // } ``` #### `urlPattern.test(input[, baseURL])` \* `input` {string | Object} A URL or URL parts \* `baseURL` {string | undefined} A base URL string Input can be a string or an object providing the individual URL parts. The object members can be any of `protocol`, `username`, `password`, `hostname`, `port`, `pathname`, `search`, `hash` or `baseURL`. If `baseURL` is not specified, it will default to `undefined`. Returns a boolean indicating if the input matches the current pattern. ```js const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/\*.html'); console.log(myPattern.test('https://nodejs.org/docs/latest/api/dns.html')); // Prints: true ``` ### Class: `URLSearchParams` The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the four following constructors. The `URLSearchParams` class is also available on the global object. The WHATWG `URLSearchParams` interface and the [`querystring`][] module have similar purpose, but the purpose of the [`querystring`][] module is more general, as it allows the customization of delimiter characters (`&` and `=`). On the other hand, this API is designed purely for URL query strings. ```js const myURL = new URL('https://example.org/?abc=123'); console.log(myURL.searchParams.get('abc')); // Prints 123 myURL.searchParams.append('abc', 'xyz'); console.log(myURL.href); // Prints https://example.org/?abc=123&abc=xyz myURL.searchParams.delete('abc'); myURL.searchParams.set('a', 'b'); console.log(myURL.href); // Prints https://example.org/?a=b const newSearchParams = new URLSearchParams(myURL.searchParams); // The above is equivalent to // const newSearchParams = new URLSearchParams(myURL.search); newSearchParams.append('a', 'c'); console.log(myURL.href); // Prints https://example.org/?a=b console.log(newSearchParams.toString()); // Prints a=b&a=c // newSearchParams.toString() is implicitly called myURL.search = newSearchParams; console.log(myURL.href); // Prints https://example.org/?a=b&a=c newSearchParams.delete('a'); console.log(myURL.href); // Prints https://example.org/?a=b&a=c ``` #### `new URLSearchParams()` Instantiate a new empty `URLSearchParams` object. #### `new URLSearchParams(string)` \* `string` {string} A query string Parse the `string` as a query string, and use it to instantiate a new `URLSearchParams` object. A leading `'?'`, if present, is ignored. ```js let params; params = new URLSearchParams('user=abc&query=xyz'); console.log(params.get('user')); // Prints 'abc' console.log(params.toString()); // Prints 'user=abc&query=xyz' params = new URLSearchParams('?user=abc&query=xyz'); console.log(params.toString()); // Prints 'user=abc&query=xyz' ``` #### `new URLSearchParams(obj)` \* `obj` {Object} An object representing a collection of key-value 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 array elements
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.038903363049030304, 0.06676973402500153, 0.05219894275069237, 0.007433180697262287, -0.008640365675091743, 0.013673379085958004, -0.015900012105703354, 0.10120442509651184, 0.03224988654255867, -0.031419139355421066, -0.03762879595160484, -0.08267413079738617, -0.06762532144784927, 0.006001308094710112, -0.031011974439024925, 0.024771803990006447, -0.019291264936327934, 0.056741032749414444, -0.020993564277887344, -0.09969115257263184, 0.04807087033987045, 0.008122874423861504, 0.1071656122803688, 0.02288231998682022, -0.10564447194337845, -0.02151246927678585, -0.06104397401213646, 0.02843201346695423, 0.024195613339543343, -0.06675919145345688, -0.029842130839824677, -0.060353588312864304, -0.006268239114433527, -0.05822063982486725, 0.021628526970744133, -0.10701150447130203, -0.0289531871676445, -0.07321959733963013, -0.033543385565280914, -0.058422625064849854, 0.020023377612233162, 0.08522626757621765, 0.04690103605389595, -0.09625007957220078, 0.03961380571126938, 0.003911307547241449, -0.02771119400858879, 0.004560403525829315, -0.04920424893498421, 0.05638595297932625, -0.0386476032435894, 0.06321693956851959, -0.057099852710962296, -0.01066479180008173, -0.043301213532686234, 0.055801235139369965, -0.015485032461583614, -0.0843765065073967, 0.005606553982943296, -0.1134166494011879, 0.09848571568727493, -0.047263748943805695, 0.01696855202317238, 0.013718011789023876, 0.023951852694153786, -0.0580412782728672, 0.000417745322920382, -0.005208911839872599, -0.09942062199115753, -0.049923766404390335, 0.06865928322076797, 0.055505119264125824, 0.023703882470726967, 0.017367273569107056, 0.02871396206319332, 0.023918623104691505, 0.049496691673994064, -0.011545129120349884, -0.1065053641796112, -0.0017762494971975684, 0.03481023386120796, 0.09350911527872086, 0.05588032305240631, -0.039446376264095306, 0.008294578641653061, -0.031594786792993546, 0.003844248363748193, -0.016144825145602226, -0.041338708251714706, 0.11019190400838852, -0.09950869530439377, -0.0001981161767616868, 0.013180230744183064, 0.0267654936760664, 0.022648602724075317, 0.01903349533677101, -0.07490198314189911, -0.07882728427648544, -0.049188222736120224, -0.013856165111064911, -0.05286436527967453, -0.0821036696434021, 0.004537940490990877, 0.07637081295251846, -0.008788407780230045, -0.026255248114466667, 0.07019093632698059, 0.08986693620681763, 0.061623767018318176, 0.03350323811173439, 0.00794406607747078, -0.031215613707900047, -0.059956446290016174, 0.0322711244225502, 4.681344538696342e-33, 0.03390413895249367, -0.01493141707032919, -0.04750009998679161, 0.01901417225599289, 0.01755325123667717, 0.0380098931491375, 0.06731653213500977, 0.07407383620738983, -0.02947368659079075, 0.011762706562876701, -0.09870552271604538, 0.022737938910722733, 0.03632768243551254, -0.02725156955420971, 0.05974274128675461, 0.06474810093641281, 0.045413944870233536, 0.05388054996728897, 0.050396934151649475, 0.01622219942510128, 0.06907674670219421, 0.03550935164093971, -0.047463662922382355, -0.005106454715132713, -0.010800253599882126, -0.0009687680867500603, -0.031175605952739716, -0.013931936584413052, -0.0380457267165184, -0.02116323448717594, 0.10528293251991272, -0.041851889342069626, -0.071689173579216, 0.10268055647611618, 0.08542662113904953, -0.020710306242108345, 0.036812376230955124, 0.021787181496620178, -0.07854588329792023, -0.06688748300075531, -0.06020953133702278, -0.04521820694208145, -0.031852107495069504, 0.08455316722393036, -0.01666216552257538, -0.11172308772802353, -0.15410436689853668, -0.03576440364122391, 0.03000175766646862, 0.04497377201914787, 0.0053621986880898476, 0.01874682493507862, 0.08526374399662018, 0.02928919717669487, 0.0272478386759758, -0.01512483973056078, -0.06149281561374664, 0.015202386304736137, -0.050241030752658844, 0.0105936573818326, -0.04701022803783417, 0.051254238933324814, -0.07344575226306915, 0.021548965945839882, -0.0780092254281044, -0.02006508596241474, 0.04894097521901131, -0.03202919661998749, 0.041253890842199326, 0.042312394827604294, -0.015084926038980484, 0.028784915804862976, -0.03163531422615051, 0.05201062932610512, -0.05939273163676262, -0.0539303794503212, -0.08152833580970764, -0.05840427801012993, -0.023075174540281296, -0.008348365314304829, -0.03462861105799675, -0.00238628126680851, -0.03526671603322029, 0.08082535117864609, -0.01220633927732706, 0.04058540612459183, -0.04332549497485161, -0.06230197474360466, 0.02740057371556759, -0.06758705526590347, 0.028853993862867355, -0.031545352190732956, -0.09793810546398163, -0.012486827559769154, 0.035471055656671524, -7.841196780613487e-33, 0.08708524703979492, 0.017210520803928375, -0.008510114625096321, 0.03485000506043434, -0.06383165717124939, -0.02633053809404373, 0.06580071151256561, -0.020546359941363335, -0.0279888566583395, -0.0195919182151556, -0.04771331697702408, 0.06975114345550537, 0.07859013974666595, -0.073488250374794, -0.012037514708936214, 0.046698689460754395, -0.12970489263534546, -0.1157563105225563, 0.01054167840629816, -0.04859728366136551, -0.05627206340432167, 0.06218888238072395, -0.03182370960712433, 0.011513661593198776, -0.05779033526778221, 0.04774589464068413, 0.0017262558685615659, -0.05666916072368622, -0.004889931529760361, 0.04706577584147453, 0.0021210424602031708, 0.02425495535135269, -0.05842878296971321, 0.04544594883918762, -0.04478185251355171, 0.018131401389837265, 0.03234902024269104, 0.1048392802476883, 0.029935678467154503, -0.020883027464151382, 0.10910836607217789, 0.030320266261696815, -0.0048669567331671715, 0.08701524138450623, 0.020161151885986328, -0.04731529951095581, 0.005003621336072683, 0.06087398901581764, -0.01485075056552887, -0.017430346459150314, 0.05188394710421562, -0.03700621798634529, 0.044212955981492996, -0.012093509547412395, 0.020052822306752205, -0.00019526606774888933, 0.0035177927929908037, -0.02632209099829197, -0.07258597761392593, 0.08765124529600143, 0.039234500378370285, -0.07059234380722046, -0.0035351819824427366, 0.10931901633739471, -0.09993002563714981, -0.0323372557759285, -0.07836797833442688, 0.02851269207894802, 0.04443284869194031, -0.055181872099637985, 0.004447980783879757, -0.017795680090785027, 0.026583101600408554, 0.018260158598423004, 0.07577436417341232, 0.0031396723352372646, 0.0012144132051616907, 0.015938790515065193, 0.05095502361655235, 0.07908908277750015, -0.005919031798839569, 0.059229038655757904, 0.013927415944635868, 0.005440172273665667, 0.0802280381321907, -0.06967780739068985, -0.011748113669455051, 0.05884896218776703, -0.06812897324562073, -0.03705998510122299, 0.015073039568960667, 0.08717796206474304, -0.07804732024669647, 0.04660588875412941, -0.022042306140065193, -6.437067412434772e-8, -0.04032585024833679, 0.04686090722680092, -0.08134671300649643, 0.011994756758213043, -0.013899966143071651, 0.030341168865561485, 0.018206577748060226, -0.019526120275259018, 0.07930547744035721, 0.04241868481040001, -0.03977962210774422, 0.03227312117815018, -0.06003250554203987, 0.004806229844689369, 0.019313596189022064, 0.03433971852064133, -0.020640168339014053, 0.02472057193517685, -0.04315558820962906, 0.00721398601308465, -0.020500298589468002, -0.056557051837444305, -0.07959339767694473, 0.020542746409773827, 0.024613317102193832, -0.04158739000558853, 0.007332765031605959, 0.047887496650218964, -0.1018119528889656, 0.05819782242178917, -0.015036381781101227, 0.06286586076021194, -0.003423848655074835, -0.020515307784080505, -0.06115416809916496, 0.13142208755016327, -0.016568627208471298, -0.0336274579167366, -0.011783312074840069, 0.006275544874370098, 0.022931676357984543, 0.03984738886356354, -0.002988120773807168, -0.04144391790032387, -0.0011530788615345955, -0.03815014287829399, 0.048624902963638306, 0.035383544862270355, 0.005548590794205666, 0.02141362428665161, 0.0014304373180493712, -0.0030488912016153336, -0.045689765363931656, 0.006471811328083277, -0.043392494320869446, 0.04363373667001724, -0.030725380405783653, -0.08184696733951569, -0.02532375603914261, 0.02413402684032917, 0.05877310037612915, 0.08610355108976364, 0.0806853324174881, 0.028296245262026787 ]
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 array elements with commas. ```js const params = new URLSearchParams({ user: 'abc', query: ['first', 'second'], }); console.log(params.getAll('query')); // Prints [ 'first,second' ] console.log(params.toString()); // Prints 'user=abc&query=first%2Csecond' ``` #### `new URLSearchParams(iterable)` \* `iterable` {Iterable} An iterable object whose elements are key-value pairs Instantiate a new `URLSearchParams` object with an iterable map in a way that is similar to {Map}'s constructor. `iterable` can be an `Array` or any iterable object. That means `iterable` can be another `URLSearchParams`, in which case the constructor will simply create a clone of the provided `URLSearchParams`. Elements of `iterable` are key-value pairs, and can themselves be any iterable object. Duplicate keys are allowed. ```js let params; // Using an array params = new URLSearchParams([ ['user', 'abc'], ['query', 'first'], ['query', 'second'], ]); console.log(params.toString()); // Prints 'user=abc&query=first&query=second' // Using a Map object const map = new Map(); map.set('user', 'abc'); map.set('query', 'xyz'); params = new URLSearchParams(map); console.log(params.toString()); // Prints 'user=abc&query=xyz' // Using a generator function function\* getQueryPairs() { yield ['user', 'abc']; yield ['query', 'first']; yield ['query', 'second']; } params = new URLSearchParams(getQueryPairs()); console.log(params.toString()); // Prints 'user=abc&query=first&query=second' // Each key-value pair must have exactly two elements new URLSearchParams([ ['user', 'abc', 'error'], ]); // Throws TypeError [ERR\_INVALID\_TUPLE]: // Each query pair must be an iterable [name, value] tuple ``` #### `urlSearchParams.append(name, value)` \* `name` {string} \* `value` {string} Append a new name-value pair to the query string. #### `urlSearchParams.delete(name[, value])` \* `name` {string} \* `value` {string} If `value` is provided, removes all name-value pairs where name is `name` and value is `value`.. If `value` is not provided, removes all name-value pairs whose name is `name`. #### `urlSearchParams.entries()` \* Returns: {Iterator} Returns an ES6 `Iterator` over each of the name-value pairs in the query. Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`. Alias for [`urlSearchParams[Symbol.iterator]()`][`urlSearchParamsSymbol.iterator()`]. #### `urlSearchParams.forEach(fn[, thisArg])` \* `fn` {Function} Invoked for each name-value pair in the query \* `thisArg` {Object} To be used as `this` value for when `fn` is called Iterates over each name-value pair in the query and invokes the given function. ```js const myURL = new URL('https://example.org/?a=b&c=d'); myURL.searchParams.forEach((value, name, searchParams) => { console.log(name, value, myURL.searchParams === searchParams); }); // Prints: // a b true // c d true ``` #### `urlSearchParams.get(name)` \* `name` {string} \* Returns: {string | null} A string or `null` if there is no name-value pair with the given `name`. Returns the value of the first name-value pair whose name is `name`. If there are no such pairs, `null` is returned. #### `urlSearchParams.getAll(name)` \* `name` {string} \* Returns: {string\[]} Returns the values of all name-value pairs whose name is `name`. If there are no such pairs, an empty array is returned. #### `urlSearchParams.has(name[, value])` \* `name` {string} \* `value` {string} \* Returns: {boolean} Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument. If `value` is provided, returns `true` when name-value pair with same `name` and `value` exists. If `value` is not 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); } // Prints: // foo //
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.010105772875249386, 0.0441361702978611, 0.04007989913225174, -0.059782475233078, 0.027346698567271233, -0.04990658909082413, -0.07119733095169067, 0.07823455333709717, -0.025011876598000526, -0.030855856835842133, -0.03473987057805061, -0.02523207664489746, 0.030327079817652702, 0.0404016338288784, -0.04377100244164467, -0.012002550065517426, 0.031264036893844604, 0.03796382620930672, -0.09542042762041092, -0.0868832990527153, 0.06202021986246109, -0.04106394574046135, 0.06303955614566803, 0.008283877745270729, -0.07090683281421661, 0.066070556640625, -0.06791986525058746, 0.01166653260588646, 0.09625894576311111, -0.09062735736370087, -0.051718857139348984, -0.04651598632335663, 0.02930743247270584, -0.03038237988948822, 0.04359576478600502, -0.026022111997008324, 0.010037592612206936, -0.0740145742893219, -0.016811350360512733, -0.036338772624731064, -0.03179875388741493, 0.08101052790880203, 0.020563751459121704, -0.1500701606273651, -0.017656760290265083, 0.03248288109898567, -0.06264689564704895, -0.013851791620254517, -0.0758744478225708, 0.07544528692960739, 0.06542115658521652, 0.03909403085708618, -0.08486433327198029, 0.03601428121328354, -0.006542652379721403, 0.06126004830002785, 0.018982987850904465, -0.01987130381166935, -0.016008097678422928, 0.046013105660676956, 0.019360361620783806, -0.027311835438013077, 0.036910418421030045, -0.048987507820129395, -0.04815031960606575, -0.052470967173576355, 0.02778661623597145, -0.04225070774555206, -0.12216483056545258, -0.055809199810028076, 0.059344589710235596, 0.002384312218055129, 0.00695453118532896, -0.04427337646484375, -0.06559855490922928, 0.0005211495445109904, 0.026188615709543228, -0.029921669512987137, -0.04075407236814499, 0.05022731050848961, 0.043430767953395844, 0.0895153284072876, 0.023204203695058823, 0.05501252040266991, -0.027052508667111397, -0.01611248031258583, 0.02105148695409298, 0.010829722508788109, -0.0220437441021204, 0.0842803567647934, -0.06833764165639877, -0.0035334196873009205, -0.007796100806444883, 0.011526665650308132, -0.020784854888916016, -0.0489644780755043, 0.04570390284061432, -0.02577536180615425, 0.03200684115290642, -0.007748914882540703, -0.0008838947396725416, -0.13211466372013092, 0.0056796595454216, 0.007198091130703688, -0.058230046182870865, 0.05817825347185135, 0.02881176583468914, 0.07977667450904846, -0.017423368990421295, -0.022780228406190872, -0.021937668323516846, -0.03508047014474869, -0.027057522907853127, -0.0018130970420315862, 3.542348552783117e-33, 0.07719310373067856, 0.05864237993955612, 0.0018336029024794698, -0.02384490706026554, -0.05863229185342789, 0.08323832601308823, 0.04277566447854042, 0.08409527689218521, -0.03269876167178154, -0.024649396538734436, -0.09978827834129333, 0.07226718217134476, 0.029276147484779358, -0.04265628382563591, -0.0429636687040329, 0.02592877298593521, 0.04559796303510666, -0.036644671112298965, -0.04012899100780487, 0.009684808552265167, 0.021570192649960518, 0.05754929035902023, 0.032540109008550644, -0.02870066650211811, 0.033015649765729904, -0.05248343572020531, 0.00121043820399791, 0.0022297510877251625, -0.02567814104259014, 0.009524484165012836, 0.06343908607959747, 0.05162809044122696, -0.11082785576581955, 0.04179436340928078, 0.0788571909070015, 0.012677956372499466, 0.09326718747615814, 0.030504778027534485, -0.1276881992816925, -0.054780472069978714, -0.03070029616355896, -0.02262788638472557, 0.06171682849526405, -0.027138417586684227, -0.04455070197582245, -0.10078998655080795, -0.13385196030139923, 0.015062832273542881, -0.001004773541353643, 0.056777313351631165, -0.07654621452093124, 0.04365803673863411, -0.007930664345622063, -0.04099269211292267, 0.022131608799099922, -0.04731852933764458, 0.015834106132388115, -0.013534272089600563, -0.04656841605901718, 0.08397137373685837, -0.060536108911037445, 0.030759215354919434, 0.04689038172364235, 0.002014393685385585, -0.01056604739278555, -0.03020036779344082, 0.060983043164014816, 0.06982355564832687, 0.01844334416091442, 0.02121368609368801, -0.03790433332324028, 0.020973563194274902, -0.00026770951808430254, -0.04389304667711258, -0.04249604418873787, -0.05708455666899681, -0.03482683002948761, -0.0325591005384922, 0.011216024868190289, -0.04610399529337883, -0.018933940678834915, -0.07707181572914124, -0.03483734279870987, 0.08648905158042908, -0.024798590689897537, 0.062119632959365845, -0.08330516517162323, -0.023444192484021187, -0.01247086189687252, 0.02677045203745365, 0.00906459055840969, 0.058541297912597656, -0.07157964259386063, -0.04207742586731911, 0.01109185628592968, -6.38326493275119e-33, 0.06385276466608047, -0.0599900521337986, 0.025249438360333443, 0.1178402304649353, 0.07037008553743362, -0.058159783482551575, 0.05779319629073143, 0.003525510663166642, -0.05678124353289604, -0.016511105000972748, -0.031910285353660583, 0.045944277197122574, 0.10308809578418732, -0.07177425175905228, 0.04601498320698738, 0.07161771506071091, -0.060348231345415115, -0.0343238040804863, 0.04969047009944916, -0.07691854983568192, 0.02549581788480282, 0.04008461534976959, -0.017315099015831947, -0.012722384184598923, -0.08287464082241058, 0.011084283702075481, 0.009847227483987808, -0.07190454751253128, 0.030252134427428246, 0.06616977602243423, 0.05680066719651222, -0.02014823630452156, -0.021337972953915596, -0.009977412410080433, -0.038853373378515244, -0.00764621002599597, 0.013568541035056114, 0.07456424832344055, -0.005162355490028858, 0.040415264666080475, 0.013773249462246895, -0.04516001045703888, 0.03412732481956482, 0.02581605687737465, 0.04728774353861809, -0.023742934688925743, 0.011875922791659832, 0.058625660836696625, 0.01999276876449585, -0.01066415011882782, 0.11019320785999298, -0.015135595574975014, -0.08159197866916656, -0.0057627116329967976, 0.023524072021245956, -0.10688082873821259, -0.11424480378627777, -0.03490656241774559, 0.0023154160007834435, 0.023127274587750435, 0.013928614556789398, -0.049756988883018494, 0.07578326016664505, 0.04625803977251053, 0.010471377521753311, -0.06033870205283165, -0.1039181724190712, -0.036822814494371414, -0.016310205683112144, -0.002217082306742668, -0.035393692553043365, -0.07708650082349777, 0.0029623443260788918, -0.00536706205457449, 0.028934231027960777, -0.059281766414642334, -0.035866569727659225, -0.0044944980181753635, 0.09147616475820541, 0.014436205849051476, 0.03462769091129303, 0.031284887343645096, 0.04199009761214256, 0.01815866120159626, 0.0022104878444224596, -0.010993247851729393, 0.02792983688414097, 0.06716148555278778, -0.06539265811443329, 0.030601035803556442, 0.02574622444808483, 0.06521014124155045, -0.07476988434791565, 0.014289402402937412, 0.011774099431931973, -4.789952967598765e-8, -0.07921843230724335, 0.04131361469626427, -0.1268738955259323, 0.08257859945297241, -0.008151990361511707, -0.016648104414343834, 0.022908303886651993, 0.09891673922538757, 0.016573740169405937, 0.010064692236483097, 0.003041824558749795, 0.07508927583694458, 0.05682249367237091, 0.025923460721969604, 0.032003674656152725, -0.02493167854845524, -0.07260071486234665, -0.029241027310490608, -0.03676673024892807, 0.023549271747469902, -0.005993565544486046, -0.043411217629909515, -0.05687188357114792, -0.003341604257002473, 0.11749549955129623, 0.007276242598891258, 0.014351793564856052, -0.015073826536536217, 0.02149827405810356, 0.08598745614290237, -0.09578612446784973, -0.0010487533872947097, 0.018802369013428688, -0.029369119554758072, -0.034038007259368896, -0.019088556990027428, -0.09031806141138077, -0.011560273356735706, -0.012408042326569557, -0.027902765199542046, 0.08302731812000275, 0.03193604573607445, -0.007138765882700682, 0.09021789580583572, -0.021334843710064888, -0.08221184462308884, 0.0868552103638649, 0.08599187433719635, 0.0012713023461401463, -0.01441742293536663, -0.02231398969888687, -0.04503847286105156, 0.036817196756601334, -0.07759422808885574, -0.0615638867020607, -0.029331957921385765, -0.011333935894072056, -0.0021407047752290964, 0.0705546885728836, 0.01647822931408882, 0.08112790435552597, -0.03034096024930477, -0.04023854807019234, 0.05664711073040962 ]
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); } // Prints: // foo // foo ``` #### `urlSearchParams.set(name, value)` \* `name` {string} \* `value` {string} Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, set the first such pair's value to `value` and remove all others. If not, append the name-value pair to the query string. ```js const params = new URLSearchParams(); params.append('foo', 'bar'); params.append('foo', 'baz'); params.append('abc', 'def'); console.log(params.toString()); // Prints foo=bar&foo=baz&abc=def params.set('foo', 'def'); params.set('xyz', 'opq'); console.log(params.toString()); // Prints foo=def&abc=def&xyz=opq ``` #### `urlSearchParams.size` The total number of parameter entries. #### `urlSearchParams.sort()` Sort all existing name-value pairs in-place by their names. Sorting is done with a [stable sorting algorithm][], so relative order between name-value pairs with the same name is preserved. This method can be used, in particular, to increase cache hits. ```js const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); params.sort(); console.log(params.toString()); // Prints query%5B%5D=abc&query%5B%5D=123&type=search ``` #### `urlSearchParams.toString()` \* Returns: {string} Returns the search parameters serialized as a string, with characters percent-encoded where necessary. #### `urlSearchParams.values()` \* Returns: {Iterator} Returns an ES6 `Iterator` over the values of each name-value pair. #### `urlSearchParams[Symbol.iterator]()` \* Returns: {Iterator} Returns an ES6 `Iterator` over each of the name-value pairs in the query string. Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`. Alias for [`urlSearchParams.entries()`][]. ```js const params = new URLSearchParams('foo=bar&xyz=baz'); for (const [name, value] of params) { console.log(name, value); } // Prints: // foo bar // xyz baz ``` ### `url.domainToASCII(domain)` \* `domain` {string} \* Returns: {string} Returns the [Punycode][] ASCII serialization of the `domain`. If `domain` is an invalid domain, the empty string is returned. It performs the inverse operation to [`url.domainToUnicode()`][]. ```mjs import url from 'node:url'; console.log(url.domainToASCII('español.com')); // Prints xn--espaol-zwa.com console.log(url.domainToASCII('中文.com')); // Prints xn--fiq228c.com console.log(url.domainToASCII('xn--iñvalid.com')); // Prints an empty string ``` ```cjs const url = require('node:url'); console.log(url.domainToASCII('español.com')); // Prints xn--espaol-zwa.com console.log(url.domainToASCII('中文.com')); // Prints xn--fiq228c.com console.log(url.domainToASCII('xn--iñvalid.com')); // Prints an empty string ``` ### `url.domainToUnicode(domain)` \* `domain` {string} \* Returns: {string} Returns the Unicode serialization of the `domain`. If `domain` is an invalid domain, the empty string is returned. It performs the inverse operation to [`url.domainToASCII()`][]. ```mjs import url from 'node:url'; console.log(url.domainToUnicode('xn--espaol-zwa.com')); // Prints español.com console.log(url.domainToUnicode('xn--fiq228c.com')); // Prints 中文.com console.log(url.domainToUnicode('xn--iñvalid.com')); // Prints an empty string ``` ```cjs const url = require('node:url'); console.log(url.domainToUnicode('xn--espaol-zwa.com')); // Prints español.com console.log(url.domainToUnicode('xn--fiq228c.com')); // Prints 中文.com console.log(url.domainToUnicode('xn--iñvalid.com')); // Prints an empty string ``` ### `url.fileURLToPath(url[, options])` \* `url` {URL | string} The file URL string or URL object to convert to a path. \* `options` {Object} \* `windows` {boolean|undefined} `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. \*\*Default:\*\* `undefined`. \* Returns: {string} The fully-resolved platform-specific Node.js file path. This function ensures the correct decodings of percent-encoded characters as well as ensuring a cross-platform valid absolute path string. \*\*Security Considerations:\*\* This function decodes percent-encoded characters, including encoded dot-segments (`%2e` as `.` and `%2e%2e` as `..`), and then normalizes the resulting path. This means that 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 and security checks on the returned path value to
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.03293807432055473, 0.016446160152554512, 0.026361901313066483, -0.06656546890735626, 0.04852193593978882, -0.017795773223042488, -0.10002176463603973, 0.08811908960342407, 0.0008382031228393316, -0.020481474697589874, -0.06278754025697708, 0.005868511740118265, -0.013566089794039726, -0.03707528114318848, -0.09167491644620895, 0.031365565955638885, -0.010051858611404896, 0.07693137973546982, -0.06374284625053406, -0.060683246701955795, 0.10846106708049774, 0.02544754184782505, 0.05348769947886467, -0.046054501086473465, -0.05081892013549805, 0.010801544412970543, -0.012426276691257954, 0.037083111703395844, 0.05547676980495453, -0.09154268354177475, -0.0855330228805542, -0.0014371565775945783, 0.028313325718045235, -0.051744360476732254, 0.006769118830561638, -0.0542776994407177, 0.018929000943899155, -0.039828889071941376, -0.03585723415017128, -0.08757825940847397, 0.005824959371238947, 0.06227688118815422, 0.022231854498386383, -0.1021856814622879, -0.00965695921331644, 0.03902130201458931, -0.032221417874097824, 0.0036351243034005165, -0.0630459263920784, 0.028131620958447456, -0.012780710123479366, 0.04735308140516281, -0.04076700657606125, 0.04678233340382576, -0.020245660096406937, 0.07891599088907242, 0.018834678456187248, -0.00838432926684618, 0.06006613001227379, 0.06839387863874435, -0.008641717955470085, -0.0316646471619606, 0.01967856101691723, -0.031834833323955536, -0.006032674573361874, -0.07853968441486359, 0.03472474589943886, -0.009058604948222637, -0.14238864183425903, -0.06630787998437881, 0.035790640860795975, 0.007512691430747509, 0.03647925332188606, -0.04321210831403732, -0.07438746094703674, 0.06693663448095322, 0.047799818217754364, -0.09881122410297394, -0.1515694409608841, 0.01585015282034874, 0.012169670313596725, 0.06928360462188721, 0.06311863660812378, 0.04517004266381264, -0.02566724456846714, 0.0005412377067841589, -0.00003387481046956964, -0.014846333302557468, -0.018864789977669716, 0.10818244516849518, -0.07152873277664185, -0.024981947615742683, 0.027033908292651176, 0.00621617678552866, -0.005901400465518236, -0.03090905211865902, 0.05964275822043419, -0.044110190123319626, 0.05475592613220215, 0.056833475828170776, -0.007286648266017437, -0.09060980379581451, 0.019488366320729256, 0.05646534636616707, -0.049614764750003815, 0.03148328512907028, 0.0029027326963841915, 0.04807961732149124, -0.004068824462592602, 0.00614427775144577, -0.004627617541700602, -0.06371729075908661, 0.027255671098828316, -0.030460011214017868, 3.9673812287595474e-33, 0.03559581935405731, 0.03311130031943321, -0.004328127019107342, -0.05138922482728958, -0.07407597452402115, 0.05725334584712982, 0.04467347636818886, 0.08479176461696625, 0.005171115510165691, 0.011192242614924908, -0.06572896987199783, 0.030650565400719643, -0.010828088968992233, -0.07154446095228195, -0.031051449477672577, 0.009983650408685207, 0.04564441740512848, -0.012635231018066406, -0.0274752639234066, -0.01834217645227909, 0.044942792505025864, 0.061674825847148895, -0.02618326060473919, -0.014023687690496445, 0.0036940935533493757, -0.07945124804973602, 0.031964339315891266, -0.02934463694691658, -0.051336921751499176, -0.018301619216799736, 0.0686621367931366, 0.02220151573419571, -0.07322438061237335, 0.07188639789819717, 0.10233602672815323, 0.07168780267238617, 0.05190764740109444, 0.03315773606300354, -0.10868030786514282, 0.0046392809599637985, -0.051346682012081146, -0.00001784866071830038, -0.027612609788775444, 0.05831276997923851, -0.042105525732040405, -0.10791581869125366, -0.08446613699197769, -0.048599034547805786, 0.0037289524916559458, -0.01565246842801571, -0.06306703388690948, 0.04944474250078201, -0.01211885642260313, -0.035589419305324554, -0.03062981553375721, 0.0011272330302745104, 0.0030835801735520363, -0.015845658257603645, -0.0851559117436409, 0.03897017613053322, -0.020172351971268654, -0.03447294607758522, 0.0037717013619840145, 0.038469113409519196, 0.009863761253654957, 0.01684318669140339, 0.09005311131477356, 0.05374772846698761, -0.00498697767034173, 0.05813612788915634, -0.04155648499727249, -0.0016756398836150765, 0.0034522637724876404, -0.05065428093075752, 0.025793597102165222, -0.07508838176727295, -0.05930788069963455, -0.024733945727348328, -0.005736249033361673, -0.021625924855470657, 0.044745516031980515, -0.05041110888123512, -0.004671116825193167, 0.13267631828784943, 0.06288061290979385, 0.04876391217112541, -0.05338823422789574, -0.08444567769765854, 0.01750548742711544, -0.014358026906847954, 0.04165421426296234, 0.02539004199206829, -0.09638840705156326, -0.030589547008275986, -0.023679062724113464, -5.4529320510783833e-33, 0.07830160856246948, -0.025136630982160568, 0.03503258526325226, 0.13359738886356354, -0.0006839976995252073, -0.06515272706747055, 0.06440930813550949, 0.01627407781779766, 0.0011241429019719362, -0.014251944608986378, -0.004765224177390337, 0.025636494159698486, 0.09485707432031631, -0.10238111019134521, 0.039836540818214417, 0.11907202005386353, -0.07595816254615784, -0.07871809601783752, -0.002981855534017086, -0.0523604154586792, -0.0057049961760640144, -0.01219393964856863, -0.030986232683062553, 0.023689227178692818, -0.08415553718805313, 0.016902726143598557, 0.032624803483486176, -0.04319360479712486, 0.005628096871078014, 0.0755024403333664, 0.055277977138757706, 0.021402835845947266, 0.017467772588133812, 0.0035064280964434147, -0.06518063694238663, -0.024339057505130768, 0.017267892137169838, 0.08638451993465424, -0.023579252883791924, 0.04254539683461189, 0.0393993966281414, -0.014398084953427315, 0.015672864392399788, 0.027739493176341057, 0.0034419125877320766, -0.027902506291866302, 0.0055290148593485355, 0.06169277802109718, 0.02058923989534378, -0.03634102642536163, 0.08825221657752991, -0.02681632898747921, -0.11854758858680725, -0.0070985532365739346, 0.024693381041288376, -0.10650135576725006, -0.1261969953775406, -0.008706727996468544, -0.01984475366771221, 0.06955280900001526, 0.05859338864684105, 0.011756664142012596, 0.002949743764474988, 0.09086640924215317, -0.017272192984819412, -0.044178400188684464, -0.07734321057796478, -0.012933358550071716, -0.005206587258726358, -0.055751971900463104, 0.03504713624715805, -0.08192943781614304, 0.03906160593032837, -0.03545777499675751, 0.04566146433353424, -0.0007930434076115489, -0.048678863793611526, -0.018259815871715546, 0.07821205258369446, 0.02033534273505211, -0.0013411067193374038, 0.06132184714078903, 0.031063979491591454, 0.0041880919598042965, 0.010186213068664074, 0.03396449610590935, -0.014151138253509998, 0.148465096950531, -0.050597451627254486, 0.023222284391522408, 0.04748218134045601, 0.016362901777029037, -0.005912781693041325, -0.03210035711526871, -0.022666212171316147, -4.6831125644075655e-8, -0.04013338312506676, 0.011753114871680737, -0.09732590615749359, 0.05571821704506874, -0.043886978179216385, -0.005539319943636656, 0.03905094787478447, 0.11611680686473846, -0.0005911266198381782, -0.014948869124054909, 0.05120101943612099, 0.07083409279584885, 0.007700030691921711, 0.035480741411447525, 0.03241487592458725, -0.0307542085647583, -0.026865718886256218, 0.046228982508182526, -0.05200695991516113, 0.06620217859745026, -0.016847945749759674, -0.03800276666879654, -0.04199192672967911, 0.0031322783324867487, 0.11537553369998932, -0.04555803909897804, 0.034855764359235764, 0.038795843720436096, -0.005312526598572731, 0.04855505749583244, -0.09128689020872116, 0.03017820231616497, 0.00851530209183693, -0.005135237239301205, -0.004638708662241697, 0.058309976011514664, -0.044735245406627655, -0.0231606625020504, 0.02251063659787178, 0.1084078922867775, 0.007692537736147642, 0.014501165598630905, 0.014667072333395481, 0.05294325202703476, -0.07591614872217178, -0.022502383217215538, 0.08755097538232803, 0.05899369344115257, 0.033307913690805435, -0.0029313242994248867, -0.006733347196131945, -0.010534903034567833, -0.011980734765529633, -0.049129340797662735, -0.05306392163038254, -0.04114488512277603, -0.01052869576960802, 0.0275421179831028, 0.024397332221269608, -0.005347735248506069, 0.09378796815872192, -0.09849648922681808, -0.01989821530878544, 0.024696512147784233 ]
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 and security checks on the returned path value to ensure it remains within expected boundaries before using it for file system operations. ```mjs import { fileURLToPath } from 'node:url'; const \_\_filename = fileURLToPath(import.meta.url); new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) new URL('file:///hello world').pathname; // Incorrect: /hello%20world fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) ``` ```cjs const { fileURLToPath } = require('node:url'); new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) new URL('file:///hello world').pathname; // Incorrect: /hello%20world fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) ``` ### `url.fileURLToPathBuffer(url[, options])` \* `url` {URL | string} The file URL string or URL object to convert to a path. \* `options` {Object} \* `windows` {boolean|undefined} `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. \*\*Default:\*\* `undefined`. \* Returns: {Buffer} The fully-resolved platform-specific Node.js file path as a {Buffer}. Like `url.fileURLToPath(...)` except that instead of returning a string representation of the path, a `Buffer` is returned. This conversion is helpful when the input URL contains percent-encoded segments that are not valid UTF-8 / Unicode sequences. \*\*Security Considerations:\*\* This function has the same security considerations as [`url.fileURLToPath()`][]. It decodes percent-encoded characters, including encoded dot-segments (`%2e` as `.` and `%2e%2e` as `..`), and normalizes the path. \*\*Applications must not rely on this function alone to prevent directory traversal attacks.\*\* Always perform explicit path validation on the returned buffer value before using it for file system operations. ### `url.format(URL[, options])` \* `URL` {URL} A [WHATWG URL][] object \* `options` {Object} \* `auth` {boolean} `true` if the serialized URL string should include the username and password, `false` otherwise. \*\*Default:\*\* `true`. \* `fragment` {boolean} `true` if the serialized URL string should include the fragment, `false` otherwise. \*\*Default:\*\* `true`. \* `search` {boolean} `true` if the serialized URL string should include the search query, `false` otherwise. \*\*Default:\*\* `true`. \* `unicode` {boolean} `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to being Punycode encoded. \*\*Default:\*\* `false`. \* Returns: {string} Returns a customizable serialization of a URL `String` representation of a [WHATWG URL][] object. The URL object has both a `toString()` method and `href` property that return string serializations of the URL. These are not, however, customizable in any way. The `url.format(URL[, options])` method allows for basic customization of the output. ```mjs import url from 'node:url'; const myURL = new URL('https://a:b@測試?abc#foo'); console.log(myURL.href); // Prints https://a:b@xn--g6w251d/?abc#foo console.log(myURL.toString()); // Prints https://a:b@xn--g6w251d/?abc#foo console.log(url.format(myURL, { fragment: false, unicode: true, auth: false })); // Prints 'https://測試/?abc' ``` ```cjs const url = require('node:url'); const myURL = new URL('https://a:b@測試?abc#foo'); console.log(myURL.href); // Prints https://a:b@xn--g6w251d/?abc#foo console.log(myURL.toString()); // Prints https://a:b@xn--g6w251d/?abc#foo console.log(url.format(myURL, { fragment: false, unicode: true, auth: false })); // Prints 'https://測試/?abc' ``` ### `url.pathToFileURL(path[, options])` \* `path` {string} The path to convert to a File URL. \* `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 control characters are correctly
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.09106940776109695, -0.03373449295759201, 0.045089300721883774, -0.09134484827518463, 0.10389828681945801, 0.01506875827908516, 0.024359581992030144, 0.019872600212693214, 0.03320682793855667, 0.10298839956521988, -0.06630109995603561, 0.02879924513399601, -0.04745589569211006, -0.04804430156946182, 0.0006988960667513311, 0.026421263813972473, -0.020638970658183098, 0.09684022516012192, -0.008433305658400059, -0.0568348728120327, 0.01192327868193388, 0.09607232362031937, 0.10284913331270218, 0.0566176176071167, -0.14861029386520386, -0.0522666871547699, -0.024100378155708313, 0.06778734922409058, 0.10400260984897614, -0.020055241882801056, -0.010844171047210693, -0.008661787025630474, -0.04112622141838074, -0.009084846824407578, 0.0038595853839069605, -0.07821732014417648, 0.038557667285203934, -0.12798409163951874, -0.010201334953308105, -0.10288336873054504, -0.011965337209403515, 0.007623179815709591, -0.041984278708696365, -0.025174934417009354, 0.07853830605745316, 0.03564886003732681, 0.030315348878502846, 0.032231368124485016, -0.06887441873550415, -0.004912157543003559, -0.05675069987773895, 0.0374528169631958, -0.006351389456540346, -0.06454908847808838, 0.0481598787009716, -0.0017708820523694158, -0.049487192183732986, -0.022764308378100395, -0.017860347405076027, -0.07837068289518356, 0.0582563616335392, -0.011088293045759201, 0.008485236205160618, -0.05451870709657669, 0.06064404547214508, -0.015425948426127434, -0.08525361865758896, 0.0771024078130722, -0.1019907146692276, 0.06347426772117615, 0.011758488602936268, 0.06218556687235832, 0.030773969367146492, -0.060058485716581345, -0.0007491501746699214, 0.00044252301449887455, -0.009946467354893684, 0.022331073880195618, -0.11570294201374054, -0.03307872265577316, 0.02036050148308277, 0.08174827694892883, 0.0082654794678092, -0.02480473928153515, 0.09372370690107346, 0.015796009451150894, -0.0173952579498291, -0.031008992344141006, -0.02749083936214447, -0.030851924791932106, -0.03409944847226143, 0.08258141577243805, 0.046897418797016144, 0.07645631581544876, 0.01924307271838188, 0.0222412571310997, -0.06930065155029297, -0.029223864898085594, -0.040640659630298615, -0.00988713651895523, -0.047933995723724365, -0.03514450043439865, -0.04462486132979393, 0.018644588068127632, 0.004918323829770088, -0.0042547183111310005, 0.1753770112991333, -0.009609821252524853, -0.06785595417022705, 0.001567744999192655, -0.01135879848152399, -0.017257578670978546, -0.0713886171579361, 0.060118235647678375, 2.7519294372299102e-33, -0.07166358083486557, 0.03450913354754448, 0.04605190083384514, 0.04550385847687721, 0.012028045952320099, -0.06783922016620636, 0.019327310845255852, -0.014516250230371952, -0.060383252799510956, -0.008212524466216564, -0.08559801429510117, -0.06842093169689178, 0.006056980229914188, -0.042542267590761185, 0.00981944426894188, -0.0376339852809906, 0.03651712089776993, -0.059804677963256836, -0.005383416078984737, -0.033982016146183014, 0.053294092416763306, 0.09407445788383484, -0.018064701929688454, -0.028059713542461395, -0.045709796249866486, -0.048111479729413986, -0.012129892595112324, -0.014927234500646591, 0.07060455530881882, -0.006101788487285376, 0.011236910708248615, -0.010545805096626282, 0.03089110367000103, 0.04005839675664902, -0.01425097044557333, 0.048902932554483414, 0.031702522188425064, -0.01652531325817108, -0.12353416532278061, -0.009624485857784748, -0.034184206277132034, -0.0026888565625995398, -0.0364992581307888, 0.08588621765375137, -0.048949386924505234, -0.026627564802765846, -0.09214914590120316, -0.09692470729351044, -0.043856989592313766, 0.04166746139526367, -0.05957907810807228, 0.07372137904167175, 0.048547256737947464, 0.021233294159173965, 0.01933513581752777, -0.02313508465886116, -0.020193537697196007, -0.09906591475009918, -0.007575870957225561, 0.012319794856011868, 0.06646190583705902, 0.03935394808650017, -0.02431042119860649, -0.026796601712703705, -0.030649658292531967, -0.06531481444835663, 0.02264953777194023, 0.023460226133465767, -0.023442327976226807, 0.1041504517197609, -0.04667671397328377, 0.031905610114336014, 0.026118220761418343, -0.03111131489276886, -0.006635000929236412, 0.017485741525888443, -0.04349411651492119, 0.00957985408604145, 0.023138824850320816, -0.09985794872045517, -0.08726600557565689, -0.07404036819934845, 0.007880911231040955, 0.013826381415128708, 0.037839531898498535, -0.014084534719586372, -0.05422128364443779, -0.05621793866157532, 0.06423451006412506, -0.00680877547711134, 0.1322811245918274, -0.02510807290673256, -0.04167405888438225, 0.00749551085755229, -0.04644119367003441, -3.885706044554492e-33, 0.05966847017407417, 0.12928728759288788, 0.00993069726973772, 0.02422567829489708, -0.10375091433525085, -0.022744938731193542, 0.043716173619031906, -0.058359384536743164, 0.007961777038872242, 0.04671497270464897, -0.06476546823978424, 0.08484448492527008, 0.08948507905006409, -0.05108782649040222, 0.05318794026970863, -0.04162769764661789, 0.02478710189461708, -0.059096306562423706, 0.03557371348142624, -0.015512511134147644, -0.02819034270942211, 0.05393262580037117, -0.03683018684387207, 0.055576592683792114, -0.007970687001943588, 0.07359453290700912, -0.02182554453611374, -0.012653987854719162, 0.01773911714553833, 0.04374730959534645, -0.03683226928114891, 0.05180371552705765, -0.036622680723667145, 0.005313435569405556, 0.03200134262442589, -0.011525304056704044, -0.02506568655371666, 0.09647165983915329, 0.07650517672300339, -0.038834765553474426, 0.05310278385877609, 0.005642225034534931, -0.011597519740462303, 0.07792762666940689, 0.06545852869749069, -0.0122917415574193, 0.011924529448151588, 0.06515034288167953, 0.00550271850079298, -0.038969531655311584, 0.05197776108980179, -0.022082779556512833, 0.02622818388044834, 0.010728690773248672, 0.06398306041955948, 0.007892553694546223, -0.04101424291729927, -0.04735073447227478, -0.06057978793978691, 0.04368152096867561, 0.046258244663476944, -0.031102171167731285, -0.049216266721487045, -0.0694165751338005, -0.03591175004839897, -0.0149315744638443, -0.1066499724984169, -0.006629826035350561, 0.02176169492304325, -0.04597993195056915, -0.016051901504397392, 0.05052628368139267, -0.020502299070358276, 0.04266007989645004, 0.021994629874825478, 0.010671074502170086, -0.006287093739956617, 0.00720961345359683, 0.03519832715392113, 0.05691125988960266, -0.01624910533428192, 0.08520685881376266, -0.06108631193637848, 0.04266883432865143, 0.04038963094353676, -0.08561959117650986, -0.0582476407289505, -0.0226752832531929, -0.015996871516108513, -0.058265164494514465, 0.05939566344022751, 0.08777391165494919, -0.01450865063816309, -0.03239436075091362, -0.0030041481368243694, -5.072135422778956e-8, -0.08025270700454712, -0.0398784875869751, -0.0829111859202385, 0.006104762200266123, 0.006213743705302477, -0.033352941274642944, -0.05244744196534157, -0.009018484503030777, 0.10097409784793854, 0.06654764711856842, 0.04082120582461357, -0.05462975427508354, -0.04583115130662918, -0.06184335798025131, -0.05242437124252319, 0.046914905309677124, 0.0015772184124216437, 0.030377348884940147, -0.0011364052770659328, 0.07793957740068436, -0.002569936215877533, 0.019626358523964882, -0.017948942258954048, 0.059425316751003265, 0.005104634910821915, -0.054926250129938126, 0.004164949990808964, -0.006420930381864309, -0.08409156650304794, -0.03181963041424751, -0.030863692983984947, -0.016665371134877205, -0.01622215285897255, 0.05834199860692024, -0.1538728028535843, 0.06683564186096191, 0.0612766295671463, -0.021094946190714836, -0.01536659337580204, 0.03475867211818695, 0.08713069558143616, -0.007285784929990768, 0.02113054133951664, 0.0015328567242249846, -0.042918890714645386, -0.014641035348176956, 0.049034323543310165, 0.0504075363278389, -0.03267310932278633, -0.016549183055758476, 0.05319005995988846, -0.010621592402458191, -0.010205489583313465, 0.04397696629166603, 0.051390234380960464, -0.0180504210293293, -0.02092195674777031, -0.02823243848979473, -0.012171369977295399, 0.051522206515073776, 0.04746929183602333, 0.05793638899922371, 0.09029363840818405, -0.012109501287341118 ]
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 control characters are correctly encoded when converting into a File URL. ```mjs import { pathToFileURL } from 'node:url'; new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) ``` ```cjs const { pathToFileURL } = require('node:url'); new URL(\_\_filename); // Incorrect: throws (POSIX) new URL(\_\_filename); // Incorrect: C:\... (Windows) pathToFileURL(\_\_filename); // Correct: file:///... (POSIX) pathToFileURL(\_\_filename); // Correct: file:///C:/... (Windows) new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) ``` ### `url.urlToHttpOptions(url)` \* `url` {URL} The [WHATWG URL][] object to convert to an options object. \* Returns: {Object} Options object \* `protocol` {string} Protocol to use. \* `hostname` {string} A domain name or IP address of the server to issue the request to. \* `hash` {string} The fragment portion of the URL. \* `search` {string} The serialized query portion of the URL. \* `pathname` {string} The path portion of the URL. \* `path` {string} Request path. Should include query string if any. E.G. `'/index.html?page=12'`. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future. \* `href` {string} The serialized URL. \* `port` {number} Port of remote server. \* `auth` {string} Basic authentication i.e. `'user:password'` to compute an Authorization header. This utility function converts a URL object into an ordinary options object as expected by the [`http.request()`][] and [`https.request()`][] APIs. ```mjs import { urlToHttpOptions } from 'node:url'; const myURL = new URL('https://a:b@測試?abc#foo'); console.log(urlToHttpOptions(myURL)); /\* { protocol: 'https:', hostname: 'xn--g6w251d', hash: '#foo', search: '?abc', pathname: '/', path: '/?abc', href: 'https://a:b@xn--g6w251d/?abc#foo', auth: 'a:b' } \*/ ``` ```cjs const { urlToHttpOptions } = require('node:url'); const myURL = new URL('https://a:b@測試?abc#foo'); console.log(urlToHttpOptions(myURL)); /\* { protocol: 'https:', hostname: 'xn--g6w251d', hash: '#foo', search: '?abc', pathname: '/', path: '/?abc', href: 'https://a:b@xn--g6w251d/?abc#foo', auth: 'a:b' } \*/ ``` ## Legacy URL API > Stability: 3 - Legacy: Use the WHATWG URL API instead. ### Legacy `urlObject` The legacy `urlObject` (`require('node:url').Url` or `import { Url } from 'node:url'`) is created and returned by the `url.parse()` function. #### `urlObject.auth` The `auth` property is the username and password portion of the URL, also referred to as \_userinfo\_. This string subset follows the `protocol` and double slashes (if present) and precedes the `host` component, delimited by `@`. The string is either the username, or it is the username and password separated by `:`. For example: `'user:pass'`. #### `urlObject.hash` The `hash` property is the fragment identifier portion of the URL including the leading `#` character. For example: `'#hash'`. #### `urlObject.host` The `host` property is the full lower-cased host portion of the URL, including the `port` if specified. For example: `'sub.example.com:8080'`. #### `urlObject.hostname` The `hostname` property is the lower-cased host name portion of the `host` component \_without\_ the `port` included. For example: `'sub.example.com'`. #### `urlObject.href` The `href` property is the full URL string that was parsed with both the `protocol` and `host` components converted to lower-case. For example: `'http://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'`. #### `urlObject.path` The `path` property is 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 of the `query` or `hash`
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.06226790323853493, -0.0030361744575202465, 0.06227433681488037, -0.09201088547706604, 0.11160320788621902, -0.01988554745912552, 0.022311853244900703, 0.05776313692331314, -0.013243920169770718, 0.06177971884608269, -0.07725632190704346, 0.02705094777047634, -0.0519842803478241, -0.007393375504761934, 0.003286641091108322, 0.033721841871738434, -0.06176837533712387, 0.0397847518324852, -0.004723486490547657, -0.05167818069458008, 0.009229711256921291, 0.07337130606174469, 0.11368810385465622, 0.050393011420965195, -0.16387967765331268, -0.04032353684306145, -0.05775218456983566, 0.0824374258518219, 0.10781148821115494, -0.059179529547691345, -0.06229185685515404, 0.0010347194038331509, 0.05136292800307274, -0.004301042761653662, 0.00961355585604906, -0.10919488221406937, 0.02094724401831627, -0.0776188001036644, -0.01644941233098507, -0.07729163765907288, -0.040527552366256714, 0.03267445042729378, 0.008251075632870197, -0.05686020106077194, 0.09045681357383728, 0.024702759459614754, 0.03605864569544792, -0.029349027201533318, -0.056981947273015976, 0.02852666564285755, -0.03502877801656723, 0.029842469841241837, -0.012381050735712051, -0.10471393913030624, 0.012530202977359295, 0.0024377177469432354, -0.008011721074581146, -0.08960576355457306, -0.05313620716333389, -0.04546213895082474, 0.04071822017431259, -0.028027299791574478, 0.005895107984542847, 0.0009558158344589174, 0.04794129729270935, 0.012399029918015003, -0.0003267653228249401, 0.05342474207282066, -0.08882088959217072, 0.010743828490376472, 0.054993536323308945, 0.09534914791584015, 0.05100465193390846, -0.11079294234514236, 0.008991049602627754, 0.01103451382368803, 0.018564553931355476, -0.06276885420084, -0.1264936774969101, -0.029363982379436493, 0.011716795153915882, 0.06516927480697632, 0.022392963990569115, 0.029827985912561417, 0.05806001275777817, -0.010970532894134521, -0.03222348913550377, -0.010386635549366474, -0.027835732325911522, 0.07977268099784851, -0.02422306127846241, 0.05836493894457817, 0.02919943444430828, 0.028415272012352943, 0.03573368489742279, 0.06029858440160751, -0.061524905264377594, -0.03854884207248688, -0.03150933235883713, -0.004518440458923578, -0.08576997369527817, -0.038046613335609436, -0.046186260879039764, 0.05073125287890434, 0.0029479344375431538, -0.000636425509583205, 0.11561062932014465, -0.017243022099137306, -0.06621230393648148, 0.0038310871459543705, 0.0027035169769078493, -0.021637296304106712, -0.07184438407421112, 0.06411715596914291, 1.922183239814982e-33, -0.057692866772413254, -0.0028881561011075974, 0.05120432749390602, 0.03870590031147003, 0.01481613703072071, -0.0829881802201271, 0.023172589018940926, -0.04394001513719559, -0.03185054287314415, -0.028637832030653954, -0.08314985781908035, -0.04671049118041992, -0.03792762756347656, -0.013765844516456127, -0.008738352917134762, -0.003585082944482565, 0.049493610858917236, -0.057937685400247574, 0.042550649493932724, 0.005122839938849211, 0.01967308111488819, 0.12119310349225998, -0.03286454454064369, -0.04712386429309845, -0.04270727559924126, -0.04671655222773552, 0.05998406559228897, -0.06118714064359665, 0.02264587953686714, -0.04217084124684334, 0.02716895192861557, -0.017811710014939308, 0.06920347362756729, 0.005037772469222546, -0.012440823018550873, 0.060268282890319824, 0.0005884712445549667, 0.014735677279531956, -0.13477076590061188, -0.0017316772136837244, -0.024219773709774017, 0.0318094864487648, -0.026318037882447243, 0.06152623891830444, -0.01961749978363514, -0.012119857594370842, -0.0579037144780159, -0.071719229221344, -0.011579100042581558, 0.0006103184423409402, -0.043256454169750214, 0.08820302039384842, 0.03655989095568657, 0.032913938164711, 0.022155633196234703, -0.023291828110814095, -0.016404399648308754, -0.07168299704790115, -0.05081508681178093, -0.02362661436200142, 0.06524427235126495, 0.02850363776087761, 0.017104927450418472, 0.01454688049852848, -0.009629982523620129, -0.06342725455760956, 0.005960647016763687, 0.017849110066890717, -0.05258679389953613, 0.10224097222089767, -0.036104824393987656, -0.0014021560782566667, -0.017546506598591805, 0.004513499792665243, -0.011481937021017075, -0.020355936139822006, -0.08267565071582794, 0.006658097729086876, 0.043278489261865616, -0.08731093257665634, -0.014145860448479652, -0.0434747040271759, -0.0046198247000575066, 0.011341174133121967, 0.04227061942219734, -0.030556028708815575, -0.05085394158959389, -0.059668224304914474, 0.09211278706789017, -0.018041037023067474, 0.1448131501674652, -0.006053552497178316, -0.0557267926633358, 0.0016727549955248833, -0.07762686163187027, -4.191829018079601e-33, 0.07422653585672379, 0.10270372033119202, 0.018942900002002716, 0.09967247396707535, -0.10116853564977646, 0.01147622149437666, 0.02083648554980755, -0.0033842625562101603, 0.026913445442914963, 0.04963750019669533, -0.08066397160291672, 0.07729747146368027, 0.09242647141218185, -0.029103092849254608, 0.056982412934303284, -0.027847152203321457, -0.042755160480737686, -0.03779715299606323, 0.010440170764923096, -0.0364876464009285, -0.03840421885251999, -0.016042469069361687, 0.0064180763438344, 0.04206947982311249, -0.009620267897844315, 0.06970784813165665, -0.004154728725552559, -0.012974530458450317, -0.047813668847084045, 0.01908373460173607, -0.009767885319888592, 0.04646584764122963, -0.06197165697813034, -0.0088848527520895, 0.04869749769568443, -0.051013555377721786, -0.009554420597851276, 0.13210390508174896, 0.054502904415130615, -0.05013292655348778, 0.046116702258586884, -0.031026819720864296, -0.027596693485975266, 0.09121346473693848, 0.05906376242637634, 0.00015405220619868487, -0.02304210513830185, 0.06713662296533585, 0.008419837802648544, -0.00493591045960784, 0.046175818890333176, -0.025276856496930122, 0.023052534088492393, -0.02519204281270504, 0.028902025893330574, -0.018899710848927498, -0.06393125653266907, -0.05632682889699936, -0.06513892859220505, 0.04182722419500351, -0.020564138889312744, -0.08415266871452332, -0.06168392300605774, -0.04655701667070389, -0.07312344759702682, -0.0012287712888792157, -0.06156736984848976, 0.025488369166851044, 0.043871257454156876, -0.08487997204065323, -0.01601382903754711, 0.051455121487379074, -0.044092435389757156, 0.008125272579491138, 0.07669789344072342, 0.020483486354351044, 0.03540709614753723, 0.01093578152358532, 0.063777394592762, 0.0675465539097786, -0.03386574611067772, 0.06400791555643082, -0.054688598960638046, 0.06008061766624451, 0.05714370310306549, -0.043450575321912766, -0.05514521896839142, 0.03917308896780014, -0.03774302825331688, -0.015660803765058517, 0.04624968022108078, 0.15220844745635986, -0.05869160592556, -0.023786509409546852, -0.030800538137555122, -5.076238451806603e-8, -0.11622963845729828, -0.014728792011737823, -0.11853419989347458, -0.03404659032821655, -0.08138610422611237, -0.006881429348140955, -0.027956562116742134, -0.01714635081589222, 0.06199582666158676, 0.0305755827575922, 0.027701597660779953, -0.026167534291744232, -0.050967875868082047, -0.05656157433986664, -0.05857309326529503, 0.03389882668852806, -0.02015727572143078, 0.06361202150583267, 0.02265879139304161, 0.09057577699422836, -0.015574431046843529, 0.034484826028347015, -0.02334929071366787, 0.09149019420146942, 0.02583335153758526, -0.019249744713306427, -0.014487308450043201, 0.03241586312651634, -0.07067934423685074, 0.03466144949197769, -0.01134543027728796, 0.00013660646800417453, -0.0047264713793993, 0.04737132042646408, -0.10945199429988861, 0.04308643564581871, 0.052007824182510376, -0.027999643236398697, 0.004297070670872927, 0.04958758130669594, 0.10272068530321121, 0.007947736419737339, 0.016176411882042885, 0.006888064555823803, -0.07471420615911484, -0.03389354422688484, 0.01888062246143818, 0.0451398603618145, -0.010088309645652771, -0.04699242487549782, 0.05347643792629242, -0.02009091153740883, -0.025105321779847145, -0.009977532550692558, 0.02638409286737442, -0.02146713063120842, 0.00600585388019681, -0.01995820179581642, 0.0012762282276526093, 0.04012465104460716, 0.0770307183265686, 0.027149708941578865, 0.029508179053664207, 0.00811432022601366 ]
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 of the `query` or `hash` components, delimited by either the ASCII question mark (`?`) or hash (`#`) characters. For example: `'/p/a/t/h'`. No decoding of the path string is performed. #### `urlObject.port` The `port` property is the numeric port portion of the `host` component. For example: `'8080'`. #### `urlObject.protocol` The `protocol` property identifies the URL's lower-cased protocol scheme. For example: `'http:'`. #### `urlObject.query` The `query` property is either the query string without the leading ASCII question mark (`?`), or an object returned by the [`querystring`][] module's `parse()` method. Whether the `query` property is a string or object is determined by the `parseQueryString` argument passed to `url.parse()`. For example: `'query=string'` or `{'query': 'string'}`. If returned as a string, no decoding of the query string is performed. If returned as an object, both keys and values are decoded. #### `urlObject.search` The `search` property consists of the entire "query string" portion of the URL, including the leading ASCII question mark (`?`) character. For example: `'?query=string'`. No decoding of the query string is performed. #### `urlObject.slashes` The `slashes` property is a `boolean` with a value of `true` if two ASCII forward-slash characters (`/`) are required following the colon in the `protocol`. ### `url.format(urlObject)` \* `urlObject` {Object|string} A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. The `url.format()` method returns a formatted URL string derived from `urlObject`. ```js const url = require('node:url'); url.format({ protocol: 'https', hostname: 'example.com', pathname: '/some/path', query: { page: 1, format: 'json', }, }); // => 'https://example.com/some/path?page=1&format=json' ``` If `urlObject` is not an object or a string, `url.format()` will throw a [`TypeError`][]. The formatting process operates as follows: \* A new empty string `result` is created. \* If `urlObject.protocol` is a string, it is appended as-is to `result`. \* Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an [`Error`][] is thrown. \* For all string values of `urlObject.protocol` that \_do not end\_ with an ASCII colon (`:`) character, the literal string `:` will be appended to `result`. \* If either of the following conditions is true, then the literal string `//` will be appended to `result`: \* `urlObject.slashes` property is true; \* `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; \* If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string and appended to `result` followed by the literal string `@`. \* If the `urlObject.host` property is `undefined` then: \* If the `urlObject.hostname` is a string, it is appended to `result`. \* Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, an [`Error`][] is thrown. \* If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: \* The literal string `:` is appended to `result`, and \* The value of `urlObject.port` is coerced to a string and appended to `result`. \* Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string 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`. \*
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.017705082893371582, 0.016590161249041557, 0.017185840755701065, 0.021368175745010376, 0.005439798813313246, 0.007590573746711016, -0.04375598207116127, 0.11887247860431671, 0.09754433482885361, 0.029142342507839203, -0.0704868957400322, -0.02134622074663639, -0.04216466099023819, 0.009819667786359787, 0.03588326275348663, 0.04473854601383209, -0.0007016821764409542, 0.018352003768086433, 0.027650507166981697, -0.06299179792404175, 0.06757574528455734, 0.012462133541703224, 0.09336197376251221, 0.06742501258850098, -0.07952005416154861, -0.062317170202732086, -0.04049566388130188, 0.08333945274353027, -0.001287571038119495, -0.03813411295413971, 0.02037104032933712, -0.06973609328269958, 0.013803372159600258, -0.0430956669151783, -0.0030859513208270073, -0.11254065483808517, -0.05574122443795204, -0.06816480308771133, -0.04793466627597809, -0.08216065168380737, 0.05157109722495079, 0.03978515788912773, -0.011454414576292038, -0.12583264708518982, 0.06435584276914597, 0.015285490080714226, 0.025584783405065536, -0.0482332818210125, 0.009394430555403233, -0.0022290274500846863, 0.03131977841258049, 0.0494348518550396, -0.04676148667931557, 0.006701713427901268, -0.023938177153468132, 0.07426474988460541, -0.06045794486999512, -0.07145025581121445, -0.054333701729774475, -0.1209787055850029, 0.012647421099245548, -0.025734560564160347, 0.07193758338689804, -0.004993679467588663, 0.015714582055807114, -0.04492432251572609, -0.05096237733960152, -0.013210052624344826, -0.09310495853424072, -0.00781780295073986, 0.1015564426779747, 0.05807823687791824, 0.004237618762999773, 0.005758578889071941, -0.06097296625375748, 0.07149994373321533, 0.026853982359170914, -0.04430195689201355, -0.12210707366466522, -0.0002620676241349429, 0.017391877248883247, 0.043501850217580795, 0.05198957398533821, 0.011890169233083725, 0.0705084428191185, 0.0035387040115892887, 0.026569826528429985, 0.04336215928196907, 0.0032216450199484825, 0.05300978571176529, -0.09990596026182175, -0.0387776680290699, 0.0237149465829134, -0.019789351150393486, 0.05872444063425064, 0.09038940817117691, -0.03200149908661842, -0.06318569928407669, -0.02157018333673477, -0.0020701445173472166, -0.0765334814786911, -0.09407086670398712, -0.030211787670850754, 0.023361600935459137, 0.018093906342983246, -0.0018942102324217558, 0.031491074711084366, 0.01728850230574608, -0.016604814678430557, 0.025246018543839455, -0.035837747156620026, 0.02181953564286232, -0.024418922141194344, -0.024810826405882835, 4.870567537768052e-33, 0.06111076474189758, 0.02342820353806019, -0.010898858308792114, 0.002479209564626217, -0.02901431918144226, 0.03052659146487713, 0.04970919340848923, 0.04494140297174454, -0.007516487501561642, 0.056919924914836884, -0.07939819991588593, -0.027039779350161552, -0.04602665826678276, -0.03175583854317665, 0.009517465718090534, 0.005552003160119057, 0.008889825083315372, 0.004998854827135801, -0.001416388200595975, 0.0775769054889679, 0.0016029445687308908, 0.07396046817302704, -0.0034310936462134123, 0.010775676928460598, 0.035612139850854874, -0.013902616687119007, -0.016728192567825317, -0.07212799787521362, -0.04907508194446564, 0.006784005090594292, 0.021542420610785484, -0.016978513449430466, -0.11553917825222015, 0.010189717635512352, 0.06255515664815903, 0.007843464612960815, 0.04473372921347618, 0.014857552945613861, -0.1259787231683731, -0.01864032633602619, -0.06895535439252853, -0.050275400280952454, -0.06487615406513214, 0.022822245955467224, -0.013148156926035881, -0.10767901688814163, -0.10305270552635193, -0.09321747720241547, 0.02195562981069088, 0.053639966994524, -0.016294322907924652, -0.01442707795649767, 0.09749691933393478, -0.008627817966043949, 0.03885018080472946, -0.0389808714389801, 0.006415682379156351, 0.009291700087487698, -0.057805854827165604, 0.08440539240837097, -0.018728354945778847, 0.03034069947898388, 0.00016688680625520647, 0.03059738129377365, 0.015162545256316662, 0.01691998355090618, 0.03944197669625282, 0.019582116976380348, 0.031565096229314804, 0.12666703760623932, -0.011613771319389343, 0.01604670286178589, 0.05242983251810074, 0.033331599086523056, -0.017865780740976334, -0.05282300338149071, -0.10913405567407608, -0.04373667389154434, 0.011070969514548779, -0.0019574719481170177, -0.044515036046504974, -0.020691152662038803, -0.0064837257377803326, 0.10920175909996033, -0.04714609682559967, 0.0026103220880031586, 0.010681205429136753, -0.07740587741136551, -0.004204792436212301, -0.13840192556381226, 0.037126779556274414, 0.025069059804081917, -0.02745700068771839, -0.037046290934085846, 0.003172756638377905, -6.150199667813655e-33, 0.052352774888277054, -0.02081409841775894, -0.05101107805967331, 0.04872320219874382, -0.11357095837593079, -0.11313890665769577, 0.05716841295361519, -0.004191405605524778, -0.0075853681191802025, -0.011256051249802113, 0.019576285034418106, 0.04406473785638809, 0.0863398015499115, -0.09526275098323822, 0.027461308985948563, 0.047165628522634506, -0.029780404642224312, -0.07536868005990982, 0.009564625099301338, 0.0286763533949852, -0.08837106823921204, 0.042278043925762177, -0.03020361065864563, -0.00826890580356121, -0.023347560316324234, 0.036062080413103104, 0.05193406715989113, -0.05895032733678818, 0.005594734568148851, 0.005331255961209536, 0.02979048527777195, 0.012469831854104996, -0.020038777962327003, -0.036696020513772964, -0.1135697290301323, 0.06693646311759949, -0.022242581471800804, 0.08825808763504028, 0.04722657427191734, -0.04380793124437332, 0.08427862077951431, -0.04075215011835098, 0.03409942239522934, 0.08915894478559494, -0.0124860480427742, -0.021128099411725998, -0.06106581166386604, 0.03343573585152626, -0.017653539776802063, -0.014913641847670078, 0.13461503386497498, 0.013808181509375572, 0.04392305761575699, -0.015393846668303013, 0.025935865938663483, 0.020206062123179436, -0.09237394481897354, 0.030311916023492813, -0.04399348795413971, 0.015507854521274567, 0.06063066050410271, 0.00255225389264524, -0.0421806164085865, 0.0611640103161335, -0.052848223596811295, -0.011854336597025394, -0.08350928872823715, -0.05019848793745041, 0.033285196870565414, -0.0745997205376625, -0.03220762312412262, -0.039089884608983994, -0.0032628935296088457, 0.045151203870773315, 0.10218222439289093, -0.05422821640968323, 0.002234079409390688, 0.04508424550294876, 0.05194273218512535, 0.08386646956205368, -0.05247371643781662, 0.07508381456136703, -0.07896256446838379, 0.03744838386774063, 0.035732120275497437, -0.05280257761478424, -0.11172047257423401, 0.08822649717330933, -0.03552711382508278, -0.01093947235494852, 0.04998119920492172, 0.10781009495258331, -0.08548823744058609, 0.0556267648935318, -0.05621412768959999, -5.690639426347843e-8, 0.008148430846631527, 0.008586591109633446, -0.06543944776058197, -0.008892112411558628, 0.031149856746196747, 0.0653526782989502, -0.013250994496047497, 0.03237932547926903, 0.04480355978012085, 0.07421793043613434, 0.050537023693323135, 0.03746802359819412, -0.08745613694190979, -0.014197009615600109, -0.026646830141544342, 0.03616754338145256, -0.041462380439043045, 0.04787326976656914, -0.053673747926950455, -0.018259255215525627, -0.007033231668174267, -0.023067623376846313, -0.10046359151601791, 0.004345716908574104, 0.01498002652078867, 0.006851487327367067, 0.022276677191257477, 0.06485867500305176, -0.058161474764347076, -0.002811444690451026, -0.012733839452266693, 0.028585273772478104, -0.02367432788014412, -0.026151098310947418, -0.06202320381999016, 0.12878258526325226, -0.051848892122507095, -0.023955736309289932, -0.008560866117477417, 0.0419694259762764, 0.030090540647506714, 0.0063453977927565575, 0.014145887456834316, 0.02878798171877861, -0.021243492141366005, -0.009705930948257446, 0.04196333885192871, 0.08362791687250137, -0.018803253769874573, 0.0012046239571645856, 0.0001705965114524588, -0.021903999149799347, -0.0240501556545496, -0.0025951010175049305, -0.01852760836482048, 0.06439924985170364, 0.011126025579869747, -0.11943522095680237, 0.007593204267323017, 0.009541191160678864, 0.021187668666243553, 0.07703737169504166, 0.02025260217487812, -0.003558691358193755 ]
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`. \* Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an [`Error`][] is thrown. \* If the `urlObject.search` property is `undefined` and if the `urlObject.query` property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the [`querystring`][] module's `stringify()` method passing the value of `urlObject.query`. \* Otherwise, if `urlObject.search` is a string: \* If the value of `urlObject.search` \_does not start\_ with the ASCII question mark (`?`) character, the literal string `?` is appended to `result`. \* The value of `urlObject.search` is appended to `result`. \* Otherwise, if `urlObject.search` is not `undefined` and is not a string, an [`Error`][] is thrown. \* If the `urlObject.hash` property is a string: \* If the value of `urlObject.hash` \_does not start\_ with the ASCII hash (`#`) character, the literal string `#` is appended to `result`. \* The value of `urlObject.hash` is appended to `result`. \* Otherwise, if the `urlObject.hash` property is not `undefined` and is not a string, an [`Error`][] is thrown. \* `result` is returned. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url)). ```bash npx codemod@latest @nodejs/node-url-to-whatwg-url ``` ### `url.parse(urlString[, parseQueryString[, slashesDenoteHost]])` > Stability: 0 - Deprecated: Use the WHATWG URL API instead. \* `urlString` {string} The URL string to parse. \* `parseQueryString` {boolean} If `true`, the `query` property will always be set to an object returned by the [`querystring`][] module's `parse()` method. If `false`, the `query` property on the returned URL object will be an unparsed, undecoded string. \*\*Default:\*\* `false`. \* `slashesDenoteHost` {boolean} If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. \*\*Default:\*\* `false`. The `url.parse()` method takes a URL string, parses it, and returns a URL object. A `TypeError` is thrown if `urlString` is not a string. A `URIError` is thrown if the `auth` property is present but cannot be decoded. `url.parse()` uses a lenient, non-standard algorithm for parsing URL strings. It is prone to security issues such as [host name spoofing][] and incorrect handling of usernames and passwords. Do not use with untrusted input. CVEs are not issued for `url.parse()` vulnerabilities. Use the [WHATWG URL][] API instead, for example: ```js function getURL(req) { const proto = req.headers['x-forwarded-proto'] || 'https'; const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com'; return new URL(`${proto}://${host}${req.url || '/'}`); } ``` The example above assumes well-formed headers are forwarded from a reverse proxy to your Node.js server. If you are not using a reverse proxy, you should use the example below: ```js function getURL(req) { return new URL(`https://example.com${req.url || '/'}`); } ``` An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url)). ```bash npx codemod@latest @nodejs/node-url-to-whatwg-url ``` ### `url.resolve(from, to)` \* `from` {string} The base URL to use if `to` is a relative URL. \* `to` {string} The target URL to resolve. The `url.resolve()` method resolves a target URL relative to a base URL in a manner similar to that of a web browser resolving 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: ```js function resolve(from, to) { const resolvedUrl = new URL(to, new URL(from, 'resolve://')); if (resolvedUrl.protocol === 'resolve:') { //
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.001399216242134571, -0.0024443732108920813, 0.059196826070547104, 0.013553756289184093, -0.009516306221485138, -0.032956723123788834, -0.011364294216036797, 0.11395427584648132, 0.11966893076896667, 0.021500514820218086, -0.003368537640199065, 0.022967038676142693, -0.07082539051771164, -0.026790905743837357, -0.07220632582902908, 0.010990285314619541, 0.05074221268296242, 0.03027092106640339, -0.03675055131316185, -0.045310504734516144, 0.059046316891908646, 0.09898971021175385, 0.07503008842468262, 0.04254636913537979, -0.14193668961524963, -0.022505607455968857, -0.07173574715852737, 0.0731324627995491, 0.005437961779534817, -0.036470115184783936, -0.021996913477778435, -0.045533668249845505, -0.011840753257274628, -0.03986130654811859, -0.02249152399599552, -0.09814777970314026, -0.02967456355690956, -0.05623604729771614, -0.06485190987586975, -0.06688321381807327, -0.02781086228787899, 0.07537516206502914, 0.012806697748601437, -0.09507622569799423, 0.07576872408390045, 0.005025989841669798, -0.0034107386600226164, 0.04241318255662918, -0.04608585312962532, 0.002658101497218013, 0.008602766320109367, 0.031343091279268265, -0.08568854629993439, -0.03752235323190689, -0.035713180899620056, 0.07496540993452072, -0.0703519731760025, -0.06018183007836342, 0.00032544409623369575, -0.09037131071090698, 0.06618272513151169, 0.006537408567965031, 0.0339646115899086, -0.01095337700098753, 0.05052543058991432, -0.04981328547000885, 0.0007978667272254825, -0.01972801424562931, -0.1793753057718277, -0.0038601476699113846, 0.05838166922330856, 0.05901796743273735, -0.019603896886110306, 0.004251493141055107, -0.04306500777602196, 0.06240341439843178, -0.010876483283936977, -0.0200981255620718, -0.11371881514787674, -0.06864181905984879, 0.035052698105573654, 0.065859854221344, 0.03870801627635956, -0.02986202947795391, -0.03581579402089119, 0.005929119419306517, 0.006540724076330662, 0.0032093264162540436, -0.02884221076965332, 0.05005427822470665, -0.08386670053005219, 0.027390049770474434, 0.041572440415620804, 0.013906006701290607, -0.023258961737155914, 0.0547599196434021, -0.04438852518796921, -0.04523581266403198, -0.02464689314365387, 0.07111562788486481, -0.0503067821264267, -0.05481307581067085, -0.03399985656142235, -0.009799071587622166, -0.0005454762140288949, -0.018699830397963524, 0.10232625901699066, 0.08684758841991425, -0.04099878668785095, -0.007729006465524435, -0.04537610709667206, 0.008060093969106674, -0.05130648612976074, 0.02087758295238018, 2.075583783229352e-33, 0.038069948554039, -0.010737922973930836, 0.0016045266529545188, 0.034362711012363434, -0.006069154478609562, 0.03649594634771347, 0.029960816726088524, 0.062141548842191696, -0.021106243133544922, -0.014336210675537586, -0.09088733047246933, 0.004566002171486616, -0.00026224838802590966, 0.012881589122116566, -0.031098714098334312, 0.03932845592498779, 0.06538014113903046, -0.034403592348098755, 0.0378301776945591, 0.05699923262000084, 0.01669812947511673, 0.06451665610074997, -0.015366896986961365, 0.00264689140021801, 0.0014143040170893073, -0.024001559242606163, -0.01535762008279562, -0.041174501180648804, -0.035635240375995636, -0.008875937201082706, -0.010386019945144653, -0.0447702631354332, -0.0991678312420845, 0.03290511295199394, 0.023854171857237816, 0.04642384126782417, 0.032762035727500916, 0.030228877440094948, -0.14247144758701324, 0.04426206275820732, -0.09976788610219955, -0.035847146064043045, -0.07777585834264755, 0.006428121123462915, 0.029220715165138245, -0.1134520098567009, -0.14002884924411774, -0.05968207120895386, 0.03353016451001167, 0.030724022537469864, -0.048504024744033813, 0.07140102982521057, 0.09325439482927322, 0.0271650031208992, 0.03912116214632988, -0.026222877204418182, -0.011377749033272266, 0.007514912635087967, -0.0728929415345192, -0.038940273225307465, 0.019460119307041168, 0.03414874151349068, 0.008113844320178032, 0.018032822757959366, -0.019890647381544113, 0.021707527339458466, 0.07636667042970657, 0.01764035038650036, 0.05260511115193367, 0.06214060261845589, -0.01929839886724949, 0.011047311127185822, 0.000413609785027802, -0.0035755112767219543, -0.0262263435870409, -0.08579238504171371, -0.11037350445985794, -0.06850441545248032, 0.028952084481716156, -0.0151026276871562, 0.004327721428126097, -0.05606623739004135, -0.0284894946962595, 0.07049701362848282, -0.022325631231069565, 0.08890090137720108, -0.005096598993986845, -0.06125959753990173, -0.015090351924300194, -0.031779199838638306, 0.12050364911556244, 0.003435805905610323, -0.10774093866348267, 0.013759206049144268, 0.048098959028720856, -5.3167580100333293e-33, 0.11685436964035034, 0.026371486485004425, -0.03293478116393089, -0.0023127233143895864, -0.06523729860782623, -0.07819180190563202, 0.08697432279586792, -0.01245860755443573, -0.0237265732139349, -0.03079523704946041, -0.012506229802966118, 0.04741886258125305, 0.04422430321574211, -0.040399760007858276, 0.0016953501617535949, 0.06376679986715317, -0.06891554594039917, -0.12044578045606613, 0.009358575567603111, 0.021024974063038826, -0.01731094717979431, 0.07075296342372894, 0.005479636136442423, -0.023429689928889275, -0.09676133096218109, 0.003820994636043906, 0.03749661520123482, -0.04176551103591919, -0.07062539458274841, 0.03606591001152992, 0.06752283871173859, 0.014964255504310131, -0.05993202328681946, -0.005321616772562265, -0.043733082711696625, 0.04506015405058861, 0.03332354500889778, -0.011179853230714798, 0.038405414670705795, -0.07637130469083786, 0.08490545302629471, -0.006662969943135977, 0.04634077847003937, 0.046408019959926605, 0.04870180785655975, -0.055768631398677826, -0.0019428238738328218, 0.057924918830394745, 0.0413786917924881, -0.03116786479949951, 0.07021032273769379, -0.03236998990178108, -0.025667011737823486, 0.026522453874349594, -0.0076630436815321445, 0.0023111868649721146, -0.08896714448928833, 0.030080843716859818, -0.062182120978832245, 0.048324767500162125, -0.055632203817367554, 0.022844862192869186, -0.010456828400492668, 0.003551007714122534, -0.12015733122825623, 0.022221246734261513, -0.058032818138599396, -0.008274922147393227, 0.09880983084440231, -0.07901560515165329, -0.0016303516458719969, -0.035140782594680786, -0.011901193298399448, 0.02407456375658512, 0.027451029047369957, 0.08863265812397003, 0.013315197080373764, 0.044530417770147324, 0.020480159670114517, 0.06458517163991928, -0.053261689841747284, 0.040235184133052826, -0.017913570627570152, 0.033262237906455994, 0.009963585063815117, -0.11710774153470993, -0.0785190686583519, 0.06832832843065262, -0.07406466454267502, 0.0075487843714654446, 0.06495612859725952, 0.03627431392669678, -0.052188895642757416, 0.010782649740576744, -0.020069299265742302, -5.278262094066122e-8, -0.02845674380660057, 0.01619039475917816, -0.11393765360116959, 0.015620345249772072, 0.01388755813241005, 0.06645134091377258, 0.03514047712087631, -0.005187502130866051, 0.03388237580657005, -0.02465558610856533, 0.01920919306576252, 0.027297355234622955, -0.05457533895969391, 0.025597678497433662, -0.033891644328832626, -0.0019836353603750467, -0.04076880216598511, 0.010002623312175274, -0.018913572654128075, 0.027446694672107697, 0.0260306429117918, -0.053384289145469666, -0.06268563866615295, -0.008035081438720226, 0.015634233132004738, 0.024076443165540695, -0.04593179374933243, 0.04585062339901924, -0.07305828481912613, 0.026863502338528633, 0.04044482484459877, 0.03734515607357025, -0.008473752997815609, 0.004618986509740353, 0.0024675133172422647, 0.11536792665719986, 0.05734800547361374, -0.019018344581127167, 0.014341157861053944, 0.04432447627186775, 0.11142342537641525, 0.047108061611652374, 0.01957722380757332, 0.015880363062024117, -0.05112118646502495, -0.05825362727046013, 0.09264121949672699, 0.05028964951634407, 0.028456907719373703, -0.03571823984384537, 0.008277952671051025, -0.025017771869897842, -0.06408946961164474, 0.01752101071178913, -0.045722901821136475, 0.02926764264702797, 0.013556125573813915, -0.0025499630719423294, -0.06868652999401093, 0.0705723911523819, 0.04847129061818123, -0.008282536640763283, -0.01721440814435482, -0.04378693550825119 ]
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: ```js function resolve(from, to) { const resolvedUrl = new URL(to, new URL(from, 'resolve://')); if (resolvedUrl.protocol === 'resolve:') { // `from` is a relative URL. const { pathname, search, hash } = resolvedUrl; return pathname + search + hash; } return resolvedUrl.toString(); } resolve('/one/two/three', 'four'); // '/one/two/four' resolve('http://example.com/', '/one'); // 'http://example.com/one' resolve('http://example.com/one', '/two'); // 'http://example.com/two' ``` ## Percent-encoding in URLs URLs are permitted to only contain a certain range of characters. Any character falling outside of that range must be encoded. How such characters are encoded, and which characters to encode depends entirely on where the character is located within the structure of the URL. ### Legacy API Within the Legacy API, spaces (`' '`) and the following characters will be automatically escaped in the properties of URL objects: ```text < > " ` \r \n \t { } | \ ^ ' ``` For example, the ASCII space character (`' '`) is encoded as `%20`. The ASCII forward slash (`/`) character is encoded as `%3C`. ### WHATWG API The [WHATWG URL Standard][] uses a more selective and fine grained approach to selecting encoded characters than that used by the Legacy API. The WHATWG algorithm defines four "percent-encode sets" that describe ranges of characters that must be percent-encoded: \* The \_C0 control percent-encode set\_ includes code points in range U+0000 to U+001F (inclusive) and all code points greater than U+007E (\~). \* The \_fragment percent-encode set\_ includes the \_C0 control percent-encode set\_ and code points U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (\`). \* The \_path percent-encode set\_ includes the \_C0 control percent-encode set\_ and code points U+0020 SPACE, U+0022 ("), U+0023 (#), U+003C (<), U+003E (>), U+003F (?), U+0060 (\`), U+007B ({), and U+007D (}). \* The \_userinfo encode set\_ includes the \_path percent-encode set\_ and code points U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B (\[) to U+005E(^), and U+007C (|). The \_userinfo percent-encode set\_ is used exclusively for username and passwords encoded within the URL. The \_path percent-encode set\_ is used for the path of most URLs. The \_fragment percent-encode set\_ is used for URL fragments. The \_C0 control percent-encode set\_ is used for host and path under certain specific conditions, in addition to all other cases. When non-ASCII characters appear within a host name, the host name is encoded using the [Punycode][] algorithm. Note, however, that a host name \_may\_ contain \_both\_ Punycode encoded and percent-encoded characters: ```js const myURL = new URL('https://%CF%80.example.com/foo'); console.log(myURL.href); // Prints https://xn--1xa.example.com/foo console.log(myURL.origin); // Prints https://xn--1xa.example.com ``` [Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4 [WHATWG URL]: #the-whatwg-url-api [WHATWG URL Standard]: https://url.spec.whatwg.org/ [`Error`]: errors.md#class-error [`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/JSON/stringify [`TypeError`]: errors.md#class-typeerror [`URLSearchParams`]: #class-urlsearchparams [`array.toString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Array/toString [`http.request()`]: http.md#httprequestoptions-callback [`https.request()`]: https.md#httpsrequestoptions-callback [`new URL()`]: #new-urlinput-base [`querystring`]: querystring.md [`url.domainToASCII()`]: #urldomaintoasciidomain [`url.domainToUnicode()`]: #urldomaintounicodedomain [`url.fileURLToPath()`]: #urlfileurltopathurl-options [`url.format()`]: #urlformaturlobject [`url.href`]: #urlhref [`url.parse()`]: #urlparseurlstring-parsequerystring-slashesdenotehost [`url.search`]: #urlsearch [`url.toJSON()`]: #urltojson [`url.toString()`]: #urltostring [`urlSearchParams.entries()`]: #urlsearchparamsentries [`urlSearchParamsSymbol.iterator()`]: #urlsearchparamssymboliterator [converted to a string]: https://tc39.es/ecma262/#sec-tostring [examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing [host name spoofing]: https://hackerone.com/reports/678487 [legacy `urlObject`]: #legacy-urlobject [percent-encoded]: #percent-encoding-in-urls [stable sorting algorithm]: https://en.wikipedia.org/wiki/Sorting\_algorithm#Stability
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.05101222172379494, 0.050366900861263275, 0.02775694616138935, -0.06166353076696396, 0.0709402784705162, -0.012297296896576881, -0.023835087195038795, 0.1300327032804489, 0.005896355025470257, 0.05144751816987991, 0.006452132947742939, -0.04520890861749649, -0.07885526865720749, -0.006258587818592787, -0.03309834748506546, 0.047397516667842865, 0.0386192724108696, 0.0805247575044632, -0.003161765169352293, -0.19849394261837006, -0.008112475275993347, -0.0688721314072609, 0.027029693126678467, -0.05117327719926834, -0.017275020480155945, 0.0364471897482872, -0.00542769581079483, 0.05102185159921646, 0.11349598318338394, 0.004857649561017752, -0.05704491585493088, 0.017680000513792038, -0.01946314424276352, -0.04370381310582161, 0.09329812973737717, -0.04533267021179199, -0.012133870273828506, -0.018926765769720078, -0.04152943938970566, -0.1058650091290474, -0.060674943029880524, 0.030166851356625557, 0.05599668622016907, -0.12613564729690552, 0.03913231939077377, 0.001475759781897068, 0.05327287316322327, 0.05342517048120499, -0.06976311653852463, 0.05134885758161545, -0.023332588374614716, 0.04150071367621422, -0.03804551064968109, -0.04303218796849251, -0.022690968587994576, -0.03382585197687149, 0.028210174292325974, -0.019098589196801186, -0.06358274817466736, 0.03973918780684471, -0.0008212358225136995, 0.022068576887249947, 0.0034786874894052744, -0.06857358664274216, 0.050316888839006424, -0.04330475628376007, -0.034036461263895035, 0.053623028099536896, -0.10428347438573837, -0.009895109571516514, 0.0598335936665535, 0.05933256819844246, 0.0123214116320014, -0.023279916495084763, -0.045642051845788956, 0.05681251361966133, -0.01840817555785179, 0.006711636204272509, -0.04953042045235634, -0.04810258746147156, -0.014978443272411823, 0.01881292089819908, 0.05648227408528328, 0.01874607242643833, 0.06617926061153412, -0.005593019537627697, -0.006949276197701693, 0.026188921183347702, -0.002796708606183529, 0.027644263580441475, -0.07934286445379257, 0.015414613299071789, 0.024280982092022896, -0.008090107701718807, 0.0757509097456932, 0.011935442686080933, 0.010641430504620075, -0.017223499715328217, 0.014530772343277931, 0.013174050487577915, -0.0469147227704525, -0.12483955919742584, -0.03016195073723793, 0.08761894702911377, -0.05956799536943436, 0.0639004036784172, -0.012558498419821262, 0.005050963722169399, 0.006422732025384903, -0.01142485998570919, -0.033903125673532486, -0.04132261127233505, -0.04244877025485039, 0.05532914027571678, 1.4855813117035604e-33, 0.054361652582883835, 0.03568684682250023, -0.03688240796327591, -0.003659943351522088, -0.03771119564771652, 0.028609782457351685, -0.0006227486883290112, -0.017678750678896904, -0.06467055529356003, 0.01380416564643383, -0.021610096096992493, 0.005196481943130493, 0.02377021126449108, -0.11512472480535507, -0.10501690953969955, 0.006506542209535837, 0.03136006370186806, 0.0017160269198939204, 0.03131747618317604, 0.03243737295269966, -0.026543764397501945, 0.04817895591259003, 0.004125285428017378, -0.011878830380737782, 0.07050251960754395, -0.001206343062222004, -0.020475171506404877, -0.02610139362514019, -0.05243964493274689, -0.0328875407576561, 0.1371028572320938, 0.002572530647739768, -0.05938731133937836, 0.011191700585186481, 0.06035489961504936, 0.03358551859855652, 0.05682841315865517, 0.033767443150281906, -0.15000048279762268, -0.037740182131528854, 0.013872544281184673, 0.0178951695561409, -0.03885292261838913, 0.0375194326043129, 0.03840097784996033, -0.06440646946430206, -0.061988718807697296, -0.021017158403992653, -0.0005592339439317584, -0.012955877929925919, -0.0718236044049263, 0.01633830927312374, 0.022790608927607536, -0.07535088807344437, 0.048576172441244125, 0.020305262878537178, -0.03627960756421089, -0.025647958740592003, -0.05041901767253876, 0.031235206872224808, -0.037060923874378204, -0.0253301989287138, -0.07524210214614868, -0.02378280833363533, -0.029408184811472893, 0.0401998832821846, 0.010976552963256836, 0.07699643075466156, -0.05933434143662453, 0.03932800889015198, 0.0489891916513443, 0.02001621201634407, 0.06932876259088516, -0.007621822413057089, -0.04958977922797203, -0.012177913449704647, -0.1353762298822403, 0.012245267629623413, -0.006855820305645466, -0.037696972489356995, -0.03236187621951103, -0.08534128218889236, -0.023305609822273254, 0.1658022254705429, 0.04396138712763786, 0.027880825102329254, -0.030814358964562416, -0.07288342714309692, 0.04406078904867172, 0.010341044515371323, 0.033965013921260834, 0.049719374626874924, 0.0017330574337393045, -0.0743882805109024, 0.024682141840457916, -4.5906878429670346e-33, 0.028262043371796608, -0.003680987749248743, 0.01190587691962719, 0.09387268871068954, -0.009201041422784328, -0.012620619498193264, 0.0981818437576294, -0.030188314616680145, 0.005004975013434887, 0.05147578567266464, 0.051587507128715515, 0.021009797230362892, 0.02375783957540989, -0.05638639256358147, 0.040576521307229996, 0.1324007511138916, 0.004432512912899256, -0.015798034146428108, -0.02661622315645218, -0.006889263167977333, 0.046769727021455765, 0.045081786811351776, -0.04228298366069794, 0.03827991709113121, -0.020560018718242645, -0.00300205172970891, 0.08279728144407272, -0.03368254005908966, -0.08577095717191696, -0.0033417728263884783, 0.02446821704506874, -0.06866618245840073, 0.005649346858263016, 0.028212957084178925, 0.03122769482433796, 0.023716352880001068, 0.0036108887288719416, 0.13567782938480377, 0.0377843864262104, -0.0374077744781971, 0.03408689796924591, -0.053266603499650955, -0.031397197395563126, 0.09145471453666687, -0.00668341014534235, -0.027649298310279846, -0.018235769122838974, 0.0835975781083107, -0.0358772948384285, -0.010756106115877628, -0.0011075284564867616, -0.06088533252477646, -0.005539517384022474, -0.08050553500652313, 0.007014301139861345, -0.012989100068807602, -0.023696931079030037, -0.014962680637836456, -0.02061203122138977, 0.03988369554281235, 0.02845371887087822, -0.09605658799409866, 0.0071791247464716434, 0.05977337807416916, 0.027884261682629585, -0.010385801084339619, -0.13251572847366333, -0.0212981216609478, -0.03222324699163437, -0.006938183214515448, -0.053321074694395065, -0.04034990817308426, -0.00033938034903258085, -0.03227117657661438, 0.11844562739133835, -0.03627629950642586, 0.05233330652117729, -0.018766729161143303, 0.03635600209236145, 0.050733257085084915, -0.04564788192510605, 0.0442686453461647, -0.003973060287535191, -0.072846420109272, 0.07516583800315857, 0.014227818697690964, -0.05649019777774811, 0.14249156415462494, -0.041944000869989395, -0.029611919075250626, 0.034929320216178894, 0.05050941929221153, -0.11327172815799713, -0.06534575670957565, -0.01966562494635582, -5.4888673162167834e-8, -0.04795575886964798, 0.057291630655527115, -0.07865823060274124, -0.009529595263302326, -0.07396899908781052, 0.056328389793634415, 0.048985157161951065, 0.047684598714113235, 0.008177130483090878, 0.04153931140899658, -0.024355638772249222, 0.03862074017524719, -0.03165064752101898, 0.040752094238996506, -0.011501899920403957, -0.060623183846473694, -0.005354104097932577, -0.002295370679348707, -0.04746689647436142, -0.0073853484354913235, -0.11485514789819717, -0.027604473754763603, -0.0017766071250662208, 0.005986847914755344, 0.061390940099954605, -0.03825141862034798, -0.0063909608870744705, -0.01870141737163067, 0.023848026990890503, 0.01004953496158123, -0.08109678328037262, 0.0012132867705076933, -0.04866712912917137, -0.03420429676771164, -0.02125396952033043, -0.013842381536960602, 0.021173764020204544, 0.001244710641913116, 0.019556807354092598, 0.04624001681804657, 0.0893026813864708, 0.024429339915513992, 0.01930117793381214, 0.05374900624155998, -0.0011156813707202673, -0.005175481550395489, 0.07842447608709335, 0.003951829392462969, 0.11977747827768326, 0.05833158642053604, -0.006678062491118908, -0.0545746386051178, -0.005612912122160196, -0.09559947997331619, -0.02287342958152294, -0.0072819809429347515, -0.04988092556595802, -0.09482353925704956, -0.01908009685575962, 0.03915444761514664, 0.07614651322364807, -0.016318023204803467, 0.007263248320668936, 0.04141846299171448 ]
-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'); ``` ## Determining if crypto support is unavailable It is possible for Node.js to be built without including support for the `node:crypto` module. In such cases, attempting to `import` from `tls` or calling `require('node:tls')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: ```cjs let tls; try { tls = require('node:tls'); } catch (err) { console.error('tls support is disabled!'); } ``` When using the lexical ESM `import` keyword, the error can only be caught if a handler for `process.on('uncaughtException')` is registered \_before\_ any attempt to load the module is made (using, for instance, a preload module). When using ESM, if there is a chance that the code may be run on a build of Node.js where crypto support is not enabled, consider using the [`import()`][] function instead of the lexical `import` keyword: ```mjs let tls; try { tls = await import('node:tls'); } catch (err) { console.error('tls support is disabled!'); } ``` ## TLS/SSL concepts TLS/SSL is a set of protocols that rely on a public key infrastructure (PKI) to enable secure communication between a client and a server. For most common cases, each server must have a private key. Private keys can be generated in multiple ways. The example below illustrates use of the OpenSSL command-line interface to generate a 2048-bit RSA private key: ```bash openssl genrsa -out ryans-key.pem 2048 ``` With TLS/SSL, all servers (and some clients) must have a \_certificate\_. Certificates are \_public keys\_ that correspond to a private key, and that are digitally signed either by a Certificate Authority or by the owner of the private key (such certificates are referred to as "self-signed"). The first step to obtaining a certificate is to create a \_Certificate Signing Request\_ (CSR) file. The OpenSSL command-line interface can be used to generate a CSR for a private key: ```bash openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem ``` Once the CSR file is generated, it can either be sent to a Certificate Authority for signing or used to generate a self-signed certificate. Creating a self-signed certificate using the OpenSSL command-line interface is illustrated in the example below: ```bash openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem ``` Once the certificate is generated, it can be used to generate a `.pfx` or `.p12` file: ```bash openssl pkcs12 -export -in ryans-cert.pem -inkey ryans-key.pem \ -certfile ca-cert.pem -out ryans.pfx ``` Where: \* `in`: is the signed certificate \* `inkey`: is the associated private key \* `certfile`: is a concatenation of all Certificate Authority (CA) certs into a single file, e.g. `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem` ### Perfect forward secrecy The term \_[forward secrecy][]\_ or \_perfect forward secrecy\_ describes a feature of key-agreement (i.e., key-exchange) methods. That is, the server and client keys are used to negotiate new temporary keys that are used specifically and only for the current communication session. Practically, this means that even if the server's private key is compromised, communication can only be decrypted by eavesdroppers if the attacker manages 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 commonly used to
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.047191206365823746, 0.0657188817858696, -0.005290448199957609, 0.01698789931833744, 0.06504280120134354, -0.013250657357275486, -0.02732032537460327, -0.015117823146283627, -0.04240799695253372, -0.007067062426358461, 0.00510972598567605, -0.09182724356651306, -0.09650533646345139, -0.03827681764960289, 0.025242723524570465, 0.013012418523430824, 0.021769089624285698, -0.09288322925567627, 0.00291670230217278, -0.0854233056306839, 0.07484255731105804, -0.11495082080364227, 0.10137028247117996, -0.026255501434206963, -0.07629385590553284, -0.052565935999155045, -0.052629683166742325, 0.002732659690082073, -0.014197079464793205, -0.07121194899082184, -0.04338328167796135, -0.01203359104692936, -0.040728189051151276, -0.030820591375231743, -0.026564709842205048, -0.11321724206209183, -0.05232341215014458, -0.02909906394779682, -0.019660253077745438, -0.019901568070054054, -0.000745053868740797, -0.04978456348180771, 0.04794088006019592, -0.04303226247429848, 0.01663985289633274, -0.005860844161361456, 0.06874828040599823, -0.0213045384734869, -0.0028118095360696316, 0.03530232235789299, 0.03293514996767044, 0.0175222996622324, 0.013505215756595135, -0.027580097317695618, 0.0359170138835907, 0.005650544073432684, 0.11159913241863251, -0.008821222931146622, -0.044302500784397125, 0.0038546195719391108, 0.03753921017050743, -0.06745254993438721, -0.050119828432798386, 0.010855995118618011, -0.046218808740377426, -0.035143330693244934, 0.06213745102286339, -0.048339445143938065, -0.058500614017248154, -0.06673017144203186, 0.034596264362335205, 0.0042167725041508675, 0.05521322414278984, -0.015820462256669998, 0.008397497236728668, 0.04749015346169472, 0.049562178552150726, -0.012319371104240417, -0.06522738188505173, -0.010648609139025211, 0.06911814957857132, 0.10840565711259842, 0.005943546071648598, 0.04520295560359955, 0.017443936318159103, -0.09883152693510056, -0.05875374749302864, -0.006235870532691479, 0.002258592750877142, 0.053321268409490585, -0.03488500416278839, 0.026446765288710594, 0.02420991286635399, 0.02690940909087658, -0.08105306327342987, 0.023947061970829964, 0.0013365184422582388, 0.010667444206774235, 0.020314931869506836, 0.009523902088403702, -0.05376015603542328, -0.04297157749533653, -0.0002480647817719728, 0.015132157132029533, -0.03931053355336189, 0.08346724510192871, 0.09737907350063324, 0.02499479614198208, 0.026657849550247192, 0.04623324051499367, -0.014101333916187286, 0.04038635641336441, -0.05586618557572365, 0.0819767415523529, 2.5467410208221258e-33, -0.024710169062018394, -0.02908802404999733, -0.028805818408727646, 0.09157532453536987, 0.006490663625299931, -0.00019429990788921714, 0.07869458198547363, 0.011537749320268631, -0.152377188205719, -0.02449953556060791, -0.009162405505776405, 0.030738819390535355, -0.013090030290186405, -0.0492219403386116, 0.0825302004814148, 0.03775806725025177, 0.09029865264892578, -0.05236217752099037, 0.11837593466043472, 0.03237765282392502, 0.0558004155755043, -0.03704135864973068, 0.0544651597738266, -0.005563041660934687, 0.009055419825017452, 0.02635672129690647, 0.03201909363269806, -0.018640093505382538, 0.05642956867814064, 0.026399526745080948, -0.0005759980413131416, 0.05236876755952835, 0.03902973234653473, 0.018974412232637405, 0.0914381816983223, 0.041228037327528, -0.00868340115994215, 0.06279546022415161, -0.067839615046978, -0.061081383377313614, 0.02125198021531105, 0.07926113903522491, -0.026656167581677437, 0.04983873665332794, 0.007826696150004864, -0.061598073691129684, -0.04745316132903099, -0.07350503653287888, 0.02852921560406685, 0.016572732478380203, -0.03617997467517853, 0.0220989640802145, -0.042262058705091476, -0.08168447017669678, 0.07293262332677841, -0.03768852725625038, 0.04538273066282272, 0.035908717662096024, -0.06381615996360779, -0.013461667113006115, -0.013331323862075806, -0.03291035816073418, -0.057255491614341736, -0.021518608555197716, 0.05175004526972771, 0.053331710398197174, -0.08857149630784988, -0.019881151616573334, -0.10570864379405975, 0.03140602260828018, -0.010873247869312763, 0.017015885561704636, -0.014862442389130592, 0.06567233800888062, 0.005049174185842276, 0.03142084553837776, -0.045764848589897156, -0.011291987262666225, 0.07185232639312744, -0.06784748286008835, 0.021001596003770828, -0.06843271106481552, 0.012327555567026138, 0.08225061744451523, -0.0023810749407857656, 0.059412311762571335, -0.0267814788967371, 0.074168361723423, 0.059908799827098846, 0.03345926105976105, 0.039165277034044266, 0.013016225770115852, 0.02813439816236496, -0.07787966728210449, -0.1290546953678131, -4.835252014049504e-33, -0.02342577837407589, -0.006864746566861868, -0.04583776742219925, 0.11626497656106949, -0.0198028776794672, -0.06820163130760193, -0.06994416564702988, -0.047473322600126266, 0.09137073159217834, 0.05973329767584801, -0.03076634369790554, -0.01415021251887083, 0.13085363805294037, 0.028121642768383026, 0.026928994804620743, -0.023591239005327225, -0.13659709692001343, 0.014458389021456242, -0.03337080404162407, 0.007402668707072735, -0.04428528621792793, -0.018208004534244537, 0.009141308255493641, 0.0399838387966156, -0.033720195293426514, 0.058686669915914536, -0.11661408841609955, -0.017443442717194557, -0.05485880747437477, -0.03212727606296539, -0.022067418321967125, -0.020070785656571388, 0.022353006526827812, 0.03667735308408737, -0.028543837368488312, -0.06212117522954941, -0.04762427881360054, 0.036140866577625275, 0.06949619203805923, -0.06616371870040894, 0.0815856009721756, 0.028802478685975075, -0.005612270440906286, -0.042903512716293335, -0.007159631699323654, -0.0335959829390049, 0.018531186506152153, 0.01717866025865078, 0.02247346006333828, -0.040318574756383896, -0.01919165812432766, -0.017439603805541992, -0.00709123257547617, -0.038967445492744446, -0.01010109018534422, 0.012084832414984703, 0.00954695139080286, 0.0798053964972496, 0.013465006835758686, -0.04755542799830437, 0.059992715716362, -0.05922922119498253, -0.018270669505000114, -0.012818217277526855, 0.05094281584024429, 0.04468623176217079, -0.13627320528030396, 0.0252427589148283, 0.11490312963724136, -0.0040509761311113834, 0.01794116199016571, 0.02970215305685997, -0.02816561609506607, -0.05472369119524956, 0.011981658637523651, -0.03143894672393799, -0.03385225310921669, -0.05460156500339508, 0.06312377005815506, 0.03984847292304039, -0.03666125237941742, 0.07879087328910828, -0.05109970271587372, -0.005430677905678749, 0.08389008045196533, 0.004074406810104847, 0.021160222589969635, -0.014865335077047348, -0.0018249197164550424, -0.0396617166697979, 0.041778698563575745, 0.04903412237763405, -0.09470772743225098, 0.02634626440703869, 0.04603451490402222, -4.7351758070135475e-8, -0.031710200011730194, -0.0009541262988932431, -0.1420581340789795, -0.03190690279006958, 0.06802427768707275, 0.008190526627004147, 0.0520518533885479, -0.07495361566543579, 0.06891423463821411, 0.0724620521068573, -0.02176801860332489, -0.003635458881035447, -0.030673637986183167, -0.025280173867940903, -0.022200515493750572, 0.05476982146501541, -0.10018086433410645, 0.02323417365550995, -0.011606348678469658, -0.07385804504156113, 0.01052251085639, 0.00442781625315547, -0.02571481466293335, 0.13155323266983032, -0.05674070864915848, 0.013703873381018639, 0.04988132789731026, 0.04538162425160408, -0.0038569120224565268, -0.030939297750592232, -0.1156662255525589, -0.05243169516324997, 0.022355452179908752, 0.0302790068089962, -0.01877143420279026, 0.0628788098692894, -0.06978577375411987, -0.00919727049767971, 0.08594495803117752, 0.060288820415735245, 0.025096405297517776, 0.05038546398282051, 0.007664755452424288, 0.061774447560310364, -0.05612093210220337, 0.029888754710555077, 0.021253179758787155, 0.023196624591946602, -0.02157723717391491, 0.014286073856055737, -0.003798854537308216, -0.02476164884865284, -0.08746951818466187, 0.027559898793697357, -0.038581956177949905, 0.01849173754453659, 0.024485114961862564, -0.07477539777755737, -0.05998166650533676, -0.09109792858362198, 0.0600992850959301, -0.03683420643210411, 0.10406602174043655, -0.02517438866198063 ]
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 commonly used to achieve perfect forward secrecy (note the character "E" appended to the traditional abbreviations): \* [ECDHE][]: An ephemeral version of the Elliptic Curve Diffie-Hellman key-agreement protocol. \* [DHE][]: An ephemeral version of the Diffie-Hellman key-agreement protocol. Perfect forward secrecy using ECDHE is enabled by default. The `ecdhCurve` option can be used when creating a TLS server to customize the list of supported ECDH curves to use. See [`tls.createServer()`][] for more info. DHE is disabled by default but can be enabled alongside ECDHE by setting the `dhparam` option to `'auto'`. Custom DHE parameters are also supported but discouraged in favor of automatically selected, well-known parameters. Perfect forward secrecy was optional up to TLSv1.2. As of TLSv1.3, (EC)DHE is always used (with the exception of PSK-only connections). ### ALPN and SNI ALPN (Application-Layer Protocol Negotiation Extension) and SNI (Server Name Indication) are TLS handshake extensions: \* ALPN: Allows the use of one TLS server for multiple protocols (HTTP, HTTP/2) \* SNI: Allows the use of one TLS server for multiple hostnames with different certificates. ### Pre-shared keys TLS-PSK support is available as an alternative to normal certificate-based authentication. It uses a pre-shared key instead of certificates to authenticate a TLS connection, providing mutual authentication. TLS-PSK and public key infrastructure are not mutually exclusive. Clients and servers can accommodate both, choosing either of them during the normal cipher negotiation step. TLS-PSK is only a good choice where means exist to securely share a key with every connecting machine, so it does not replace the public key infrastructure (PKI) for the majority of TLS uses. The TLS-PSK implementation in OpenSSL has seen many security flaws in recent years, mostly because it is used only by a minority of applications. Please consider all alternative solutions before switching to PSK ciphers. Upon generating PSK it is of critical importance to use sufficient entropy as discussed in [RFC 4086][]. Deriving a shared secret from a password or other low-entropy sources is not secure. PSK ciphers are disabled by default, and using TLS-PSK thus requires explicitly specifying a cipher suite with the `ciphers` option. The list of available ciphers can be retrieved via `openssl ciphers -v 'PSK'`. All TLS 1.3 ciphers are eligible for PSK and can be retrieved via `openssl ciphers -v -s -tls1\_3 -psk`. On the client connection, a custom `checkServerIdentity` should be passed because the default one will fail in the absence of a certificate. According to the [RFC 4279][], PSK identities up to 128 bytes in length and PSKs up to 64 bytes in length must be supported. As of OpenSSL 1.1.0 maximum identity size is 128 bytes, and maximum PSK length is 256 bytes. The current implementation doesn't support asynchronous PSK callbacks due to the limitations of the underlying OpenSSL API. To use TLS-PSK, client and server must specify the `pskCallback` option, a function that returns the PSK to use (which must be compatible with the selected cipher's digest). It will be called first on the client: \* `hint` {string} optional message sent from 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}
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.03593631088733673, 0.031206456944346428, -0.05830089747905731, 0.018175804987549782, -0.020457476377487183, -0.010807963088154793, -0.05054028704762459, 0.04652755707502365, -0.0042906529270112514, 0.0052866688929498196, 0.011661943048238754, -0.08552280068397522, -0.055933550000190735, 0.05826764553785324, 0.03863426297903061, 0.013240792788565159, -0.008372264914214611, 0.03634622320532799, -0.03017725609242916, -0.028102461248636246, 0.0558093823492527, -0.12904097139835358, 0.04553350806236267, 0.031462449580430984, 0.04736723750829697, 0.045107897371053696, -0.059009652584791183, -0.004799623042345047, -0.10086474567651749, -0.019605090841650963, 0.023713991045951843, -0.03414665162563324, 0.03800120949745178, -0.015260173007845879, 0.0432186983525753, -0.09276537597179413, -0.029169663786888123, 0.08597593754529953, 0.025428080931305885, -0.028691163286566734, 0.03515317291021347, -0.04787527397274971, 0.015453269705176353, -0.07619336992502213, 0.02909100614488125, -0.013580413535237312, 0.0630912333726883, -0.0630631297826767, 0.040802985429763794, -0.06476272642612457, 0.0407496802508831, -0.05302455648779869, -0.018787825480103493, 0.07811884582042694, -0.07283320277929306, 0.043506868183612823, 0.00920913927257061, -0.06916317343711853, -0.06237843260169029, 0.010463425889611244, -0.03496354818344116, -0.03466495871543884, 0.02313675731420517, -0.04865550994873047, -0.06762516498565674, -0.10360592603683472, -0.006604308262467384, -0.003990038298070431, 0.009197600185871124, 0.04922150820493698, 0.032954465597867966, 0.048709407448768616, 0.0018692552112042904, -0.05750492215156555, 0.04799306020140648, 0.02453591302037239, -0.01303661148995161, -0.07360482215881348, -0.04163378104567528, -0.13618798553943634, 0.04387977719306946, 0.06381244212388992, 0.07721464335918427, 0.06234712898731232, -0.008245326578617096, -0.02324647828936577, 0.035711225122213364, 0.030506592243909836, 0.054735004901885986, -0.022650837898254395, -0.050942130386829376, 0.028183627873659134, 0.006798111367970705, 0.024045409634709358, -0.06402963399887085, 0.04458991065621376, 0.04463302344083786, -0.06403243541717529, -0.04690710827708244, 0.03628336265683174, -0.07048218697309494, 0.01126769371330738, 0.02489880472421646, -0.09431181848049164, 0.03515520691871643, 0.08963843435049057, -0.00521545996889472, 0.024294672533869743, 0.03241315856575966, 0.053193598985672, 0.02355007454752922, -0.07887641340494156, -0.0031676325015723705, 0.05341501533985138, 6.263526874124524e-33, 0.029147833585739136, 0.02052691951394081, -0.016725486144423485, 0.02731662429869175, -0.061707839369773865, 0.13556906580924988, 0.0065585351549088955, -0.02522481419146061, -0.030889874324202538, 0.0032840154599398375, -0.021778693422675133, -0.03436357527971268, 0.06137292459607124, 0.020723000168800354, -0.016004061326384544, -0.020722659304738045, -0.02940579131245613, 0.09599277377128601, 0.12418180704116821, -0.010382810607552528, 0.03883447125554085, -0.01908707246184349, 0.09137667715549469, 0.009956078603863716, 0.05762312188744545, 0.06821981817483902, 0.049084797501564026, 0.02933860383927822, 0.000784973381087184, 0.012420253828167915, -0.00267403363250196, 0.03828030079603195, -0.003731765318661928, -0.06707818061113358, -0.008830800652503967, 0.058078255504369736, -0.08605927228927612, 0.027006281539797783, -0.0033973141107708216, -0.057567257434129715, -0.014629758894443512, -0.010253102518618107, -0.02777991257607937, -0.03090212680399418, -0.03636425361037254, -0.03727579116821289, -0.049752868711948395, 0.058770060539245605, 0.026751872152090073, -0.0009496684069745243, -0.014931864105165005, -0.044652875512838364, -0.06924005597829819, -0.09523320943117142, -0.06405171006917953, -0.042726676911115646, 0.03365049138665199, 0.07040008157491684, -0.0281570665538311, 0.090586356818676, 0.000820996065158397, 0.058703839778900146, -0.09489912539720535, -0.05372906103730202, 0.003034349996596575, 0.07432445883750916, -0.02084708772599697, -0.02797657437622547, -0.022715026512742043, -0.031176181510090828, -0.026093635708093643, 0.007760657928884029, 0.04721245914697647, 0.0007699946872889996, -0.022866148501634598, -0.059278011322021484, 0.007062254007905722, 0.05993722379207611, 0.11733508110046387, -0.014865921810269356, -0.0897437259554863, 0.0659605860710144, 0.049681734293699265, 0.061938751488924026, -0.05298876017332077, -0.017950858920812607, -0.027887718752026558, 0.07229302078485489, -0.024345317855477333, -0.021788522601127625, 0.016976719722151756, -0.04463527724146843, 0.030735310167074203, 0.056267596781253815, 0.039386849850416183, -8.161854007102545e-33, 0.010251286439597607, 0.02889629267156124, -0.054347556084394455, 0.07297348976135254, 0.0510159507393837, 0.03753575310111046, -0.013693191111087799, -0.017505943775177002, 0.005100018344819546, -0.02684635855257511, 0.020899442955851555, -0.0423324815928936, 0.0911523699760437, -0.06934306770563126, 0.042721521109342575, -0.050158172845840454, -0.11556155979633331, 0.0491451732814312, 0.014295627363026142, 0.05187009274959564, 0.0482795387506485, -0.04309534654021263, -0.02185446210205555, 0.025043901056051254, 0.09383893758058548, -0.03149159625172615, -0.023483460769057274, 0.026183050125837326, -0.05530381575226784, -0.0029811477288603783, -0.02550583705306053, 0.04363025724887848, -0.045163594186306, -0.0583840012550354, -0.11065655946731567, 0.014304636977612972, -0.09588984400033951, 0.03540153428912163, 0.03137704357504845, -0.009052686393260956, 0.05747615545988083, 0.021551022306084633, 0.05965755507349968, -0.006742015480995178, -0.024395570158958435, 0.12238284200429916, -0.062046848237514496, 0.0057613239623606205, -0.031206056475639343, -0.0127871073782444, -0.003468746319413185, -0.015019197948276997, -0.11517485231161118, -0.09710538387298584, -0.02943611331284046, 0.05206901952624321, -0.11512155085802078, 0.05657655745744705, -0.0006098057492636144, -0.05407707393169403, -0.013910326175391674, -0.07268434762954712, 0.1319735050201416, 0.08378714323043823, -0.06744560599327087, -0.024535497650504112, -0.04775606840848923, -0.000277912215096876, 0.01562906801700592, 0.058030419051647186, 0.019120577722787857, -0.016576619818806648, -0.01261046715080738, -0.023153478279709816, 0.12234719097614288, -0.11359917372465134, -0.03003613092005253, -0.0873265489935875, -0.011582572013139725, 0.025843016803264618, 0.0422397181391716, 0.1085435003042221, -0.05545279383659363, -0.008419950492680073, 0.06440932303667068, 0.009450878947973251, 0.04041849821805954, 0.06296879798173904, -0.025248466059565544, -0.02229759283363819, 0.021339863538742065, 0.03927191346883774, -0.023155566304922104, 0.09105319529771805, 0.05329106003046036, -6.24103364543771e-8, -0.022044744342565536, -0.0008614225662313402, 0.03938065841794014, -0.018804315477609634, 0.006216580513864756, -0.032756175845861435, 0.05804437771439552, 0.032033633440732956, 0.0345461368560791, -0.0812298059463501, 0.012131365947425365, -0.008718308992683887, 0.016533326357603073, -0.03972884640097618, -0.016918214038014412, 0.0536545068025589, -0.06259273737668991, 0.003089007455855608, -0.012477507814764977, -0.0637047216296196, -0.03376989811658859, -0.09508595615625381, 0.002859516767784953, 0.013965999707579613, 0.04290471225976944, 0.06943108886480331, 0.044012650847435, 0.0182332880795002, -0.04252252355217934, 0.049666982144117355, -0.0052949427627027035, -0.04907168075442314, -0.008517389185726643, -0.027184857055544853, -0.056323081254959106, 0.14372314512729645, -0.10268961638212204, -0.012552807107567787, -0.00340284314006567, 0.06654158979654312, -0.04191789776086807, -0.06627701222896576, -0.022111352533102036, 0.015696845948696136, -0.02850569784641266, 0.061605650931596756, -0.02600994147360325, 0.07159043848514557, -0.059998657554388046, -0.01646721176803112, -0.015754004940390587, -0.059321921318769455, 0.02338179387152195, -0.07846805453300476, -0.02803047001361847, 0.0948280543088913, -0.0024429019540548325, -0.03355437144637108, 0.09842270612716675, -0.031520020216703415, 0.06412824243307114, -0.0037125740200281143, -0.01910857856273651, 0.0032553488854318857 ]
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 sent from the client. \* Returns: {Buffer|TypedArray|DataView} the PSK (or `null`). A return value of `null` stops the negotiation process and sends an `unknown\_psk\_identity` alert message to the other party. If the server wishes to hide the fact that the PSK identity was not known, the callback must provide some random data as `psk` to make the connection fail with `decrypt\_error` before negotiation is finished. ### Client-initiated renegotiation attack mitigation The TLS protocol allows clients to renegotiate certain aspects of the TLS session. Unfortunately, session renegotiation requires a disproportionate amount of server-side resources, making it a potential vector for denial-of-service attacks. To mitigate the risk, renegotiation is limited to three times every ten minutes. An `'error'` event is emitted on the [`tls.TLSSocket`][] instance when this threshold is exceeded. The limits are configurable: \* `tls.CLIENT\_RENEG\_LIMIT` {number} Specifies the number of renegotiation requests. \*\*Default:\*\* `3`. \* `tls.CLIENT\_RENEG\_WINDOW` {number} Specifies the time renegotiation window in seconds. \*\*Default:\*\* `600` (10 minutes). The default renegotiation limits should not be modified without a full understanding of the implications and risks. TLSv1.3 does not support renegotiation. ### Session resumption Establishing a TLS session can be relatively slow. The process can be sped up by saving and later reusing the session state. There are several mechanisms to do so, discussed here from oldest to newest (and preferred). #### Session identifiers Servers generate a unique ID for new connections and send it to the client. Clients and servers save the session state. When reconnecting, clients send the ID of their saved session state and if the server also has the state for that ID, it can agree to use it. Otherwise, the server will create a new session. See [RFC 2246][] for more information, page 23 and 30\. Resumption using session identifiers is supported by most web browsers when making HTTPS requests. For Node.js, clients wait for the [`'session'`][] event to get the session data, and provide the data to the `session` option of a subsequent [`tls.connect()`][] to reuse the session. Servers must implement handlers for the [`'newSession'`][] and [`'resumeSession'`][] events to save and restore the session data using the session ID as the lookup key to reuse sessions. To reuse sessions across load balancers or cluster workers, servers must use a shared session cache (such as Redis) in their session handlers. #### Session tickets The servers encrypt the entire session state and send it to the client as a "ticket". When reconnecting, the state is sent to the server in the initial connection. This mechanism avoids the need for a server-side session cache. If the server doesn't use the ticket, for any reason (failure to decrypt it, it's too old, etc.), it will create a new session and send a new ticket. See [RFC 5077][] for more information. Resumption using session tickets is becoming commonly supported by many web browsers when making HTTPS requests. For Node.js, clients use the same APIs for resumption with session identifiers as for resumption with session tickets. For debugging, if [`tls.TLSSocket.getTLSTicket()`][] 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 session tickets. To
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.011946150101721287, -0.016697660088539124, 0.0012641728390008211, 0.010714882984757423, -0.005843665916472673, 0.03958788514137268, -0.025792043656110764, -0.06030047684907913, -0.050868794322013855, -0.05232085660099983, 0.02292129397392273, 0.012590995989739895, -0.05660993233323097, 0.08145144581794739, 0.009769418276846409, -0.018927887082099915, 0.03850507363677025, -0.06932588666677475, -0.0268106646835804, -0.09697275608778, 0.020644772797822952, -0.02673301473259926, 0.05314427614212036, 0.034385859966278076, -0.009768219664692879, -0.07301609963178635, 0.0056477137841284275, 0.06417422741651535, -0.04846164956688881, -0.13742442429065704, 0.03581726551055908, -0.013706466183066368, -0.0011163802118971944, -0.043320268392562866, -0.025400135666131973, -0.09734600782394409, -0.07619655132293701, 0.01736943982541561, 0.06002449989318848, -0.05707518011331558, 0.08493049442768097, -0.03661034628748894, -0.022549418732523918, -0.06451836228370667, 0.0691065564751625, 0.025253726169466972, 0.16849252581596375, 0.00469181640073657, -0.03867782652378082, 0.00013357044372241944, 0.05240591987967491, 0.04787609726190567, 0.024872690439224243, 0.02591666951775551, -0.05775974690914154, 0.007953198626637459, 0.037509985268116, -0.03647801652550697, -0.04215338081121445, -0.0029907296411693096, -0.05265862122178078, -0.009891754947602749, -0.01402925606817007, -0.014077248983085155, -0.04117053002119064, -0.05246642231941223, -0.027943380177021027, -0.013723906129598618, -0.0415952168405056, -0.11307378858327866, 0.030790919438004494, -0.004847161006182432, -0.012246564030647278, -0.10788610577583313, 0.020641813054680824, -0.003990283235907555, 0.05974580720067024, -0.04539593309164047, -0.03238379955291748, -0.03902692347764969, 0.045501165091991425, 0.06224009767174721, 0.031054610386490822, 0.006727780215442181, 0.0029511144384741783, -0.02586832270026207, 0.026190713047981262, -0.045013997703790665, 0.020547667518258095, 0.031282611191272736, -0.042522694915533066, -0.06240730732679367, 0.0022917429450899363, -0.059644587337970734, -0.10201872140169144, 0.05515830218791962, 0.04047142714262009, -0.06311971694231033, -0.030559882521629333, 0.018670478835701942, 0.04248487949371338, -0.04082261770963669, 0.09875048696994781, -0.02157404273748398, 0.027869436889886856, 0.08032909035682678, 0.03116934560239315, 0.06336504966020584, -0.024960363283753395, -0.05919148027896881, 0.010515888221561909, -0.002386764856055379, 0.03871573880314827, 0.04115419089794159, 4.5221532162362335e-33, 0.011090821586549282, 0.049545638263225555, -0.02925487793982029, 0.04276576265692711, -0.0221860334277153, 0.024030648171901703, 0.07353419810533524, -0.030383024364709854, -0.02894000895321369, 0.09832687675952911, -0.00799600500613451, -0.001954335719347, 0.06235075742006302, 0.028845960274338722, -0.07291442900896072, 0.0669625923037529, 0.01239568181335926, 0.0646824762225151, 0.038563646376132965, 0.01945709064602852, 0.020984221249818802, 0.028170006349682808, 0.04342823475599289, 0.024008600041270256, 0.025856899097561836, 0.03837849572300911, -0.048487648367881775, -0.004038182552903891, -0.04939839988946915, 0.007212020456790924, -0.025950882583856583, 0.023791799321770668, 0.12024766206741333, 0.04233245179057121, 0.06484320759773254, 0.0464571937918663, 0.062365271151065826, -0.027237441390752792, -0.015896284952759743, -0.018975716084241867, -0.007872659713029861, 0.01357080228626728, -0.0883350819349289, 0.05851931497454643, -0.029132679104804993, -0.07482324540615082, -0.0211567934602499, -0.050113022327423096, 0.0020350958220660686, -0.009184751659631729, -0.04737038165330887, 0.044183436781167984, -0.03761596605181694, 0.030139772221446037, -0.00042936563841067255, -0.08832502365112305, -0.020295966416597366, 0.03535797446966171, -0.06990103423595428, -0.004594853147864342, 0.0024834887590259314, -0.0846785381436348, -0.07804195582866669, -0.058678217232227325, 0.046088989824056625, 0.07359758764505386, -0.08596328645944595, 0.0010119049111381173, -0.10756777226924896, -0.10099274665117264, -0.055393606424331665, 0.10432656109333038, 0.0420340970158577, 0.011552407406270504, -0.038789890706539154, 0.026059485971927643, -0.01559846568852663, 0.09420974552631378, 0.05259024724364281, -0.026484590023756027, -0.004021385218948126, -0.017610222101211548, 0.05450373515486717, 0.053879156708717346, -0.045380670577287674, 0.030871262773871422, 0.04103715717792511, -0.05042330175638199, -0.03773105889558792, -0.012692851014435291, -0.06924964487552643, 0.013009700924158096, 0.014000034891068935, 0.07951907068490982, 0.030631981790065765, -7.399213108756215e-33, -0.036522723734378815, -0.031048361212015152, -0.11595316976308823, 0.01234370470046997, 0.009707925841212273, -0.024730661883950233, -0.0005601502489298582, 0.00369643815793097, 0.0008475573849864304, -0.041780490428209305, 0.0613265261054039, -0.02045571058988571, 0.06990960985422134, -0.017196249216794968, 0.0114613501355052, -0.03163794428110123, -0.04687126725912094, 0.051227420568466187, -0.02540651336312294, -0.00848605576902628, 0.061519693583250046, 0.07403314858675003, 0.014319759793579578, 0.011864970438182354, -0.010833695530891418, 0.009256352670490742, -0.0003961671609431505, -0.00307626579888165, -0.019741037860512733, 0.04535570740699768, 0.08089447021484375, -0.04293752834200859, -0.0029715371783822775, -0.01527452189475298, -0.024308498948812485, 0.023577017709612846, 0.027562400326132774, 0.0029293617699295282, 0.05889420211315155, 0.06605738401412964, 0.09448206424713135, -0.024557987228035927, 0.02419411763548851, -0.024280618876218796, -0.007374080363661051, 0.013846118003129959, 0.02210826240479946, -0.048950519412755966, 0.04377060383558273, -0.02201627567410469, 0.07468654960393906, 0.05292636528611183, 0.03853278607130051, 0.01735641062259674, -0.026736069470643997, -0.01937655545771122, -0.02849085070192814, 0.019268784672021866, 0.04674640670418739, -0.057888004928827286, 0.05002643167972565, -0.030784517526626587, 0.018465839326381683, 0.07376640290021896, 0.025744115933775902, 0.016826413571834564, -0.01797032356262207, 0.012789567932486534, 0.14525018632411957, 0.004738821182399988, 0.03423500806093216, -0.031305067241191864, -0.09609860926866531, -0.03553732857108116, 0.11109265685081482, -0.03138209879398346, -0.08988489210605621, -0.055476512759923935, 0.01556532271206379, 0.04043137654662132, -0.06497649848461151, 0.06992153078317642, -0.03114716336131096, 0.008685145527124405, 0.10706844925880432, 0.007687663659453392, -0.035101138055324554, 0.06461422890424728, -0.017121411859989166, -0.006177365779876709, -0.019747110083699226, 0.045387834310531616, -0.1417016237974167, 0.03492193669080734, 0.03537283465266228, -5.67632483239322e-8, -0.017342422157526016, -0.00027470086934044957, -0.056784968823194504, -0.016427433118224144, 0.04063193127512932, -0.02779361978173256, -0.032316580414772034, -0.03322978317737579, 0.001581486314535141, -0.02866237796843052, -0.004316585138440132, -0.059254877269268036, 0.058071088045835495, -0.12293409556150436, -0.008999377489089966, 0.0007476945174857974, -0.06758315116167068, -0.06885069608688354, -0.019915100187063217, -0.08978018164634705, -0.019857795909047127, -0.06409868597984314, -0.060240648686885834, -0.030748583376407623, -0.037782564759254456, -0.011752133257687092, 0.05707841366529465, 0.09262757748365402, -0.0874507799744606, 0.012603746727108955, -0.0926097109913826, -0.031017985194921494, 0.011772101745009422, 0.025375954806804657, 0.012888855300843716, 0.1303366869688034, -0.04702755808830261, -0.0036257472820580006, -0.0027218200266361237, 0.07302086055278778, -0.04626661539077759, 0.004098162055015564, -0.016617225483059883, 0.07375173270702362, -0.05587659031152725, 0.040741533041000366, -0.009630168788135052, 0.01238368358463049, -0.043952059000730515, 0.012800964526832104, -0.026897484436631203, -0.025436677038669586, -0.0680537298321724, 0.03031931072473526, 0.0226748026907444, -0.02072487585246563, 0.02027750201523304, 0.040220651775598526, 0.0009606585372239351, 0.02133123204112053, 0.000027375039280741476, -0.002607492497190833, -0.0710219144821167, -0.09106017649173737 ]
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 session tickets. To use session tickets across server restarts or load balancers, servers must all have the same ticket keys. There are three 16-byte keys internally, but the tls API exposes them as a single 48-byte buffer for convenience. It's possible to get the ticket keys by calling [`server.getTicketKeys()`][] on one server instance and then distribute them, but it is more reasonable to securely generate 48 bytes of secure random data and set them with the `ticketKeys` option of [`tls.createServer()`][]. The keys should be regularly regenerated and server's keys can be reset with [`server.setTicketKeys()`][]. Session ticket keys are cryptographic keys, and they \_\*\*must be stored securely\*\*\_. With TLS 1.2 and below, if they are compromised all sessions that used tickets encrypted with them can be decrypted. They should not be stored on disk, and they should be regenerated regularly. If clients advertise support for tickets, the server will send them. The server can disable tickets by supplying `require('node:constants').SSL\_OP\_NO\_TICKET` in `secureOptions`. Both session identifiers and session tickets timeout, causing the server to create new sessions. The timeout can be configured with the `sessionTimeout` option of [`tls.createServer()`][]. For all the mechanisms, when resumption fails, servers will create new sessions. Since failing to resume the session does not cause TLS/HTTPS connection failures, it is easy to not notice unnecessarily poor TLS performance. The OpenSSL CLI can be used to verify that servers are resuming sessions. Use the `-reconnect` option to `openssl s\_client`, for example: ```bash openssl s\_client -connect localhost:443 -reconnect ``` Read through the debug output. The first connection should say "New", for example: ```text New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 ``` Subsequent connections should say "Reused", for example: ```text Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 ``` ## Modifying the default TLS cipher suite Node.js is built with a default suite of enabled and disabled TLS ciphers. This default cipher list can be configured when building Node.js to allow distributions to provide their own default list. The following command can be used to show the default cipher suite: ```console node -p crypto.constants.defaultCoreCipherList | tr ':' '\n' TLS\_AES\_256\_GCM\_SHA384 TLS\_CHACHA20\_POLY1305\_SHA256 TLS\_AES\_128\_GCM\_SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES256-GCM-SHA384 DHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA256 DHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA384 DHE-RSA-AES256-SHA384 ECDHE-RSA-AES256-SHA256 DHE-RSA-AES256-SHA256 HIGH !aNULL !eNULL !EXPORT !DES !RC4 !MD5 !PSK !SRP !CAMELLIA ``` This default can be replaced entirely using the [`--tls-cipher-list`][] command-line switch (directly, or via the [`NODE\_OPTIONS`][] environment variable). For instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS cipher suite: ```bash node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' server.js export NODE\_OPTIONS=--tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' node server.js ``` To verify, use the following command to show the set cipher list, note the difference between `defaultCoreCipherList` and `defaultCipherList`: ```bash node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' -p crypto.constants.defaultCipherList | tr ':' '\n' ECDHE-RSA-AES128-GCM-SHA256 !RC4 ``` i.e. the `defaultCoreCipherList` list is set at compilation time and the `defaultCipherList` is set at runtime. To modify the default cipher suites from within the runtime, modify the `tls.DEFAULT\_CIPHERS` variable, this must be performed before listening on any sockets, it will not affect sockets already opened. For example: ```js // Remove Obsolete CBC Ciphers and RSA Key Exchange based Ciphers as they don't provide Forward Secrecy tls.DEFAULT\_CIPHERS += ':!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 [`tls.createSecureContext()`][], which is also available in [`tls.createServer()`][], [`tls.connect()`][], and when creating new [`tls.TLSSocket`][]s. The ciphers list can contain a mixture of TLSv1.3 cipher suite names, the
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.0009761507390066981, 0.021933304145932198, -0.06878449022769928, -0.014647668227553368, -0.016001630574464798, 0.012770304456353188, -0.08084964007139206, -0.000745642464607954, -0.00569410715252161, -0.014816424809396267, 0.04166444018483162, -0.07153400778770447, -0.05483165755867958, -0.049465566873550415, 0.0694999098777771, 0.03756510466337204, 0.010156538337469101, 0.005986422300338745, -0.01690707542002201, -0.14607113599777222, 0.004000233951956034, -0.027852971106767654, 0.0026899988297373056, 0.03286721557378769, 0.017619553953409195, -0.006784718483686447, -0.008607218973338604, 0.09193995594978333, -0.016098473221063614, -0.037414733320474625, 0.0703057125210762, -0.017525894567370415, 0.04910783842206001, -0.02829812839627266, -0.015573633834719658, -0.04622751474380493, 0.015529733151197433, 0.029559848830103874, 0.03441929444670677, 0.036888107657432556, 0.04102662578225136, -0.11821530014276505, 0.03634927049279213, -0.03937757387757301, 0.06862537562847137, -0.022949712350964546, 0.10916000604629517, -0.037836335599422455, -0.034193992614746094, 0.003932391759008169, 0.03738558292388916, -0.07806530594825745, 0.03867427632212639, 0.010306994430720806, -0.0388924703001976, 0.05766730010509491, -0.01981615461409092, -0.06529174000024796, -0.007902623154222965, -0.0046765864826738834, -0.06547597050666809, -0.07246539741754532, -0.01728692650794983, -0.046235259622335434, -0.10234327614307404, -0.0727631151676178, -0.020922785624861717, -0.036044057458639145, -0.1250494122505188, -0.041561197489500046, 0.0636771023273468, -0.008034594357013702, -0.025667281821370125, -0.024698220193386078, 0.03253240883350372, 0.03149992227554321, 0.07321099936962128, 0.0036909477785229683, 0.010781588032841682, 0.03791804984211922, 0.050702668726444244, 0.0443246103823185, 0.14741747081279755, 0.0006180467316880822, 0.016842901706695557, 0.033724360167980194, 0.0023804481606930494, -0.015455859713256359, -0.017681356519460678, 0.03121785819530487, 0.03694227710366249, 0.03990982845425606, 0.029457904398441315, -0.036479976028203964, -0.04472704231739044, 0.07620162516832352, -0.011354691348969936, -0.036082614213228226, 0.14002422988414764, 0.0685340166091919, 0.01993921771645546, -0.02521159127354622, 0.11692044138908386, -0.0901622548699379, 0.01955264061689377, 0.04160542041063309, 0.053121138364076614, 0.04765235260128975, -0.028719035908579826, -0.017594048753380775, 0.029312923550605774, -0.015712056308984756, -0.0743522122502327, 0.07445799559354782, 5.118781986151809e-33, 0.0041328007355332375, -0.054006122052669525, -0.028935443609952927, 0.023114211857318878, 0.03171613812446594, 0.10034029930830002, 0.05595126003026962, 0.010959196835756302, -0.07223843038082123, 0.02247154340147972, -0.06801668554544449, 0.003153646131977439, 0.011951444670557976, -0.07690803706645966, 0.008841228671371937, 0.0071358331479132175, -0.033382318913936615, 0.06580979377031326, 0.03500178083777428, 0.0013535958714783192, -0.028257984668016434, 0.014329287223517895, 0.05336394160985947, 0.017761332914233208, 0.007956089451909065, 0.02289457619190216, -0.03641904890537262, 0.017880436033010483, 0.04866429418325424, 0.0005535892560146749, 0.012247064150869846, 0.027060778811573982, -0.004769261460751295, -0.014435295946896076, 0.08516468107700348, 0.043788716197013855, 0.029718603938817978, 0.04776088520884514, 0.01029180083423853, -0.058640025556087494, -0.0007367711514234543, 0.00656159920617938, -0.03530041500926018, -0.012504258193075657, -0.15384545922279358, -0.039009787142276764, -0.11381334811449051, -0.022779446095228195, 0.07089423388242722, 0.009115247055888176, -0.027690349146723747, 0.02060263603925705, -0.0182513315230608, -0.06916484236717224, -0.03687316179275513, -0.10337451100349426, 0.0122482655569911, 0.08691322058439255, -0.03903185948729515, 0.05695903301239014, -0.08977342396974564, -0.07167121022939682, -0.04994114860892296, -0.037316516041755676, 0.052067432552576065, 0.03263754025101662, 0.0029615943785756826, -0.009946424514055252, -0.0697273313999176, -0.06909821927547455, 0.03184512257575989, 0.12716245651245117, 0.02585671655833721, -0.04223044216632843, 0.022080710157752037, 0.007093504536896944, 0.02558646723628044, 0.023853149265050888, 0.018047120422124863, 0.009468159638345242, 0.036486681550741196, 0.057206470519304276, -0.005561120808124542, 0.08440211415290833, 0.0036275219172239304, 0.04134703055024147, -0.034283265471458435, 0.013924039900302887, -0.02297869324684143, -0.05584432929754257, -0.049824826419353485, -0.061028484255075455, 0.07260874658823013, -0.00845323782414198, -0.05927664414048195, -5.694995357929478e-33, -0.009712710976600647, -0.02162901684641838, -0.02478240616619587, 0.06709618866443634, 0.017178289592266083, -0.002759695053100586, -0.002985562663525343, 0.016907671466469765, -0.006650916766375303, -0.015087164007127285, -0.0016575916670262814, -0.0021982716862112284, 0.03761903941631317, -0.012873826548457146, -0.004192616790533066, -0.05011932551860809, -0.012107286602258682, 0.04902239143848419, -0.00404850859194994, -0.04650750011205673, -0.034470655024051666, -0.012685638852417469, -0.037691060453653336, 0.07796996831893921, 0.015050197951495647, 0.0337834507226944, -0.04391881078481674, 0.013171743601560593, -0.05391160771250725, 0.016045108437538147, 0.003248087363317609, -0.04597802087664604, 0.007750562857836485, 0.011505616828799248, -0.010354830883443356, -0.07671166956424713, 0.034964874386787415, 0.04463101550936699, 0.04140229523181915, 0.08818952739238739, 0.09806753695011139, -0.058246079832315445, 0.028642555698752403, -0.07970114052295685, 0.010861556977033615, 0.08864355832338333, -0.04335051774978638, 0.07241714745759964, -0.036345962435007095, 0.043642085045576096, -0.014490365982055664, 0.0044278427958488464, -0.0798325315117836, -0.01755848154425621, 0.03809349611401558, -0.039735347032547, -0.0385124534368515, 0.037889521569013596, 0.018984243273735046, -0.11592736840248108, 0.04934677109122276, -0.032274920493364334, -0.013856630772352219, 0.12018850445747375, -0.0024014627560973167, 0.05390136316418648, -0.07893545925617218, -0.019811296835541725, -0.01913127675652504, 0.0512557290494442, -0.04839414358139038, -0.03169844299554825, -0.011802609078586102, -0.03182992339134216, 0.11853985488414764, -0.04101032763719559, -0.010629397816956043, -0.08916966617107391, 0.0268902275711298, 0.006165596656501293, -0.03984270617365837, 0.023686399683356285, 0.009410434402525425, -0.021279828622937202, 0.06474678218364716, 0.029370099306106567, 0.05685389041900635, 0.03867826983332634, 0.05807211995124817, 0.013607552275061607, -0.025796350091695786, 0.07497135549783707, -0.036234185099601746, 0.02824818156659603, 0.09807507693767548, -5.1447759830125506e-8, -0.009436164982616901, 0.04130091145634651, -0.030417464673519135, 0.08111980557441711, -0.053701650351285934, 0.05594366043806076, -0.0214442890137434, 0.057442910969257355, 0.022290460765361786, -0.02375389263033867, 0.01454874686896801, -0.0778927281498909, 0.014021624810993671, -0.07328228652477264, -0.06954178214073181, 0.05064830556511879, -0.11452928930521011, -0.06346534937620163, 0.006916916463524103, -0.10466957092285156, 0.02424613945186138, -0.046399276703596115, 0.06039528548717499, 0.00950334407389164, -0.033367693424224854, 0.02214011363685131, 0.030281413346529007, 0.07413457334041595, 0.004029702395200729, -0.07178653031587601, -0.07789977639913559, -0.040688589215278625, 0.047554243355989456, 0.004694654606282711, 0.05306117981672287, 0.016494164243340492, -0.1499234288930893, -0.01372156385332346, 0.06352607905864716, 0.11610535532236099, -0.029282744973897934, 0.0008421202073805034, -0.011085977777838707, 0.040351081639528275, 0.02223946526646614, 0.039027485996484756, -0.06971666216850281, 0.1363057941198349, 0.030972938984632492, -0.017056303098797798, -0.02681106887757778, 0.0008330742130056024, -0.03301113471388817, 0.02775437757372856, -0.04112299159169197, 0.00001562349461892154, 0.03088938258588314, -0.022516226395964622, 0.02383488602936268, -0.03267310559749603, 0.01811409182846546, 0.0010627319570630789, -0.08986876159906387, -0.07070383429527283 ]
-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 [`tls.createSecureContext()`][], which is also available in [`tls.createServer()`][], [`tls.connect()`][], and when creating new [`tls.TLSSocket`][]s. The ciphers list can contain a mixture of TLSv1.3 cipher suite names, the ones that start with `'TLS\_'`, and specifications for TLSv1.2 and below cipher suites. The TLSv1.2 ciphers support a legacy specification format, consult the OpenSSL [cipher list format][] documentation for details, but those specifications do \_not\_ apply to TLSv1.3 ciphers. The TLSv1.3 suites can only be enabled by including their full name in the cipher list. They cannot, for example, be enabled or disabled by using the legacy TLSv1.2 `'EECDH'` or `'!EECDH'` specification. Despite the relative order of TLSv1.3 and TLSv1.2 cipher suites, the TLSv1.3 protocol is significantly more secure than TLSv1.2, and will always be chosen over TLSv1.2 if the handshake indicates it is supported, and if any TLSv1.3 cipher suites are enabled. The default cipher suite included within Node.js has been carefully selected to reflect current security best practices and risk mitigation. Changing the default cipher suite can have a significant impact on the security of an application. The `--tls-cipher-list` switch and `ciphers` option should by used only if absolutely necessary. The default cipher suite prefers GCM ciphers for [Chrome's 'modern cryptography' setting][] and also prefers ECDHE and DHE ciphers for perfect forward secrecy, while offering \_some\_ backward compatibility. Old clients that rely on insecure and deprecated RC4 or DES-based ciphers (like Internet Explorer 6) cannot complete the handshaking process with the default configuration. If these clients \_must\_ be supported, the [TLS recommendations][] may offer a compatible cipher suite. For more details on the format, see the OpenSSL [cipher list format][] documentation. There are only five TLSv1.3 cipher suites: \* `'TLS\_AES\_256\_GCM\_SHA384'` \* `'TLS\_CHACHA20\_POLY1305\_SHA256'` \* `'TLS\_AES\_128\_GCM\_SHA256'` \* `'TLS\_AES\_128\_CCM\_SHA256'` \* `'TLS\_AES\_128\_CCM\_8\_SHA256'` The first three are enabled by default. The two `CCM`-based suites are supported by TLSv1.3 because they may be more performant on constrained systems, but they are not enabled by default since they offer less security. ## OpenSSL security level The OpenSSL library enforces security levels to control the minimum acceptable level of security for cryptographic operations. OpenSSL's security levels range from 0 to 5, with each level imposing stricter security requirements. The default security level is 2, which is generally suitable for most modern applications. However, some legacy features and protocols, such as TLSv1, require a lower security level (`SECLEVEL=0`) to function properly. For more detailed information, please refer to the [OpenSSL documentation on security levels][]. ### Setting security levels To adjust the security level in your Node.js application, you can include `@SECLEVEL=X` within a cipher string, where `X` is the desired security level. For example, to set the security level to 0 while using the default OpenSSL cipher list, you could use: ```mjs import { createServer, connect } from 'node:tls'; const port = 443; createServer({ ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1' }, function(socket) { console.log('Client connected with protocol:', socket.getProtocol()); socket.end(); this.close(); }) .listen(port, () => { connect(port, { ciphers: 'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1' }); }); ``` ```cjs const { createServer, connect } = require('node:tls'); const port = 443; createServer({ ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1' }, function(socket) { console.log('Client connected with protocol:', socket.getProtocol()); socket.end(); this.close(); }) .listen(port, () => { connect(port, { ciphers: '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=DEFAULT@SECLEVEL=X` as described in [Modifying
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.017416831105947495, 0.03846820071339607, -0.0727783665060997, -0.032783616334199905, 0.023353053256869316, 0.0505027174949646, -0.08674003928899765, -0.01020470168441534, 0.017553281038999557, -0.012668946757912636, 0.044965196400880814, -0.07553789019584656, -0.018658867105841637, -0.0038187047466635704, 0.09245285391807556, -0.014247472397983074, -0.0022661371622234583, 0.04461750015616417, -0.037392958998680115, -0.04798552766442299, 0.008463069796562195, -0.03326054662466049, 0.0292647797614336, 0.04417761415243149, 0.006142036989331245, 0.019624244421720505, 0.007692735642194748, -0.009507579728960991, -0.07514431327581406, -0.07095978409051895, -0.035772498697042465, -0.03102567046880722, -0.007329494226723909, -0.00038483840762637556, -0.02109389193356037, -0.07058274000883102, -0.03746580705046654, 0.0774710476398468, 0.013995558954775333, -0.031966324895620346, 0.04095634073019028, -0.006072890944778919, -0.053749628365039825, -0.11962829530239105, 0.038817398250103, 0.014327569864690304, 0.06770789623260498, -0.019864700734615326, 0.0783829316496849, 0.02576439268887043, 0.0878358781337738, -0.07505093514919281, 0.019166620448231697, 0.07428409904241562, -0.03604370355606079, -0.014769339002668858, 0.04180615767836571, -0.10422775894403458, -0.03246280178427696, 0.002393725560978055, 0.020677534863352776, -0.023130550980567932, 0.06730300933122635, -0.0047278921119868755, -0.04072488099336624, -0.06629599630832672, -0.04436447098851204, -0.032711394131183624, -0.10532967001199722, -0.042506203055381775, 0.06416758894920349, 0.014347182586789131, -0.04371922090649605, -0.060866013169288635, -0.030001064762473106, 0.05329457297921181, 0.042948704212903976, 0.07162995636463165, -0.0052803512662649155, -0.0396171435713768, 0.041791487485170364, 0.07553816586732864, 0.07955320179462433, 0.014570915140211582, 0.04156456142663956, -0.054221801459789276, 0.006588777992874384, -0.05870462581515312, 0.013765888288617134, -0.040015630424022675, -0.023098178207874298, 0.02099313959479332, 0.005741727072745562, -0.025459423661231995, 0.006405165418982506, 0.023327551782131195, -0.03404942527413368, -0.032369937747716904, -0.032901693135499954, 0.01909831166267395, -0.07857000082731247, 0.012523185461759567, 0.025796707719564438, -0.0760173350572586, 0.011911082081496716, 0.026288257911801338, 0.07148044556379318, 0.04377111792564392, 0.011267876252532005, 0.010752638801932335, 0.06825023144483566, -0.047209396958351135, -0.01814599335193634, 0.010890090838074684, 5.962780317886488e-33, 0.06201132759451866, 0.07574422657489777, 0.0037564521189779043, 0.009399243630468845, -0.03477894514799118, 0.04997558146715164, -0.0010077098850160837, 0.052943140268325806, -0.08791796863079071, 0.0063957031816244125, -0.004766426049172878, -0.03899926319718361, 0.018122024834156036, -0.06315427273511887, 0.03410648554563522, 0.03105715662240982, 0.03295392915606499, -0.04806991666555405, 0.10011561959981918, -0.0016074765007942915, -0.055421605706214905, 0.04808040335774422, 0.07464954257011414, 0.016296254470944405, -0.018870361149311066, 0.07293581962585449, 0.03638899326324463, -0.019154783338308334, -0.018958352506160736, 0.016856778413057327, 0.053250234574079514, -0.019127709791064262, -0.04983622208237648, -0.02794322557747364, 0.010456417687237263, 0.01681557297706604, -0.033789485692977905, 0.04061956703662872, -0.057091206312179565, -0.0851222574710846, 0.08409325033426285, 0.019578149542212486, -0.040323175489902496, -0.0010522885713726282, -0.035178497433662415, 0.014627036638557911, -0.08496621996164322, -0.011894702911376953, 0.08111190795898438, 0.00921771302819252, -0.020100366324186325, -0.03317245841026306, -0.04993528127670288, -0.06058518961071968, 0.0010030753910541534, -0.08753299713134766, 0.019246984273195267, 0.026328569278120995, -0.026618583127856255, -0.03955056890845299, -0.04525257274508476, -0.016148841008543968, -0.0337894931435585, -0.13089554011821747, 0.0888373851776123, -0.0004765632620546967, 0.0027679018676280975, -0.03200817480683327, -0.1610599160194397, 0.007866593077778816, -0.054828938096761703, 0.1005912721157074, 0.08266856521368027, 0.07785078138113022, -0.025525661185383797, -0.028878265991806984, -0.0410061739385128, -0.01567632332444191, 0.04334915429353714, -0.043760720640420914, -0.04042316600680351, 0.05135492980480194, 0.06919361650943756, 0.04317799583077431, -0.00355749623849988, 0.005041604861617088, 0.011952999047935009, 0.05447661131620407, 0.036023277789354324, -0.008411196991801262, -0.013268123380839825, -0.05992495268583298, 0.02032252959907055, -0.004865513648837805, -0.05808074399828911, -7.746136756514396e-33, -0.028210684657096863, -0.011780980043113232, -0.09380005300045013, -0.008677047677338123, -0.015307176858186722, -0.03529883548617363, 0.005869338288903236, 0.06998682022094727, 0.08920064568519592, 0.010052628815174103, 0.07984118908643723, -0.07926394045352936, 0.0807669460773468, -0.09670577943325043, 0.06184305623173714, -0.06663749366998672, -0.1201067790389061, 0.007923228666186333, 0.06054637208580971, -0.018651768565177917, -0.007122562266886234, 0.001186605542898178, 0.041569821536540985, 0.06418029963970184, 0.06549736112356186, 0.023487111553549767, -0.00044628529576584697, 0.03089643456041813, -0.003989494405686855, -0.032067928463220596, -0.022053927183151245, 0.024808477610349655, 0.02272314392030239, 0.06595079600811005, -0.07075272500514984, 0.007540661375969648, -0.03604352846741676, 0.037492312490940094, 0.04934826120734215, 0.03454182296991348, 0.08194347470998764, 0.003714368911460042, 0.06087561696767807, -0.009951073676347733, 0.0028451683465391397, 0.012119275517761707, 0.015933794900774956, 0.07987570017576218, -0.0203408095985651, -0.009498648345470428, 0.03402034938335419, -0.055449385195970535, -0.030450433492660522, -0.00945010595023632, 0.09560032933950424, 0.09115508198738098, -0.03003707155585289, 0.02142447978258133, 0.049596551805734634, -0.07887423038482666, 0.04454129561781883, -0.03886738047003746, 0.045172858983278275, 0.05516523867845535, -0.04448055103421211, 0.007081280928105116, -0.1138022392988205, -0.03512343019247055, 0.0398310124874115, -0.0046502347104251385, -0.0061903707683086395, -0.04341151565313339, -0.1051374301314354, -0.08498921245336533, 0.08405642211437225, -0.10777091234922409, -0.043239276856184006, 0.024445533752441406, 0.037560656666755676, 0.036499783396720886, -0.02417505532503128, 0.0919039249420166, -0.04530998319387436, 0.0068197366781532764, 0.06578121334314346, -0.07214698195457458, 0.06900852173566818, 0.0702742263674736, -0.01512274332344532, -0.024386664852499962, -0.030147667974233627, 0.1352713406085968, 0.031659483909606934, 0.07972913980484009, 0.11382415890693665, -4.783830931387456e-8, -0.026668645441532135, -0.0453786738216877, -0.052044451236724854, 0.01691451482474804, 0.10587283968925476, 0.005618393421173096, -0.019870959222316742, 0.011773863807320595, -0.018553247675299644, -0.08500736951828003, 0.08713610470294952, -0.023470615968108177, -0.01856890507042408, -0.04801328852772713, -0.027889542281627655, 0.039076246321201324, -0.11585865914821625, -0.016924774274230003, -0.004506548400968313, -0.06586417555809021, 0.013483269140124321, -0.04236413910984993, 0.008488280698657036, -0.021869679912924767, 0.0379488542675972, 0.005742943845689297, 0.019456136971712112, -0.014756661839783192, -0.05078236386179924, 0.02573891170322895, -0.04053216427564621, -0.08202474564313889, 0.030025001615285873, -0.08804921060800552, 0.0014455325435847044, 0.07520544528961182, -0.14971226453781128, 0.01031232625246048, 0.06232377886772156, 0.12306720018386841, -0.01822778396308422, -0.06887109577655792, -0.042204584926366806, 0.035187747329473495, 0.020666440948843956, -0.010766161605715752, 0.025793615728616714, 0.0798446536064148, -0.018599733710289, 0.012065527960658073, -0.015983354300260544, -0.0615159347653389, 0.036917053163051605, -0.07851222902536392, -0.07459404319524765, -0.006725369021296501, 0.03523389995098114, -0.08570405840873718, 0.03702397644519806, -0.04189104959368706, 0.08001222461462021, -0.00866877380758524, 0.04664565250277519, 0.001626490498892963 ]
-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=DEFAULT@SECLEVEL=X` as described in [Modifying the default TLS cipher suite][]. However, it is generally discouraged to use the command line option for setting ciphers and it is preferable to configure the ciphers for individual contexts within your application code, as this approach provides finer control and reduces the risk of globally downgrading the security level. ## X509 certificate error codes Multiple functions can fail due to certificate errors that are reported by OpenSSL. In such a case, the function provides an {Error} via its callback that has the property `code` which can take one of the following values: \* `'UNABLE\_TO\_GET\_ISSUER\_CERT'`: Unable to get issuer certificate. \* `'UNABLE\_TO\_GET\_CRL'`: Unable to get certificate CRL. \* `'UNABLE\_TO\_DECRYPT\_CERT\_SIGNATURE'`: Unable to decrypt certificate's signature. \* `'UNABLE\_TO\_DECRYPT\_CRL\_SIGNATURE'`: Unable to decrypt CRL's signature. \* `'UNABLE\_TO\_DECODE\_ISSUER\_PUBLIC\_KEY'`: Unable to decode issuer public key. \* `'CERT\_SIGNATURE\_FAILURE'`: Certificate signature failure. \* `'CRL\_SIGNATURE\_FAILURE'`: CRL signature failure. \* `'CERT\_NOT\_YET\_VALID'`: Certificate is not yet valid. \* `'CERT\_HAS\_EXPIRED'`: Certificate has expired. \* `'CRL\_NOT\_YET\_VALID'`: CRL is not yet valid. \* `'CRL\_HAS\_EXPIRED'`: CRL has expired. \* `'ERROR\_IN\_CERT\_NOT\_BEFORE\_FIELD'`: Format error in certificate's notBefore field. \* `'ERROR\_IN\_CERT\_NOT\_AFTER\_FIELD'`: Format error in certificate's notAfter field. \* `'ERROR\_IN\_CRL\_LAST\_UPDATE\_FIELD'`: Format error in CRL's lastUpdate field. \* `'ERROR\_IN\_CRL\_NEXT\_UPDATE\_FIELD'`: Format error in CRL's nextUpdate field. \* `'OUT\_OF\_MEM'`: Out of memory. \* `'DEPTH\_ZERO\_SELF\_SIGNED\_CERT'`: Self signed certificate. \* `'SELF\_SIGNED\_CERT\_IN\_CHAIN'`: Self signed certificate in certificate chain. \* `'UNABLE\_TO\_GET\_ISSUER\_CERT\_LOCALLY'`: Unable to get local issuer certificate. \* `'UNABLE\_TO\_VERIFY\_LEAF\_SIGNATURE'`: Unable to verify the first certificate. \* `'CERT\_CHAIN\_TOO\_LONG'`: Certificate chain too long. \* `'CERT\_REVOKED'`: Certificate revoked. \* `'INVALID\_CA'`: Invalid CA certificate. \* `'PATH\_LENGTH\_EXCEEDED'`: Path length constraint exceeded. \* `'INVALID\_PURPOSE'`: Unsupported certificate purpose. \* `'CERT\_UNTRUSTED'`: Certificate not trusted. \* `'CERT\_REJECTED'`: Certificate rejected. \* `'HOSTNAME\_MISMATCH'`: Hostname mismatch. When certificate errors like `UNABLE\_TO\_VERIFY\_LEAF\_SIGNATURE`, `DEPTH\_ZERO\_SELF\_SIGNED\_CERT`, or `UNABLE\_TO\_GET\_ISSUER\_CERT` occur, Node.js appends a hint suggesting that if the root CA is installed locally, try running with the `--use-system-ca` flag to direct developers towards a secure solution, to prevent unsafe workarounds. ## Class: `tls.Server` \* Extends: {net.Server} Accepts encrypted connections using TLS or SSL. ### Event: `'connection'` \* `socket` {stream.Duplex} This event is emitted when a new TCP stream is established, before the TLS handshake begins. `socket` is typically an object of type [`net.Socket`][] but will not receive events unlike the socket created from the [`net.Server`][] `'connection'` event. Usually users will not want to access this event. This event can also be explicitly emitted by users to inject connections into the TLS server. In that case, any [`Duplex`][] stream can be passed. ### Event: `'keylog'` \* `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format. \* `tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance on which it was generated. The `keylog` event is emitted when key material is generated or received by a connection to this server (typically before handshake has completed, but not necessarily). This keying material can be stored for debugging, as it allows captured TLS traffic to be decrypted. It may be emitted multiple times for each socket. A typical use case is to append received lines to a common text file, which is later used by software (such as Wireshark) to decrypt the traffic: ```js 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 upon creation of a new TLS session. This
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.06431030482053757, 0.02846316434442997, -0.0413065068423748, -0.005785772576928139, 0.030654072761535645, 0.016849065199494362, -0.026025038212537766, 0.00034640778903849423, -0.012814142741262913, -0.000526362331584096, 0.03728879988193512, -0.07008609920740128, -0.0958675667643547, -0.04659988731145859, 0.038481444120407104, -0.0007449874537996948, -0.006072342861443758, 0.02891516126692295, 0.009639337658882141, 0.00361401098780334, 0.015683574602007866, -0.007194279693067074, 0.0519622303545475, 0.07525207102298737, -0.025314992293715477, -0.02656191773712635, 0.005206466186791658, -0.026781762018799782, -0.07541105896234512, -0.0899277925491333, 0.024081073701381683, -0.058441925793886185, -0.024369528517127037, 0.03830501437187195, -0.06406167149543762, -0.10755733400583267, -0.014525699429214, 0.05007467046380043, 0.04896314814686775, 0.0007274395902641118, -0.002661338774487376, -0.03612317144870758, 0.005482351873070002, -0.08582185953855515, 0.026700768619775772, 0.009438049979507923, 0.03591153770685196, 0.020706363022327423, 0.02002236619591713, -0.02390536479651928, 0.026583049446344376, -0.04316787049174309, 0.021571733057498932, 0.0052854097448289394, -0.07276470214128494, -0.02268861047923565, 0.09537146985530853, -0.054119378328323364, -0.020994700491428375, 0.005686244461685419, 0.041393645107746124, 0.010205480270087719, 0.05646808072924614, -0.023804526776075363, -0.06595692038536072, -0.05183550715446472, -0.06984520703554153, 0.005103283561766148, -0.02144460938870907, -0.023081205785274506, 0.017246637493371964, 0.011873274110257626, 0.0001616977242520079, -0.013113650493323803, 0.017707524821162224, 0.10304674506187439, 0.11296764761209488, 0.06637990474700928, 0.0032971182372421026, -0.03423294797539711, 0.030055008828639984, 0.11518484354019165, 0.012411536648869514, 0.026753997430205345, -0.061310261487960815, -0.004805585835129023, -0.04176965355873108, -0.04768853262066841, -0.08854567259550095, 0.0015703582903370261, 0.027789413928985596, 0.05542584881186485, 0.014394252561032772, 0.022491425275802612, -0.01901603862643242, -0.005188691429793835, -0.07798118889331818, 0.009766795672476292, 0.04577900469303131, -0.0276754479855299, -0.1742858588695526, -0.00603858195245266, 0.052837420254945755, -0.011054761707782745, 0.04924967139959335, 0.03545399755239487, 0.0459093376994133, 0.02097163163125515, -0.036595191806554794, -0.03872703015804291, 0.06494926661252975, 0.01189412735402584, -0.044249147176742554, -0.01448151096701622, 3.74339629034013e-33, 0.03137202188372612, 0.011604989878833294, -0.012265047989785671, 0.05189669504761696, -0.030370227992534637, 0.016487814486026764, 0.08935421705245972, 0.02779594250023365, -0.10300888121128082, 0.06181567162275314, 0.05199173465371132, -0.028432324528694153, -0.04468756169080734, -0.06964149326086044, 0.028958871960639954, 0.052854981273412704, 0.02445128560066223, -0.02661416493356228, 0.0349336601793766, -0.044732846319675446, 0.04172161966562271, -0.017550505697727203, 0.02870165929198265, 0.007109100930392742, 0.027927283197641373, 0.03847433626651764, 0.028457216918468475, -0.02833426557481289, -0.038324013352394104, 0.014130936935544014, 0.029484886676073074, -0.011770201846957207, 0.04202656075358391, 0.005229376256465912, 0.05000636726617813, 0.08307123929262161, 0.053622469305992126, 0.09393323957920074, -0.03852786496281624, 0.02410040609538555, 0.054626256227493286, 0.042052920907735825, 0.03896954655647278, 0.02171698771417141, 0.0605495423078537, -0.0071325283497571945, -0.03289010375738144, 0.006963466294109821, 0.04323863610625267, -0.011841212399303913, -0.01998734474182129, 0.0710396021604538, -0.08774538338184357, -0.0754360780119896, 0.06735160946846008, -0.11963897943496704, -0.0005533319781534374, -0.023107903078198433, -0.12376482784748077, -0.09549355506896973, -0.01833161897957325, -0.11716321855783463, -0.06702369451522827, -0.09623323380947113, 0.10535382479429245, 0.029797356575727463, -0.018253857269883156, -0.03655635192990303, -0.1157415360212326, -0.0079727778211236, -0.11825229972600937, 0.057719625532627106, 0.031509723514318466, 0.03169289231300354, -0.01094098947942257, 0.050888046622276306, 0.007352151907980442, 0.03927188739180565, 0.11919800937175751, -0.08639412373304367, 0.009734174236655235, 0.08821476250886917, 0.0003956206201110035, 0.0770263597369194, -0.014377128332853317, 0.05533578246831894, 0.007041520904749632, 0.050621215254068375, 0.0075664641335606575, 0.025160562247037888, -0.0001585368881933391, -0.06711521744728088, 0.10098370164632797, -0.011378875933587551, -0.11915306001901627, -5.5793961414436606e-33, -0.00933885294944048, -0.048365067690610886, -0.05582121014595032, 0.05768854543566704, -0.05677376687526703, -0.0024505082983523607, 0.0009212192380800843, 0.03707410767674446, 0.046398699283599854, 0.04355631023645401, 0.05159289389848709, -0.04081680625677109, 0.044222842901945114, -0.05306971073150635, 0.009786177426576614, -0.03937174007296562, -0.12994632124900818, 0.05031771957874298, -0.061874326318502426, 0.037368837743997574, -0.04725112393498421, 0.06609945744276047, 0.02229432202875614, 0.09317361563444138, 0.10498916357755661, 0.011653043329715729, -0.028950383886694908, 0.03843747451901436, 0.004744104575365782, -0.06886192411184311, -0.04013469070196152, 0.03193695843219757, 0.05852444842457771, 0.024611985310912132, -0.01994607225060463, -0.03621906042098999, -0.016883717849850655, 0.02377993054687977, 0.05561598017811775, 0.07548391819000244, 0.053254611790180206, 0.006175078917294741, 0.00994927529245615, 0.0075883627869188786, 0.0077506620436906815, 0.02192825637757778, 0.0227062925696373, -0.010573427192866802, 0.02640737034380436, 0.03465276211500168, -0.026629187166690826, -0.033374421298503876, 0.013645968399941921, 0.04736778512597084, 0.05613893270492554, 0.03379721939563751, -0.06109605357050896, 0.030590413138270378, -0.004794873297214508, -0.030484475195407867, 0.023211587220430374, 0.007659882307052612, 0.027675094082951546, 0.03936830908060074, -0.01280921045690775, 0.03121192753314972, -0.1482100784778595, 0.029642222449183464, 0.0029272972606122494, 0.0053586517460644245, -0.020961513742804527, -0.10716421157121658, -0.01596924103796482, -0.12922132015228271, -0.005411334801465273, -0.08870525658130646, 0.004241561982780695, -0.08151663839817047, 0.02173006907105446, 0.08090854436159134, -0.007785639259964228, 0.03909529373049736, -0.051602162420749664, 0.04963885247707367, 0.028945444151759148, -0.03084750473499298, 0.05176753178238869, 0.012026730924844742, 0.034452442079782486, -0.007104686927050352, -0.02670769952237606, 0.028746357187628746, -0.009230520576238632, 0.03136463835835457, 0.08608576655387878, -5.891476462238643e-8, -0.04641751945018768, -0.02263464219868183, -0.1492355912923813, 0.011407292447984219, 0.04798145592212677, 0.07542319595813751, -0.053547825664281845, -0.08481860160827637, -0.026848632842302322, -0.016859350726008415, 0.02348356321454048, -0.023158404976129532, 0.013692892156541348, -0.07753781229257584, -0.02317916601896286, -0.03818080574274063, -0.058840490877628326, -0.018666641786694527, 0.017433570697903633, -0.04526348039507866, -0.0382034033536911, -0.03099052608013153, -0.0023124990984797478, 0.011566706001758575, -0.000616532692220062, 0.007071452680975199, 0.03861111029982567, 0.07816488295793533, 0.04556221514940262, 0.010460306890308857, -0.06929672509431839, -0.06377054005861282, 0.00809758622199297, 0.05340266972780228, -0.014507210813462734, 0.06499186903238297, -0.09723971039056778, 0.049654699862003326, 0.1004585400223732, 0.06663284450769424, 0.04248541593551636, -0.028107065707445145, -0.03799549117684364, 0.08476855605840683, -0.11803464591503143, 0.01736348122358322, -0.006672156509011984, 0.02863279916346073, 0.035473719239234924, 0.003222839208319783, -0.08637751638889313, 0.027846889570355415, -0.03870990499854088, 0.02972467616200447, -0.0631377249956131, 0.06623852998018265, 0.03954368084669113, -0.017632804811000824, -0.05835988000035286, -0.025314796715974808, 0.015917737036943436, -0.028108157217502594, -0.006537613924592733, -0.04507409781217575 ]
-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 upon creation of a new TLS session. This may be used to store sessions in external storage. The data should be provided to the [`'resumeSession'`][] callback. The listener callback is passed three arguments when called: \* `sessionId` {Buffer} The TLS session identifier \* `sessionData` {Buffer} The TLS session data \* `callback` {Function} A callback function taking no arguments that must be invoked in order for data to be sent or received over the secure connection. Listening for this event will have an effect only on connections established after the addition of the event listener. ### Event: `'OCSPRequest'` The `'OCSPRequest'` event is emitted when the client sends a certificate status request. The listener callback is passed three arguments when called: \* `certificate` {Buffer} The server certificate \* `issuer` {Buffer} The issuer's certificate \* `callback` {Function} A callback function that must be invoked to provide the results of the OCSP request. The server's current certificate can be parsed to obtain the OCSP URL and certificate ID; after obtaining an OCSP response, `callback(null, resp)` is then invoked, where `resp` is a `Buffer` instance containing the OCSP response. Both `certificate` and `issuer` are `Buffer` DER-representations of the primary and issuer's certificates. These can be used to obtain the OCSP certificate ID and OCSP endpoint URL. Alternatively, `callback(null, null)` may be called, indicating that there was no OCSP response. Calling `callback(err)` will result in a `socket.destroy(err)` call. The typical flow of an OCSP request is as follows: 1. Client connects to the server and sends an `'OCSPRequest'` (via the status info extension in ClientHello). 2. Server receives the request and emits the `'OCSPRequest'` event, calling the listener if registered. 3. Server extracts the OCSP URL from either the `certificate` or `issuer` and performs an [OCSP request][] to the CA. 4. Server receives `'OCSPResponse'` from the CA and sends it back to the client via the `callback` argument 5. Client validates the response and either destroys the socket or performs a handshake. The `issuer` can be `null` if the certificate is either self-signed or the issuer is not in the root certificates list. (An issuer may be provided via the `ca` option when establishing the TLS connection.) Listening for this event will have an effect only on connections established after the addition of the event listener. An npm module like [asn1.js][] may be used to parse the certificates. ### Event: `'resumeSession'` The `'resumeSession'` event is emitted when the client requests to resume a previous TLS session. The listener callback is passed two arguments when called: \* `sessionId` {Buffer} The TLS session identifier \* `callback` {Function} A callback function to be called when the prior session has been recovered: `callback([err[, sessionData]])` \* `err` {Error} \* `sessionData` {Buffer} The event listener should perform a lookup in external storage for the `sessionData` saved by the [`'newSession'`][] event handler using the given `sessionId`. If found, call `callback(null, sessionData)` to resume the session. If not found, the session cannot be resumed. `callback()` must be called without `sessionData` so that the handshake can continue and a new session can be 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.on('newSession', (id, data,
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.036531489342451096, -0.0014348950935527682, -0.0564272366464138, -0.038862138986587524, 0.003756085177883506, -0.012955770827829838, -0.08077377080917358, 0.05883277952671051, -0.027138836681842804, 0.01140685472637415, 0.014851318672299385, -0.035275813192129135, -0.061043545603752136, 0.03235950320959091, -0.027596626430749893, 0.02698918990790844, 0.04112909734249115, -0.009419509209692478, -0.04934229701757431, -0.09358925372362137, -0.019282879307866096, -0.10408355295658112, 0.017856795340776443, 0.06980152428150177, -0.020814761519432068, -0.005654934793710709, 0.04035978019237518, 0.059214647859334946, -0.02539348416030407, -0.07896150648593903, 0.022355766966938972, 0.0019461403135210276, -0.01096857525408268, -0.060778021812438965, -0.00720672681927681, -0.07205826789140701, 0.0514669269323349, -0.017122726887464523, 0.0629919245839119, -0.013578047975897789, 0.05587992072105408, -0.06685076653957367, 0.04446905478835106, -0.03720578923821449, 0.03382410109043121, 0.033446911722421646, 0.030046846717596054, -0.009169448167085648, -0.018910471349954605, 0.034861885011196136, 0.002143014222383499, -0.03430218622088432, 0.008677351288497448, -0.0411117821931839, 0.07166091352701187, 0.06281974166631699, 0.03990933299064636, -0.0481131374835968, 0.04539644718170166, -0.011422169394791126, -0.06143362447619438, -0.02749140001833439, -0.10122711211442947, 0.00935659371316433, -0.029863107949495316, -0.10925279557704926, 0.02778385765850544, 0.01940520666539669, -0.11161112040281296, -0.0465550422668457, 0.02817857265472412, -0.011155184358358383, -0.007749498821794987, -0.04331108182668686, -0.010766448453068733, 0.001626055222004652, 0.06649640947580338, -0.08074119687080383, -0.022881554439663887, -0.07554445415735245, 0.053865112364292145, -0.0030688862316310406, 0.06101672723889351, -0.025072315707802773, 0.07488904148340225, 0.011449785903096199, -0.04519630968570709, 0.027548713609576225, 0.03690800070762634, 0.016946403309702873, 0.04208126291632652, 0.004090104717761278, -0.0161220021545887, -0.05940573289990425, -0.046365268528461456, 0.019166966900229454, 0.031049001961946487, 0.009990690276026726, 0.0832141637802124, 0.031058188527822495, 0.009219944477081299, 0.01815509796142578, 0.09994970262050629, -0.06121513992547989, -0.010685740038752556, 0.02809732034802437, 0.07805374264717102, 0.10601789504289627, -0.030444154515862465, -0.06063130497932434, 0.08022503554821014, 0.04100228101015091, -0.03773856535553932, 0.11667440831661224, 3.050406003673913e-33, 0.02394665777683258, 0.03649063780903816, -0.04054256156086922, 0.10411795973777771, 0.05120515078306198, 0.05107847601175308, 0.041444823145866394, -0.03994181752204895, -0.10009230673313141, 0.05505876988172531, -0.07927704602479935, 0.022001774981617928, 0.020945880562067032, -0.07008042931556702, -0.037750065326690674, -0.013861242681741714, -0.02263469621539116, 0.03361739590764046, 0.09124303609132767, 0.050880007445812225, -0.022049058228731155, -0.003557038027793169, 0.07158438116312027, 0.02123164013028145, 0.03694719448685646, 0.0319969616830349, 0.02041604556143284, 0.011358140967786312, -0.02245802991092205, 0.0025300770066678524, 0.0463937371969223, 0.03773681819438934, 0.05501926690340042, -0.022138161584734917, 0.14005449414253235, -0.0029199845157563686, 0.02358623594045639, 0.06509403884410858, -0.06026057153940201, -0.042623843997716904, 0.0432879775762558, 0.007441108115017414, -0.12146437168121338, -0.00995156355202198, -0.07251513749361038, -0.02754121832549572, -0.08065592497587204, -0.001390479621477425, 0.08779032528400421, -0.026761304587125778, -0.027677426114678383, 0.01671261340379715, -0.02397950552403927, -0.031430624425411224, 0.03964400663971901, -0.02069365791976452, 0.023964285850524902, -0.02604658529162407, -0.0815260112285614, 0.018273979425430298, -0.034803666174411774, 0.011383448727428913, -0.026281772181391716, -0.08800947666168213, 0.04626978561282158, 0.05582433193922043, 0.005230533424764872, 0.06867310404777527, -0.06504659354686737, -0.06543739885091782, 0.006187323946505785, 0.031342536211013794, 0.04220299422740936, 0.06961356103420258, 0.011599547229707241, 0.08107779175043106, -0.05487159639596939, 0.0640895664691925, 0.004619138315320015, -0.0022699201945215464, 0.09913165867328644, -0.04422410577535629, 0.006335137877613306, 0.06570395827293396, 0.01756015419960022, 0.004923330619931221, -0.05394713953137398, -0.03728138655424118, -0.010467087849974632, 0.0767730101943016, -0.05896661803126335, 0.008747078478336334, 0.06872952729463577, -0.01755610480904579, -0.10968965291976929, -4.721960439911144e-33, -0.03915250301361084, -0.02892567776143551, -0.09292999655008316, 0.03896864131093025, -0.030030515044927597, 0.006611620541661978, -0.009419628418982029, 0.048105113208293915, 0.00930788740515709, 0.0012490472290664911, 0.02454734593629837, 0.00021980423480272293, 0.03739200904965401, 0.0009618583717383444, -0.06590379029512405, 0.03426804393529892, -0.04667877033352852, -0.01583789847791195, -0.07484909892082214, -0.06465859711170197, -0.01780017837882042, -0.051407814025878906, 0.03272969275712967, 0.07527507841587067, -0.017774377018213272, 0.05379931628704071, 0.006146953906863928, 0.0032295556738972664, -0.07916989177465439, -0.059691209346055984, 0.004009179305285215, -0.025713086128234863, 0.002800548216328025, 0.013511914759874344, 0.025604644790291786, -0.03839739039540291, 0.004610186442732811, 0.04193463921546936, 0.06300875544548035, -0.027889061719179153, 0.09649725258350372, -0.0003863504680339247, 0.026465335860848427, -0.08781232684850693, -0.021321939304471016, 0.07724570482969284, -0.05905824899673462, 0.03416970372200012, -0.04236524924635887, 0.005308582913130522, 0.03087545558810234, -0.022317951545119286, -0.017885832116007805, 0.01513051986694336, -0.001351604238152504, 0.035446666181087494, -0.02915213629603386, -0.014666983857750893, 0.029671432450413704, -0.040961284190416336, 0.058661799877882004, -0.1299092173576355, -0.0008915977668948472, 0.02862638235092163, 0.0025280022528022528, -0.10273915529251099, -0.05411195382475853, 0.05887488275766373, 0.11075812578201294, 0.04831022396683693, -0.014256240800023079, -0.01500760205090046, -0.026345189660787582, 0.023275122046470642, 0.08404280245304108, -0.003555504372343421, -0.02392532117664814, -0.16473020613193512, 0.03671425208449364, 0.055990856140851974, -0.06257438659667969, 0.03942546248435974, -0.04316379502415657, -0.031604133546352386, 0.12572447955608368, 0.05779263749718666, -0.0068841539323329926, 0.06320120394229889, 0.03104337863624096, -0.027710463851690292, -0.01783524639904499, 0.07634491473436356, -0.12039925903081894, -0.021443137899041176, 0.10530192404985428, -5.104659095422903e-8, -0.03579505905508995, -0.006220864597707987, -0.09052155911922455, 0.04256238788366318, -0.03989919647574425, -0.016567805781960487, 0.033090364187955856, -0.051852673292160034, -0.00549875246360898, -0.031088490039110184, -0.0606238953769207, -0.022198544815182686, 0.02603069506585598, -0.034533776342868805, -0.034946806728839874, -0.03335726261138916, -0.02332153357565403, -0.07079964876174927, 0.046887632459402084, -0.1256033033132553, 0.09661136567592621, -0.05069771409034729, 0.00618752371519804, 0.100995734333992, 0.005826853681355715, -0.03060268610715866, 0.07095394283533096, 0.03886207193136215, -0.013867736794054508, -0.04380151629447937, -0.07658226788043976, -0.042251866310834885, -0.004519538953900337, -0.0004517649649642408, -0.017306046560406685, 0.06678898632526398, -0.07007347792387009, -0.056276656687259674, 0.02995211072266102, 0.05927218869328499, 0.003200733568519354, 0.021699370816349983, 0.003620618488639593, 0.04989010840654373, -0.07908794283866882, 0.019534152001142502, -0.01620042510330677, 0.11361633986234665, 0.029579991474747658, 0.04507051780819893, -0.020189499482512474, -0.010022190399467945, -0.024622034281492233, -0.04978261515498161, -0.02481609769165516, -0.013172972947359085, 0.02819184586405754, -0.04592323675751686, 0.011320853605866432, -0.08959945291280746, 0.021119069308042526, -0.00763747887685895, -0.06479475647211075, -0.04087776318192482 ]
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.on('newSession', (id, data, cb) => { tlsSessionStore[id.toString('hex')] = data; cb(); }); server.on('resumeSession', (id, cb) => { cb(null, tlsSessionStore[id.toString('hex')] || null); }); ``` ### Event: `'secureConnection'` The `'secureConnection'` event is emitted after the handshaking process for a new connection has successfully completed. The listener callback is passed a single argument when called: \* `tlsSocket` {tls.TLSSocket} The established TLS socket. The `tlsSocket.authorized` property is a `boolean` indicating whether the client has been verified by one of the supplied Certificate Authorities for the server. If `tlsSocket.authorized` is `false`, then `socket.authorizationError` is set to describe how authorization failed. Depending on the settings of the TLS server, unauthorized connections may still be accepted. The `tlsSocket.alpnProtocol` property is a string that contains the selected ALPN protocol. When ALPN has no selected protocol because the client or the server did not send an ALPN extension, `tlsSocket.alpnProtocol` equals `false`. The `tlsSocket.servername` property is a string containing the server name requested via SNI. ### Event: `'tlsClientError'` The `'tlsClientError'` event is emitted when an error occurs before a secure connection is established. The listener callback is passed two arguments when called: \* `exception` {Error} The `Error` object describing the error \* `tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance from which the error originated. ### `server.addContext(hostname, context)` \* `hostname` {string} A SNI host name or wildcard (e.g. `'\*'`) \* `context` {Object|tls.SecureContext} An object containing any of the possible properties from the [`tls.createSecureContext()`][] `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created with [`tls.createSecureContext()`][] itself. The `server.addContext()` method adds a secure context that will be used if the client request's SNI name matches the supplied `hostname` (or wildcard). When there are multiple matching contexts, the most recently added one is used. ### `server.address()` \* Returns: {Object} Returns the bound address, the address family name, and port of the server as reported by the operating system. See [`net.Server.address()`][] for more information. ### `server.close([callback])` \* `callback` {Function} A listener callback that will be registered to listen for the server instance's `'close'` event. \* Returns: {tls.Server} The `server.close()` method stops the server from accepting new connections. This function operates asynchronously. The `'close'` event will be emitted when the server has no more open connections. ### `server.getTicketKeys()` \* Returns: {Buffer} A 48-byte buffer containing the session ticket keys. Returns the session ticket keys. See [Session Resumption][] for more information. ### `server.listen()` Starts the server listening for encrypted connections. This method is identical to [`server.listen()`][] from [`net.Server`][]. ### `server.setSecureContext(options)` \* `options` {Object} An object containing any of the possible properties from the [`tls.createSecureContext()`][] `options` arguments (e.g. `key`, `cert`, `ca`, etc). The `server.setSecureContext()` method replaces the secure context of an existing server. Existing connections to the server are not interrupted. ### `server.setTicketKeys(keys)` \* `keys` {Buffer|TypedArray|DataView} A 48-byte buffer containing the session ticket keys. Sets the session ticket keys. Changes to the ticket keys are effective only for future server connections. Existing or currently pending server connections will use the previous keys. See [Session Resumption][] for more information. ## Class: `tls.TLSSocket` \* Extends: {net.Socket} Performs transparent encryption of written data 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|stream.Duplex} On the server side, any `Duplex` stream. On the client side, any instance
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.011881797574460506, -0.03219084069132805, -0.027903366833925247, -0.014230594970285892, 0.03165730834007263, -0.0013229426695033908, -0.08088664710521698, 0.015319294296205044, -0.019675789400935173, -0.02545887604355812, -0.025825466960668564, -0.07118403166532516, -0.03629540652036667, 0.016223421320319176, -0.050499871373176575, 0.03339875116944313, 0.054830193519592285, -0.03714974597096443, -0.04596467316150665, -0.10665059834718704, -0.0758117213845253, -0.08897198736667633, 0.07510154694318771, 0.015122008509933949, 0.029689056798815727, -0.032910220324993134, 0.015988299623131752, 0.06007038429379463, -0.03555384650826454, -0.12230391055345535, 0.05953437089920044, -0.010835113003849983, -0.011368410661816597, -0.03707846254110336, -0.05585687234997749, -0.06468739360570908, 0.00833932776004076, 0.03178602457046509, 0.044384609907865524, 0.0036768720019608736, 0.060965631157159805, -0.04152751341462135, 0.052297040820121765, -0.04699451103806496, 0.03720477595925331, -0.015947671607136726, 0.07986440509557724, -0.011395118199288845, 0.007626615930348635, -0.033171892166137695, 0.02535806968808174, -0.004441517870873213, 0.05512114241719246, 0.02022460661828518, 0.005498450715094805, 0.010441630147397518, 0.07616005837917328, -0.007720509078353643, 0.015777843073010445, -0.008913017809391022, -0.045447055250406265, 0.005101910326629877, -0.023728711530566216, -0.016735538840293884, -0.06277820467948914, -0.09800610691308975, 0.06472320854663849, 0.04684606194496155, -0.10382622480392456, -0.04485785961151123, 0.007217364851385355, -0.045809175819158554, 0.028009135276079178, -0.010865592397749424, -0.04391300678253174, 0.035848524421453476, 0.06452514976263046, -0.07937359809875488, 0.019461479038000107, -0.054845910519361496, 0.04286477342247963, 0.013223957270383835, 0.03260580822825432, 0.0036243493668735027, 0.04746108502149582, -0.03272046148777008, -0.04777536913752556, 0.048606064170598984, 0.013906462118029594, -0.03117251582443714, 0.008391456678509712, -0.039043061435222626, 0.003680807538330555, -0.08291609585285187, -0.04383872449398041, 0.03775379806756973, 0.040721211582422256, 0.007505464367568493, 0.016190743073821068, 0.04219655692577362, -0.02351432852447033, -0.019743284210562706, 0.13832981884479523, -0.03837139531970024, 0.045001495629549026, 0.06004736199975014, 0.03236919268965721, 0.10410638153553009, 0.016358913853764534, -0.0017086155712604523, 0.018782753497362137, 0.02112961933016777, -0.050653211772441864, 0.09829404950141907, 3.664533843711401e-33, -0.029859580099582672, -0.007383635733276606, -0.07700476050376892, 0.0721597671508789, 0.027455849573016167, 0.009624925442039967, 0.04466855525970459, 0.004190593492239714, -0.0502968356013298, 0.040080416947603226, -0.05064760148525238, -0.0067777251824736595, -0.006677624769508839, -0.08890780061483383, -0.02726415917277336, 0.003542388556525111, 0.05767270550131798, 0.022495359182357788, 0.07452135533094406, 0.04596981778740883, 0.00446797301992774, -0.01587432622909546, 0.06799355894327164, 0.04076097160577774, 0.04830794036388397, 0.009936289861798286, -0.013486198149621487, 0.02699817158281803, -0.049857791513204575, -0.0032144354190677404, 0.010446896776556969, 0.022166632115840912, 0.03520352020859718, 0.01055111363530159, 0.047798026353120804, -0.014951608143746853, 0.028835585340857506, 0.07514435052871704, 0.010571821592748165, -0.05913127586245537, 0.07672351598739624, 0.03895622864365578, -0.1173376515507698, 0.06600107997655869, -0.014333451166749, -0.07759740203619003, -0.07220078259706497, -0.03885969892144203, 0.07859361171722412, -0.03236740827560425, -0.03806143254041672, -0.01599891111254692, -0.013947161845862865, -0.06650359183549881, -0.02724737487733364, -0.009778376668691635, 0.016650544479489326, 0.0675242468714714, -0.08199595659971237, 0.037899672985076904, -0.035241782665252686, -0.024366414174437523, -0.0663178339600563, -0.04455487057566643, 0.042445141822099686, 0.014474332332611084, -0.05989040806889534, -0.01509001199156046, -0.16402477025985718, -0.056989461183547974, -0.05627993494272232, 0.09324011206626892, 0.0401456318795681, 0.02545326016843319, -0.011608886532485485, 0.04714673012495041, -0.055323611944913864, 0.10635728389024734, 0.045322638005018234, -0.02820560336112976, 0.10982043296098709, -0.05743381008505821, 0.013834428042173386, 0.038179151713848114, 0.022968849167227745, 0.056413255631923676, 0.002036141697317362, -0.07630138099193573, -0.04683572053909302, 0.04155096411705017, -0.03616775944828987, 0.0053275879472494125, 0.09130147099494934, -0.020384998992085457, -0.03854618966579437, -6.354241977229388e-33, -0.029299719259142876, -0.06241217628121376, -0.08791431784629822, 0.06336341053247452, -0.027308112010359764, -0.015420190989971161, -0.02996242791414261, 0.07493837177753448, -0.06546088308095932, -0.03858698159456253, 0.08960165083408356, 0.008719190023839474, 0.0633312463760376, 0.02706925943493843, -0.0722702145576477, -0.002929173642769456, -0.013816818594932556, 0.01731935702264309, -0.075619176030159, 0.02566012367606163, 0.007170842494815588, -0.06083826720714569, 0.04565479978919029, 0.012224060483276844, -0.04941071942448616, 0.0020255669951438904, -0.021339941769838333, -0.009337423369288445, -0.03990554437041283, 0.005076556466519833, 0.019072789698839188, -0.05619111284613609, 0.054454922676086426, 0.05214831233024597, -0.016281303018331528, 0.008397756144404411, -0.002836755942553282, -0.001980595290660858, 0.10731754451990128, -0.001855048001743853, 0.15821334719657898, -0.03287732973694801, -0.02051697112619877, -0.05828190967440605, 0.0390222892165184, 0.04652466997504234, -0.04812498390674591, 0.01638501137495041, -0.02953573502600193, -0.008977564051747322, -0.010046317242085934, 0.028623901307582855, -0.02279009483754635, 0.009910278022289276, 0.00672341650351882, 0.017717592418193817, 0.0348941944539547, -0.029962703585624695, 0.018404126167297363, -0.06475280225276947, 0.056653864681720734, -0.09452660381793976, 0.04837504029273987, 0.02094801887869835, 0.060666441917419434, 0.006982159335166216, -0.079229436814785, 0.06332872807979584, 0.12790805101394653, 0.023934198543429375, -0.01884690672159195, 0.039165396243333817, -0.08711931109428406, -0.025327090173959732, 0.084775909781456, -0.01701991818845272, -0.04564545676112175, -0.13780944049358368, 0.04493715986609459, 0.04967620596289635, -0.08230449259281158, 0.05230972170829773, -0.05448269844055176, -0.03693457692861557, 0.10704756528139114, 0.02884288877248764, -0.04042115807533264, 0.04084942862391472, 0.04879697412252426, -0.014297344721853733, -0.016882119700312614, 0.05346420779824257, -0.07423210144042969, -0.012103688903152943, 0.038972169160842896, -5.034199901388092e-8, 0.0043747019954025745, -0.018064523115754128, -0.058149032294750214, 0.012127296067774296, 0.04435966908931732, -0.0157117061316967, -0.019820455461740494, -0.03449228033423424, 0.017620321363210678, -0.014105098322033882, -0.057487744837999344, 0.012786787934601307, 0.03317782282829285, -0.010087036527693272, -0.016216158866882324, 0.003637145971879363, 0.007796615827828646, -0.045732028782367706, 0.0340583398938179, -0.09730818122625351, 0.02504061907529831, -0.033130109310150146, 0.010966555215418339, 0.09782461076974869, -0.01370454952120781, -0.04497377574443817, 0.06585411727428436, 0.041183073073625565, -0.0029497859068214893, -0.05173220485448837, -0.13531124591827393, -0.09207899868488312, -0.008879560977220535, 0.03218020871281624, -0.037229523062705994, 0.07537215203046799, -0.06573755294084549, -0.02522365376353264, 0.06968792527914047, 0.05554373189806938, 0.054550401866436005, 0.02224910631775856, -0.007489967159926891, 0.10395991057157516, 0.0001413355494150892, 0.08055029809474945, 0.01771833561360836, 0.10680161416530609, 0.010586779564619064, 0.02898627147078514, -0.08727993071079254, -0.035926733165979385, -0.03866388648748398, -0.08523794263601303, -0.04971995949745178, -0.058726727962493896, 0.002141924574971199, -0.003519811201840639, -0.04459443315863609, -0.05939728766679764, -0.024912888184189796, -0.0030936726834625006, -0.04408574104309082, -0.06549563258886337 ]
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|stream.Duplex} On the server side, any `Duplex` stream. On the client side, any instance of [`net.Socket`][] (for generic `Duplex` stream support on the client side, [`tls.connect()`][] must be used). \* `options` {Object} \* `enableTrace`: See [`tls.createServer()`][] \* `isServer`: The SSL/TLS protocol is asymmetrical, TLSSockets must know if they are to behave as a server or a client. If `true` the TLS socket will be instantiated as a server. \*\*Default:\*\* `false`. \* `server` {net.Server} A [`net.Server`][] instance. \* `requestCert`: Whether to authenticate the remote peer by requesting a certificate. Clients always request a server certificate. Servers (`isServer` is true) may set `requestCert` to true to request a client certificate. \* `rejectUnauthorized`: See [`tls.createServer()`][] \* `ALPNProtocols`: See [`tls.createServer()`][] \* `SNICallback`: See [`tls.createServer()`][] \* `ALPNCallback`: See [`tls.createServer()`][] \* `session` {Buffer} A `Buffer` instance containing a TLS session. \* `requestOCSP` {boolean} If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication \* `secureContext`: TLS context object created with [`tls.createSecureContext()`][]. If a `secureContext` is \_not\_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`. \* ...: [`tls.createSecureContext()`][] options that are used if the `secureContext` option is missing. Otherwise, they are ignored. Construct a new `tls.TLSSocket` object from an existing TCP socket. ### Event: `'keylog'` \* `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format. The `keylog` event is emitted on a `tls.TLSSocket` when key material is generated or received by the socket. This keying material can be stored for debugging, as it allows captured TLS traffic to be decrypted. It may be emitted multiple times, before or after the handshake completes. A typical use case is to append received lines to a common text file, which is later used by software (such as Wireshark) to decrypt the traffic: ```js const logFile = fs.createWriteStream('/tmp/ssl-keys.log', { flags: 'a' }); // ... tlsSocket.on('keylog', (line) => logFile.write(line)); ``` ### Event: `'OCSPResponse'` The `'OCSPResponse'` event is emitted if the `requestOCSP` option was set when the `tls.TLSSocket` was created and an OCSP response has been received. The listener callback is passed a single argument when called: \* `response` {Buffer} The server's OCSP response Typically, the `response` is a digitally signed object from the server's CA that contains information about server's certificate revocation status. ### Event: `'secure'` The `'secure'` event is emitted after the TLS handshake has successfully completed and a secure connection has been established. This event is emitted on both client and server {tls.TLSSocket} instances, including sockets created using the `new tls.TLSSocket()` constructor. ### Event: `'secureConnect'` The `'secureConnect'` event is emitted after the handshaking process for a new connection has successfully completed. The listener callback will be called regardless of whether or not the server's certificate has been authorized. It is the client's responsibility to check the `tlsSocket.authorized` property to determine if the server certificate was signed by one of the specified CAs. If `tlsSocket.authorized === false`, then the error can be found by examining the `tlsSocket.authorizationError` property. If ALPN was used, the `tlsSocket.alpnProtocol` property can be checked 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 may or may not
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.027127455919981003, 0.023359570652246475, -0.036848608404397964, 0.059248413890600204, 0.026637660339474678, 0.0486949160695076, -0.0769842118024826, 0.019726676866412163, -0.05613798275589943, -0.023499326780438423, 0.0018653888255357742, -0.05176030844449997, -0.02816557139158249, -0.007620437070727348, 0.015798445791006088, 0.01176389865577221, 0.054694514721632004, -0.013780451379716396, -0.034679461270570755, -0.16472473740577698, 0.036917462944984436, -0.06456483900547028, -0.010247400030493736, 0.08606887608766556, 0.04966790974140167, -0.07622077316045761, 0.007024314720183611, 0.07373958081007004, -0.08361513912677765, -0.09201601147651672, 0.016234086826443672, -0.05967660993337631, -0.012423759326338768, -0.00550101650878787, -0.02179647982120514, -0.07973047345876694, -0.06911183893680573, -0.04905323684215546, 0.06486458331346512, -0.01405840739607811, 0.11228051036596298, 0.046896740794181824, -0.030801858752965927, -0.07923827320337296, 0.047664377838373184, -0.014656612649559975, 0.07150498032569885, -0.04623844474554062, 0.017301218584179878, -0.01511175837367773, 0.07860678434371948, -0.04392428696155548, 0.017705967649817467, 0.008957077749073505, 0.06164044886827469, 0.026486441493034363, 0.0011316763702780008, -0.05428400635719299, -0.01766142062842846, 0.016942579299211502, -0.005204278510063887, -0.022130154073238373, -0.0724022388458252, 0.019350318238139153, -0.04242207482457161, -0.11726000905036926, -0.019511720165610313, -0.019953448325395584, -0.07162617146968842, -0.060495201498270035, 0.05676884204149246, -0.028235916048288345, -0.034322042018175125, -0.041205618530511856, 0.01967725344002247, 0.03061327151954174, 0.03502776846289635, 0.0011019710218533874, 0.041776981204748154, -0.12306836247444153, 0.052754420787096024, 0.08246395736932755, 0.0936426892876625, 0.023464633151888847, 0.020860690623521805, -0.020827678963541985, -0.0071951658464968204, -0.00303295417688787, -0.05723786726593971, 0.03350989893078804, -0.007381588686257601, 0.011145336553454399, -0.0038175415247678757, -0.025970561429858208, -0.033630240708589554, 0.08299156278371811, 0.025981273502111435, -0.01354070845991373, -0.013366940431296825, 0.05296732112765312, -0.01657465286552906, -0.020236268639564514, 0.10296089947223663, -0.08053437620401382, 0.04337598755955696, 0.06283965706825256, 0.061181873083114624, 0.0471227765083313, -0.0146971819922328, 0.0056279972195625305, 0.04843224957585335, 0.08341779559850693, 0.004776204004883766, 0.03860390931367874, 4.533957383570397e-33, -0.012333798222243786, -0.008893572725355625, -0.02573961205780506, 0.09962604194879532, -0.024881785735487938, 0.024509789422154427, 0.08862006664276123, 0.03039822354912758, -0.061616428196430206, 0.027739962562918663, -0.032074425369501114, 0.002764431294053793, -0.047148097306489944, -0.054495468735694885, -0.024276498705148697, 0.026726391166448593, 0.018786964938044548, 0.016328949481248856, 0.07635495811700821, 0.09106269478797913, 0.025960423052310944, 0.011422237381339073, 0.055005308240652084, 0.01592700555920601, -0.00980598945170641, -0.015847574919462204, -0.008093677461147308, -0.020813871175050735, -0.030075514689087868, 0.021121103316545486, 0.029351985082030296, -0.0032134803477674723, 0.046689942479133606, 0.0037399183493107557, 0.09623873978853226, -0.0019642983097583055, 0.03847062587738037, 0.040138352662324905, -0.047511350363492966, -0.08578461408615112, 0.028113583102822304, -0.049933530390262604, -0.10235069692134857, -0.00453874422237277, -0.02218105085194111, -0.07696223258972168, -0.1381502002477646, -0.031208472326397896, 0.05149750038981438, 0.026089927181601524, 0.03675384446978569, 0.0016365392366424203, -0.03901438042521477, -0.0036612292751669884, 0.03562808036804199, -0.021739879623055458, -0.016057290136814117, 0.07852306962013245, -0.029347103089094162, 0.05379367619752884, -0.0916026160120964, -0.03838827461004257, -0.08887812495231628, -0.13615767657756805, 0.09098844230175018, 0.03585635498166084, -0.004508749581873417, 0.002119492506608367, -0.09590929001569748, -0.06925695389509201, -0.03657766804099083, 0.07375182211399078, 0.006681111641228199, 0.024061663076281548, 0.015262817032635212, 0.05763871222734451, -0.0002805496333166957, -0.023659994825720787, 0.08704815804958344, -0.05561162903904915, 0.0045432779006659985, 0.012665390968322754, 0.08103486150503159, 0.06932299584150314, -0.03365152329206467, 0.044128596782684326, -0.022071292623877525, -0.013174955733120441, 0.014772084541618824, 0.019449690356850624, -0.04391838237643242, 0.0134011534973979, 0.07500294595956802, -0.030319390818476677, -0.013705834746360779, -5.943363722604796e-33, -0.00018137267034035176, -0.050040971487760544, -0.07129207253456116, 0.04625452309846878, -0.011549918912351131, -0.04858030751347542, -0.05134906619787216, 0.005378690082579851, 0.017462214455008507, 0.002575390972197056, 0.09294379502534866, -0.05326622352004051, 0.03127121925354004, -0.018229901790618896, -0.016165349632501602, -0.04995314031839371, -0.033589523285627365, -0.02294212393462658, -0.012515023350715637, 0.013826330192387104, -0.04138205200433731, -0.018453016877174377, 0.07245828211307526, -0.0045713866129517555, -0.019283341243863106, 0.04137438163161278, -0.020532531663775444, 0.01820247247815132, -0.02981896884739399, 0.0027945227921009064, 0.04807906225323677, -0.002440017880871892, 0.019395051524043083, -0.02269773744046688, -0.02066149190068245, 0.056589964777231216, 0.02788139507174492, 0.028500476852059364, 0.07157808542251587, 0.020387573167681694, 0.12535211443901062, -0.052190691232681274, -0.01844017580151558, -0.057764653116464615, 0.0434955470263958, 0.018007248640060425, -0.06804323196411133, 0.023888658732175827, -0.04285780340433121, -0.014753798954188824, 0.1004873663187027, 0.03681372478604317, -0.0428183376789093, -0.021367330104112625, 0.028246119618415833, 0.032343540340662, 0.04521896317601204, -0.0023249853402376175, 0.03353143855929375, -0.04899714142084122, 0.07654426991939545, -0.11090647429227829, -0.056057367473840714, 0.04357545077800751, 0.007957745343446732, 0.041962191462516785, -0.08463653922080994, 0.000017246054994757287, 0.06436685472726822, 0.02081122435629368, -0.006379751954227686, -0.026048313826322556, -0.09677355736494064, -0.06727342307567596, 0.13314694166183472, 0.021097024902701378, -0.009878178127110004, -0.05550974979996681, 0.0354728177189827, 0.0753239244222641, -0.05810878798365593, 0.07770853489637375, -0.0521668940782547, -0.05100569128990173, 0.03890175372362137, 0.003441674867644906, 0.00616060383617878, 0.023384349420666695, -0.002252524020150304, -0.0339425727725029, -0.018625235185027122, 0.09038278460502625, -0.07249552756547928, 0.057254478335380554, 0.05770594999194145, -5.2140208595119475e-8, -0.046005506068468094, 0.006851750425994396, -0.10150635242462158, 0.027353990823030472, -0.0026728918310254812, 0.04439179599285126, -0.017915641888976097, -0.060150183737277985, 0.06894119083881378, 0.0232017133384943, -0.04036286473274231, -0.05197703093290329, 0.01092748623341322, -0.009437160566449165, 0.049344200640916824, 0.0014996277168393135, -0.02157759480178356, -0.12190235406160355, 0.0000697509094607085, -0.09592875838279724, 0.06500913947820663, -0.04582840949296951, -0.011342438869178295, 0.10911344736814499, -0.027605321258306503, -0.029020631685853004, 0.065483458340168, 0.04374091699719429, -0.051477596163749695, 0.008835484273731709, -0.07701316475868225, -0.06285750865936279, 0.02018832415342331, 0.04995144158601761, 0.046062078326940536, 0.1037193238735199, -0.12645556032657623, 0.025636333972215652, 0.03774058818817139, 0.13206204771995544, -0.009834995493292809, 0.014223812147974968, -0.032802827656269073, 0.03940081223845482, -0.0005712862475775182, 0.021951010450720787, 0.020442435517907143, 0.07320956140756607, -0.004893706180155277, 0.030585234984755516, -0.05273847654461861, 0.005691898055374622, -0.03691389784216881, -0.079100102186203, -0.08803241699934006, 0.03401441499590874, 0.02629155106842518, -0.036916881799697876, -0.04163653403520584, -0.023433662950992584, -0.01514964085072279, 0.015236019156873226, -0.010025396943092346, -0.01279989443719387 ]
-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 may or may not be before the handshake is complete, depending on the TLS protocol version that was negotiated. The event is not emitted on the server, or if a new session was not created, for example, when the connection was resumed. For some TLS protocol versions the event may be emitted multiple times, in which case all the sessions can be used for resumption. On the client, the `session` can be provided to the `session` option of [`tls.connect()`][] to resume the connection. See [Session Resumption][] for more information. For TLSv1.2 and below, [`tls.TLSSocket.getSession()`][] can be called once the handshake is complete. For TLSv1.3, only ticket-based resumption is allowed by the protocol, multiple tickets are sent, and the tickets aren't sent until after the handshake completes. So it is necessary to wait for the `'session'` event to get a resumable session. Applications should use the `'session'` event instead of `getSession()` to ensure they will work for all TLS versions. Applications that only expect to get or use one session should listen for this event only once: ```js tlsSocket.once('session', (session) => { // The session can be used immediately or later. tls.connect({ session: session, // Other connect options... }); }); ``` ### `tlsSocket.address()` \* Returns: {Object} Returns the bound `address`, the address `family` name, and `port` of the underlying socket as reported by the operating system: `{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. ### `tlsSocket.authorizationError` Returns the reason why the peer's certificate was not been verified. This property is set only when `tlsSocket.authorized === false`. ### `tlsSocket.authorized` \* Type: {boolean} This property is `true` if the peer certificate was signed by one of the CAs specified when creating the `tls.TLSSocket` instance, otherwise `false`. ### `tlsSocket.disableRenegotiation()` Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts to renegotiate will trigger an `'error'` event on the `TLSSocket`. ### `tlsSocket.enableTrace()` When enabled, TLS packet trace information is written to `stderr`. This can be used to debug TLS connection problems. The format of the output is identical to the output of `openssl s\_client -trace` or `openssl s\_server -trace`. While it is produced by OpenSSL's `SSL\_trace()` function, the format is undocumented, can change without notice, and should not be relied on. ### `tlsSocket.encrypted` Always returns `true`. This may be used to distinguish TLS sockets from regular `net.Socket` instances. ### `tlsSocket.exportKeyingMaterial(length, label[, context])` \* `length` {number} number of bytes to retrieve from keying material \* `label` {string} an application specific label, typically this will be a value from the [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). \* `context` {Buffer} Optionally provide a context. \* Returns: {Buffer} requested bytes of the keying material Keying material is used for validations to prevent different kind of attacks in network protocols, for example in the specifications of IEEE 802.1X. Example ```js const keyingMaterial = tlsSocket.exportKeyingMaterial( 128, 'client finished'); /\* Example return value of keyingMaterial: \*/ ``` See the OpenSSL [`SSL\_export\_keying\_material`][] documentation for more information. ### `tlsSocket.getCertificate()` \* Returns: {Object} Returns an object representing the local certificate. The returned object has some properties corresponding to the fields of 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 the cipher suite. \* `standardName` {string}
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.018093135207891464, -0.030567074194550514, -0.0724160298705101, 0.05671851709485054, -0.04649516940116882, 0.01327222678810358, -0.05095132067799568, 0.018909558653831482, -0.014724473468959332, -0.02565871924161911, -0.04097821190953255, -0.02515273541212082, -0.03772178292274475, 0.01440898235887289, 0.003705675480887294, 0.06931329518556595, 0.094314344227314, -0.08835656195878983, 0.0206090547144413, -0.08667860925197601, 0.023996302857995033, -0.09566356986761093, -0.0016441644402220845, 0.06697729974985123, 0.07028847187757492, -0.005245398264378309, 0.025205817073583603, 0.01923290640115738, -0.09951337426900864, -0.0825747400522232, 0.0429643914103508, 0.007518240250647068, 0.020609596744179726, -0.04512086883187294, -0.01848369836807251, -0.10794807970523834, -0.024796435609459877, 0.04089877009391785, 0.07284971326589584, -0.03928656131029129, 0.07713993638753891, -0.05380595847964287, 0.048195429146289825, -0.059311505407094955, 0.05949078127741814, 0.003578838426619768, 0.08057334274053574, -0.038032665848731995, 0.017185283824801445, -0.08102952688932419, 0.07090704888105392, -0.009067668579518795, 0.009900219738483429, 0.045586392283439636, 0.021466713398694992, 0.0927434042096138, -0.025994854047894478, -0.04150931164622307, -0.012506947852671146, 0.009620925411581993, -0.08816827088594437, 0.01687738671898842, -0.06017199531197548, 0.05174660310149193, -0.011318594217300415, -0.09601540118455887, -0.031132083386182785, 0.009142154827713966, -0.05992461368441582, -0.06280604749917984, 0.037188053131103516, 0.007235807832330465, -0.01195054966956377, -0.05295691266655922, -0.006183916702866554, 0.019011307507753372, 0.06162090227007866, -0.05117257684469223, -0.0031391368247568607, -0.12366712093353271, 0.04873593896627426, 0.027446158230304718, 0.06830663979053497, 0.023799322545528412, 0.057107049971818924, 0.021614018827676773, 0.014692820608615875, 0.005492508877068758, -0.029171466827392578, -0.02314351685345173, 0.008592846803367138, -0.05409013107419014, 0.010763686150312424, -0.05404359847307205, -0.06349888443946838, 0.08466128259897232, 0.06249665468931198, 0.000019162591343047097, -0.026870381087064743, 0.07059827446937561, -0.006615383550524712, 0.004234584514051676, 0.08453606814146042, -0.11328103393316269, 0.03742091730237007, 0.039205070585012436, 0.04450822249054909, 0.0369960181415081, 0.0011349290143698454, 0.007287482265383005, -0.025849709287285805, -0.0596555657684803, -0.02133653499186039, 0.08208255469799042, 3.631230986726652e-33, 0.01594553329050541, -0.03634358569979668, -0.04632348567247391, 0.11112062633037567, 0.015782803297042847, 0.06287791579961777, 0.04039325937628746, -0.019519837573170662, -0.026638425886631012, 0.038518473505973816, -0.011876043863594532, -0.031229369342327118, 0.0005152438534423709, -0.021960066631436348, -0.05515021085739136, 0.012884655967354774, -0.016016388311982155, 0.008996261283755302, 0.034101635217666626, 0.05928029865026474, -0.02221129834651947, 0.03988700360059738, 0.07919115573167801, 0.05133303627371788, 0.05146820470690727, 0.007897290401160717, -0.03929176926612854, 0.041214339435100555, -0.0644950419664383, 0.017603421583771706, 0.0011974124936386943, 0.022704077884554863, 0.026004349812865257, -0.03146333619952202, 0.07797939330339432, 0.02208346500992775, 0.040267497301101685, -0.0020309663377702236, -0.012292028404772282, -0.09265436232089996, 0.012502350844442844, -0.019698770716786385, -0.09298184514045715, -0.010920312255620956, -0.04034049063920975, -0.07212617993354797, -0.09713416546583176, -0.017175577580928802, 0.06161925569176674, 0.0009689421276561916, -0.046914249658584595, -0.010285857133567333, 0.01729866862297058, -0.004204954486340284, -0.037657368928194046, -0.022914975881576538, 0.03488621115684509, 0.04631616547703743, -0.07161501795053482, 0.0507967434823513, -0.009303131140768528, -0.012748278677463531, -0.045171428471803665, -0.10397587716579437, 0.054293178021907806, 0.08498680591583252, -0.07201449573040009, 0.0188889279961586, -0.05525357648730278, -0.04293809458613396, -0.04680759459733963, 0.1081780269742012, 0.019169876351952553, -0.0054337577894330025, 0.020104127004742622, -0.0030952156521379948, -0.004331452306360006, 0.09561052173376083, 0.007192905526608229, -0.011349690146744251, 0.01101033017039299, 0.04114815592765808, 0.06435027718544006, 0.03704341873526573, -0.05872870981693268, 0.047366149723529816, 0.010772673413157463, -0.03541610389947891, -0.026059862226247787, 0.01661253720521927, -0.024613112211227417, -0.017349742352962494, 0.09111098945140839, 0.0326637402176857, 0.03856739029288292, -5.691323407451097e-33, 0.02171489968895912, 0.009482893161475658, -0.0736493468284607, 0.04648429527878761, -0.021028634160757065, -0.06005096435546875, -0.0372866615653038, -0.0035595300141721964, -0.030418988317251205, -0.0008074162760749459, 0.0927116870880127, -0.01956837624311447, 0.03560561686754227, -0.030961964279413223, -0.04046611115336418, 0.006132766138762236, -0.006248919293284416, -0.0176725871860981, 0.0009563263156451285, 0.026979222893714905, 0.0006059472798369825, -0.07779431343078613, 0.04067466780543327, -0.029890622943639755, -0.026664724573493004, -0.005260815378278494, 0.00980253517627716, -0.05147385969758034, -0.061918552964925766, -0.014940435066819191, 0.03981650993227959, -0.037850528955459595, 0.010545887984335423, 0.09026464074850082, -0.012704389169812202, -0.024384867399930954, -0.0002562797744758427, -0.03501401096582413, 0.09794285148382187, -0.02890765108168125, 0.12979057431221008, -0.012808372266590595, -0.001954347128048539, -0.010165349580347538, 0.028768984600901604, 0.06410792469978333, -0.06793343275785446, 0.00689016655087471, -0.026721665635704994, -0.034774355590343475, 0.0874459370970726, 0.030215805396437645, -0.011662685312330723, -0.008627820760011673, 0.03602049872279167, 0.06353463977575302, -0.007025715429335833, 0.030983269214630127, 0.052313219755887985, -0.08283749222755432, 0.048665229231119156, -0.052077289670705795, -0.020332766696810722, 0.06023577228188515, 0.013883288949728012, 0.04506157338619232, -0.09133148938417435, 0.054454024881124496, 0.08603348582983017, 0.036800045520067215, -0.0432707853615284, 0.008564246818423271, -0.08049759268760681, -0.07122991979122162, 0.07142525911331177, -0.025585705414414406, -0.04371720552444458, -0.11986438930034637, 0.019261803478002548, 0.009239889681339264, -0.09634962677955627, 0.03496173769235611, -0.07370611280202866, -0.022528696805238724, 0.03304808959364891, 0.06597191840410233, -0.018750570714473724, 0.05957656726241112, 0.056904274970293045, -0.040805090218782425, -0.021347597241401672, 0.04391765594482422, -0.05645129457116127, 0.021457815542817116, 0.06535252928733826, -5.176434214604342e-8, -0.01893244870007038, -0.025445563718676567, -0.05959592014551163, -0.011586767621338367, 0.03777050971984863, 0.06338612735271454, 0.0004931039293296635, -0.04652557894587517, 0.03063913621008396, 0.022439518943428993, -0.051924947649240494, -0.034215182065963745, 0.020611347630620003, -0.06733881682157516, 0.041024141013622284, 0.02079659514129162, -0.07100647687911987, -0.08209776133298874, -0.00028251527692191303, -0.12355638295412064, 0.053546447306871414, -0.07291408628225327, -0.005008636973798275, 0.12102846801280975, -0.050024766474962234, -0.03638434410095215, 0.02384362183511257, 0.0843801498413086, -0.08297644555568695, -0.04883618652820587, -0.10084384679794312, -0.060634613037109375, -0.013370229862630367, -0.032367877662181854, 0.053703680634498596, 0.13557954132556915, -0.13788551092147827, -0.03961599990725517, 0.11437172442674637, 0.09112237393856049, 0.02189824730157852, 0.033745672553777695, 0.0032917559146881104, 0.06563214212656021, -0.02890891022980213, 0.04705711081624031, 0.0032091131433844566, 0.11780070513486862, -0.006657461170107126, 0.031076699495315552, -0.051152393221855164, 0.003497408702969551, -0.03845324367284775, -0.04895387589931488, -0.051885802298784256, -0.006242218893021345, 0.021587129682302475, -0.04188909754157066, 0.029990097507834435, -0.03737957775592804, -0.06063904985785484, 0.029318131506443024, -0.04695180431008339, -0.0780339241027832 ]
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 the cipher suite. \* `standardName` {string} IETF name for the cipher suite. \* `version` {string} The minimum TLS protocol version supported by this cipher suite. For the actual negotiated protocol, see [`tls.TLSSocket.getProtocol()`][]. Returns an object containing information on the negotiated cipher suite. For example, a TLSv1.2 protocol with AES256-SHA cipher: ```json { "name": "AES256-SHA", "standardName": "TLS\_RSA\_WITH\_AES\_256\_CBC\_SHA", "version": "SSLv3" } ``` See [SSL\\_CIPHER\\_get\\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL\_CIPHER\_get\_name.html) for more information. ### `tlsSocket.getEphemeralKeyInfo()` \* Returns: {Object} Returns an object representing the type, name, and size of parameter of an ephemeral key exchange in [perfect forward secrecy][] on a client connection. It returns an empty object when the key exchange is not ephemeral. As this is only supported on a client socket; `null` is returned if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. ### `tlsSocket.getFinished()` \* Returns: {Buffer|undefined} The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. As the `Finished` messages are message digests of the complete handshake (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can be used for external authentication procedures when the authentication provided by SSL/TLS is not desired or is not enough. Corresponds to the `SSL\_get\_finished` routine in OpenSSL and may be used to implement the `tls-unique` channel binding from [RFC 5929][]. ### `tlsSocket.getPeerCertificate([detailed])` \* `detailed` {boolean} Include the full certificate chain if `true`, otherwise include just the peer's certificate. \* Returns: {Object} A certificate object. Returns an object representing the peer's certificate. If the peer does not provide a certificate, an empty object will be returned. If the socket has been destroyed, `null` will be returned. If the full certificate chain was requested, each certificate will include an `issuerCertificate` property containing an object representing its issuer's certificate. #### Certificate object A certificate object has properties corresponding to the fields of the certificate. \* `ca` {boolean} `true` if a Certificate Authority (CA), `false` otherwise. \* `raw` {Buffer} The DER encoded X.509 certificate data. \* `subject` {Object} The certificate subject, described in terms of Country (`C`), StateOrProvince (`ST`), Locality (`L`), Organization (`O`), OrganizationalUnit (`OU`), and CommonName (`CN`). The CommonName is typically a DNS name with TLS certificates. Example: `{C: 'UK', ST: 'BC', L: 'Metro', O: 'Node Fans', OU: 'Docs', CN: 'example.com'}`. \* `issuer` {Object} The certificate issuer, described in the same terms as the `subject`. \* `valid\_from` {string} The date-time the certificate is valid from. \* `valid\_to` {string} The date-time the certificate is valid to. \* `serialNumber` {string} The certificate serial number, as a hex string. Example: `'B9B0D332A1AA5635'`. \* `fingerprint` {string} The SHA-1 digest of the DER encoded certificate. It is returned as a `:` separated hexadecimal string. Example: `'2A:7A:C2:DD:...'`. \* `fingerprint256` {string} The SHA-256 digest of the DER encoded certificate. It is returned as a `:` separated hexadecimal string. Example: `'2A:7A:C2:DD:...'`. \* `fingerprint512` {string} The SHA-512 digest of the 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` names. \* `infoAccess` {Array} (Optional) An array
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.02321770042181015, -0.015976689755916595, -0.06079883128404617, 0.020601272583007812, -0.008807245641946793, 0.05417933687567711, -0.12230796366930008, 0.006617997772991657, -0.00021440080308821052, 0.015010015107691288, -0.023888226598501205, -0.010219183750450611, 0.014083953574299812, -0.037677403539419174, 0.033924464136362076, -0.020230544731020927, 0.04228977859020233, -0.048005860298871994, -0.031220000237226486, -0.0515671968460083, 0.0010448076063767076, -0.025098538026213646, 0.03156612440943718, 0.050426553934812546, 0.048474185168743134, -0.01189736369997263, -0.009730767458677292, -0.015549596399068832, -0.05615752190351486, -0.08359576761722565, 0.032874178141355515, 0.02917560748755932, 0.0012910512741655111, -0.016446370631456375, -0.0319395549595356, -0.13626711070537567, -0.0589071623980999, 0.01860257424414158, 0.05795819312334061, -0.0053917416371405125, 0.1049879863858223, 0.010858873836696148, -0.04147517681121826, -0.09433496743440628, 0.05356592684984207, -0.024656079709529877, 0.07354983687400818, -0.0010857372544705868, 0.021939104422926903, -0.04144718125462532, 0.0805182233452797, -0.04967126250267029, -0.023961206898093224, 0.02452484704554081, -0.024912158027291298, -0.0022306658793240786, -0.02303204871714115, -0.06469546258449554, -0.0526394322514534, 0.012536754831671715, 0.03908461704850197, 0.003423320362344384, 0.0297435000538826, 0.02717544324696064, -0.07214221358299255, -0.09756273031234741, 0.022818192839622498, -0.036377742886543274, -0.07884781062602997, -0.0751027837395668, 0.03426932916045189, -0.02407497726380825, 0.007806120906025171, 0.006477643270045519, -0.0007417086744681001, 0.04646258056163788, 0.090754434466362, 0.011199566535651684, -0.009652598761022091, -0.09414389729499817, 0.023139480501413345, 0.09920509159564972, 0.04527561739087105, 0.040944650769233704, -0.011760244145989418, -0.00481452839449048, 0.003179319202899933, -0.015616453252732754, -0.06586611270904541, 0.015038070268929005, -0.05556084215641022, 0.03751739487051964, 0.06247097626328468, -0.05626532435417175, -0.06353939324617386, 0.06054091453552246, 0.03556942194700241, 0.014110807329416275, -0.0004601999244187027, 0.02457180619239807, -0.05975833162665367, -0.030570119619369507, 0.054525624960660934, -0.106504425406456, 0.04372480511665344, 0.07878605276346207, 0.0767122134566307, 0.07468922436237335, -0.016290003433823586, 0.007810644339770079, 0.03406786546111107, -0.041730884462594986, 0.005442824214696884, 0.03926428407430649, 2.994301311348096e-33, 0.017219047993421555, -0.00388969574123621, -0.0011774498270824552, 0.09410876035690308, -0.0037421975284814835, 0.03739006072282791, 0.08368944376707077, 0.0674096867442131, -0.016716808080673218, 0.04682561382651329, -0.010310645215213299, 0.01391854789108038, -0.019111795350909233, 0.000745338445995003, -0.04187024384737015, 0.04929056763648987, 0.0470794178545475, -0.014097613282501698, 0.009372597560286522, 0.05504286289215088, 0.003780488157644868, 0.0585763119161129, 0.05803681164979935, 0.006532807368785143, 0.038747645914554596, 0.025835765525698662, 0.01905616745352745, 0.01334044337272644, -0.106470987200737, 0.011212261393666267, -0.04323505610227585, -0.03191107511520386, 0.026127828285098076, -0.05320427939295769, 0.09071379154920578, 0.05816318839788437, 0.06639005988836288, 0.046445731073617935, -0.04218267649412155, -0.06538531184196472, 0.05541347712278366, -0.026084840297698975, -0.0735209509730339, 0.0202095415443182, -0.018481291830539703, -0.08946927636861801, -0.031961869448423386, -0.0472983717918396, 0.07079853117465973, 0.009988436475396156, 0.02895554155111313, 0.00021743946126662195, -0.06213996559381485, -0.033633191138505936, 0.028706500306725502, -0.02863597683608532, 0.04169034585356712, 0.0592157356441021, -0.07870560884475708, -0.033813588321208954, -0.04811993986368179, -0.06003870815038681, -0.058486394584178925, -0.12051988393068314, 0.09202346950769424, 0.062457334250211716, -0.02610955387353897, -0.06755197793245316, -0.12886330485343933, -0.050926052033901215, -0.030992908403277397, 0.09844786673784256, 0.011858620680868626, 0.01767166331410408, 0.0036292430013418198, 0.04709088057279587, -0.0250998605042696, 0.015552572906017303, 0.08550205081701279, -0.10437360405921936, -0.011168495751917362, 0.006370255723595619, 0.07560814172029495, 0.033258069306612015, 0.004181989002972841, 0.11459119617938995, 0.04216296970844269, -0.02406209334731102, 0.009807595051825047, -0.02746172994375229, -0.06908918917179108, -0.03817673772573471, 0.0012741473037749529, -0.009168113581836224, 0.015740184113383293, -4.6418093576003266e-33, 0.023377399891614914, -0.011334499344229698, -0.0425405316054821, 0.08020579069852829, -0.07276502996683121, -0.07761833816766739, -0.07213756442070007, 0.04387473687529564, -0.0007315849070437253, 0.036182645708322525, 0.08563874661922455, -0.06689837574958801, 0.07987957447767258, 0.00939410924911499, 0.04528852924704552, -0.021862270310521126, -0.0386447049677372, 0.0037702738773077726, -0.006481637246906757, 0.04071236401796341, 0.0010595532367005944, -0.013827821239829063, 0.026565752923488617, -0.0037572181317955256, 0.004824156407266855, 0.01891840435564518, 0.04220028594136238, -0.02278393879532814, -0.06268475949764252, -0.030489707365632057, 0.05766025558114052, -0.04055516794323921, 0.0005659564631059766, 0.06243940815329552, -0.05578658729791641, -0.00035715833655558527, 0.014577300287783146, -0.03466857969760895, 0.07646052539348602, 0.02522025816142559, 0.10971612483263016, -0.030019395053386688, 0.0004668734618462622, -0.010190203785896301, 0.009620576165616512, -0.008830033242702484, 0.01256274338811636, 0.07156168669462204, 0.05263422429561615, -0.04133118689060211, 0.09426013380289078, 0.009487747214734554, -0.03946937248110771, 0.022778453305363655, 0.03504863753914833, 0.03111126460134983, -0.00428610946983099, 0.045754872262477875, 0.040123868733644485, -0.1036486029624939, 0.02765144594013691, -0.046680718660354614, -0.029934147372841835, 0.0592743381857872, 0.011339068412780762, 0.04993514344096184, -0.08353361487388611, 0.01708703488111496, 0.04364322870969772, -0.028933987021446228, 0.028814272955060005, 0.0020009640138596296, -0.08185657113790512, -0.13212525844573975, 0.08568225055932999, 0.017546582967042923, -0.019171958789229393, -0.06989279389381409, 0.06383433192968369, 0.028241105377674103, 0.023297028616070747, 0.05367531627416611, -0.06516078114509583, -0.04269171133637428, 0.14129260182380676, 0.0023295460268855095, -0.025890005752444267, 0.02194960229098797, -0.0026486855931580067, 0.013319429010152817, -0.001662137103267014, 0.10051227360963821, -0.059668418020009995, 0.007137444335967302, 0.060955993831157684, -5.3542343891876953e-8, -0.005766993388533592, 0.0014105879236012697, -0.12497305870056152, 0.0187548715621233, 0.03966674953699112, 0.06297735869884491, 0.023513570427894592, -0.07176011800765991, 0.036248575896024704, 0.002092178678140044, -0.02694309689104557, -0.08948749303817749, -0.007879274897277355, -0.07024252414703369, 0.041349880397319794, 0.026555074378848076, -0.05636169761419296, -0.03529026359319687, -0.015772178769111633, -0.07001497596502304, 0.051916755735874176, -0.042683396488428116, -0.024901052936911583, 0.05702091008424759, -0.02136846072971821, -0.024901948869228363, 0.042143192142248154, 0.02882254496216774, -0.027257040143013, 0.008842234499752522, -0.08446701616048813, -0.06220606341958046, 0.04284847155213356, 0.0032983156852424145, 0.03520679101347923, 0.10703273117542267, -0.08926188945770264, 0.012022797018289566, 0.07373708486557007, 0.1401565670967102, 0.0014657119754701853, 0.01001125480979681, -0.06273727864027023, 0.04722418263554573, -0.12433947622776031, 0.03417439013719559, 0.0030800155363976955, 0.05058997869491577, -0.07268515229225159, 0.04198935255408287, -0.04839034751057625, -0.012616081163287163, -0.0635969266295433, -0.046612195670604706, -0.15390928089618683, 0.014612852595746517, 0.06380162388086319, 0.017494427040219307, -0.03431801125407219, -0.041504405438899994, -0.03515267372131348, -0.0068893758580088615, 0.044918980449438095, -0.049189500510692596 ]
-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` names. \* `infoAccess` {Array} (Optional) An array describing the AuthorityInfoAccess, used with OCSP. \* `issuerCertificate` {Object} (Optional) The issuer certificate object. For self-signed certificates, this may be a circular reference. The certificate may contain information about the public key, depending on the key type. For RSA keys, the following properties may be defined: \* `bits` {number} The RSA bit size. Example: `1024`. \* `exponent` {string} The RSA exponent, as a string in hexadecimal number notation. Example: `'0x010001'`. \* `modulus` {string} The RSA modulus, as a hexadecimal string. Example: `'B56CE45CB7...'`. \* `pubkey` {Buffer} The public key. For EC keys, the following properties may be defined: \* `pubkey` {Buffer} The public key. \* `bits` {number} The key size in bits. Example: `256`. \* `asn1Curve` {string} (Optional) The ASN.1 name of the OID of the elliptic curve. Well-known curves are identified by an OID. While it is unusual, it is possible that the curve is identified by its mathematical properties, in which case it will not have an OID. Example: `'prime256v1'`. \* `nistCurve` {string} (Optional) The NIST name for the elliptic curve, if it has one (not all well-known curves have been assigned names by NIST). Example: `'P-256'`. Example certificate: ```js { subject: { OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ], CN: '\*.nodejs.org' }, issuer: { C: 'GB', ST: 'Greater Manchester', L: 'Salford', O: 'COMODO CA Limited', CN: 'COMODO RSA Domain Validation Secure Server CA' }, subjectaltname: 'DNS:\*.nodejs.org, DNS:nodejs.org', infoAccess: { 'CA Issuers - URI': [ 'http://crt.comodoca.com/COMODORSADomainValidationSecureServerCA.crt' ], 'OCSP - URI': [ 'http://ocsp.comodoca.com' ] }, modulus: 'B56CE45CB740B09A13F64AC543B712FF9EE8E4C284B542A1708A27E82A8D151CA178153E12E6DDA15BF70FFD96CB8A88618641BDFCCA03527E665B70D779C8A349A6F88FD4EF6557180BD4C98192872BCFE3AF56E863C09DDD8BC1EC58DF9D94F914F0369102B2870BECFA1348A0838C9C49BD1C20124B442477572347047506B1FCD658A80D0C44BCC16BC5C5496CFE6E4A8428EF654CD3D8972BF6E5BFAD59C93006830B5EB1056BBB38B53D1464FA6E02BFDF2FF66CD949486F0775EC43034EC2602AEFBF1703AD221DAA2A88353C3B6A688EFE8387811F645CEED7B3FE46E1F8B9F59FAD028F349B9BC14211D5830994D055EEA3D547911E07A0ADDEB8A82B9188E58720D95CD478EEC9AF1F17BE8141BE80906F1A339445A7EB5B285F68039B0F294598A7D1C0005FC22B5271B0752F58CCDEF8C8FD856FB7AE21C80B8A2CE983AE94046E53EDE4CB89F42502D31B5360771C01C80155918637490550E3F555E2EE75CC8C636DDE3633CFEDD62E91BF0F7688273694EEEBA20C2FC9F14A2A435517BC1D7373922463409AB603295CEB0BB53787A334C9CA3CA8B30005C5A62FC0715083462E00719A8FA3ED0A9828C3871360A73F8B04A4FC1E71302844E9BB9940B77E745C9D91F226D71AFCAD4B113AAF68D92B24DDB4A2136B55A1CD1ADF39605B63CB639038ED0F4C987689866743A68769CC55847E4A06D6E2E3F1', exponent: '0x10001', pubkey: , valid\_from: 'Aug 14 00:00:00 2017 GMT', valid\_to: 'Nov 20 23:59:59 2019 GMT', fingerprint: '01:02:59:D9:C3:D2:0D:08:F7:82:4E:44:A4:B4:53:C5:E2:3A:87:4D', fingerprint256: '69:AE:1A:6A:D4:3D:C6:C1:1B:EA:C6:23:DE:BA:2A:14:62:62:93:5C:7A:EA:06:41:9B:0B:BC:87:CE:48:4E:02', fingerprint512: '19:2B:3E:C3:B3:5B:32:E8:AE:BB:78:97:27:E4:BA:6C:39:C9:92:79:4F:31:46:39:E2:70:E5:5F:89:42:17:C9:E8:64:CA:FF:BB:72:56:73:6E:28:8A:92:7E:A3:2A:15:8B:C2:E0:45:CA:C3:BC:EA:40:52:EC:CA:A2:68:CB:32', ext\_key\_usage: [ '1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2' ], serialNumber: '66593D57F20CBC573E433381B5FEC280', raw: } ``` ### `tlsSocket.getPeerFinished()` \* Returns: {Buffer|undefined} The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so far. As the `Finished` messages are message digests of the complete handshake (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can be used for external authentication procedures when the authentication provided by SSL/TLS is not desired or is not enough. Corresponds to the `SSL\_get\_peer\_finished` routine in OpenSSL and may be used to implement the `tls-unique` channel binding from [RFC 5929][]. ### `tlsSocket.getPeerX509Certificate()` \* Returns: {X509Certificate} Returns the peer certificate as an {X509Certificate} object. If there is no peer certificate, or the socket has been destroyed, `undefined` will be returned. ### `tlsSocket.getProtocol()` \* Returns: {string|null} Returns a string containing the negotiated SSL/TLS protocol version of the current connection. The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. The value `null` will be returned for server sockets or disconnected client sockets. Protocol versions are: \* `'SSLv3'` \* `'TLSv1'` \* `'TLSv1.1'` \* `'TLSv1.2'` \* `'TLSv1.3'` See the OpenSSL [`SSL\_get\_version`][] documentation for more information. ### `tlsSocket.getSession()` \* Type: {Buffer} Returns the TLS session data or `undefined` if no session was negotiated. On the client, the 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 for TLSv1.2
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.044342149049043655, -0.011935057118535042, -0.0019296858226880431, -0.060943663120269775, -0.012382603250443935, -0.03270631283521652, 0.006155960727483034, 0.1094171553850174, 0.0406981036067009, -0.04447741433978081, -0.03710588067770004, -0.04334394633769989, -0.01718810759484768, 0.005312077235430479, 0.06630340218544006, 0.026311926543712616, -0.05227377265691757, 0.09219818562269211, 0.031737443059682846, 0.0118977976962924, 0.01924770139157772, -0.025609208270907402, 0.05380043759942055, 0.11917586624622345, 0.02672920748591423, 0.004535814747214317, 0.01482341531664133, 0.06211119145154953, 0.010986859910190105, -0.033267099410295486, 0.042022641748189926, 0.01703968085348606, 0.07761866599321365, -0.046316053718328476, -0.037852972745895386, -0.12486399710178375, -0.027362346649169922, -0.009071152657270432, 0.021964576095342636, -0.07412297278642654, 0.07154341042041779, 0.018483076244592667, -0.05001923814415932, -0.037295274436473846, 0.005529934074729681, -0.029667824506759644, 0.07040263712406158, -0.008925441652536392, 0.04998853802680969, 0.007472002413123846, 0.031486667692661285, -0.01825605519115925, -0.023096824064850807, 0.026556428521871567, -0.0778496190905571, -0.02664083242416382, -0.04756203666329384, -0.05153317749500275, -0.03362671658396721, -0.005261480808258057, 0.05157063528895378, 0.05837131291627884, -0.03752083703875542, -0.06365039199590683, -0.000664187129586935, 0.019381558522582054, -0.06152886524796486, 0.0012435450917109847, 0.010173209942877293, -0.024350332096219063, 0.08202669769525528, 0.004244845360517502, 0.042811453342437744, 0.003016479080542922, -0.000965835468377918, 0.01420366670936346, 0.1162320226430893, -0.019835546612739563, -0.09091171622276306, 0.005196770653128624, -0.013380778022110462, 0.1261882781982422, 0.020651504397392273, 0.07640626281499863, -0.06151575595140457, 0.07033714652061462, -0.058434076607227325, 0.0033524108584970236, 0.005690538324415684, -0.027632657438516617, -0.02720930613577366, -0.09855824708938599, -0.013960042037069798, -0.013594378717243671, -0.028091929852962494, 0.052782196551561356, 0.0029186599422246218, -0.03231911361217499, 0.01943633332848549, -0.08225147426128387, -0.1484965682029724, -0.07273653894662857, 0.05177287757396698, -0.07006288319826126, 0.04079985246062279, 0.07048678398132324, -0.03128032758831978, -0.06541427969932556, -0.047303710132837296, -0.04062143713235855, 0.03401130065321922, -0.06434166431427002, 0.014849871397018433, -0.02118212915956974, 3.81025032749124e-33, 0.008027587085962296, 0.06690230965614319, -0.018081028014421463, -0.06289815157651901, -0.025905076414346695, 0.01259349100291729, 0.02302941493690014, 0.021693138405680656, 0.027409760281443596, 0.02376997470855713, -0.01440898235887289, 0.09283819794654846, -0.035314854234457016, -0.032268308103084564, 0.0158586036413908, 0.0033764136023819447, -0.045427270233631134, 0.040704574435949326, -0.019819052889943123, 0.01768995076417923, 0.03312935307621956, 0.10824031382799149, 0.0016391255194321275, 0.04812238737940788, 0.08726662397384644, 0.03007841669023037, 0.04967275634407997, -0.006630819756537676, -0.015025578439235687, -0.021350279450416565, 0.01944291964173317, -0.04781319573521614, -0.004235917702317238, -0.039530497044324875, 0.13416898250579834, 0.026579875499010086, 0.05358558148145676, 0.012056798674166203, -0.024214202538132668, 0.013502187095582485, 0.066969133913517, -0.0169812198728323, 0.016048623248934746, 0.11145729571580887, -0.05885938182473183, -0.08247669041156769, -0.011836200952529907, -0.01222691684961319, 0.12866519391536713, -0.003528330707922578, 0.003218596801161766, 0.02378995157778263, -0.009222326800227165, -0.04985366016626358, -0.008876488544046879, -0.07605986297130585, -0.03477609530091286, 0.011348641477525234, -0.10293686389923096, -0.01228303648531437, -0.01760413870215416, -0.046358611434698105, 0.02477993071079254, -0.02933512255549431, 0.026699649170041084, -0.03562379628419876, 0.03904029354453087, -0.049504730850458145, -0.0048361243680119514, -0.08224159479141235, -0.061150677502155304, -0.01224148366600275, 0.0245894193649292, -0.019643371924757957, -0.027284687384963036, 0.02460087090730667, -0.05658772215247154, 0.06070072576403618, 0.02903684228658676, -0.01814604364335537, -0.018241770565509796, 0.07159648090600967, 0.04688902571797371, -0.02234967052936554, -0.0315423309803009, 0.08488235622644424, 0.006505373399704695, -0.04414500668644905, -0.05554690212011337, -0.03227241337299347, 0.01842571794986725, -0.0245206281542778, -0.04912014678120613, 0.04721854627132416, -0.015598076395690441, -5.347317557076847e-33, 0.027342282235622406, -0.05791986361145973, -0.004402885213494301, 0.06682208925485611, -0.00958597008138895, -0.07616638392210007, -0.04369669407606125, 0.09033504873514175, 0.016153860837221146, -0.01962888054549694, -0.022738786414265633, -0.07446974515914917, 0.08511565625667572, -0.0464794747531414, 0.042131207883358, -0.07234898954629898, -0.126297727227211, 0.12053016573190689, -0.020368298515677452, 0.0382852703332901, -0.01058847364038229, 0.005210216157138348, 0.032105594873428345, 0.00935057457536459, 0.0527665875852108, 0.045214924961328506, -0.0019927448593080044, -0.036206599324941635, 0.019906360656023026, 0.019642427563667297, 0.024473385885357857, 0.03814489021897316, -0.039849743247032166, 0.009754080325365067, -0.09823863208293915, -0.10579345375299454, 0.01608962006866932, -0.05705759674310684, 0.029517725110054016, 0.026445630937814713, 0.014784141443669796, 0.033318981528282166, 0.04571593552827835, 0.07506143301725388, 0.023467542603611946, -0.013006766326725483, -0.02681516297161579, 0.09583090245723724, 0.075702965259552, 0.012979716062545776, 0.06702124327421188, -0.01670880801975727, -0.09999540448188782, -0.012388588860630989, 0.03858227655291557, 0.024364184588193893, -0.09103798866271973, 0.08591698855161667, 0.019924800843000412, -0.03740397468209267, 0.041175175458192825, 0.005322596523910761, 0.0328468419611454, 0.0868179202079773, -0.016294069588184357, 0.042028289288282394, 0.005334097426384687, -0.07622095197439194, -0.034048713743686676, -0.06649100035429001, 0.013990585692226887, -0.08158434182405472, -0.08736398816108704, -0.06025473773479462, 0.007275480777025223, -0.0434747040271759, 0.0014663205947726965, 0.007189906667917967, 0.023102037608623505, 0.07307642698287964, -0.0011143606388941407, 0.02885115146636963, -0.011180856265127659, 0.053602609783411026, 0.02009906992316246, -0.03185424208641052, 0.025569340214133263, 0.030894670635461807, -0.04679400101304054, 0.03876078501343727, 0.0412801057100296, 0.07612702995538712, -0.04039862006902695, 0.11315984278917313, 0.01362315658479929, -6.02056076104418e-8, -0.00024380798276979476, -0.03344425931572914, -0.08317173272371292, -0.03851892799139023, 0.019971778616309166, -0.021143805235624313, -0.01116818469017744, -0.048325661569833755, -0.0026110620237886906, -0.03465883061289787, 0.04135451838374138, -0.05426183342933655, -0.085521399974823, -0.13541845977306366, 0.025001347064971924, -0.026712914928793907, -0.02122020721435547, 0.019901512190699577, 0.0076983338221907616, -0.010433109477162361, 0.0610419325530529, -0.11559005826711655, -0.0016420910833403468, 0.03161349520087242, -0.016692472621798515, 0.036577094346284866, 0.043541859835386276, 0.13040359318256378, 0.04389706254005432, -0.018852658569812775, 0.007380072493106127, -0.004560405854135752, 0.04788409173488617, -0.07952579110860825, -0.03671608865261078, 0.10888522118330002, -0.0039024956058710814, -0.02055216208100319, 0.041274670511484146, 0.08798795193433762, 0.04423061013221741, -0.021959008648991585, -0.02651379443705082, 0.060520805418491364, -0.04747604578733444, 0.028095968067646027, -0.04434066638350487, 0.009797181934118271, -0.0397275947034359, -0.023997649550437927, -0.02154422737658024, -0.10726534575223923, 0.014056154526770115, 0.01112539041787386, -0.1761941760778427, 0.006381784565746784, -0.020945023745298386, 0.017947932705283165, 0.015985820442438126, -0.027729446068406105, 0.014290849678218365, 0.030033688992261887, 0.06961135566234589, 0.02404165267944336 ]
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 for TLSv1.2 and below). ### `tlsSocket.getSharedSigalgs()` \* Returns: {Array} List of signature algorithms shared between the server and the client in the order of decreasing preference. See [SSL\\_get\\_shared\\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL\_get\_shared\_sigalgs.html) for more information. ### `tlsSocket.getTLSTicket()` \* Type: {Buffer} For a client, returns the TLS session ticket if one is available, or `undefined`. For a server, always returns `undefined`. It may be useful for debugging. See [Session Resumption][] for more information. ### `tlsSocket.getX509Certificate()` \* Returns: {X509Certificate} Returns the local certificate as an {X509Certificate} object. If there is no local certificate, or the socket has been destroyed, `undefined` will be returned. ### `tlsSocket.isSessionReused()` \* Returns: {boolean} `true` if the session was reused, `false` otherwise. See [Session Resumption][] for more information. ### `tlsSocket.localAddress` \* Type: {string} Returns the string representation of the local IP address. ### `tlsSocket.localPort` \* Type: {integer} Returns the numeric representation of the local port. ### `tlsSocket.remoteAddress` \* Type: {string} Returns the string representation of the remote IP address. For example, `'74.125.127.100'` or `'2001:4860:a005::68'`. ### `tlsSocket.remoteFamily` \* Type: {string} Returns the string representation of the remote IP family. `'IPv4'` or `'IPv6'`. ### `tlsSocket.remotePort` \* Type: {integer} Returns the numeric representation of the remote port. For example, `443`. ### `tlsSocket.renegotiate(options, callback)` \* `options` {Object} \* `rejectUnauthorized` {boolean} If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code. \*\*Default:\*\* `true`. \* `requestCert` \* `callback` {Function} If `renegotiate()` returned `true`, callback is attached once to the [`'secure'`][] event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. \* Returns: {boolean} `true` if renegotiation was initiated, `false` otherwise. The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. Upon completion, the `callback` function will be passed a single argument that is either an `Error` (if the request failed) or `null`. This method can be used to request a peer's certificate after the secure connection has been established. When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. For TLSv1.3, renegotiation cannot be initiated, it is not supported by the protocol. ### `tlsSocket.setKeyCert(context)` \* `context` {Object|tls.SecureContext} An object containing at least `key` and `cert` properties from the [`tls.createSecureContext()`][] `options`, or a TLS context object created with [`tls.createSecureContext()`][] itself. The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. ### `tlsSocket.setMaxSendFragment(size)` \* `size` {number} The maximum TLS fragment size. The maximum value is `16384`. \*\*Default:\*\* `16384`. \* Returns: {boolean} The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. Returns `true` if setting the limit succeeded; `false` otherwise. Smaller fragment sizes decrease the buffering latency on the client: larger fragments are buffered by the TLS layer until the entire fragment is received and its integrity is verified; large fragments can span multiple roundtrips and their processing 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 [certificate object][] representing
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.024935413151979446, 0.027869725599884987, -0.06899764388799667, 0.010946962982416153, 0.04014982655644417, 0.05186516046524048, -0.0958603098988533, 0.0078104580752551556, 0.011771735735237598, -0.008433045819401741, 0.01687490940093994, -0.031097978353500366, -0.008700736798346043, -0.008845268748700619, 0.014275104738771915, 0.025217432528734207, 0.06082525476813316, -0.004547634162008762, -0.039543267339468, -0.09596674889326096, 0.018776895478367805, -0.03017084114253521, 0.055581122636795044, 0.05713658779859543, 0.051772817969322205, -0.043124232441186905, 0.020716587081551552, 0.04727185145020485, -0.08925681561231613, -0.10898073762655258, 0.05971454456448555, -0.019781718030571938, 0.013280557468533516, -0.042884666472673416, -0.00427329121157527, -0.1109922006726265, -0.002277791267260909, -0.0035283963661640882, 0.032919853925704956, -0.009230297058820724, 0.07524628937244415, -0.04792226478457451, 0.0017946360167115927, -0.03904985636472702, 0.05509321764111519, -0.03154878690838814, 0.03861801326274872, -0.06963977962732315, 0.0004107127897441387, -0.02416214719414711, 0.04644292965531349, -0.08620207756757736, 0.059953056275844574, 0.06850670278072357, 0.03212370350956917, 0.012427887879312038, 0.019487403333187103, -0.060033008456230164, 0.005222842562943697, -0.03137799724936485, -0.0551595464348793, -0.009166226722300053, -0.026483306661248207, -0.02347111701965332, -0.04408188909292221, -0.10485295951366425, -0.06693203002214432, -0.00837801769375801, -0.066560298204422, -0.10369216650724411, 0.0940140038728714, -0.02953025884926319, -0.00998383853584528, -0.06935150176286697, 0.027712848037481308, 0.059383243322372437, 0.07680930942296982, 0.013286372646689415, 0.023992173373699188, -0.09979993849992752, 0.017801739275455475, 0.03932299092411995, 0.1178884208202362, 0.007795084733515978, 0.04236653447151184, 0.0026559357065707445, 0.01671610400080681, -0.00715811550617218, -0.014054952189326286, -0.02019292116165161, 0.03660951554775238, 0.03597128391265869, 0.02143002115190029, -0.013100703246891499, -0.04830554127693176, 0.01595580391585827, -0.00026198613340966403, 0.0023675912525504827, 0.034771863371133804, 0.05111221969127655, -0.024910850450396538, 0.04619184881448746, 0.06396059691905975, -0.08485990762710571, 0.02220054902136326, -0.00448312982916832, 0.043772004544734955, 0.0896255150437355, -0.039301857352256775, -0.0016485576052218676, 0.06645819544792175, 0.025849726051092148, 0.0066425795666873455, 0.06280069053173065, 2.4302684487678457e-33, 0.007198833394795656, 0.03721589222550392, -0.03095727600157261, 0.0818348377943039, -0.05733617767691612, 0.020367629826068878, 0.05398967117071152, 0.01213743630796671, -0.060697175562381744, 0.04811989888548851, -0.037190087139606476, 0.013542071916162968, -0.009677576832473278, -0.05008077248930931, -0.008547453209757805, 0.008604954928159714, -0.005407977383583784, 0.03346995264291763, 0.03673538193106651, 0.03995990380644798, 0.01696048118174076, 0.024697424843907356, 0.06463149189949036, 0.05953599140048027, 0.06011617183685303, 0.0139527078717947, -0.0496869795024395, 0.011705479584634304, -0.04707054793834686, -0.009373040869832039, 0.08599257469177246, 0.00306508457288146, 0.045872513204813004, -0.03368392586708069, 0.10567405074834824, 0.014706289395689964, 0.03639844059944153, 0.05053248628973961, -0.033481765538454056, -0.059064771980047226, 0.0854652002453804, 0.02594769187271595, -0.03503981605172157, 0.009523794986307621, -0.08251477032899857, -0.07893714308738708, -0.12328514456748962, 0.0025002399925142527, 0.10008785873651505, -0.05429753661155701, 0.019720572978258133, 0.018027842044830322, -0.02841106988489628, -0.026686696335673332, -0.012641506269574165, -0.05044146627187729, 0.002320188097655773, 0.059592753648757935, -0.09825528413057327, 0.01332235150039196, -0.07743534445762634, -0.04464937373995781, -0.009948507882654667, -0.13353422284126282, 0.056801918894052505, 0.04708994925022125, -0.05885383486747742, -0.014487594366073608, -0.09443981200456619, -0.04946066439151764, -0.05766173452138901, 0.0914015844464302, -0.008476510643959045, 0.024481559172272682, 0.016812395304441452, 0.055521558970212936, -0.05242576450109482, 0.052351076155900955, 0.044291287660598755, -0.0416623055934906, 0.06233536824584007, 0.02089245617389679, 0.037663575261831284, 0.02627221867442131, 0.00579072255641222, 0.026917360723018646, 0.019841322675347328, -0.09543352574110031, -0.051654163748025894, 0.00144050526432693, -0.061905842274427414, 0.011659068986773491, 0.047462984919548035, 0.02048501931130886, -0.014613662846386433, -4.324312374205058e-33, 0.03243688493967056, -0.04026506841182709, -0.007402520161122084, 0.08422643691301346, 0.01169339194893837, -0.012921658344566822, -0.025008773431181908, 0.03736759349703789, -0.018593991175293922, 0.03219342976808548, 0.08062776178121567, -0.018124902620911598, 0.025632981210947037, -0.034046024084091187, 0.0012417350662872195, -0.009428123943507671, -0.0049931746907532215, 0.010640029795467854, 0.0013379869051277637, -0.04824429750442505, -0.05993843823671341, -0.023615187034010887, 0.08359026908874512, 0.007592340465635061, -0.004588381852954626, 0.0369294099509716, 0.0058313473127782345, -0.018595505505800247, -0.05597029998898506, -0.04697868227958679, 0.04050816595554352, -0.008464678190648556, 0.030086608603596687, 0.02434242144227028, -0.0006064636399969459, 0.02009083330631256, 0.0007213274948298931, 0.034447263926267624, 0.04685065522789955, 0.06539136171340942, 0.14968940615653992, -0.014667225070297718, -0.004540236666798592, -0.054861124604940414, 0.01839139126241207, 0.056190334260463715, -0.059158775955438614, 0.0742490291595459, -0.030872374773025513, -0.016707414761185646, 0.09550648182630539, -0.009757700376212597, -0.027118541300296783, 0.01796926185488701, 0.07507818937301636, 0.07405661791563034, 0.010874028317630291, -0.009053019806742668, 0.013935032300651073, -0.12723268568515778, 0.008646010421216488, -0.06772935390472412, -0.022875016555190086, 0.04607215151190758, 0.014674583449959755, -0.03324277326464653, -0.0571681447327137, -0.029433337971568108, 0.03883698210120201, 0.008916814811527729, -0.06696043908596039, -0.0709608718752861, -0.08094155788421631, -0.06450103223323822, 0.08972146362066269, -0.0211638230830431, -0.053838904947042465, -0.07926660031080246, 0.06263069808483124, 0.014746148139238358, -0.06566645950078964, 0.03007328510284424, -0.061843134462833405, -0.007748001255095005, 0.07269221544265747, 0.045582618564367294, -0.01873995177447796, 0.06765380501747131, 0.0473971962928772, -0.020101027563214302, -0.03457344323396683, 0.13198459148406982, -0.044897451996803284, 0.0006432613590732217, 0.06577549874782562, -5.6335494491577265e-8, -0.029379313811659813, -0.07716897875070572, -0.05469130352139473, 0.06194925680756569, 0.011381873860955238, 0.015529832802712917, -0.01948409341275692, -0.017173627391457558, -0.010564969852566719, 0.02875647507607937, -0.014602445997297764, -0.04233754798769951, 0.015721170231699944, -0.07778115570545197, -0.01166145596653223, 0.0041553252376616, -0.03379621356725693, -0.08843869715929031, -0.01737869344651699, -0.1546696424484253, 0.05322476476430893, -0.04939044266939163, -0.006326793227344751, 0.06486225128173828, 0.012430844828486443, -0.04857683926820755, 0.035027313977479935, 0.07076329737901688, -0.01230995636433363, -0.047716397792100906, -0.04322684928774834, -0.07647034525871277, 0.04029370844364166, -0.04029618203639984, 0.07013177871704102, 0.08283912390470505, -0.13133852183818817, -0.04167039692401886, 0.11430299282073975, 0.14539922773838043, 0.01792008802294731, 0.029504014179110527, -0.006357923615723848, 0.04677553474903107, -0.042933009564876556, 0.040247466415166855, -0.004055257420986891, 0.12657445669174194, 0.02508418820798397, 0.024993950501084328, -0.04177834093570709, -0.0522308386862278, -0.028739793226122856, -0.038143340498209, -0.06994504481554031, -0.06375546008348465, 0.04891897365450859, -0.04073202982544899, 0.041150547564029694, -0.05052173137664795, 0.010487972758710384, -0.03014685958623886, -0.059334881603717804, -0.021659262478351593 ]
-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 [certificate object][] representing the peer's certificate. \* Returns: {Error|undefined} Verifies the certificate `cert` is issued to `hostname`. Returns {Error} object, populating it with `reason`, `host`, and `cert` on failure. On success, returns {undefined}. This function is intended to be used in combination with the `checkServerIdentity` option that can be passed to [`tls.connect()`][] and as such operates on a [certificate object][]. For other purposes, consider using [`x509.checkHost()`][] instead. This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The overwriting function can call `tls.checkServerIdentity()` of course, to augment the checks done with additional verification. This function is only called if the certificate passed all other checks, such as being issued by trusted CA (`options.ca`). Earlier versions of Node.js incorrectly accepted certificates for a given `hostname` if a matching `uniformResourceIdentifier` subject alternative name was present (see [CVE-2021-44531][]). Applications that wish to accept `uniformResourceIdentifier` subject alternative names can use a custom `options.checkServerIdentity` function that implements the desired behavior. ## `tls.connect(options[, callback])` \* `options` {Object} \* `enableTrace`: See [`tls.createServer()`][] \* `host` {string} Host the client should connect to. \*\*Default:\*\* `'localhost'`. \* `port` {number} Port the client should connect to. \* `path` {string} Creates Unix socket connection to path. If this option is specified, `host` and `port` are ignored. \* `socket` {stream.Duplex} Establish secure connection on a given socket rather than creating a new socket. Typically, this is an instance of [`net.Socket`][], but any `Duplex` stream is allowed. If this option is specified, `path`, `host`, and `port` are ignored, except for certificate validation. Usually, a socket is already connected when passed to `tls.connect()`, but it can be connected later. Connection/disconnection/destruction of `socket` is the user's responsibility; calling `tls.connect()` will not cause `net.connect()` to be called. \* `allowHalfOpen` {boolean} If set to `false`, then the socket will automatically end the writable side when the readable side ends. If the `socket` option is set, this option has no effect. See the `allowHalfOpen` option of [`net.Socket`][] for details. \*\*Default:\*\* `false`. \* `rejectUnauthorized` {boolean} If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code. \*\*Default:\*\* `true`. \* `pskCallback` {Function} For TLS-PSK negotiation, see [Pre-shared keys][]. \* `ALPNProtocols` {string\[]|Buffer|TypedArray|DataView} An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `'\x08http/1.1\x08http/1.0'`, where the `len` byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher preference than those later. \* `servername` {string} Server name for the SNI (Server Name Indication) TLS extension. It is the name of the host being connected to, and must be a host name, and not an IP address. It can be used by a multi-homed server to choose the correct certificate to present to the client, see the `SNICallback` option to [`tls.createServer()`][]. \* `checkServerIdentity(servername, cert)` {Function} A callback function to be used (instead of 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} A `Buffer` instance, containing TLS session. \*
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.017939694225788116, 0.004892378114163876, -0.06362464278936386, -0.014180438593029976, 0.001300824573263526, 0.02605513483285904, -0.06236756220459938, -0.0452549010515213, -0.02807447500526905, 0.0007441681227646768, 0.04744282737374306, -0.028638197109103203, -0.10242579877376556, -0.05258164927363396, 0.01161366980522871, 0.014755227603018284, -0.011414612643420696, 0.02844329923391342, 0.022517524659633636, -0.09749360382556915, 0.02972019650042057, -0.05910544469952583, 0.07848361879587173, 0.06558459252119064, 0.0001298268762184307, -0.014549327082931995, -0.021868230774998665, 0.08434353023767471, -0.06728023290634155, -0.0541093572974205, -0.010466770268976688, -0.02236640825867653, -0.022302918136119843, 0.026907019317150116, -0.02257523126900196, -0.04143548011779785, -0.05077330768108368, 0.019749239087104797, 0.0309277530759573, -0.029410768300294876, 0.05542697012424469, -0.02843555249273777, 0.05514084920287132, -0.051009126007556915, 0.05561589449644089, -0.01628848910331726, 0.07411951571702957, -0.0034486125223338604, -0.03684178367257118, -0.003945460077375174, 0.021143505349755287, 0.09878131747245789, 0.0008375421166419983, 0.03298807144165039, -0.0551595613360405, -0.002733411733061075, 0.10945563018321991, 0.046682585030794144, 0.04374242201447487, 0.04799104854464531, 0.043635960668325424, -0.047712747007608414, -0.0554378442466259, -0.0034536542370915413, -0.05729510635137558, -0.051249582320451736, -0.004848248790949583, -0.03617317974567413, -0.10451880097389221, -0.06222386285662651, 0.04630674794316292, -0.02523117884993553, -0.08515316992998123, 0.03289124742150307, 0.018048981204628944, -0.024383364245295525, -0.02844085730612278, 0.03937827795743942, 0.023968933150172234, -0.02294269949197769, 0.032236650586128235, 0.11701542139053345, 0.07731536030769348, 0.01148489024490118, -0.055733755230903625, 0.001874643610790372, -0.02223736047744751, -0.011788859963417053, 0.016855215653777122, -0.007968735881149769, -0.014058913104236126, 0.06683728843927383, 0.036561254411935806, 0.012899769470095634, 0.030342787504196167, 0.07290072739124298, 0.06872012466192245, 0.029565148055553436, 0.00975954532623291, 0.07475809752941132, -0.036630257964134216, -0.09700064361095428, 0.1311197131872177, 0.007731753401458263, 0.008464268408715725, 0.03428157791495323, -0.005413378588855267, 0.0544467456638813, 0.03032766655087471, 0.05902566760778427, -0.03297628462314606, 0.055467166006565094, -0.0044319587759673595, 0.05004500225186348, 5.712427939152173e-33, 0.04004845395684242, 0.03156144917011261, -0.04995382949709892, 0.03600083291530609, -0.013207239098846912, 0.018541404977440834, 0.09300459921360016, 0.03244937211275101, -0.08923181146383286, -0.007282586302608252, -0.07486279308795929, -0.014748877845704556, -0.016378385946154594, -0.0866239070892334, 0.017599208280444145, -0.017951831221580505, 0.05745421722531319, 0.05889878049492836, -0.005887686740607023, 0.12774024903774261, 0.02290019392967224, -0.15018540620803833, 0.016359420493245125, 0.04225662723183632, -0.032092221081256866, -0.0023584053851664066, -0.03963667154312134, 0.03772803023457527, -0.053765829652547836, -0.019758598878979683, -0.0037935308646410704, -0.0005067226011306047, 0.024104207754135132, -0.005708761978894472, 0.0927044227719307, 0.0027516866102814674, 0.09768204391002655, -0.010332412086427212, -0.05115356668829918, -0.07132258266210556, -0.016101902350783348, -0.006430582143366337, -0.03708824887871742, 0.02934524603188038, -0.0605735257267952, -0.0772719606757164, -0.08790009468793869, -0.008937209844589233, 0.06999915838241577, 0.1010584607720375, 0.06476367264986038, 0.047803185880184174, -0.05134996026754379, -0.030515335500240326, 0.01982009969651699, -0.03788779675960541, 0.02504829689860344, 0.03676440939307213, -0.056135393679142, 0.030171528458595276, -0.020771903917193413, -0.08808811753988266, -0.14547596871852875, -0.051630694419145584, 0.0765720009803772, 0.08629784733057022, 0.016156524419784546, 0.02810673974454403, -0.0859985202550888, -0.01240971963852644, -0.059440042823553085, 0.0627821758389473, 0.0030608787201344967, 0.027081606909632683, 0.03894493728876114, 0.003312075277790427, -0.09444407373666763, -0.0005247602821327746, 0.04097341001033783, -0.09358392655849457, 0.058784715831279755, 0.03565921261906624, -0.002029098803177476, 0.025226641446352005, -0.06224513053894043, 0.03259407356381416, 0.06513553112745285, 0.006324405781924725, -0.022278014570474625, 0.00018429642659612, -0.054138608276844025, 0.016282156109809875, 0.05645494535565376, 0.0037572328001260757, -0.01951826922595501, -4.855063501964675e-33, 0.001499547972343862, -0.0807873085141182, -0.012154829688370228, 0.10387150198221207, 0.04326895996928215, -0.09547077864408493, 0.006390823516994715, 0.06587681174278259, -0.03589830920100212, -0.06149188429117203, 0.04019717872142792, -0.06851688027381897, 0.010494220070540905, -0.05022326856851578, 0.033887580037117004, 0.01783989742398262, -0.023818397894501686, 0.018203817307949066, 0.016267942264676094, -0.020789476111531258, 0.04201459884643555, 0.015444382093846798, 0.015078339725732803, 0.01702888123691082, -0.040533483028411865, 0.08089567720890045, -0.039111483842134476, -0.00876653753221035, -0.03509703278541565, -0.03507490083575249, 0.027723269537091255, 0.05948418751358986, 0.00882050022482872, 0.03380228206515312, 0.04051359370350838, 0.04066752642393112, -0.036163587123155594, 0.05541001632809639, 0.08993569016456604, -0.0006251440499909222, 0.06914064288139343, 0.009312963113188744, -0.003342280862852931, -0.004627717658877373, -0.001375514199025929, -0.01284710317850113, 0.028774213045835495, 0.053768668323755264, -0.016753461211919785, 0.06149996444582939, 0.02922705002129078, 0.02023342438042164, 0.0352746807038784, 0.01070872787386179, 0.10103393346071243, 0.047679975628852844, -0.09259297698736191, -0.01373618096113205, 0.0313093401491642, 0.02190563455224037, 0.0034667043946683407, -0.07490134239196777, 0.0069413334131240845, 0.052548207342624664, 0.01838391274213791, 0.08333021402359009, -0.08614747226238251, -0.009222447872161865, 0.11902718991041183, 0.05891881510615349, 0.024201281368732452, -0.06961144506931305, -0.08196377009153366, -0.04414072260260582, 0.04054378345608711, -0.018617931753396988, -0.007227852940559387, -0.0012304631527513266, 0.019785255193710327, 0.04922722280025482, -0.0209817998111248, 0.054845474660396576, -0.029251569882035255, -0.05165170133113861, 0.03766573965549469, 0.0005605679471045732, 0.026288503780961037, 0.011946952901780605, -0.010441322810947895, -0.007277331780642271, -0.012113664299249649, 0.07942231744527817, -0.016239890828728676, -0.010199878364801407, 0.03882991150021553, -5.404166714129133e-8, -0.027194472029805183, 0.03968722000718117, -0.12780924141407013, 0.01668231561779976, 0.03075767681002617, 0.043978504836559296, -0.004547448828816414, -0.07679357379674911, 0.0433940626680851, -0.0012126477668061852, -0.023871785029768944, -0.05159960314631462, 0.007030838169157505, -0.036317601799964905, 0.014632593840360641, -0.05914250761270523, -0.05947908014059067, -0.07061132043600082, -0.05149267613887787, -0.07668057084083557, -0.00416059885174036, -0.07349566370248795, -0.025450680404901505, 0.02149527706205845, -0.09391750395298004, 0.021595286205410957, 0.10698225349187851, 0.08241735398769379, -0.018334317952394485, -0.02143244631588459, -0.13965727388858795, 0.020533116534352303, -0.04324638843536377, 0.07853173464536667, 0.03831826522946358, 0.10166193544864655, -0.07557936012744904, 0.029929595068097115, 0.09457637369632721, 0.11070238798856735, 0.011025155894458294, -0.0077826762571930885, -0.031203757971525192, 0.026180295273661613, -0.008054431527853012, -0.01581016182899475, -0.059445999562740326, 0.07855161279439926, -0.011848936788737774, -0.027163634076714516, -0.03310531750321388, -0.054752886295318604, -0.08387509733438492, -0.05503494665026665, -0.08996932953596115, -0.012538379058241844, 0.016988862305879593, -0.06416408717632294, -0.010442866012454033, -0.04290382191538811, 0.012456885538995266, -0.059537630528211594, 0.015978721901774406, -0.052293408662080765 ]
-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} A `Buffer` instance, containing TLS session. \* `requestOCSP` {boolean} If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication. \* `minDHSize` {number} Minimum size of the DH parameter in bits to accept a TLS connection. When a server offers a DH parameter with a size less than `minDHSize`, the TLS connection is destroyed and an error is thrown. \*\*Default:\*\* `1024`. \* `highWaterMark` {number} Consistent with the readable stream `highWaterMark` parameter. \*\*Default:\*\* `16 \* 1024`. \* `timeout`: {number} If set and if a socket is created internally, will call [`socket.setTimeout(timeout)`][] after the socket is created, but before it starts the connection. \* `secureContext`: TLS context object created with [`tls.createSecureContext()`][]. If a `secureContext` is \_not\_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`. \* `onread` {Object} If the `socket` option is missing, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket, otherwise the option is ignored. See the `onread` option of [`net.Socket`][] for details. \* ...: [`tls.createSecureContext()`][] options that are used if the `secureContext` option is missing, otherwise they are ignored. \* ...: Any [`socket.connect()`][] option not already listed. \* `callback` {Function} \* Returns: {tls.TLSSocket} The `callback` function, if specified, will be added as a listener for the [`'secureConnect'`][] event. `tls.connect()` returns a [`tls.TLSSocket`][] object. Unlike the `https` API, `tls.connect()` does not enable the SNI (Server Name Indication) extension by default, which may cause some servers to return an incorrect certificate or reject the connection altogether. To enable SNI, set the `servername` option in addition to `host`. The following illustrates a client for the echo server example from [`tls.createServer()`][]: ```mjs // Assumes an echo server that is listening on port 8000. import { connect } from 'node:tls'; import { readFileSync } from 'node:fs'; import { stdin } from 'node:process'; const options = { // Necessary only if the server requires client certificate authentication. key: readFileSync('client-key.pem'), cert: readFileSync('client-cert.pem'), // Necessary only if the server uses a self-signed certificate. ca: [ readFileSync('server-cert.pem') ], // Necessary only if the server's cert isn't for "localhost". checkServerIdentity: () => { return null; }, }; const socket = connect(8000, options, () => { console.log('client connected', socket.authorized ? 'authorized' : 'unauthorized'); stdin.pipe(socket); stdin.resume(); }); socket.setEncoding('utf8'); socket.on('data', (data) => { console.log(data); }); socket.on('end', () => { console.log('server ends connection'); }); ``` ```cjs // Assumes an echo server that is listening on port 8000. const { connect } = require('node:tls'); const { readFileSync } = require('node:fs'); const options = { // Necessary only if the server requires client certificate authentication. key: readFileSync('client-key.pem'), cert: readFileSync('client-cert.pem'), // Necessary only if the server uses a self-signed certificate. ca: [ readFileSync('server-cert.pem') ], // Necessary only if the server's cert isn't for "localhost". checkServerIdentity: () => { return null; }, }; const socket = connect(8000, options, () => { console.log('client connected', socket.authorized ? 'authorized' : 'unauthorized'); process.stdin.pipe(socket); process.stdin.resume(); }); socket.setEncoding('utf8'); socket.on('data', (data) => { console.log(data); }); 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 this example, run: ```bash openssl pkcs12 -certpbe AES-256-CBC
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.034241318702697754, -0.05579601600766182, 0.0009458581334911287, 0.032835349440574646, -0.03283759579062462, 0.029439514502882957, -0.04249302297830582, 0.0006918612634763122, -0.08807864785194397, 0.04340266436338425, 0.018118323758244514, -0.08618581295013428, -0.07955459505319595, -0.03782539814710617, 0.0528322234749794, 0.0014305904041975737, 0.011895786970853806, 0.02713959477841854, 0.004834157880395651, -0.05870961397886276, -0.024208370596170425, 0.025459304451942444, 0.06957073509693146, 0.08246186375617981, -0.02910173498094082, -0.0655360072851181, -0.000714261899702251, 0.04070841521024704, -0.09604587405920029, -0.05298711359500885, 0.05657327175140381, -0.031725235283374786, 0.052379000931978226, 0.04414806142449379, -0.049461301416158676, -0.15107133984565735, -0.008719732984900475, -0.021855762228369713, 0.01719282567501068, -0.04093172773718834, 0.06079832464456558, -0.056895580142736435, -0.015478682704269886, -0.10213438421487808, 0.040735356509685516, -0.015000704675912857, 0.10509802401065826, -0.0448012501001358, 0.0030264207161962986, -0.004808973520994186, 0.03377952054142952, 0.058476123958826065, 0.008972019888460636, -0.03942383453249931, -0.05777345970273018, -0.05498403683304787, 0.0656893327832222, -0.014335788786411285, 0.024918679147958755, 0.04293427988886833, 0.05012763291597366, 0.017546549439430237, -0.0007535403128713369, -0.025633947923779488, -0.0710439682006836, -0.013533378951251507, -0.029017629101872444, -0.0008114685188047588, -0.05891026556491852, -0.11867252737283707, 0.007167200092226267, 0.00036474657827056944, -0.028354523703455925, -0.02189374342560768, -0.002695544855669141, 0.029146799817681313, 0.04008302837610245, -0.0031291255727410316, -0.02891152910888195, -0.05741399899125099, 0.02812579646706581, 0.11728773266077042, 0.01056716963648796, 0.0031343630980700254, 0.0023344559594988823, -0.03255848214030266, -0.030531369149684906, -0.003690021811053157, -0.016174431890249252, 0.01249129232019186, -0.02967771515250206, 0.022175686433911324, 0.03675086423754692, 0.020697597414255142, 0.018669169396162033, 0.09595422446727753, -0.008249213919043541, -0.010153691284358501, 0.03055480308830738, 0.06925366818904877, -0.06287901848554611, -0.0520300567150116, 0.05334899574518204, -0.0817350447177887, -0.002294891979545355, 0.005982206203043461, -0.033542174845933914, -0.012939992360770702, -0.055977508425712585, -0.005168786738067865, 0.035320065915584564, 0.05808299034833908, 0.0031544361263513565, 0.10061274468898773, 5.213260875231212e-33, 0.06126725673675537, 0.028465772047638893, -0.044680286198854446, 0.06198427826166153, -0.0026462762616574764, 0.006045847199857235, 0.10160614550113678, 0.009141010232269764, -0.06558597087860107, 0.03970230743288994, -0.009976456873118877, -0.04568874090909958, -0.003209770657122135, -0.04448356479406357, 0.048555079847574234, -0.014761380851268768, -0.0073379576206207275, 0.015992894768714905, 0.007701119873672724, 0.05346264690160751, 0.014468482695519924, -0.02826026640832424, 0.024906100705266, -0.013875136151909828, 0.01944740116596222, 0.011548161506652832, -0.028068657964468002, -0.007938812486827374, 0.02307901158928871, 0.0038895858451724052, 0.01207796111702919, -0.03781818598508835, 0.05073847621679306, -0.003793288255110383, 0.112423375248909, 0.07065331190824509, 0.023346809670329094, 0.018835624679923058, -0.01733257807791233, -0.07660607248544693, -0.015294836834073067, 0.0167068038135767, -0.03538393974304199, 0.1120578870177269, -0.026803530752658844, -0.03549684211611748, -0.09515271335840225, 0.00813505332916975, 0.07226433604955673, 0.027632374316453934, 0.0004304213507566601, -0.01039801724255085, -0.07306379824876785, 0.04720910266041756, -0.015198086388409138, -0.05002985894680023, -0.03694060072302818, 0.02542741969227791, -0.07317618280649185, 0.04749169200658798, -0.023382270708680153, -0.05998804420232773, -0.11277616024017334, -0.10016363114118576, 0.021218592301011086, 0.056767821311950684, 0.0014321720227599144, -0.013072212226688862, -0.037220560014247894, -0.04673858731985092, -0.017326857894659042, 0.051681291311979294, 0.05222358927130699, 0.05187472701072693, -0.03289923071861267, 0.042097192257642746, -0.003323921235278249, 0.07318706065416336, 0.06366067379713058, -0.05596810579299927, 0.06554805487394333, 0.02169226109981537, 0.06517668813467026, 0.04606837406754494, -0.01999707520008087, 0.029579907655715942, 0.023583034053444862, 0.011838272213935852, -0.08526964485645294, 0.03922216594219208, 0.0002383189566899091, -0.015052269212901592, 0.1005694642663002, -0.0010643129935488105, -0.03746975213289261, -4.44360998979215e-33, 0.005123481620103121, -0.06711231172084808, -0.028599776327610016, 0.06377314031124115, -0.032937243580818176, -0.0669751763343811, -0.042307570576667786, 0.08796118944883347, -0.0051064640283584595, -0.03277910500764847, 0.05281088128685951, -0.030770841985940933, 0.022778932005167007, -0.040807582437992096, -0.023691371083259583, -0.1291494369506836, -0.1098160445690155, 0.06561249494552612, -0.03007613494992256, 0.055280089378356934, 0.07156896591186523, -0.018203452229499817, 0.04047703742980957, 0.056687165051698685, 0.015775974839925766, 0.07685064524412155, -0.01836840808391571, -0.05192306265234947, -0.05032878369092941, -0.012003488838672638, 0.032115913927555084, 0.06415187567472458, -0.025454387068748474, 0.06158606708049774, 0.012809802778065205, -0.0387195348739624, 0.006768570281565189, 0.026951758190989494, 0.03193312883377075, 0.028223322704434395, 0.07242614775896072, -0.04474026337265968, -0.02766687422990799, -0.055987171828746796, -0.05818471312522888, 0.06686253100633621, 0.0026160036213696003, 0.08559739589691162, 0.010333814658224583, 0.013075229711830616, 0.01197855081409216, -0.026281733065843582, -0.015508601441979408, 0.055030133575201035, 0.0981469452381134, 0.053014371544122696, -0.022655433043837547, -0.005499149207025766, -0.026198536157608032, -0.07138033211231232, 0.05079053342342377, -0.047701530158519745, -0.01150052435696125, 0.06745662540197372, -0.023395182564854622, 0.11597856879234314, -0.013707407750189304, 0.034297823905944824, 0.11943324655294418, 0.02510831505060196, -0.040832243859767914, -0.03371517360210419, -0.0625937357544899, -0.1014217808842659, 0.06978002935647964, -0.013361742720007896, -0.0010702847503125668, -0.038578957319259644, 0.02970518171787262, 0.09869701415300369, -0.08651167899370193, 0.05244039371609688, -0.04118208587169647, 0.019613660871982574, 0.08063243329524994, -0.0006207230035215616, 0.019568242132663727, 0.023752359673380852, -0.020041238516569138, 0.04002029076218605, -0.012194756418466568, 0.09369789808988571, -0.06467410922050476, 0.01886490359902382, 0.03289731591939926, -5.782483469829458e-8, -0.09960387647151947, -0.00501598184928298, -0.07984773069620132, 0.01821783371269703, 0.028521807864308357, 0.019315337762236595, 0.04323713108897209, -0.07666665315628052, 0.011214779689908028, 0.0014848116552457213, 0.02644173987209797, -0.028901519253849983, -0.02445356547832489, -0.1371043473482132, 0.013153785839676857, -0.09522309899330139, -0.018055861815810204, -0.013835746794939041, -0.022637177258729935, -0.07307793200016022, 0.014888615347445011, -0.04660515487194061, -0.006192284636199474, 0.11254749447107315, -0.03887489438056946, 0.0030512285884469748, 0.03397340700030327, 0.08933936059474945, -0.04643990471959114, 0.0051522874273359776, -0.0031988820992410183, 0.0015531830722466111, 0.00042364979162812233, -0.013015778735280037, 0.04975545033812523, 0.12157007306814194, -0.04499812796711922, 0.0401679202914238, 0.05738304182887077, 0.07669065147638321, -0.05414489284157753, 0.07985028624534607, 0.00005382868766901083, 0.04086952283978462, 0.06080455705523491, 0.0672912746667862, -0.010858286172151566, 0.04334069788455963, -0.0722433403134346, -0.024947838857769966, -0.027927646413445473, -0.023373154923319817, -0.040181200951337814, 0.0003887104394380003, -0.09594915807247162, -0.0861346572637558, -0.0073159076273441315, -0.018234437331557274, -0.05331479012966156, -0.014125249348580837, 0.08232509344816208, 0.024598894640803337, 0.038898762315511703, 0.013811936601996422 ]
-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 this example, run: ```bash openssl pkcs12 -certpbe AES-256-CBC -export -out server-cert.pem \ -inkey client-key.pem -in client-cert.pem ``` ## `tls.connect(path[, options][, callback])` \* `path` {string} Default value for `options.path`. \* `options` {Object} See [`tls.connect()`][]. \* `callback` {Function} See [`tls.connect()`][]. \* Returns: {tls.TLSSocket} Same as [`tls.connect()`][] except that `path` can be provided as an argument instead of an option. A path option, if specified, will take precedence over the path argument. ## `tls.connect(port[, host][, options][, callback])` \* `port` {number} Default value for `options.port`. \* `host` {string} Default value for `options.host`. \* `options` {Object} See [`tls.connect()`][]. \* `callback` {Function} See [`tls.connect()`][]. \* Returns: {tls.TLSSocket} Same as [`tls.connect()`][] except that `port` and `host` can be provided as arguments instead of options. A port or host option, if specified, will take precedence over any port or host argument. ## `tls.createSecureContext([options])` \* `options` {Object} \* `allowPartialTrustChain` {boolean} Treat intermediate (non-self-signed) certificates in the trust CA certificate list as trusted. \* `ca` {string|string\[]|Buffer|Buffer\[]} Optionally override the trusted CA certificates. If not specified, the CA certificates trusted by default are the same as the ones returned by [`tls.getCACertificates()`][] using the `default` type. If specified, the default list would be completely replaced (instead of being concatenated) by the certificates in the `ca` option. Users need to concatenate manually if they wish to add additional certificates instead of completely overriding the default. The value can be a string or `Buffer`, or an `Array` of strings and/or `Buffer`s. Any string or `Buffer` can contain multiple PEM CAs concatenated together. The peer's certificate must be chainable to a CA trusted by the server for the connection to be authenticated. When using certificates that are not chainable to a well-known CA, the certificate's CA must be explicitly specified as a trusted or the connection will fail to authenticate. If the peer uses a certificate that doesn't match or chain to one of the default CAs, use the `ca` option to provide a CA certificate that the peer's certificate can match or chain to. For self-signed certificates, the certificate is its own CA, and must be provided. For PEM encoded certificates, supported types are "TRUSTED CERTIFICATE", "X509 CERTIFICATE", and "CERTIFICATE". \* `cert` {string|string\[]|Buffer|Buffer\[]} Cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private `key`, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see `ca`). When providing multiple cert chains, they do not have to be in the same order as their private keys in `key`. If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail. \* `sigalgs` {string} Colon-separated list of supported signature algorithms. The list can contain digest algorithms (`SHA256`, `MD5` etc.), public key algorithms (`RSA-PSS`, `ECDSA` etc.), combination of both (e.g 'RSA+SHA384') or TLS v1.3 scheme names (e.g. `rsa\_pss\_pss\_sha512`). See [OpenSSL man pages](https://www.openssl.org/docs/man1.1.1/man3/SSL\_CTX\_set1\_sigalgs\_list.html) for more info. \* `ciphers` {string} Cipher suite specification, 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 certificate. \*\*Deprecated.\*\* \* `crl` {string|string\[]|Buffer|Buffer\[]}
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.01955360732972622, 0.017733363434672356, -0.030252596363425255, -0.08061560988426208, 0.006241913884878159, 0.1041012704372406, -0.05430850759148598, -0.02596817910671234, -0.05260409787297249, 0.05927175283432007, -0.037966933101415634, -0.08053240180015564, -0.06476735323667526, 0.06420894712209702, 0.08107277750968933, -0.013721348717808723, 0.06485487520694733, 0.06854519993066788, -0.026148533448576927, -0.06083327531814575, -0.016670076176524162, -0.027096476405858994, 0.09859253466129303, 0.03924277797341347, 0.04127220809459686, -0.026501737534999847, -0.0060891807079315186, 0.13034676015377045, -0.04113175719976425, -0.04879024997353554, 0.0051632714457809925, 0.04815533757209778, 0.025274867191910744, -0.04220014065504074, -0.052573271095752716, -0.07731824368238449, -0.04379293695092201, -0.02562210150063038, 0.011214870028197765, -0.04762444645166397, 0.013379998505115509, -0.026155957952141762, 0.0022771917283535004, -0.08677507191896439, 0.03651425987482071, 0.016672402620315552, 0.020275970920920372, 0.021094337105751038, 0.02536090463399887, -0.009638984687626362, 0.01895199343562126, -0.07329383492469788, 0.03769766911864281, -0.0050849635154008865, -0.0033455148804932833, -0.04251423478126526, 0.0765276774764061, 0.0009050802909769118, -0.014776177704334259, -0.007947930134832859, -0.04539300501346588, -0.05053139105439186, -0.01907048001885414, -0.035321883857250214, -0.028323423117399216, -0.10284698009490967, 0.050004299730062485, -0.032302599400281906, -0.09401915222406387, -0.1020871177315712, 0.06676866859197617, -0.04884214326739311, 0.05055326595902443, 0.0390007384121418, -0.010655122809112072, -0.04906463623046875, 0.06034712493419647, 0.04478349909186363, 0.015761593356728554, -0.06246962025761604, 0.02261924557387829, 0.0677293986082077, 0.050678104162216187, 0.03651295229792595, 0.011180366389453411, 0.00703832134604454, -0.060118936002254486, -0.060305990278720856, -0.012314734049141407, -0.017803901806473732, -0.08716709166765213, -0.02497187815606594, 0.04811686649918556, -0.03754385560750961, 0.026271313428878784, 0.052790820598602295, 0.03474311903119087, 0.0030432012863457203, 0.018003474920988083, 0.012893417850136757, -0.026067040860652924, -0.020023232325911522, 0.12978355586528778, -0.03934907168149948, 0.012533110566437244, 0.056407954543828964, 0.08568096160888672, 0.03906033933162689, -0.019028840586543083, -0.09154339879751205, 0.08302786201238632, -0.03310844302177429, -0.014218288473784924, 0.060587216168642044, 1.2639870349201278e-33, 0.07713767886161804, -0.023332590237259865, 0.0027667880058288574, 0.0350603386759758, 0.049446962773799896, 0.057639311999082565, 0.07836737483739853, -0.027110476046800613, -0.08194620907306671, 0.026788467541337013, -0.03578547388315201, -0.014158478006720543, -0.03644649684429169, 0.00981662143021822, 0.013493649661540985, -0.02774205431342125, -0.0012316672364249825, -0.03832300379872322, 0.07969782501459122, 0.02169780619442463, -0.023536935448646545, -0.04224183037877083, 0.047159455716609955, 0.01966256834566593, -0.003968989476561546, 0.07297652214765549, 0.03307686001062393, -0.006049789488315582, -0.04282654449343681, -0.025002483278512955, 0.03808433189988136, -0.003926918841898441, 0.0051564243622124195, -0.038884807378053665, 0.022696882486343384, -0.0320318229496479, 0.05578704923391342, 0.07058827579021454, -0.06724833697080612, -0.0013870816910639405, 0.05662015080451965, -0.030980784446001053, -0.036029621958732605, 0.08323407918214798, -0.02090112864971161, 0.008674565702676773, -0.07229001075029373, -0.05111036077141762, 0.1294083297252655, 0.02656814642250538, -0.038414809852838516, -0.019915064796805382, -0.03594566136598587, -0.058347299695014954, 0.050220150500535965, -0.06241864338517189, -0.033557381480932236, 0.06221862882375717, -0.10607362538576126, -0.10321401804685593, -0.008397131226956844, -0.006470289081335068, -0.021295461803674698, -0.09128928929567337, 0.12139331549406052, 0.024299338459968567, -0.06539301574230194, 0.02656460553407669, -0.09957189112901688, -0.015062849968671799, -0.023885009810328484, 0.07206369936466217, -0.0070900279097259045, 0.008472444489598274, 0.016882454976439476, 0.08129910379648209, -0.015133922919631004, 0.052505336701869965, 0.0541650727391243, -0.05773036926984787, 0.028824636712670326, 0.07999011129140854, -0.004896902479231358, 0.002175213536247611, 0.076071597635746, 0.05430370196700096, -0.006145322695374489, 0.083059161901474, 0.006057493854314089, 0.01679901033639908, -0.029658658429980278, 0.015185278840363026, 0.05784054100513458, -0.020679526031017303, -0.08394733816385269, -3.536925115722011e-33, -0.018069082871079445, -0.03225018084049225, -0.04238532483577728, 0.08830354362726212, 0.040160953998565674, -0.085433229804039, -0.051848821341991425, 0.022788112983107567, -0.020592723041772842, 0.029960349202156067, -0.0017867226852104068, -0.04468407481908798, 0.12875567376613617, -0.04178226739168167, -0.021010873839259148, -0.06510898470878601, -0.06906963884830475, 0.08710899204015732, -0.015321898274123669, -0.06756125390529633, -0.04341607168316841, 0.006781676784157753, 0.08335454016923904, 0.047967713326215744, -0.0038386990781873465, 0.03992241248488426, 0.05360516905784607, 0.03386857733130455, -0.11193270236253738, -0.03475073352456093, -0.007762385066598654, 0.030826028436422348, 0.01745835319161415, 0.09720273315906525, -0.12190458923578262, -0.00125772668980062, 0.014394109137356281, 0.012785966508090496, 0.11102597415447235, 0.03626555576920509, 0.07419585436582565, -0.09360099583864212, -0.05912281200289726, -0.04204891622066498, 0.017560362815856934, 0.0121023403480649, 0.05289005860686302, 0.0437174066901207, -0.014073303900659084, 0.02112649567425251, 0.011664645746350288, 0.03270652890205383, -0.023999083787202835, -0.014000399969518185, 0.04243702068924904, 0.013330928049981594, -0.01919236220419407, 0.015498884953558445, 0.028195058926939964, -0.05816753953695297, 0.031032506376504898, -0.05697188898921013, 0.017571354284882545, 0.03193078562617302, -0.02976536564528942, 0.011908339336514473, -0.08203258365392685, 0.0005746982642449439, 0.020907169207930565, -0.005915131885558367, -0.04568064585328102, -0.021689176559448242, -0.08105252683162689, -0.029879923909902573, 0.07334241271018982, 0.017790572717785835, -0.07581473886966705, 0.015092981979250908, 0.08448000252246857, 0.022167028859257698, -0.025977743789553642, 0.06085308641195297, -0.04619137942790985, 0.00043432414531707764, 0.06988153606653214, -0.021044669672846794, 0.026362154632806778, 0.016749663278460503, 0.00898172240704298, -0.02483336068689823, -0.010576995089650154, 0.1043526828289032, 0.0012526778737083077, -0.0000071079439294408076, 0.12274845689535141, -4.8954110098975434e-8, -0.001149391639046371, 0.005490942858159542, -0.10397446155548096, 0.05061119794845581, 0.00947904959321022, 0.017068423330783844, -0.004442452918738127, -0.05833030119538307, 0.030331257730722427, -0.012738833203911781, -0.08028899878263474, -0.0894610807299614, -0.008044254034757614, 0.030953949317336082, 0.010622079484164715, 0.04110307991504669, -0.029679248109459877, 0.0028599868528544903, 0.03388722240924835, -0.06789875775575638, 0.0384381003677845, -0.10418551415205002, 0.005347869824618101, 0.1047801822423935, -0.029197819530963898, -0.04195651412010193, 0.02751103788614273, 0.028752243146300316, -0.049105484038591385, -0.0321141742169857, -0.10023820400238037, -0.08216168731451035, -0.015016749501228333, -0.014001255854964256, 0.04648171737790108, 0.03816142678260803, -0.09673628956079483, -0.026165427640080452, 0.03472401574254036, 0.09156990796327591, 0.012854955159127712, -0.037712108343839645, -0.05239949747920036, 0.020397208631038666, -0.1126149594783783, 0.024006841704249382, 0.011752092279493809, 0.06823960691690445, -0.040647588670253754, 0.05566641688346863, 0.03081100434064865, -0.07057400047779083, 0.024487636983394623, -0.12309214472770691, -0.09538950026035309, 0.05080902576446533, 0.013339127413928509, 0.006808638572692871, -0.017787998542189598, -0.05434992536902428, -0.007514628581702709, 0.03695003315806389, 0.010618127882480621, -0.021514825522899628 ]
-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 certificate. \*\*Deprecated.\*\* \* `crl` {string|string\[]|Buffer|Buffer\[]} PEM formatted CRLs (Certificate Revocation Lists). \* `dhparam` {string|Buffer} `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE [perfect forward secrecy][]. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. [ECDHE][]-based [perfect forward secrecy][] will still be available. \* `ecdhCurve` {string} A string describing a named curve or a colon separated list of curve NIDs or names, for example `P-521:P-384:P-256`, to use for ECDH key agreement. Set to `auto` to select the curve automatically. Use [`crypto.getCurves()`][] to obtain a list of available curve names. On recent releases, `openssl ecparam -list\_curves` will also display the name and description of each available elliptic curve. \*\*Default:\*\* [`tls.DEFAULT\_ECDH\_CURVE`][]. \* `honorCipherOrder` {boolean} Attempt to use the server's cipher suite preferences instead of the client's. When `true`, causes `SSL\_OP\_CIPHER\_SERVER\_PREFERENCE` to be set in `secureOptions`, see [OpenSSL Options][] for more information. \* `key` {string|string\[]|Buffer|Buffer\[]|Object\[]} Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with `options.passphrase`. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form `{pem: [, passphrase: ]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted keys will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not. \* `privateKeyEngine` {string} Name of an OpenSSL engine to get private key from. Should be used together with `privateKeyIdentifier`. \*\*Deprecated.\*\* \* `privateKeyIdentifier` {string} Identifier of a private key managed by an OpenSSL engine. Should be used together with `privateKeyEngine`. Should not be set together with `key`, because both options define a private key in different ways. \*\*Deprecated.\*\* \* `maxVersion` {string} Optionally set the maximum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other. \*\*Default:\*\* [`tls.DEFAULT\_MAX\_VERSION`][]. \* `minVersion` {string} Optionally set the minimum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other. Avoid setting to less than TLSv1.2, but it may be required for interoperability. Versions before TLSv1.2 may require downgrading the [OpenSSL Security Level][]. \*\*Default:\*\* [`tls.DEFAULT\_MIN\_VERSION`][]. \* `passphrase` {string} Shared passphrase used for a single private key and/or a PFX. \* `pfx` {string|string\[]|Buffer|Buffer\[]|Object\[]} PFX or PKCS12 encoded private key and certificate chain. `pfx` is an alternative to providing `key` and `cert` individually. PFX is usually encrypted, if it is, `passphrase` will be used to decrypt it. Multiple PFX can be provided either as an array of unencrypted PFX buffers, or an array of objects in the form `{buf: [, passphrase: ]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted PFX will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not. \* `secureOptions` {number} Optionally affect the OpenSSL protocol behavior, which is not usually necessary. This should be used carefully if at all! Value is a numeric bitmask of the `SSL\_OP\_\*` options 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 as [SSL\\_METHODS][SSL\_METHODS], use
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.017669307067990303, 0.030319159850478172, -0.04631425440311432, -0.038916461169719696, 0.04449954628944397, 0.06704947352409363, -0.07859811931848526, 0.0006144149811007082, 0.027678845450282097, -0.020393000915646553, 0.012773958034813404, -0.06172100082039833, -0.002554292092099786, -0.003513435833156109, 0.10246924310922623, -0.07599912583827972, -0.006752201821655035, 0.05314556509256363, -0.06206445023417473, 0.0028600837104022503, 0.04517726972699165, 0.035321492701768875, 0.07073628902435303, 0.011241821572184563, 0.042862266302108765, 0.07778307795524597, -0.03107300028204918, 0.062209032475948334, -0.09654990583658218, -0.042895495891571045, 0.006642153486609459, -0.01979232020676136, 0.022192522883415222, -0.024375876411795616, -0.010823400691151619, -0.10870500653982162, 0.0051461560651659966, 0.028578240424394608, -0.04338859021663666, -0.03777623921632767, 0.04751244932413101, 0.010241693817079067, -0.03605625033378601, -0.07235501706600189, 0.03869936615228653, 0.002068309346213937, -0.010942034423351288, -0.037626031786203384, 0.05433117225766182, -0.04568894952535629, 0.07076994329690933, -0.11809299886226654, 0.015125906094908714, 0.06422565877437592, -0.03444882482290268, -0.025657664984464645, 0.04752042144536972, -0.05673777312040329, -0.011343148536980152, -0.007311750203371048, -0.008916983380913734, -0.022407960146665573, 0.0495343841612339, -0.06168258190155029, -0.054524071514606476, -0.0869748666882515, -0.057866159826517105, 0.05398477986454964, -0.010770843364298344, -0.0207732692360878, 0.0336131826043129, 0.011897522956132889, 0.03709312528371811, -0.049776989966630936, -0.007822497747838497, 0.06250614672899246, 0.011382055468857288, 0.08345738053321838, -0.07608184963464737, -0.08554650843143463, 0.03995677828788757, 0.045678265392780304, 0.024562712758779526, 0.05189090222120285, -0.052645646035671234, -0.05364569276571274, -0.0064781103283166885, -0.009201736189424992, 0.020479511469602585, 0.01893996261060238, -0.056941285729408264, -0.00760099571198225, 0.07132169604301453, 0.014974337071180344, 0.009317660704255104, 0.017687691375613213, 0.01482557225972414, -0.05601555481553078, -0.010855326429009438, 0.026435816660523415, -0.16232097148895264, 0.022172419354319572, 0.0025373250246047974, -0.09582534432411194, 0.005220654420554638, 0.027516711503267288, -0.006228943821042776, -0.01979408599436283, 0.03220187500119209, -0.01066366396844387, 0.0471855029463768, -0.04520906135439873, -0.01123095117509365, 0.02450321987271309, 7.347067444669769e-33, -0.017018647864460945, 0.03233163803815842, -0.012729909271001816, 0.03700187802314758, -0.03764522075653076, 0.019880084320902824, 0.031048299744725227, 0.04955758526921272, -0.06211211159825325, -0.02526799403131008, 0.005733507219702005, -0.056947894394397736, 0.0059083616361021996, -0.03456025570631027, 0.006733854301273823, 0.0009011045331135392, 0.05058322846889496, -0.006541079841554165, 0.09617912769317627, -0.004862193483859301, -0.01611054129898548, 0.017825035378336906, 0.07271228730678558, -0.005296030081808567, -0.030658144503831863, 0.020447606220841408, 0.05156281590461731, -0.025696780532598495, 0.02551371045410633, 0.007503927685320377, 0.06305033713579178, -0.03676222637295723, 0.02718101441860199, -0.06940007209777832, 0.0069743068888783455, 0.04564748331904411, -0.03005032427608967, 0.019930008798837662, -0.04836718738079071, -0.04643828421831131, 0.013679509982466698, 0.019794128835201263, 0.01827608048915863, 0.0486152246594429, 0.013534149155020714, 0.000632886600214988, 0.01109540555626154, 0.01931951381266117, 0.06449521332979202, -0.024281535297632217, 0.0010993368923664093, -0.01132945716381073, -0.10672058910131454, -0.06915632635354996, -0.014924848452210426, -0.06672871112823486, 0.0051825945265591145, 0.04131462052464485, -0.09686189889907837, -0.017099114134907722, -0.013883054256439209, 0.05536210909485817, -0.04253282770514488, -0.11612170934677124, 0.05289192870259285, 0.034037984907627106, -0.008290166966617107, -0.03919108584523201, -0.10711343586444855, 0.006568937096744776, -0.08187616616487503, 0.04316077381372452, 0.07017209380865097, 0.0680171325802803, 0.029960298910737038, -0.020593538880348206, 0.00952739454805851, 0.04348386824131012, 0.10201116651296616, -0.09281861782073975, -0.03521814942359924, 0.039994996041059494, 0.08108142018318176, 0.04210922494530678, 0.03600239381194115, -0.007983016781508923, 0.05717049911618233, 0.019185101613402367, -0.03197072073817253, 0.01814212277531624, 0.013694919645786285, -0.055296123027801514, -0.022790899500250816, 0.038154806941747665, -0.02401365153491497, -8.384785776052022e-33, -0.0010168604785576463, -0.042924243956804276, -0.055931225419044495, 0.05079846456646919, 0.01782108098268509, -0.003701824927702546, -0.037669017910957336, 0.05240863561630249, 0.05269079655408859, 0.003497789613902569, 0.043478112667798996, -0.03116065263748169, 0.0918688178062439, -0.06750909239053726, 0.10401248186826706, -0.07885246723890305, -0.16976922750473022, 0.058500152081251144, 0.000059966707340208814, 0.04620353505015373, 0.057538952678442, 0.025056231766939163, -0.0031151806470006704, 0.07006778568029404, 0.12059824913740158, 0.034856174141168594, 0.017217326909303665, 0.017308538779616356, 0.05743298679590225, -0.0056707169860601425, -0.04371306300163269, 0.05105484277009964, -0.016228308901190758, 0.048510100692510605, -0.08845129609107971, -0.00896900799125433, -0.03206498920917511, 0.014013820327818394, 0.028415801003575325, 0.014996879734098911, 0.07604697346687317, 0.023961663246154785, -0.0010822550393640995, -0.01573829911649227, 0.0065715075470507145, 0.025577286258339882, 0.015396113507449627, 0.08146250247955322, 0.047477174550294876, 0.005993896629661322, -0.011081420816481113, -0.02088058367371559, -0.08761003613471985, -0.005653458181768656, 0.07231978327035904, 0.07521948963403702, -0.07932859659194946, -0.0005026368889957666, 0.02634645812213421, -0.13051798939704895, -0.041285231709480286, -0.0042425901629030704, 0.07568836957216263, 0.029135731980204582, 0.0012261050287634134, -0.008809701539576054, -0.09630458056926727, -0.022936079651117325, 0.009537308476865292, -0.026766307651996613, -0.02396136336028576, -0.045647669583559036, -0.05406007170677185, -0.12237004190683365, 0.09358049184083939, -0.08120346814393997, -0.03645467385649681, 0.013762859627604485, -0.001610569073818624, 0.08215310424566269, 0.05166276916861534, 0.07654662430286407, -0.05055186152458191, 0.08004532754421234, 0.10142482072114944, -0.0670764371752739, 0.044585417956113815, 0.03369545936584473, -0.04853946343064308, 0.017653189599514008, 0.023802511394023895, 0.1163797602057457, 0.04358519986271858, 0.09995327144861221, 0.1008613109588623, -5.6001958625984116e-8, -0.03834368288516998, -0.009847546927630901, -0.04611742123961449, -0.003136217128485441, 0.04510120302438736, -0.013323251157999039, 0.004691697657108307, -0.0549243688583374, -0.04823172837495804, -0.012664536014199257, 0.04698332026600838, -0.03511090204119682, -0.01614387147128582, -0.027765100821852684, -0.09514592587947845, 0.03920329734683037, -0.101945661008358, -0.0113932890817523, -0.009615587070584297, -0.039760835468769073, 0.02593659795820713, -0.09157046675682068, -0.04488098621368408, 0.011886801570653915, 0.040579989552497864, 0.031047217547893524, 0.0021212613210082054, -0.02064850553870201, -0.07859873026609421, 0.03936471790075302, 0.010005462914705276, -0.0816085934638977, 0.04871324077248573, -0.06252002716064453, 0.0066758920438587666, 0.08409591019153595, -0.09756751358509064, -0.009547711350023746, 0.05471848323941231, 0.15078793466091156, -0.004268581047654152, 0.013237370178103447, -0.01377723179757595, 0.05567196011543274, -0.03621967136859894, -0.015055336989462376, 0.016883108764886856, 0.02968146838247776, -0.058645810931921005, 0.02519214153289795, -0.012425321154296398, -0.09588980674743652, 0.02881784178316593, -0.08050533384084702, -0.09609386324882507, 0.037246014922857285, 0.014465644024312496, -0.04905950278043747, -0.004137772135436535, -0.026006042957305908, 0.06073027104139328, -0.04349420592188835, 0.09387175738811493, 0.023879243060946465 ]
-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 as [SSL\\_METHODS][SSL\_METHODS], use the function names as strings. For example, use `'TLSv1\_1\_method'` to force TLS version 1.1, or `'TLS\_method'` to allow any TLS protocol version up to TLSv1.3. It is not recommended to use TLS versions less than 1.2, but it may be required for interoperability. \*\*Default:\*\* none, see `minVersion`. \* `sessionIdContext` {string} Opaque identifier used by servers to ensure session state is not shared between applications. Unused by clients. \* `ticketKeys` {Buffer} 48-bytes of cryptographically strong pseudorandom data. See [Session Resumption][] for more information. \* `sessionTimeout` {number} The number of seconds after which a TLS session created by the server will no longer be resumable. See [Session Resumption][] for more information. \*\*Default:\*\* `300`. [`tls.createServer()`][] sets the default value of the `honorCipherOrder` option to `true`, other APIs that create secure contexts leave it unset. [`tls.createServer()`][] uses a 128 bit truncated SHA1 hash value generated from `process.argv` as the default value of the `sessionIdContext` option, other APIs that create secure contexts have no default value. The `tls.createSecureContext()` method creates a `SecureContext` object. It is usable as an argument to several `tls` APIs, such as [`server.addContext()`][], but has no public methods. The [`tls.Server`][] constructor and the [`tls.createServer()`][] method do not support the `secureContext` option. A key is \_required\_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of CAs][]. Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'` option. When set to `'auto'`, well-known DHE parameters of sufficient strength will be selected automatically. Otherwise, if necessary, `openssl dhparam` can be used to create custom parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger for stronger security. ## `tls.createServer([options][, secureConnectionListener])` \* `options` {Object} \* `ALPNProtocols` {string\[]|Buffer|TypedArray|DataView} An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['hello', 'world']`. (Protocols should be ordered by their priority.) \* `ALPNCallback` {Function} If set, this will be called when a client opens a connection using the ALPN extension. One argument will be passed to the callback: an object containing `servername` and `protocols` fields, respectively containing the server name from the SNI extension (if any) and an array of ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, which will be returned to the client as the selected ALPN protocol, or `undefined`, to reject the connection with a fatal alert. If a string is returned that does not match one of the client's ALPN protocols, an error will be thrown. This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. \* `clientCertEngine` {string} Name of an 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. \*\*Default:\*\* `false`. \* `handshakeTimeout` {number} Abort the
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.03722943365573883, 0.0420801043510437, -0.06258177757263184, 0.01774027571082115, -0.026952315121889114, 0.00011988609185209498, -0.001047809491865337, 0.022204283624887466, -0.03664673864841461, 0.00573517382144928, 0.04786204919219017, -0.029999203979969025, -0.0721529871225357, -0.08452194929122925, 0.08068455755710602, -0.01250987034291029, 0.040617868304252625, -0.009881504811346531, -0.01384906005114317, -0.05593016743659973, -0.01778475008904934, 0.033415887504816055, -0.012023390270769596, 0.012640806846320629, 0.04188143089413643, -0.04482055827975273, 0.0033970025833696127, 0.015412665903568268, -0.06384681165218353, -0.09222256392240524, 0.044087667018175125, -0.06360304355621338, -0.0033974074758589268, -0.023813826963305473, -0.007035295013338327, -0.09254612773656845, -0.010742472484707832, -0.022953543812036514, 0.03972552344202995, 0.027446342632174492, -0.003475319826975465, -0.0747217983007431, -0.054565321654081345, -0.10746676474809647, 0.08684749901294708, -0.013617000542581081, 0.09640167653560638, -0.025371169671416283, -0.010686200112104416, -0.005314497742801905, 0.03435812518000603, -0.10281229019165039, -0.028306707739830017, 0.0037279429379850626, -0.06792015582323074, 0.00624476745724678, 0.05498083680868149, -0.13408182561397552, -0.025949984788894653, -0.002585251582786441, 0.007393952459096909, -0.01953345723450184, 0.02703188918530941, 0.012443103827536106, -0.06155238673090935, -0.027440788224339485, -0.15013062953948975, 0.002097197575494647, -0.10344909876585007, -0.033650901168584824, 0.03462188318371773, -0.05190185457468033, 0.013561634346842766, -0.041981592774391174, -0.025636417791247368, 0.06248340755701065, 0.07724294811487198, 0.052078939974308014, 0.008680983446538448, 0.030684510245919228, 0.027755552902817726, 0.08939945697784424, 0.06777971982955933, -0.016959786415100098, 0.028664108365774155, 0.023303724825382233, 0.015893900766968727, -0.015348076820373535, -0.03831469267606735, 0.06548371911048889, 0.020992331206798553, 0.004374382086098194, 0.065866619348526, 0.03814207762479782, -0.06473160535097122, 0.051860738545656204, -0.018168821930885315, -0.019932322204113007, 0.0333830825984478, -0.019617948681116104, -0.11438877880573273, -0.03956088796257973, 0.033255577087402344, -0.09343849867582321, 0.005681198090314865, 0.048994001001119614, 0.03940557688474655, 0.05811751261353493, -0.06588909775018692, -0.012731409631669521, 0.02583651803433895, -0.035333290696144104, -0.024779556319117546, 0.08461160957813263, 6.764693013125852e-33, 0.03664131090044975, 0.00026525225257501006, -0.053890593349933624, 0.031078772619366646, 0.009349760599434376, 0.07782362401485443, 0.0948946550488472, 0.003872041357681155, -0.08007685840129852, 0.020310521125793457, -0.029983360320329666, -0.07174418121576309, -0.031502675265073776, -0.045181140303611755, 0.043608635663986206, 0.008219728246331215, -0.030016781762242317, 0.010624609887599945, 0.08186749368906021, -0.004525674972683191, 0.019016794860363007, 0.009401815012097359, 0.05903858691453934, -0.023440072312951088, 0.0356944240629673, 0.0015351762995123863, 0.013775147497653961, -0.012856141664087772, 0.040714286267757416, 0.013349410146474838, 0.06634685397148132, -0.01965893618762493, -0.003582780947908759, 0.0009004477178677917, 0.09275650978088379, 0.04708895832300186, 0.026594867929816246, 0.060148585587739944, -0.016474369913339615, 0.013516725040972233, 0.013715825974941254, 0.04662913456559181, 0.005544587969779968, 0.008417709730565548, -0.002063940279185772, -0.029669705778360367, -0.061011891812086105, 0.049994561821222305, 0.02939070574939251, -0.012755860574543476, -0.04057833179831505, 0.0707869604229927, -0.0596458837389946, -0.0533488430082798, 0.04630354791879654, -0.12093440443277359, 0.021621404215693474, 0.07020442187786102, -0.061323489993810654, -0.044682521373033524, -0.1036912277340889, -0.031084716320037842, -0.033062197268009186, -0.10395670682191849, 0.0648486316204071, 0.045873865485191345, -0.05674385651946068, 0.020264605060219765, -0.07012452185153961, -0.06453631073236465, -0.04164932668209076, 0.1447361558675766, 0.031123731285333633, 0.04401649534702301, 0.025310060009360313, 0.009218118153512478, 0.0601985827088356, 0.08254826813936234, 0.11002840101718903, -0.057501379400491714, -0.06070654094219208, 0.06319080293178558, 0.02396664395928383, 0.08409082889556885, -0.07281892001628876, 0.06691934168338776, 0.0013121318770572543, 0.00730929896235466, -0.015482776798307896, -0.03278206288814545, 0.014711553230881691, -0.02655116654932499, 0.022258499637246132, 0.0184299536049366, -0.0520932599902153, -7.647730981619278e-33, 0.012098127976059914, -0.01742430217564106, 0.0393010713160038, 0.06944973766803741, 0.0196306761354208, -0.03152618557214737, -0.018302271142601967, 0.006890176795423031, 0.011074664071202278, -0.00884945597499609, 0.06694170087575912, -0.05117100104689598, 0.0731370821595192, -0.0943276435136795, 0.014343513175845146, -0.078297458589077, -0.09559328109025955, 0.029581617563962936, -0.048433851450681686, -0.0008063784916885197, -0.017655566334724426, 0.017045380547642708, -0.023073239251971245, 0.10768015682697296, 0.08209343254566193, -0.028818927705287933, 0.0438639372587204, -0.011547919362783432, -0.006366012152284384, -0.013011390343308449, 0.02460075356066227, -0.007219607010483742, 0.027475696057081223, -0.013027464970946312, -0.008630850352346897, -0.033319514244794846, 0.006950952112674713, -0.028067661449313164, 0.0502547062933445, 0.01553904265165329, 0.106232650578022, -0.04180257394909859, 0.033861156553030014, -0.07567281275987625, 0.019339917227625847, 0.06354980915784836, -0.014178273268043995, 0.04454007372260094, 0.0017590473871678114, -0.013436956331133842, 0.009222262538969517, -0.0474100299179554, -0.06440535187721252, -0.029310768470168114, 0.12083619832992554, -0.009617178700864315, -0.04359886050224304, 0.04801306501030922, -0.046553436666727066, -0.09378013014793396, 0.03186187893152237, 0.03443656489253044, 0.03418724983930588, 0.08236172795295715, 0.06409093737602234, 0.037255316972732544, -0.14365001022815704, 0.060041412711143494, 0.025938870385289192, 0.055742792785167694, -0.03509019315242767, -0.06863046437501907, -0.025745511054992676, -0.08447635918855667, 0.08202435821294785, -0.06356321275234222, -0.00802510417997837, 0.008745938539505005, 0.07046153396368027, 0.05422217771410942, -0.006919423583894968, 0.05651317536830902, -0.015593590214848518, 0.00847571063786745, 0.10688348114490509, 0.023817412555217743, 0.039549943059682846, 0.057885125279426575, -0.037122733891010284, 0.005514391232281923, -0.0053148879669606686, 0.08799269795417786, -0.05420122295618057, 0.08664547652006149, 0.07512008398771286, -6.025163656886434e-8, 0.06203512102365494, -0.02364758402109146, -0.09791641682386398, 0.016166308894753456, 0.04277289658784866, 0.08856017142534256, -0.048135265707969666, -0.04652835428714752, 0.008990351110696793, 0.0062947990372776985, -0.026728158816695213, -0.0005808049463666975, 0.03752671554684639, -0.09095966815948486, -0.04883284121751785, -0.005232519935816526, -0.14124692976474762, -0.035342052578926086, 0.004346334841102362, -0.10262974351644516, 0.030306149274110794, -0.07630264014005661, -0.027159839868545532, -0.011734851635992527, -0.0030824197456240654, 0.022449005395174026, -0.06302949041128159, 0.06145083159208298, -0.009164130315184593, -0.036275818943977356, -0.040751222521066666, -0.05045671761035919, 0.013223291374742985, -0.011978291906416416, 0.07748375833034515, 0.05491519719362259, -0.1330212503671646, 0.02928348258137703, 0.042704131454229355, 0.09685759991407394, 0.029312776401638985, 0.03444026783108711, -0.0008397055207751691, 0.028210598975419998, -0.052662331610918045, 0.025497917085886, -0.0036760021466761827, 0.05734631046652794, -0.02448132075369358, 0.011368480511009693, -0.07387430965900421, 0.021891603246331215, 0.01135103777050972, 0.020858943462371826, -0.059360940009355545, 0.060548923909664154, 0.01659131795167923, -0.02110777236521244, -0.0056651923805475235, -0.038191646337509155, 0.01478615216910839, -0.0466805137693882, 0.027629980817437172, 0.012369520030915737 ]
-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. \*\*Default:\*\* `false`. \* `handshakeTimeout` {number} Abort the connection if the SSL/TLS handshake does not finish in the specified number of milliseconds. A `'tlsClientError'` is emitted on the `tls.Server` object whenever a handshake times out. \*\*Default:\*\* `120000` (120 seconds). \* `rejectUnauthorized` {boolean} If not `false` the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if `requestCert` is `true`. \*\*Default:\*\* `true`. \* `requestCert` {boolean} If `true` the server will request a certificate from clients that connect and attempt to verify that certificate. \*\*Default:\*\* `false`. \* `sessionTimeout` {number} The number of seconds after which a TLS session created by the server will no longer be resumable. See [Session Resumption][] for more information. \*\*Default:\*\* `300`. \* `SNICallback(servername, callback)` {Function} A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: `servername` and `callback`. `callback` is an error-first callback that takes two optional arguments: `error` and `ctx`. `ctx`, if provided, is a `SecureContext` instance. [`tls.createSecureContext()`][] can be used to get a proper `SecureContext`. If `callback` is called with a falsy `ctx` argument, the default secure context of the server will be used. If `SNICallback` wasn't provided the default callback with high-level API will be used (see below). \* `ticketKeys` {Buffer} 48-bytes of cryptographically strong pseudorandom data. See [Session Resumption][] for more information. \* `pskCallback` {Function} For TLS-PSK negotiation, see [Pre-shared keys][]. \* `pskIdentityHint` {string} optional hint to send to a client to help with selecting the identity during TLS-PSK negotiation. Will be ignored in TLS 1.3. Upon failing to set pskIdentityHint `'tlsClientError'` will be emitted with `'ERR\_TLS\_PSK\_SET\_IDENTITY\_HINT\_FAILED'` code. \* ...: Any [`tls.createSecureContext()`][] option can be provided. For servers, the identity options (`pfx`, `key`/`cert`, or `pskCallback`) are usually required. \* ...: Any [`net.createServer()`][] option can be provided. \* `secureConnectionListener` {Function} \* Returns: {tls.Server} Creates a new [`tls.Server`][]. The `secureConnectionListener`, if provided, is automatically set as a listener for the [`'secureConnection'`][] event. The `ticketKeys` options is automatically shared between `node:cluster` module workers. The following illustrates a simple echo server: ```mjs import { createServer } from 'node:tls'; import { readFileSync } from 'node:fs'; const options = { key: readFileSync('server-key.pem'), cert: readFileSync('server-cert.pem'), // This is necessary only if using client certificate authentication. requestCert: true, // This is necessary only if the client uses a self-signed certificate. ca: [ readFileSync('client-cert.pem') ], }; const server = createServer(options, (socket) => { console.log('server connected', socket.authorized ? 'authorized' : 'unauthorized'); socket.write('welcome!\n'); socket.setEncoding('utf8'); socket.pipe(socket); }); server.listen(8000, () => { console.log('server bound'); }); ``` ```cjs const { createServer } = require('node:tls'); const { readFileSync } = require('node:fs'); const options = { key: readFileSync('server-key.pem'), cert: readFileSync('server-cert.pem'), // This is necessary only if using client certificate authentication. requestCert: true, // This is necessary only if the client uses a self-signed certificate. ca: [ readFileSync('client-cert.pem') ], }; const server = createServer(options, (socket) => { console.log('server connected', socket.authorized ? 'authorized' : 'unauthorized'); socket.write('welcome!\n'); socket.setEncoding('utf8'); socket.pipe(socket); }); server.listen(8000, () => { console.log('server bound'); }); ``` To generate the certificate and key for this example, run: ```bash 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 ``` The server can be tested by connecting to it using the
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.0421796478331089, -0.02207569032907486, -0.04141092300415039, -0.027915965765714645, 0.041731592267751694, 0.029754143208265305, -0.06661233305931091, -0.03742872551083565, -0.06175156310200691, -0.06691275537014008, 0.015310864895582199, -0.02132520265877247, -0.1006300151348114, 0.003390377154573798, -0.014897298999130726, -0.0056192753836512566, 0.07936608791351318, -0.052146878093481064, -0.03160126507282257, -0.08059415966272354, 0.014542605727910995, -0.06754754483699799, 0.0029819414485245943, 0.10130771994590759, 0.10724528133869171, -0.00804638396948576, -0.006180296652019024, 0.049277231097221375, -0.08767487108707428, -0.06690932810306549, 0.05106137692928314, -0.004853339865803719, -0.003987790551036596, -0.016738593578338623, -0.06816285848617554, -0.13696832954883575, 0.015017927624285221, -0.08294084668159485, 0.005652732215821743, 0.005020970944315195, 0.06675183027982712, -0.05427471548318863, -0.0004053851298522204, 0.0019644482526928186, 0.021975906565785408, -0.040166161954402924, 0.05563255399465561, 0.012949259020388126, 0.011213069781661034, -0.024971183389425278, 0.03935600817203522, -0.02571261301636696, 0.06748373806476593, 0.032835084944963455, -0.0008181796292774379, 0.051978036761283875, 0.12153185158967972, -0.010914799757301807, 0.0003770324110519141, -0.0104373162612319, -0.04218677058815956, -0.040571101009845734, -0.015562784858047962, -0.06066320836544037, -0.05853616073727608, -0.03382183238863945, -0.059521958231925964, 0.015077742747962475, -0.018506081774830818, -0.09859579801559448, 0.01919102668762207, -0.04554233327507973, 0.05272306874394417, 0.013975202105939388, 0.03054913692176342, 0.0107012540102005, 0.057765211910009384, 0.028467020019888878, 0.0177497249096632, -0.10482891649007797, 0.02180367521941662, 0.05512601137161255, 0.05614573508501053, 0.05930519104003906, 0.003616846865043044, -0.011996624991297722, -0.05867036059498787, 0.03766597434878349, -0.02787034399807453, 0.0003570535918697715, -0.007900944910943508, -0.03367387875914574, 0.07197634130716324, -0.0017762853531166911, -0.014513829723000526, 0.038109567016363144, 0.016582289710640907, 0.04879406839609146, -0.020751645788550377, 0.04495934769511223, -0.10662467777729034, -0.02370544709265232, 0.1059311106801033, -0.01002622302621603, 0.03063078038394451, 0.03376895561814308, 0.06348418444395065, 0.05006256699562073, 0.04656778275966644, 0.027226215228438377, -0.022257592529058456, 0.04279613494873047, 0.025407610461115837, 0.07514218986034393, 9.768494706551492e-33, 0.040254589170217514, -0.007830304093658924, -0.026226254180073738, 0.07745488733053207, -0.023034123703837395, 0.020128712058067322, 0.03175799176096916, -0.006566550116986036, -0.048517338931560516, 0.04042143002152443, -0.003856050316244364, 0.0019129025749862194, -0.07586707174777985, -0.06146572530269623, 0.011520974338054657, -0.014114271849393845, 0.0475936122238636, -0.014940012246370316, 0.052749913185834885, 0.03728428855538368, 0.01982037164270878, -0.0960228219628334, 0.03931508585810661, 0.020377613604068756, 0.04449508339166641, 0.03700589761137962, -0.006649118848145008, 0.057684410363435745, -0.02581842429935932, 0.0010964388493448496, 0.04166172817349434, 0.009753280319273472, -0.021686771884560585, -0.021300625056028366, 0.07781156152486801, -0.02753198891878128, 0.0011966543970629573, 0.004138214513659477, 0.041824787855148315, -0.028394360095262527, 0.0004645682929549366, -0.011031021364033222, -0.0376967154443264, 0.07673175632953644, -0.018104104325175285, -0.03701232373714447, -0.12383238226175308, -0.01197641622275114, 0.0804855078458786, 0.01758069358766079, -0.0065821497701108456, 0.03217781335115433, -0.06098197400569916, -0.0564010888338089, 0.04329986125230789, -0.0380256287753582, -0.010811218991875648, 0.05991722270846367, -0.11385452002286911, 0.015022446401417255, 0.0005392379825934768, -0.0608367957174778, -0.0812055841088295, -0.0859060138463974, 0.055319495499134064, 0.05619025230407715, -0.08080551028251648, 0.016396284103393555, -0.11227698624134064, -0.026654042303562164, -0.07505082339048386, 0.09112465381622314, 0.039457157254219055, 0.03188866004347801, 0.00032153588836081326, -0.04323095828294754, 0.017562979832291603, 0.059437621384859085, 0.08443790674209595, -0.08512120693922043, 0.022720150649547577, 0.04544870927929878, 0.030422238633036613, 0.004974860232323408, 0.01186157763004303, 0.07306073606014252, 0.017525477334856987, -0.018738506361842155, -0.1003136932849884, 0.012211750261485577, -0.025777438655495644, 0.02862207032740116, 0.04914059117436409, 0.02681070566177368, -0.03634405508637428, -1.0002033107965233e-32, 0.010416615754365921, -0.10468932241201401, 0.029653720557689667, 0.08877448737621307, 0.020751450210809708, -0.06618666648864746, -0.06926651298999786, 0.10221457481384277, -0.0024750488810241222, 0.015932653099298477, 0.0836389809846878, -0.02057824097573757, 0.04143918305635452, -0.022584667429327965, -0.03748343884944916, -0.050534896552562714, -0.0076889400370419025, 0.016294565051794052, -0.05518556386232376, 0.003840874880552292, 0.04755398631095886, -0.07693469524383545, 0.07403784990310669, 0.0014243791811168194, 0.021128952503204346, 0.010474739596247673, -0.009091698564589024, -0.01736026629805565, -0.08927539736032486, -0.03467505797743797, 0.07636484503746033, 0.0267026387155056, 0.02999195270240307, 0.030590377748012543, -0.06428134441375732, 0.0013634851202368736, 0.013284904882311821, 0.035460248589515686, 0.04337654635310173, 0.028529858216643333, 0.10351166874170303, -0.024436496198177338, -0.026299068704247475, -0.021353241056203842, 0.006952258758246899, 0.048715487122535706, -0.046354010701179504, -0.005583093501627445, -0.021431637927889824, -0.006741540040820837, 0.07733827084302902, 0.0096881790086627, -0.008569205179810524, 0.01894965022802353, 0.0874495580792427, 0.046983812004327774, -0.0009078584844246507, -0.014514262787997723, 0.02496219426393509, -0.06950709223747253, 0.03701336681842804, -0.0458938404917717, -0.02426319010555744, 0.04936354607343674, 0.054076239466667175, 0.05825290083885193, -0.0711536630988121, 0.06379463523626328, 0.06518661230802536, 0.03888653218746185, 0.011374070309102535, -0.031515076756477356, -0.13036948442459106, -0.08206777274608612, 0.07612926512956619, -0.046863898634910583, -0.03187713027000427, -0.09168564528226852, 0.028918040916323662, 0.0300692617893219, -0.023797620087862015, 0.022106043994426727, -0.05601845309138298, -0.0427306666970253, 0.07791749387979507, 0.022697875276207924, -0.053583286702632904, 0.02688671089708805, 0.0619078129529953, 0.04313978925347328, -0.03301215171813965, 0.09553644061088562, -0.06340029090642929, -0.001205849228426814, 0.048351746052503586, -6.303262267692844e-8, -0.008342892862856388, -0.024007240310311317, -0.05375295132398605, -0.04671499878168106, 0.04267164692282677, 0.05686676874756813, 0.023884626105427742, -0.050249624997377396, -0.016177458688616753, 0.00887156929820776, -0.0403578095138073, -0.017040899023413658, 0.012266695499420166, -0.014635836705565453, -0.01637975312769413, -0.012336264364421368, -0.03484800085425377, -0.06737641990184784, -0.0016773557290434837, -0.12441813945770264, 0.03170479089021683, -0.05603107437491417, -0.03453627973794937, 0.1242576315999031, -0.07747592777013779, -0.021738456562161446, 0.05891420692205429, 0.0900312289595604, -0.04476210102438927, -0.03810879588127136, -0.12260100245475769, -0.0978384017944336, 0.026096107438206673, -0.02239063009619713, 0.021460942924022675, 0.15413686633110046, -0.12296823412179947, -0.035717617720365524, 0.027331911027431488, 0.12706248462200165, 0.004009326919913292, 0.02882136031985283, -0.0032286974601447582, 0.06370529532432556, -0.025068769231438637, -0.017165903002023697, -0.02623397670686245, 0.07065854966640472, -0.020559566095471382, 0.01895066164433956, -0.03135678917169571, -0.05703010782599449, -0.023502269759774208, -0.014196041040122509, -0.09370297938585281, 0.0156567245721817, 0.0718369409441948, 0.011323975399136543, -0.026869043707847595, -0.015757078304886818, 0.021336326375603676, -0.048894718289375305, 0.04293999820947647, -0.021432239562273026 ]
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 ``` The server can be tested by connecting to it using the example client from [`tls.connect()`][]. ## `tls.setDefaultCACertificates(certs)` \* `certs` {string\[]|ArrayBufferView\[]} An array of CA certificates in PEM format. Sets the default CA certificates used by Node.js TLS clients. If the provided certificates are parsed successfully, they will become the default CA certificate list returned by [`tls.getCACertificates()`][] and used by subsequent TLS connections that don't specify their own CA certificates. The certificates will be deduplicated before being set as the default. This function only affects the current Node.js thread. Previous sessions cached by the HTTPS agent won't be affected by this change, so this method should be called before any unwanted cachable TLS connections are made. To use system CA certificates as the default: ```cjs const tls = require('node:tls'); tls.setDefaultCACertificates(tls.getCACertificates('system')); ``` ```mjs import tls from 'node:tls'; tls.setDefaultCACertificates(tls.getCACertificates('system')); ``` This function completely replaces the default CA certificate list. To add additional certificates to the existing defaults, get the current certificates and append to them: ```cjs const tls = require('node:tls'); const currentCerts = tls.getCACertificates('default'); const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...']; tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]); ``` ```mjs import tls from 'node:tls'; const currentCerts = tls.getCACertificates('default'); const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...']; tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]); ``` ## `tls.getCACertificates([type])` \* `type` {string|undefined} The type of CA certificates that will be returned. Valid values are `"default"`, `"system"`, `"bundled"` and `"extra"`. \*\*Default:\*\* `"default"`. \* Returns: {string\[]} An array of PEM-encoded certificates. The array may contain duplicates if the same certificate is repeatedly stored in multiple sources. Returns an array containing the CA certificates from various sources, depending on `type`: \* `"default"`: return the CA certificates that will be used by the Node.js TLS clients by default. \* When [`--use-bundled-ca`][] is enabled (default), or [`--use-openssl-ca`][] is not enabled, this would include CA certificates from the bundled Mozilla CA store. \* When [`--use-system-ca`][] is enabled, this would also include certificates from the system's trusted store. \* When [`NODE\_EXTRA\_CA\_CERTS`][] is used, this would also include certificates loaded from the specified file. \* `"system"`: return the CA certificates that are loaded from the system's trusted store, according to rules set by [`--use-system-ca`][]. This can be used to get the certificates from the system when [`--use-system-ca`][] is not enabled. \* `"bundled"`: return the CA certificates from the bundled Mozilla CA store. This would be the same as [`tls.rootCertificates`][]. \* `"extra"`: return the CA certificates loaded from [`NODE\_EXTRA\_CA\_CERTS`][]. It's an empty array if [`NODE\_EXTRA\_CA\_CERTS`][] is not set. ## `tls.getCiphers()` \* Returns: {string\[]} Returns an array with the names of the supported TLS ciphers. The names are lower-case for historical reasons, but must be uppercased to be used in the `ciphers` option of [`tls.createSecureContext()`][]. Not all supported ciphers are enabled by default. See [Modifying the default TLS cipher suite][]. Cipher names that start with `'tls\_'` are for TLSv1.3, all the others are for TLSv1.2 and below. ```js console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] ``` ## `tls.rootCertificates` \* Type: {string\[]} An immutable array of strings representing the root certificates (in PEM format) from the bundled Mozilla CA store as supplied by the current Node.js version. The bundled CA store, as supplied by Node.js, 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
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.026673953980207443, 0.006080165971070528, -0.0567760206758976, -0.05892660468816757, 0.05856303498148918, 0.09222262352705002, -0.047990310937166214, -0.022570239380002022, -0.028013387694954872, 0.03315788507461548, -0.03543776273727417, -0.07029858231544495, -0.05451921001076698, 0.04109664633870125, 0.06046221777796745, -0.0051725790835917, 0.054967351257801056, 0.051568664610385895, -0.019673077389597893, -0.04132671281695366, -0.002580788219347596, -0.01114116981625557, 0.07497062534093857, 0.053332485258579254, 0.04089834913611412, 0.013249573297798634, -0.030239466577768326, 0.08612816780805588, 0.005390301812440157, -0.035918787121772766, 0.0094724977388978, 0.05427483841776848, 0.03469936549663544, -0.04339860379695892, -0.06568566709756851, -0.11997933685779572, -0.013878539204597473, -0.04551348835229874, -0.007079749368131161, -0.03546113893389702, 0.01065389160066843, -0.06728818267583847, 0.00864847470074892, -0.08756636828184128, 0.023725097998976707, 0.030652230605483055, 0.048772577196359634, 0.018896160647273064, -0.04441440850496292, 0.0020563455764204264, 0.0058584269136190414, -0.06339070200920105, 0.06929460912942886, -0.02420731447637081, -0.008776385337114334, -0.035794321447610855, 0.04852329567074776, 0.01771577261388302, 0.010932601056993008, 0.022029472514986992, -0.0782245621085167, -0.07771912217140198, -0.0355108305811882, -0.06900229305028915, -0.021518463268876076, -0.07448706030845642, 0.016880840063095093, 0.002934926887974143, -0.07501745223999023, -0.06856617331504822, 0.05037861689925194, -0.08457174897193909, 0.04063922166824341, -0.006509623024612665, 0.005097835790365934, -0.017471270635724068, 0.08253970742225647, 0.061546165496110916, -0.01676676794886589, -0.080387182533741, 0.017792796716094017, 0.07702042907476425, 0.0400765985250473, 0.05689707770943642, -0.015534009784460068, 0.05112258344888687, -0.06697268038988113, -0.007068028673529625, -0.008289361372590065, 0.034728214144706726, -0.07587497681379318, 0.002054910408332944, 0.06399578601121902, -0.025453995913267136, -0.0030705148819833994, 0.022842176258563995, 0.08442922681570053, 0.05010747164487839, 0.05731631815433502, -0.01704910211265087, -0.07035570591688156, -0.016598306596279144, 0.13532301783561707, -0.0005711448611691594, -0.007333243731409311, 0.06115880236029625, 0.05266502872109413, -0.03394467756152153, 0.0006631793803535402, -0.04234868288040161, 0.04157877713441849, 0.015466251410543919, -0.000267200666712597, -0.006639154627919197, 6.342536992231075e-33, 0.05549274757504463, 0.025675423443317413, 0.03547161817550659, 0.026693332940340042, 0.019757309928536415, 0.015560869127511978, 0.09052219986915588, -0.02243798039853573, -0.039672285318374634, 0.003689691424369812, 0.0015763381961733103, 0.020642394199967384, -0.06059117615222931, -0.011639869771897793, 0.010013633407652378, 0.024318521842360497, -0.019538870081305504, -0.06117156893014908, 0.045045945793390274, 0.005733641795814037, -0.016574809327721596, -0.02031557448208332, 0.06127259135246277, 0.024126358330249786, -0.041030388325452805, 0.028787588700652122, 0.03963639959692955, 0.020639942958950996, -0.05555618554353714, -0.02179502695798874, 0.0389430932700634, 0.030910413712263107, -0.0015519025037065148, -0.0579947754740715, 0.053347598761320114, 0.007603204343467951, 0.09100043773651123, 0.08463326096534729, -0.05299684405326843, -0.007807915564626455, 0.01930706389248371, 0.030216122046113014, 0.014291116036474705, 0.10001299530267715, -0.043788645416498184, -0.01599953882396221, -0.06820378452539444, -0.0742044672369957, 0.13510440289974213, 0.017591087147593498, -0.07221490889787674, -0.010996106080710888, -0.06311260163784027, -0.09661471098661423, 0.013160944916307926, -0.07555129379034042, 0.014049755409359932, 0.024376651272177696, -0.15352094173431396, -0.061258938163518906, -0.018980707973241806, -0.04729463532567024, -0.0203411802649498, -0.05767279118299484, 0.06583811342716217, 0.056745920330286026, -0.033251434564590454, 0.0049957712180912495, -0.12101740390062332, -0.02373695932328701, -0.026085173711180687, 0.07097791135311127, 0.0036532371304929256, -0.05644053965806961, 0.027256717905402184, 0.05973271280527115, 0.00901025626808405, 0.04015260934829712, 0.08307920396327972, -0.08422905206680298, 0.06551346182823181, 0.08917287737131119, -0.009754535742104053, 0.05671133100986481, 0.04337289556860924, 0.040071431547403336, 0.017845112830400467, 0.06795802712440491, 0.008021709509193897, 0.0005524935550056398, 0.025469500571489334, 0.025228353217244148, 0.042785145342350006, 0.02715638093650341, -0.057137519121170044, -6.999231319421761e-33, 0.012768209911882877, -0.020488087087869644, 0.005894178058952093, 0.09224042296409607, 0.011700076051056385, -0.07156055420637131, -0.039968330413103104, 0.06455295532941818, -0.0006968452362343669, 0.01790042221546173, 0.018231861293315887, -0.04997781291604042, 0.09399818629026413, -0.0264779943972826, -0.03499758616089821, -0.05081816390156746, -0.0708472803235054, 0.08363186568021774, 0.0016564859542995691, -0.08071357011795044, 0.014565026387572289, -0.005068316124379635, 0.05469285324215889, 0.06210760772228241, 0.04632499814033508, 0.032106682658195496, 0.008412104099988937, 0.008284593932330608, -0.04449678584933281, -0.05115438625216484, 0.025330403819680214, 0.010397464968264103, 0.025467660278081894, 0.07083947211503983, -0.09877628833055496, -0.05533156171441078, -0.02804635465145111, 0.06552733480930328, 0.08537443727254868, 0.04803011193871498, 0.022194433957338333, -0.0866788849234581, -0.06384506076574326, -0.02068694867193699, 0.02210269495844841, -0.02742103300988674, 0.05793315917253494, 0.07571626454591751, 0.006336224265396595, 0.010054930113255978, 0.008739802986383438, -0.0018128463998436928, -0.06051316484808922, -0.006481161806732416, 0.04158428683876991, 0.016641171649098396, -0.048927273601293564, 0.05842049792408943, 0.005132428836077452, -0.055357612669467926, 0.03790212422609329, -0.03198191523551941, -0.017764953896403313, 0.023824332281947136, -0.018780628219246864, 0.027291011065244675, -0.09768012911081314, -0.010467063635587692, 0.00508076511323452, 0.005874339956790209, -0.06574124842882156, -0.03492054343223572, -0.09085232019424438, -0.087992824614048, 0.09852002561092377, -0.006235005334019661, -0.054941464215517044, -0.03811096400022507, 0.07405058294534683, 0.007820538245141506, -0.0056068990379571915, 0.07809361070394516, -0.0389120951294899, 0.06790143251419067, 0.08885286748409271, -0.013900479301810265, 0.03304972127079964, -0.020885976031422615, 0.0014743232168257236, 0.027094796299934387, -0.0006884001777507365, 0.10471441596746445, -0.01684139296412468, 0.002296527847647667, 0.0845801830291748, -5.325390972643618e-8, -0.07320113480091095, -0.003438187763094902, -0.18117377161979675, 0.011120237410068512, -0.004665742628276348, 0.008049366995692253, 0.023498402908444405, -0.04342607781291008, 0.03257611021399498, -0.027651846408843994, -0.06002476066350937, -0.08491344004869461, -0.01607144996523857, 0.016554873436689377, -0.012674867175519466, 0.05023876577615738, -0.00006648836279055104, 0.0073293219320476055, 0.014701975509524345, -0.03470597043633461, 0.006994056981056929, -0.1016610637307167, 0.030657626688480377, 0.09365517646074295, -0.02803921513259411, -0.01986742578446865, -0.005225428380072117, 0.016676461324095726, 0.004535954911261797, 0.002237425884231925, -0.1071792021393776, -0.09997288882732391, -0.0028008136432617903, -0.06346302479505539, 0.06042468547821045, 0.06220842897891998, -0.10791387408971786, -0.057714398950338364, 0.03657420352101326, 0.1269024759531021, -0.01669144071638584, -0.023627009242773056, -0.06077402085065842, 0.04945288226008415, -0.11591112613677979, -0.005101009737700224, -0.0013657057425007224, 0.0735936090350151, -0.017857564613223076, 0.05201348662376404, 0.01472663413733244, -0.07143489271402359, 0.011986810714006424, -0.08651025593280792, -0.14741061627864838, 0.05351543799042702, 0.0034922694321721792, 0.024788206443190575, 0.022619089111685753, -0.02677958644926548, 0.033167414367198944, 0.00046898561413399875, 0.04153049737215042, -0.011415154673159122 ]
-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\_CA\_CERTS`, use [`tls.getCACertificates()`][]. ## `tls.DEFAULT\_ECDH\_CURVE` The default curve name to use for ECDH key agreement in a tls server. The default value is `'auto'`. See [`tls.createSecureContext()`][] for further information. ## `tls.DEFAULT\_MAX\_VERSION` \* Type: {string} The default value of the `maxVersion` option of [`tls.createSecureContext()`][]. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. \*\*Default:\*\* `'TLSv1.3'`, unless changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. ## `tls.DEFAULT\_MIN\_VERSION` \* Type: {string} The default value of the `minVersion` option of [`tls.createSecureContext()`][]. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Versions before TLSv1.2 may require downgrading the [OpenSSL Security Level][]. \*\*Default:\*\* `'TLSv1.2'`, unless changed using CLI options. Using `--tls-min-v1.0` sets the default to `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the lowest minimum is used. ## `tls.DEFAULT\_CIPHERS` \* Type: {string} The default value of the `ciphers` option of [`tls.createSecureContext()`][]. It can be assigned any of the supported OpenSSL ciphers. Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless changed using CLI options using `--tls-default-ciphers`. [CVE-2021-44531]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531 [Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites [DHE]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman\_key\_exchange [ECDHE]: https://en.wikipedia.org/wiki/Elliptic\_curve\_Diffie%E2%80%93Hellman [Modifying the default TLS cipher suite]: #modifying-the-default-tls-cipher-suite [Mozilla's publicly trusted list of CAs]: https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt [OCSP request]: https://en.wikipedia.org/wiki/OCSP\_stapling [OpenSSL Options]: crypto.md#openssl-options [OpenSSL Security Level]: #openssl-security-level [OpenSSL documentation on security levels]: https://www.openssl.org/docs/manmaster/man3/SSL\_CTX\_set\_security\_level.html#DEFAULT-CALLBACK-BEHAVIOUR [Pre-shared keys]: #pre-shared-keys [RFC 2246]: https://www.ietf.org/rfc/rfc2246.txt [RFC 4086]: https://tools.ietf.org/html/rfc4086 [RFC 4279]: https://tools.ietf.org/html/rfc4279 [RFC 5077]: https://tools.ietf.org/html/rfc5077 [RFC 5929]: https://tools.ietf.org/html/rfc5929 [SSL\_METHODS]: https://www.openssl.org/docs/man1.1.1/man7/ssl.html#Dealing-with-Protocol-Methods [Session Resumption]: #session-resumption [Stream]: stream.md#stream [TLS recommendations]: https://wiki.mozilla.org/Security/Server\_Side\_TLS [`'newSession'`]: #event-newsession [`'resumeSession'`]: #event-resumesession [`'secure'`]: #event-secure [`'secureConnect'`]: #event-secureconnect [`'secureConnection'`]: #event-secureconnection [`'session'`]: #event-session [`--tls-cipher-list`]: cli.md#--tls-cipher-listlist [`--use-bundled-ca`]: cli.md#--use-bundled-ca---use-openssl-ca [`--use-openssl-ca`]: cli.md#--use-bundled-ca---use-openssl-ca [`--use-system-ca`]: cli.md#--use-system-ca [`Duplex`]: stream.md#class-streamduplex [`NODE\_EXTRA\_CA\_CERTS`]: cli.md#node\_extra\_ca\_certsfile [`NODE\_OPTIONS`]: cli.md#node\_optionsoptions [`SSL\_export\_keying\_material`]: https://www.openssl.org/docs/man1.1.1/man3/SSL\_export\_keying\_material.html [`SSL\_get\_version`]: https://www.openssl.org/docs/man1.1.1/man3/SSL\_get\_version.html [`crypto.getCurves()`]: crypto.md#cryptogetcurves [`import()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import [`net.Server.address()`]: net.md#serveraddress [`net.Server`]: net.md#class-netserver [`net.Socket`]: net.md#class-netsocket [`net.createServer()`]: net.md#netcreateserveroptions-connectionlistener [`server.addContext()`]: #serveraddcontexthostname-context [`server.getTicketKeys()`]: #servergetticketkeys [`server.listen()`]: net.md#serverlisten [`server.setTicketKeys()`]: #serversetticketkeyskeys [`socket.connect()`]: net.md#socketconnectoptions-connectlistener [`socket.setTimeout(timeout)`]: net.md#socketsettimeouttimeout-callback [`tls.DEFAULT\_ECDH\_CURVE`]: #tlsdefault\_ecdh\_curve [`tls.DEFAULT\_MAX\_VERSION`]: #tlsdefault\_max\_version [`tls.DEFAULT\_MIN\_VERSION`]: #tlsdefault\_min\_version [`tls.Server`]: #class-tlsserver [`tls.TLSSocket.enableTrace()`]: #tlssocketenabletrace [`tls.TLSSocket.getPeerCertificate()`]: #tlssocketgetpeercertificatedetailed [`tls.TLSSocket.getProtocol()`]: #tlssocketgetprotocol [`tls.TLSSocket.getSession()`]: #tlssocketgetsession [`tls.TLSSocket.getTLSTicket()`]: #tlssocketgettlsticket [`tls.TLSSocket`]: #class-tlstlssocket [`tls.connect()`]: #tlsconnectoptions-callback [`tls.createSecureContext()`]: #tlscreatesecurecontextoptions [`tls.createServer()`]: #tlscreateserveroptions-secureconnectionlistener [`tls.getCACertificates()`]: #tlsgetcacertificatestype [`tls.getCiphers()`]: #tlsgetciphers [`tls.rootCertificates`]: #tlsrootcertificates [`x509.checkHost()`]: crypto.md#x509checkhostname-options [asn1.js]: https://www.npmjs.com/package/asn1.js [certificate object]: #certificate-object [cipher list format]: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT [forward secrecy]: https://en.wikipedia.org/wiki/Perfect\_forward\_secrecy [perfect forward secrecy]: #perfect-forward-secrecy
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.04901502653956413, 0.00982383918017149, -0.0733097717165947, -0.06812814623117447, -0.025968769565224648, 0.05101728066802025, -0.07740867882966995, -0.0006476818234659731, 0.013106384314596653, -0.0006917878636159003, 0.04375830292701721, -0.051054082810878754, -0.05898619070649147, -0.054051656275987625, 0.1021757423877716, -0.015101148746907711, 0.012076238170266151, -0.0046751610934734344, -0.012734081596136093, 0.011397890746593475, -0.009024460799992085, -0.022554349154233932, 0.05582696199417114, 0.05632980540394783, 0.028891704976558685, 0.008104367181658745, -0.009943143464624882, 0.06486236304044724, -0.041426464915275574, -0.0272966455668211, 0.01549497339874506, 0.033739350736141205, 0.0245383158326149, -0.026454955339431763, -0.06985705345869064, -0.1510862410068512, 0.04762258753180504, 0.004166163504123688, -0.006716522853821516, 0.004607098177075386, 0.033200185745954514, -0.03369897976517677, 0.028204137459397316, -0.06159083545207977, 0.10655345767736435, 0.012061136774718761, 0.139063760638237, 0.008108848705887794, -0.010968990623950958, -0.03428855910897255, 0.023956913501024246, -0.032116927206516266, 0.03221339359879494, 0.028150774538517, -0.07070805132389069, -0.04226166009902954, -0.046901602298021317, -0.028308715671300888, -0.0023593006189912558, 0.07512219250202179, -0.049650754779577255, -0.03427794203162193, -0.045352209359407425, -0.045719634741544724, -0.05741508677601814, -0.03129972517490387, -0.037950318306684494, 0.015291876159608364, -0.08252086490392685, -0.05029395967721939, 0.05475398525595665, -0.04660402238368988, 0.05360691249370575, -0.00734170014038682, 0.012468942441046238, 0.03791508078575134, 0.04252518713474274, 0.04521230235695839, -0.047631509602069855, -0.047271158546209335, 0.06451568752527237, 0.0256905946880579, 0.07035654783248901, 0.047632597386837006, 0.01662219874560833, 0.0047523933462798595, -0.055829018354415894, 0.03536776453256607, 0.0133488355204463, -0.010546143166720867, -0.056925125420093536, 0.02120971865952015, 0.03225857391953468, -0.02930361218750477, 0.025735152885317802, 0.02833901159465313, 0.02950044721364975, -0.01759781315922737, 0.031248673796653748, -0.01499911118298769, -0.07306454330682755, -0.025679124519228935, 0.08958465605974197, -0.06445523351430893, -0.0078777726739645, 0.08705952018499374, -0.010265040211379528, -0.01574654132127762, -0.023385683074593544, -0.043276961892843246, -0.004341998603194952, -0.041718099266290665, 0.0008502056589350104, 0.033887382596731186, 3.107591232447525e-33, 0.03449510037899017, 0.04620243236422539, 0.026598569005727768, 0.010225468315184116, -0.008302142843604088, 0.02766367979347706, 0.04493705928325653, -0.0061138649471104145, -0.1021617203950882, -0.021038273349404335, 0.015337259508669376, 0.04748298600316048, -0.10161690413951874, -0.04275456443428993, -0.015320216305553913, 0.011254195123910904, -0.06437517702579498, -0.037862882018089294, 0.0663166269659996, 0.025368141010403633, 0.03321017324924469, 0.036343224346637726, 0.01664583943784237, 0.03774559497833252, 0.021586447954177856, 0.025102432817220688, 0.013959739357233047, 0.06488250195980072, -0.056805942207574844, 0.0016015504952520132, 0.04455205798149109, 0.03454534709453583, -0.008875838480889797, -0.03512449562549591, 0.0961674153804779, 0.050726890563964844, 0.08856859058141708, 0.056346092373132706, -0.07147820293903351, -0.039237700402736664, 0.05934108793735504, 0.03970446437597275, 0.023475367575883865, 0.00629523117095232, -0.07125218957662582, -0.039441317319869995, -0.04937835410237312, -0.06266427040100098, 0.15114448964595795, 0.05155298858880997, -0.0815688818693161, -0.013833021745085716, -0.04549214616417885, -0.13180011510849, 0.033259570598602295, -0.030062507838010788, -0.0033815500792115927, 0.023665660992264748, -0.08288143575191498, -0.007308212574571371, -0.0005068359896540642, -0.06034849211573601, -0.05668595805764198, -0.07496977597475052, 0.009183909744024277, 0.057151541113853455, 0.012126614339649677, -0.0033246504608541727, -0.090188167989254, -0.019457727670669556, -0.048945844173431396, 0.06355033069849014, 0.07897543907165527, 0.007153312209993601, 0.023567795753479004, -0.015385037288069725, -0.06558007746934891, 0.07976046949625015, 0.06367822736501694, -0.05074037238955498, 0.005606814753264189, 0.009868340566754341, 0.06995371729135513, 0.07041002064943314, 0.028557024896144867, 0.07192949950695038, 0.04363390803337097, 0.07138392329216003, 0.014507749117910862, 0.012601707130670547, 0.021078122779726982, 0.036785274744033813, 0.04776538908481598, 0.05331940948963165, -0.08076830953359604, -4.204940188195085e-33, 0.007111473474651575, -0.04624535143375397, 0.010535326786339283, 0.052072279155254364, -0.010207188315689564, -0.038895901292562485, -0.037294767796993256, 0.013983935117721558, 0.03904082253575325, 0.0077569372951984406, 0.05754638463258743, -0.0014333518920466304, 0.051992978900671005, -0.07568931579589844, 0.06340158730745316, -0.04990433156490326, -0.10135125368833542, -0.023396499454975128, -0.012905237264931202, -0.019944284111261368, 0.010524875484406948, -0.04582563415169716, -0.016588279977440834, 0.056082312017679214, 0.023006603121757507, -0.005409832112491131, 0.023351626470685005, -0.029092473909258842, 0.0037718270905315876, -0.052559349685907364, -0.027929456904530525, -0.03571947291493416, -0.041628625243902206, 0.06473402678966522, -0.07540317624807358, -0.1013568863272667, -0.05092160776257515, 0.0038714639376848936, 0.07661735266447067, -0.006379141006618738, -0.003004047553986311, -0.044372204691171646, -0.04668250307440758, -0.02338843233883381, 0.01656918227672577, 0.06802430003881454, 0.02635679766535759, 0.039805375039577484, 0.03636730834841728, 0.013295159675180912, 0.035047903656959534, -0.006112965289503336, -0.04934727028012276, -0.02811487950384617, 0.04353698343038559, 0.04523945227265358, -0.058157920837402344, 0.0999864935874939, -0.011239900253713131, -0.1060558557510376, 0.015079141594469547, 0.01211291179060936, -0.05546634644269943, 0.039545752108097076, -0.011568207293748856, 0.05981558933854103, -0.12270481139421463, -0.01993202418088913, 0.03604612872004509, 0.027879664674401283, -0.016915634274482727, -0.06535809487104416, -0.06248703971505165, -0.14363782107830048, 0.050377070903778076, -0.08282319456338882, -0.049587152898311615, -0.049328215420246124, -0.0020566254388540983, 0.027789495885372162, 0.04481153190135956, 0.12743842601776123, -0.019886448979377747, 0.05027665197849274, 0.05632844194769859, -0.010565466247498989, 0.02059793658554554, 0.010525446385145187, -0.005079211201518774, 0.029878094792366028, 0.009816879406571388, 0.10117395967245102, -0.06753800809383392, 0.017071908339858055, 0.05343479663133621, -5.399014924023504e-8, -0.03525404632091522, 0.011303546838462353, -0.130801260471344, -0.052282992750406265, 0.05521807447075844, 0.03311983495950699, 0.09517806768417358, 0.026290928944945335, 0.033189557492733, 0.040994755923748016, 0.03045593574643135, -0.04029974341392517, -0.04072804003953934, -0.013022085651755333, -0.09378650039434433, 0.001231763162650168, -0.07677008211612701, 0.027670463547110558, 0.03733677417039871, 0.011371664702892303, 0.0022160904482007027, -0.07180976867675781, -0.005826546344906092, 0.054080531001091, -0.012116879224777222, 0.011424349620938301, 0.008318562991917133, 0.08297862112522125, 0.021047426387667656, -0.0023250470403581858, -0.08788041025400162, -0.07613519579172134, 0.026312576606869698, -0.08962640166282654, 0.011141981929540634, 0.09487202763557434, -0.09019922465085983, -0.026397980749607086, 0.03568458557128906, 0.12267762422561646, 0.03348832577466965, -0.024713944643735886, 0.015335306525230408, 0.06786640733480453, -0.05946657061576843, 0.04733744263648987, -0.057918135076761246, 0.07055655121803284, 0.019871721044182777, 0.025595765560865402, 0.03709161654114723, -0.07638099789619446, -0.005375076085329056, -0.06793691217899323, -0.13870254158973694, 0.0522029772400856, 0.023135384544730186, -0.06801286339759827, 0.008571010082960129, -0.0480525977909565, 0.07015394419431686, -0.04693020135164261, 0.09282224625349045, -0.008955259807407856 ]
-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\_modules` code only) \* Runtime (all code) \* End-of-Life A Documentation-only deprecation is one that is expressed only within the Node.js API docs. These generate no side-effects while running Node.js. Some Documentation-only deprecations trigger a runtime warning when launched with [`--pending-deprecation`][] flag (or its alternative, `NODE\_PENDING\_DEPRECATION=1` environment variable), similarly to Runtime deprecations below. Documentation-only deprecations that support that flag are explicitly labeled as such in the [list of Deprecated APIs](#list-of-deprecated-apis). An Application deprecation for only non-`node\_modules` code will, by default, generate a process warning that will be printed to `stderr` the first time the deprecated API is used in code that's not loaded from `node\_modules`. When the [`--throw-deprecation`][] command-line flag is used, a Runtime deprecation will cause an error to be thrown. When [`--pending-deprecation`][] is used, warnings will also be emitted for code loaded from `node\_modules`. A runtime deprecation for all code is similar to the runtime deprecation for non-`node\_modules` code, except that it also emits a warning for code loaded from `node\_modules`. An End-of-Life deprecation is used when functionality is or will soon be removed from Node.js. ## Revoking deprecations Occasionally, the deprecation of an API might be reversed. In such situations, this document will be updated with information relevant to the decision. However, the deprecation identifier will not be modified. ## List of deprecated APIs ### DEP0001: `http.OutgoingMessage.prototype.flush` Type: End-of-Life `OutgoingMessage.prototype.flush()` has been removed. Use `OutgoingMessage.prototype.flushHeaders()` instead. ### DEP0002: `require('\_linklist')` Type: End-of-Life The `\_linklist` module is deprecated. Please use a userland alternative. ### DEP0003: `\_writableState.buffer` Type: End-of-Life The `\_writableState.buffer` has been removed. Use `\_writableState.getBuffer()` instead. ### DEP0004: `CryptoStream.prototype.readyState` Type: End-of-Life The `CryptoStream.prototype.readyState` property was removed. ### DEP0005: `Buffer()` constructor Type: Application (non-`node\_modules` code only) The `Buffer()` function and `new Buffer()` constructor are deprecated due to API usability issues that can lead to accidental security issues. As an alternative, use one of the following methods of constructing `Buffer` objects: \* [`Buffer.alloc(size[, fill[, encoding]])`][alloc]: Create a `Buffer` with \_initialized\_ memory. \* [`Buffer.allocUnsafe(size)`][alloc\_unsafe\_size]: Create a `Buffer` with \_uninitialized\_ memory. \* [`Buffer.allocUnsafeSlow(size)`][]: Create a `Buffer` with \_uninitialized\_ memory. \* [`Buffer.from(array)`][]: Create a `Buffer` with a copy of `array` \* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from\_arraybuffer] - Create a `Buffer` that wraps the given `arrayBuffer`. \* [`Buffer.from(buffer)`][]: Create a `Buffer` that copies `buffer`. \* [`Buffer.from(string[, encoding])`][from\_string\_encoding]: Create a `Buffer` that copies `string`. Without `--pending-deprecation`, runtime warnings occur only for code not in `node\_modules`. This means there will not be deprecation warnings for `Buffer()` usage in dependencies. With `--pending-deprecation`, a runtime warning results no matter where the `Buffer()` usage occurs. ### DEP0006: `child\_process` `options.customFds` Type: End-of-Life Within the [`child\_process`][] module's `spawn()`, `fork()`, and `exec()` methods, the `options.customFds` option is deprecated. The `options.stdio` option should be used instead. ### DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect` Type: End-of-Life In an earlier version of the Node.js `cluster`, a boolean property with the name `suicide` was added to the `Worker` object. The intent of this property was to provide an indication of how and why the `Worker` instance exited. In Node.js 6.0.0, the old property was deprecated and replaced with 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 specific Node.js builtin modules, developers should instead refer to the `constants` property exposed by
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.025436682626605034, 0.04430640861392021, 0.024818234145641327, 0.01804356649518013, -0.035392146557569504, -0.020787103101611137, 0.02308143861591816, -0.008051994256675243, 0.008947755210101604, -0.06902007013559341, 0.04190441220998764, 0.014780166558921337, -0.012117724865674973, -0.12110345810651779, -0.01669899933040142, -0.025279583409428596, 0.07839180529117584, -0.06077083572745323, 0.06137145683169365, -0.07366352528333664, -0.0007510208524763584, -0.051314231008291245, 0.05574599280953407, 0.0177996177226305, -0.040782030671834946, 0.019844016060233116, -0.014632686972618103, -0.028184134513139725, 0.09715528041124344, -0.08534711599349976, -0.053207896649837494, -0.012758132070302963, -0.07182208448648453, -0.045462578535079956, -0.08942818641662598, -0.10575886815786362, 0.024969279766082764, -0.03201335296034813, -0.008603110909461975, 0.0500025637447834, -0.0865761935710907, 0.057157717645168304, -0.005057340022176504, -0.0770171731710434, 0.05942505598068237, -0.05597576126456261, 0.07472514361143112, 0.004603121895343065, -0.0570259727537632, 0.016079235821962357, -0.04523927718400955, 0.02179213985800743, 0.02710619941353798, 0.03493518754839897, -0.04454851150512695, 0.036623913794755936, 0.13219864666461945, -0.05146695300936699, 0.03429438918828964, -0.011940374039113522, -0.020928803831338882, -0.03123120218515396, 0.007541526108980179, -0.004338924773037434, -0.017569540068507195, -0.04360342025756836, -0.13950665295124054, 0.021539336070418358, -0.012170547619462013, 0.013116983696818352, 0.030433939769864082, -0.06525840610265732, 0.08181742578744888, 0.003073315601795912, -0.060457415878772736, 0.08274026960134506, -0.001429688185453415, -0.028785178437829018, -0.09971741586923599, 0.0167241133749485, 0.016631728038191795, 0.01058682706207037, -0.007100096438080072, -0.06566683202981949, 0.025298351421952248, -0.05903094634413719, -0.006288159638643265, -0.009610574692487717, -0.008789507672190666, 0.04554209113121033, -0.044039297848939896, 0.07303312420845032, -0.045540038496255875, -0.005174066871404648, -0.05404138192534447, 0.033587533980607986, 0.04779057204723358, 0.058777641505002975, 0.04713050648570061, -0.028327850624918938, -0.05489116534590721, -0.03884293884038925, 0.09143735468387604, 0.06330163776874542, -0.012326419353485107, 0.07789349555969238, 0.1382889598608017, 0.05962979793548584, 0.039816468954086304, 0.05244802311062813, 0.01743590645492077, -0.014658929780125618, -0.03473882004618645, -0.035449136048555374, 3.516394739542915e-33, -0.007682270836085081, -0.07351268827915192, 0.03707120940089226, 0.05725027248263359, 0.04618629068136215, -0.014404778368771076, 0.0553598627448082, -0.009905148297548294, -0.06397170573472977, -0.06294558197259903, 0.027501171454787254, 0.06455068290233612, -0.032562486827373505, -0.005945952143520117, 0.06364444643259048, 0.007664576172828674, 0.014730527997016907, -0.015841923654079437, 0.08639153838157654, 0.029266703873872757, 0.025599109008908272, -0.0657779723405838, -0.02811324968934059, 0.005241339560598135, 0.02162688784301281, 0.01792071759700775, 0.008245106786489487, 0.014148302376270294, -0.05542613938450813, 0.0030229296535253525, -0.010368055664002895, 0.010068514384329319, -0.010541263036429882, 0.008298872038722038, 0.021760281175374985, -0.03175823390483856, -0.07275325804948807, 0.017215806990861893, -0.015776442363858223, -0.02346581034362316, -0.039298538118600845, 0.09017757326364517, -0.05640661343932152, -0.013423754833638668, 0.07768715918064117, -0.04858039692044258, 0.07360191643238068, -0.027611318975687027, 0.02359047159552574, -0.02013739012181759, -0.04081888869404793, 0.0807124525308609, -0.0012272034073248506, -0.004124986007809639, -0.005772337317466736, -0.09355218708515167, 0.06844792515039444, -0.06259451806545258, -0.0382252037525177, 0.004462660290300846, 0.07723607122898102, -0.018689818680286407, -0.046954743564128876, -0.03225616365671158, -0.00889028050005436, 0.07343614846467972, -0.067752406001091, 0.04201290011405945, -0.019230982288718224, -0.018657725304365158, -0.03232540562748909, -0.019295575097203255, -0.020037755370140076, -0.00013112420856487006, 0.053107548505067825, -0.0428372398018837, 0.04768214002251625, -0.01780630834400654, 0.10064971446990967, -0.059224314987659454, -0.030386175960302353, -0.029595129191875458, -0.03988390788435936, 0.05059630796313286, 0.028668666258454323, -0.004939050879329443, -0.006666482891887426, -0.014893933199346066, 0.08695933222770691, 0.06564847379922867, 0.07575381547212601, -0.00426276121288538, -0.09063989669084549, -0.009961383417248726, -0.06955286115407944, -6.290957034800962e-33, -0.051591284573078156, -0.009119459427893162, -0.07149925082921982, 0.08990159630775452, -0.08158858865499496, -0.04572511836886406, -0.021444186568260193, 0.005979537032544613, 0.027838556095957756, -0.033652059733867645, 0.021874187514185905, 0.029694056138396263, -0.0005814507021568716, 0.077311672270298, -0.017032675445079803, 0.0394805409014225, -0.12386541068553925, -0.10209177434444427, 0.05992628633975983, -0.0494401752948761, 0.024668719619512558, 0.07357041537761688, 0.01573384925723076, 0.06599985808134079, -0.03143174946308136, -0.03582417219877243, -0.043961301445961, -0.0594007633626461, -0.00026586721651256084, -0.1181870847940445, 0.001034169690683484, 0.05183970183134079, 0.009961610659956932, 0.05207331106066704, 0.03661065921187401, -0.084938645362854, -0.07090429216623306, 0.02058449760079384, 0.002734407549723983, -0.06660891324281693, 0.033694591373205185, 0.013007372617721558, 0.030718304216861725, -0.03879014402627945, -0.011157701723277569, -0.022617757320404053, 0.014303911477327347, 0.040733419358730316, 0.028068041428923607, -0.009388279169797897, 0.019346605986356735, -0.06173188239336014, 0.023799458518624306, -0.0028131541330367327, -0.08006119728088379, -0.08394858986139297, -0.022721612825989723, 0.04417988285422325, -0.007181637454777956, 0.08312658965587616, 0.07903985679149628, -0.006507911719381809, -0.01683947443962097, 0.019004784524440765, -0.006066440604627132, -0.03096584416925907, -0.035891614854335785, 0.07157952338457108, 0.04237924516201019, 0.025000952184200287, 0.031001832336187363, -0.03140754625201225, -0.11889955401420593, -0.05162567272782326, -0.07970770448446274, 0.06269116699695587, -0.019731521606445312, -0.04951345548033714, -0.0410417802631855, -0.010018544271588326, -0.11895036697387695, 0.045327261090278625, 0.011789866723120213, 0.03965321555733681, 0.037638068199157715, -0.010377767495810986, -0.03921389952301979, 0.09297285974025726, -0.03263812139630318, 0.05953872576355934, -0.003181271953508258, -0.028954407200217247, -0.14124184846878052, 0.06630191951990128, -0.020557107403874397, -5.138988257158417e-8, -0.07675890624523163, 0.07495007663965225, -0.09627654403448105, -0.022316984832286835, 0.03616410121321678, -0.044593166559934616, 0.08126004785299301, 0.08775223046541214, 0.06804772466421127, 0.06491465866565704, -0.025906281545758247, 0.0013858838938176632, -0.06011432409286499, -0.0330093652009964, -0.0253872349858284, 0.0780172273516655, -0.018511299043893814, 0.025142230093479156, -0.014758013188838959, 0.02142960950732231, -0.009635895490646362, -0.04484593868255615, -0.05978349968791008, -0.04310010373592377, -0.04853374511003494, -0.06828836351633072, 0.024303419515490532, 0.08666373044252396, 0.02369951829314232, -0.09497856348752975, -0.08249372988939285, 0.03997974842786789, 0.03744320943951607, -0.006790331564843655, 0.026837844401597977, 0.01392553374171257, -0.03247633948922157, 0.011469299905002117, 0.023323263972997665, 0.09239806234836578, -0.0189248938113451, -0.009894564747810364, -0.0368792749941349, 0.03031683899462223, 0.005469226744025946, -0.009797877632081509, 0.037583328783512115, 0.039518751204013824, -0.009665705263614655, 0.016092579811811447, 0.020805329084396362, 0.0367564931511879, -0.017230933532118797, 0.02294999547302723, -0.004227132070809603, 0.04315963387489319, -0.0395423024892807, 0.005680283065885305, 0.005388084799051285, -0.02483413740992546, 0.10331635922193527, -0.05417691916227341, 0.07413573563098907, 0.0632053092122078 ]
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 specific Node.js builtin modules, developers should instead refer to the `constants` property exposed by the relevant module. For instance, `require('node:fs').constants` and `require('node:os').constants`. ### DEP0009: `crypto.pbkdf2` without digest Type: End-of-Life Use of the [`crypto.pbkdf2()`][] API without specifying a digest was deprecated in Node.js 6.0 because the method defaulted to using the non-recommended `'SHA1'` digest. Previously, a deprecation warning was printed. Starting in Node.js 8.0.0, calling `crypto.pbkdf2()` or `crypto.pbkdf2Sync()` with `digest` set to `undefined` will throw a `TypeError`. Beginning in Node.js 11.0.0, calling these functions with `digest` set to `null` would print a deprecation warning to align with the behavior when `digest` is `undefined`. Now, however, passing either `undefined` or `null` will throw a `TypeError`. ### DEP0010: `crypto.createCredentials` Type: End-of-Life The `crypto.createCredentials()` API was removed. Please use [`tls.createSecureContext()`][] instead. ### DEP0011: `crypto.Credentials` Type: End-of-Life The `crypto.Credentials` class was removed. Please use [`tls.SecureContext`][] instead. ### DEP0012: `Domain.dispose` Type: End-of-Life `Domain.dispose()` has been removed. Recover from failed I/O actions explicitly via error event handlers set on the domain instead. ### DEP0013: `fs` asynchronous function without callback Type: End-of-Life Calling an asynchronous function without a callback throws a `TypeError` in Node.js 10.0.0 onwards. See . ### DEP0014: `fs.read` legacy String interface Type: End-of-Life The [`fs.read()`][] legacy `String` interface is deprecated. Use the `Buffer` API as mentioned in the documentation instead. ### DEP0015: `fs.readSync` legacy String interface Type: End-of-Life The [`fs.readSync()`][] legacy `String` interface is deprecated. Use the `Buffer` API as mentioned in the documentation instead. ### DEP0016: `GLOBAL`/`root` Type: End-of-Life The `GLOBAL` and `root` aliases for the `global` property were deprecated in Node.js 6.0.0 and have since been removed. ### DEP0017: `Intl.v8BreakIterator` Type: End-of-Life `Intl.v8BreakIterator` was a non-standard extension and has been removed. See [`Intl.Segmenter`](https://github.com/tc39/proposal-intl-segmenter). ### DEP0018: Unhandled promise rejections Type: End-of-Life Unhandled promise rejections are deprecated. By default, promise rejections that are not handled terminate the Node.js process with a non-zero exit code. To change the way Node.js treats unhandled rejections, use the [`--unhandled-rejections`][] command-line option. ### DEP0019: `require('.')` resolved outside directory Type: End-of-Life In certain cases, `require('.')` could resolve outside the package directory. This behavior has been removed. ### DEP0020: `Server.connections` Type: End-of-Life The `Server.connections` property was deprecated in Node.js 0.9.7 and has been removed. Please use the [`Server.getConnections()`][] method instead. ### DEP0021: `Server.listenFD` Type: End-of-Life The `Server.listenFD()` method was deprecated and removed. Please use [`Server.listen({fd: })`][] instead. ### DEP0022: `os.tmpDir()` Type: End-of-Life The `os.tmpDir()` API was deprecated in Node.js 7.0.0 and has since been removed. Please use [`os.tmpdir()`][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/tmpdir-to-tmpdir)): ```bash npx codemod@latest @nodejs/tmpDir-to-tmpdir ``` ### DEP0023: `os.getNetworkInterfaces()` Type: End-of-Life The `os.getNetworkInterfaces()` method is deprecated. Please use the [`os.networkInterfaces()`][] method instead. ### DEP0024: `REPLServer.prototype.convertToContext()` Type: End-of-Life The `REPLServer.prototype.convertToContext()` API has been removed. ### DEP0025: `require('node:sys')` Type: Runtime The `node:sys` module is deprecated. Please use the [`util`][] module instead. ### DEP0026: `util.print()` Type: End-of-Life `util.print()` has been removed. Please use [`console.log()`][] 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 ``` ### DEP0027: `util.puts()` Type: End-of-Life `util.puts()` has been removed. Please use [`console.log()`][] 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 ``` ### DEP0028: `util.debug()` Type: End-of-Life `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-Life `util.error()` 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 ``` ### DEP0030: `SlowBuffer` Type: End-of-Life The `SlowBuffer`
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.025669023394584656, 0.04020706191658974, 0.0014703151537105441, 0.02445324696600437, -0.03164713829755783, 0.02791965939104557, 0.05246632173657417, 0.011128418147563934, 0.03876778110861778, 0.05001761391758919, -0.007616315968334675, -0.02185947448015213, -0.06288494169712067, -0.033513445407152176, 0.01406322792172432, -0.005109382327646017, 0.031503841280937195, 0.08888047188520432, 0.07728366553783417, -0.01311246957629919, -0.010507114231586456, -0.03535684943199158, 0.13873708248138428, 0.03229790925979614, -0.028042921796441078, -0.041289981454610825, -0.005157246254384518, 0.015690283849835396, 0.031154103577136993, -0.07575099170207977, 0.0057641807943582535, -0.06314229965209961, -0.015941409394145012, -0.028983937576413155, -0.03472325950860977, -0.02392476238310337, -0.05876225233078003, 0.05822167545557022, -0.04388849437236786, 0.023880532011389732, -0.02223849482834339, 0.045340534299612045, -7.714696153016121e-7, -0.014706398360431194, 0.06933356821537018, -0.003964636474847794, 0.031409937888383865, -0.011387074366211891, 0.02257665991783142, 0.06118496507406235, 0.00720680458471179, 0.06067247688770294, 0.04966391995549202, 0.0232464000582695, -0.06414427608251572, 0.026891449466347694, 0.10446599125862122, -0.06447460502386093, 0.008183877915143967, -0.006656609009951353, 0.02881387248635292, -0.03648519143462181, 0.01367038581520319, -0.020384954288601875, -0.027353471145033836, -0.03585154563188553, -0.07897055149078369, -0.07091826945543289, -0.0956026241183281, 0.024080712348222733, 0.05908627435564995, -0.0017335853772237897, 0.06657498329877853, -0.001856067101471126, -0.05732747167348862, 0.08646765351295471, 0.08694637566804886, 0.02511836588382721, -0.03381241112947464, -0.015169772319495678, 0.004218757152557373, 0.043884143233299255, -0.0342329740524292, -0.013762876391410828, 0.030687211081385612, -0.09756655246019363, -0.006811666768044233, -0.09725204110145569, -0.04554768651723862, 0.016471032053232193, -0.05268741026520729, 0.09912512451410294, -0.02158915251493454, -0.041686881333589554, -0.016313528642058372, 0.0011021440150216222, 0.02660042606294155, 0.05704962834715843, 0.018618006259202957, -0.043677669018507004, -0.07702378928661346, 0.03879723325371742, 0.043505918234586716, 0.031558580696582794, -0.026913229376077652, 0.04339836537837982, 0.1259046047925949, 0.07333505153656006, 0.041729096323251724, 0.017533164471387863, 0.014436849392950535, -0.07495459169149399, -0.04274772107601166, 0.029678061604499817, 5.0151129353008836e-33, -0.00519934156909585, -0.033736638724803925, 0.06772401928901672, 0.06236651539802551, 0.057218991219997406, -0.01733195222914219, 0.04383533447980881, -0.0016294061206281185, -0.07377573102712631, -0.03164879232645035, -0.003945234231650829, 0.08610904961824417, -0.01816493459045887, -0.03208243474364281, 0.02132420614361763, -0.007463512476533651, 0.0824710875749588, -0.043433062732219696, 0.06495991349220276, -0.005749633070081472, 0.045529890805482864, 0.02700609527528286, 0.005961085204035044, -0.02475832775235176, 0.022278612479567528, 0.07255318015813828, 0.06689006090164185, 0.04116504266858101, 0.009211096912622452, -0.017617417499423027, -0.02384023927152157, 0.038908451795578, 0.03358083963394165, 0.031537286937236786, -0.025756780058145523, -0.01922382041811943, -0.006885854993015528, 0.00709496671333909, -0.11536960303783417, -0.10876338183879852, 0.07140934467315674, 0.059676628559827805, -0.029695481061935425, -0.018767762929201126, 0.03813362866640091, -0.10036412626504898, -0.015995418652892113, -0.028073089197278023, 0.053887687623500824, 0.056241199374198914, -0.0316113606095314, 0.04810572788119316, 0.01272502914071083, -0.03393318131566048, -0.02792837843298912, -0.13786955177783966, 0.03881407901644707, -0.04955119639635086, -0.047607872635126114, -0.029814820736646652, 0.04294195398688316, -0.004711003042757511, 0.0051523977890610695, -0.0010894830338656902, -0.02134215272963047, 0.06402143090963364, -0.06835287064313889, 0.03493557125329971, -0.07392054051160812, 0.05425173044204712, -0.08188926428556442, 0.0067513869144022465, 0.032039422541856766, 0.02799672819674015, 0.031084299087524414, -0.00428081164136529, -0.05041743814945221, -0.037302255630493164, 0.008235173299908638, -0.020832128822803497, 0.008539318107068539, 0.020120516419410706, 0.005200176499783993, 0.05303074046969414, -0.04028324782848358, 0.003984484355896711, -0.03967340663075447, 0.07233148068189621, 0.02130049467086792, 0.04763326421380043, 0.09232990443706512, -0.021685652434825897, -0.01027075108140707, -0.015455960296094418, -0.09293784201145172, -6.661423630354206e-33, -0.03213638812303543, 0.008448523469269276, -0.0793290063738823, 0.06832455843687057, 0.02319132164120674, -0.013012665323913097, -0.04851505905389786, -0.0580124631524086, 0.08440147340297699, -0.0062395366840064526, -0.00968643743544817, -0.014870903454720974, 0.08616383373737335, -0.02557804249227047, 0.0174715556204319, 0.05776678025722504, -0.1525949388742447, -0.027364447712898254, 0.017640698701143265, -0.04320761561393738, -0.031051522120833397, 0.08996803313493729, -0.015544131398200989, -0.006337610073387623, 0.004134994000196457, -0.001503094332292676, -0.01919926516711712, 0.013169302605092525, -0.04251046106219292, -0.05098007619380951, -0.07288575172424316, 0.06545321643352509, -0.04276704043149948, 0.024198081344366074, -0.05406399816274643, -0.1190836951136589, -0.056990351527929306, -0.010403867810964584, 0.005618270020931959, -0.033671196550130844, 0.04021589085459709, 0.0255530197173357, -0.008940202184021473, 0.011211476288735867, 0.03559720888733864, -0.07707375288009644, 0.016501519829034805, -0.03746361285448074, 0.0383087620139122, -0.04339131340384483, 0.03630610182881355, -0.04304351657629013, -0.01902206614613533, 0.021433109417557716, -0.04959914833307266, 0.014017378911376, -0.05634588003158569, 0.14243023097515106, 0.031219733878970146, -0.003506010863929987, 0.059864141047000885, -0.0016472428105771542, -0.024872561916708946, 0.0792558491230011, -0.05376232787966728, 0.01655491068959236, -0.0777696892619133, 0.021516012027859688, 0.08141813427209854, -0.00227857893332839, 0.012948499992489815, 0.02416699007153511, -0.021325085312128067, -0.02070171758532524, -0.03690000995993614, 0.007204223889857531, 0.009191176854074001, -0.05029582977294922, -0.00022819980222266167, 0.07182382792234421, -0.03922327235341072, 0.06620047986507416, -0.030399322509765625, 0.047686442732810974, 0.048005279153585434, -0.07292451709508896, 0.031707193702459335, 0.03431802988052368, -0.07389440387487411, 0.013219863176345825, 0.007236490026116371, -0.014973968267440796, -0.12028905004262924, 0.089289091527462, 0.011696672067046165, -5.647465428637588e-8, -0.02410825714468956, 0.028589189052581787, -0.13698305189609528, -0.045646969228982925, 0.1590975672006607, -0.023798881098628044, 0.02547026425600052, -0.0031525655649602413, -0.024648355320096016, 0.07865139096975327, 0.03275629132986069, 0.010295442305505276, 0.027662403881549835, -0.006135175004601479, -0.02252955548465252, 0.04919400066137314, -0.03421135991811752, 0.023090671747922897, -0.05381510779261589, -0.07847820222377777, -0.006840281188488007, -0.01619078405201435, -0.11846641451120377, -0.013532005250453949, 0.02189926616847515, -0.023991931229829788, 0.00784122571349144, 0.08970349282026291, -0.03407086431980133, -0.0021578394807875156, -0.07756884396076202, -0.01877666264772415, -0.01915016397833824, -0.03926908224821091, -0.0074840509332716465, 0.0895804762840271, -0.07682107388973236, -0.03361818566918373, 0.06734093278646469, 0.13084380328655243, -0.05052368715405464, 0.021652720868587494, 0.005642568692564964, 0.041842423379421234, -0.07599344849586487, 0.004994924645870924, -0.01114471536129713, 0.08694170415401459, -0.05784772336483002, 0.05142772197723389, 0.042604170739650726, -0.0030464818701148033, -0.08643436431884766, -0.018089281395077705, -0.03724808245897293, 0.07837808132171631, -0.050376132130622864, -0.08727970719337463, -0.05395253747701645, -0.06748330593109131, 0.10836786776781082, -0.08200634270906448, 0.1343427300453186, 0.000896259443834424 ]
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-Life `util.error()` 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 ``` ### DEP0030: `SlowBuffer` Type: End-of-Life The `SlowBuffer` class has been removed. Please use [`Buffer.allocUnsafeSlow(size)`][] instead. ### DEP0031: `ecdh.setPublicKey()` Type: Runtime The [`ecdh.setPublicKey()`][] method is now deprecated as its inclusion in the API is not useful. ### DEP0032: `node:domain` module Type: Documentation-only The [`domain`][] module is deprecated and should not be used. ### DEP0033: `EventEmitter.listenerCount()` Type: Revoked The [`events.listenerCount(emitter, eventName)`][] API was deprecated, as it provided identical fuctionality to [`emitter.listenerCount(eventName)`][]. The deprecation was revoked because this function has been repurposed to also accept {EventTarget} arguments. ### DEP0034: `fs.exists(path, callback)` Type: Documentation-only The [`fs.exists(path, callback)`][] API is deprecated. Please use [`fs.stat()`][] or [`fs.access()`][] instead. ### DEP0035: `fs.lchmod(path, mode, callback)` Type: Documentation-only The [`fs.lchmod(path, mode, callback)`][] API is deprecated. ### DEP0036: `fs.lchmodSync(path, mode)` Type: Documentation-only The [`fs.lchmodSync(path, mode)`][] API is deprecated. ### DEP0037: `fs.lchown(path, uid, gid, callback)` Type: Deprecation revoked The [`fs.lchown(path, uid, gid, callback)`][] API was deprecated. The deprecation was revoked because the requisite supporting APIs were added in libuv. ### DEP0038: `fs.lchownSync(path, uid, gid)` Type: Deprecation revoked The [`fs.lchownSync(path, uid, gid)`][] API was deprecated. The deprecation was revoked because the requisite supporting APIs were added in libuv. ### DEP0039: `require.extensions` Type: Documentation-only The [`require.extensions`][] property is deprecated. ### DEP0040: `node:punycode` module Type: Runtime The [`punycode`][] module is deprecated. Please use a userland alternative instead. ### DEP0041: `NODE\_REPL\_HISTORY\_FILE` environment variable Type: End-of-Life The `NODE\_REPL\_HISTORY\_FILE` environment variable was removed. Please use `NODE\_REPL\_HISTORY` instead. ### DEP0042: `tls.CryptoStream` Type: End-of-Life The `tls.CryptoStream` class was removed. Please use [`tls.TLSSocket`][] instead. ### DEP0043: `tls.SecurePair` Type: End-of-Life The `tls.SecurePair` class is deprecated. Please use [`tls.TLSSocket`][] instead. ### DEP0044: `util.isArray()` Type: Runtime The [`util.isArray()`][] API is deprecated. Please use `Array.isArray()` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0045: `util.isBoolean()` Type: End-of-Life The `util.isBoolean()` API has been removed. Please use `typeof arg === 'boolean'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0046: `util.isBuffer()` Type: End-of-Life The `util.isBuffer()` API has been removed. Please use [`Buffer.isBuffer()`][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0047: `util.isDate()` Type: End-of-Life The `util.isDate()` API has been removed. Please use `arg instanceof Date` instead. Also for stronger approaches, consider using: `Date.prototype.toString.call(arg) === '[object Date]' && !isNaN(arg)`. This can also be used in a `try/catch` block to handle invalid date objects. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0048: `util.isError()` Type: End-of-Life The `util.isError()` API has been removed. Please use `Error.isError(arg)`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0049: `util.isFunction()` Type: End-of-Life The `util.isFunction()` API has been removed. Please use `typeof arg === 'function'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0050: `util.isNull()` Type: End-of-Life The `util.isNull()` API has been removed. Please use `arg === null` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0051: `util.isNullOrUndefined()` Type: End-of-Life The `util.isNullOrUndefined()` API has been removed. Please use `arg === null || arg === undefined` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0052: `util.isNumber()` Type: End-of-Life The `util.isNumber()` API has been removed. Please use `typeof arg === 'number'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0053: `util.isObject()` Type: End-of-Life The `util.isObject()` API has been removed. Please use `arg && typeof arg === 'object'` instead. An automated
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.03534450754523277, 0.02492421120405197, 0.0338420569896698, -0.043671201914548874, -0.020734090358018875, 0.044562626630067825, 0.009684799239039421, -0.012404399923980236, 0.04344645515084267, -0.019866034388542175, 0.023072773590683937, 0.05383377522230148, -0.0031315262895077467, -0.049921147525310516, -0.03215186297893524, -0.028316104784607887, -0.005002361722290516, -0.03238796815276146, 0.041701242327690125, -0.053941912949085236, -0.045354943722486496, 0.044881321489810944, 0.19325962662696838, 0.03779498115181923, -0.10287068039178848, -0.06791809946298599, -0.03538913279771805, 0.08300022780895233, 0.11083941161632538, -0.0648617371916771, -0.10188205540180206, 0.021280542016029358, -0.023740604519844055, -0.15943649411201477, -0.0546443909406662, -0.015209783799946308, -0.0014979834668338299, -0.02720973640680313, 0.04339921846985817, 0.03814699873328209, -0.11323898285627365, 0.061287879943847656, 0.043385669589042664, -0.004263619426637888, 0.023480761796236038, 0.05660590901970863, 0.04610457643866539, -0.011567628011107445, -0.026752294972538948, -0.02077856846153736, -0.0162828229367733, 0.04904578626155853, -0.0031782640144228935, 0.0012132077245041728, -0.010373944416642189, -0.007487903814762831, 0.09733261913061142, -0.038381047546863556, -0.007049570791423321, -0.11687760800123215, -0.012090611271560192, -0.020473284646868706, -0.03890780359506607, 0.021809926256537437, -0.017816990613937378, -0.03511083498597145, 0.021388806402683258, -0.07928813993930817, -0.027313316240906715, -0.012763479724526405, 0.03554914891719818, -0.048509448766708374, 0.11892560124397278, -0.046202559024095535, -0.02745535410940647, 0.012463820166885853, 0.009551264345645905, -0.03259389474987984, -0.08679065108299255, 0.0028088290710002184, 0.08303384482860565, 0.017217744141817093, -0.01018568966537714, 0.015830786898732185, 0.060220781713724136, -0.03143053501844406, 0.001158869476057589, -0.037379488348960876, 0.030879735946655273, 0.03987366333603859, -0.0029620828572660685, 0.034791503101587296, 0.026294127106666565, 0.032945215702056885, 0.023984601721167564, -0.002767992904409766, -0.0112134525552392, -0.01684045046567917, 0.06826364994049072, -0.033587172627449036, 0.03903322294354439, 0.04169965162873268, 0.015075374394655228, 0.014396775513887405, -0.0700652003288269, 0.049082737416028976, 0.13384167850017548, 0.14027562737464905, 0.004008032381534576, -0.031690556555986404, 0.08323879539966583, 0.05967741832137108, -0.021924953907728195, 0.07398372888565063, -7.528206991534156e-34, 0.02804821915924549, -0.07724928110837936, 0.05931911990046501, 0.07498046010732651, 0.08355287462472916, 0.037169214338064194, -0.033066585659980774, -0.00924537144601345, -0.08573724329471588, -0.05747314170002937, -0.004660240840166807, 0.0025581081863492727, -0.029556671157479286, -0.023689469322562218, 0.003215025644749403, -0.042987748980522156, 0.0782930850982666, -0.023426193743944168, 0.05946875736117363, 0.06860578060150146, 0.02420303225517273, -0.011361469514667988, -0.022927196696400642, 0.006981437560170889, 0.01243419200181961, 0.028144657611846924, 0.02301088161766529, -0.039272528141736984, 0.012236305512487888, -0.010676694102585316, -0.04047471284866333, 0.011406163685023785, 0.02693238854408264, 0.034689560532569885, -0.05391967296600342, -0.03937597572803497, 0.016155768185853958, 0.015626639127731323, -0.13901875913143158, 0.03735349327325821, -0.04188113287091255, 0.05237700045108795, -0.10763836652040482, 0.012746203690767288, 0.07224572449922562, -0.07202228158712387, -0.011237760074436665, -0.012559347786009312, 0.025259919464588165, 0.04344356432557106, -0.04387504234910011, 0.07189084589481354, 0.029506633058190346, -0.0980420783162117, 0.01536707766354084, -0.09726574271917343, 0.05961764603853226, -0.028050320222973824, -0.033505599945783615, 0.0018297993810847402, 0.10501652210950851, 0.03981972858309746, 0.011841662228107452, -0.0014924529241397977, 0.11369408667087555, -0.013079273514449596, -0.03791895881295204, 0.005959888454526663, -0.015301684848964214, 0.0007745051989331841, -0.054291822016239166, 0.006376211065798998, 0.01930699683725834, 0.04799862578511238, 0.03394905477762222, -0.03060007654130459, -0.022198395803570747, -0.021232977509498596, -0.022774847224354744, -0.04079621285200119, 0.059507209807634354, -0.03354334458708763, -0.12451864778995514, -0.013960435055196285, 0.045438822358846664, -0.013097347691655159, -0.014812556095421314, 0.005383347161114216, 0.003680130699649453, 0.08454020321369171, 0.02770352177321911, -0.028468430042266846, -0.026545850560069084, -0.06898073107004166, -0.0915406346321106, -2.281624616712475e-33, 0.03382064774632454, -0.016130102798342705, -0.07793600112199783, 0.05511772632598877, -0.03571395203471184, -0.06928476691246033, 0.0445903018116951, 0.037613578140735626, 0.07112252712249756, -0.024368546903133392, -0.04510403797030449, 0.058115217834711075, 0.08214152604341507, 0.019435983151197433, -0.058094657957553864, 0.07544489949941635, -0.0930820032954216, -0.0753544420003891, 0.015300687402486801, -0.05276702344417572, 0.0063604568131268024, 0.10402018576860428, 0.06106914207339287, 0.04593668878078461, -0.07557221502065659, 0.019982334226369858, 0.05514603853225708, 0.009046968072652817, -0.06651142239570618, -0.10230982303619385, 0.019213907420635223, 0.05203207954764366, -0.04693536087870598, 0.05223565176129341, 0.052526529878377914, 0.0232810340821743, -0.005114167928695679, 0.0828065276145935, -0.025965824723243713, -0.05087726190686226, 0.0013546351110562682, 0.030868377536535263, -0.011093353852629662, -0.04211033508181572, 0.019553424790501595, 0.009330649860203266, 0.007806150708347559, 0.0011699943570420146, 0.07766664028167725, 0.001871731597930193, 0.01971513219177723, -0.007731568533927202, 0.033155594021081924, 0.018513329327106476, -0.042997147887945175, -0.03456662967801094, 0.022014932706952095, 0.02561386488378048, 0.027380384504795074, 0.01175878755748272, -0.027433140203356743, -0.011557009071111679, -0.050860222429037094, -0.043634817004203796, -0.00475089019164443, -0.0661243423819542, -0.08783990889787674, 0.034265294671058655, 0.07013314217329025, -0.06275971978902817, -0.007684188894927502, 0.007720292545855045, -0.00762998266145587, 0.022120006382465363, -0.03758922591805458, 0.004181095398962498, 0.024140210822224617, -0.08494462072849274, 0.023295888677239418, 0.03677566349506378, -0.05991938337683678, 0.04187488928437233, -0.03800854831933975, 0.014631455764174461, 0.004503116477280855, -0.04645252227783203, -0.002923828549683094, 0.07564446330070496, -0.041854895651340485, -0.0014885644195601344, 0.05064503476023674, -0.020374968647956848, -0.08471506834030151, -0.030657580122351646, -0.004827794153243303, -4.5585885288801364e-8, -0.025642864406108856, -0.003335104323923588, -0.10015403479337692, -0.04295576363801956, 0.1203160285949707, -0.008839537389576435, 0.0607275627553463, 0.033038098365068436, 0.02009870670735836, 0.04706304147839546, -0.08582039177417755, 0.07535229623317719, 0.007171024102717638, -0.011878492310643196, 0.036441002041101456, 0.01162678375840187, -0.056185491383075714, 0.035466212779283524, -0.0015937899006530643, -0.044910818338394165, -0.019353829324245453, -0.0033888116013258696, -0.07508742809295654, -0.040394313633441925, -0.0908115953207016, -0.10738371312618256, 0.07300993800163269, 0.03985349461436272, -0.03608615696430206, -0.06980425864458084, -0.09430902451276779, 0.030911710113286972, 0.006525498814880848, 0.0015409826301038265, 0.05710813030600548, -0.011490778997540474, -0.011315924115478992, 0.029379189014434814, 0.027004053816199303, -0.010246675461530685, -0.04636501520872116, 0.04130053147673607, -0.004987174645066261, 0.002740431809797883, -0.11829844862222672, -0.06842821836471558, 0.03553716465830803, 0.09221936017274857, 0.05907076224684715, -0.0069164396263659, 0.030305109918117523, -0.035691287368535995, -0.056766193360090256, -0.009115510620176792, -0.0074052391573786736, 0.04299648106098175, -0.016639376059174538, -0.12564150989055634, 0.04950688034296036, -0.007962998934090137, 0.08977049589157104, -0.04331369325518608, 0.06525149196386337, 0.015429534018039703 ]
0.044534
DEP0052: `util.isNumber()` Type: End-of-Life The `util.isNumber()` API has been removed. Please use `typeof arg === 'number'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0053: `util.isObject()` Type: End-of-Life The `util.isObject()` API has been removed. Please use `arg && typeof arg === 'object'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0054: `util.isPrimitive()` Type: End-of-Life The `util.isPrimitive()` API has been removed. Please use `Object(arg) !== arg` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0055: `util.isRegExp()` Type: End-of-Life The `util.isRegExp()` API has been removed. Please use `arg instanceof RegExp` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0056: `util.isString()` Type: End-of-Life The `util.isString()` API has been removed. Please use `typeof arg === 'string'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0057: `util.isSymbol()` Type: End-of-Life The `util.isSymbol()` API has been removed. Please use `typeof arg === 'symbol'` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0058: `util.isUndefined()` Type: End-of-Life The `util.isUndefined()` API has been removed. Please use `arg === undefined` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)): ```bash npx codemod@latest @nodejs/util-is ``` ### DEP0059: `util.log()` Type: End-of-Life The `util.log()` API has been removed because it's an unmaintained legacy API that was exposed to user land by accident. Instead, consider the following alternatives based on your specific needs: \* \*\*Third-Party Logging Libraries\*\* \* \*\*Use `console.log(new Date().toLocaleString(), message)`\*\* By adopting one of these alternatives, you can transition away from `util.log()` and choose a logging strategy that aligns with the specific requirements and complexity of your application. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-log-to-console-log)): ```bash npx codemod@latest @nodejs/util-log-to-console-log ``` ### DEP0060: `util.\_extend()` Type: Runtime The [`util.\_extend()`][] API is deprecated because it's an unmaintained legacy API that was exposed to user land by accident. Please use `target = Object.assign(target, source)` instead. ### DEP0061: `fs.SyncWriteStream` Type: End-of-Life The `fs.SyncWriteStream` class was never intended to be a publicly accessible API and has been removed. No alternative API is available. Please use a userland alternative. ### DEP0062: `node --debug` Type: End-of-Life `--debug` activates the legacy V8 debugger interface, which was removed as of V8 5.8. It is replaced by Inspector which is activated with `--inspect` instead. ### DEP0063: `ServerResponse.prototype.writeHeader()` Type: End-of-Life The `node:http` module `ServerResponse.prototype.writeHeader()` API is deprecated. Please use `ServerResponse.prototype.writeHead()` instead. The `ServerResponse.prototype.writeHeader()` method was never documented as an officially supported API. ### DEP0064: `tls.createSecurePair()` Type: End-of-Life The `tls.createSecurePair()` API was deprecated in documentation in Node.js 0.11.3. Users should use `tls.Socket` instead. ### DEP0065: `repl.REPL\_MODE\_MAGIC` and `NODE\_REPL\_MODE=magic` Type: End-of-Life The `node:repl` module's `REPL\_MODE\_MAGIC` constant, used for `replMode` option, has been removed. Its behavior has been functionally identical to that of `REPL\_MODE\_SLOPPY` since Node.js 6.0.0, when V8 5.0 was imported. Please use `REPL\_MODE\_SLOPPY` instead. The `NODE\_REPL\_MODE` environment variable is used to set the underlying `replMode` of an interactive `node` session. Its value, `magic`, is also removed. Please use `sloppy` instead. ### DEP0066: `OutgoingMessage.prototype.\_headers, OutgoingMessage.prototype.\_headerNames` Type: End-of-Life The `node:http` module `OutgoingMessage.prototype.\_headers` and `OutgoingMessage.prototype.\_headerNames` properties are deprecated. Use one of the public methods (e.g. `OutgoingMessage.prototype.getHeader()`, `OutgoingMessage.prototype.getHeaders()`, `OutgoingMessage.prototype.getHeaderNames()`, `OutgoingMessage.prototype.getRawHeaderNames()`, `OutgoingMessage.prototype.hasHeader()`, `OutgoingMessage.prototype.removeHeader()`, `OutgoingMessage.prototype.setHeader()`) for working with outgoing headers. The `OutgoingMessage.prototype.\_headers` and `OutgoingMessage.prototype.\_headerNames` properties were never documented as officially supported properties. ### DEP0067: `OutgoingMessage.prototype.\_renderHeaders` Type: Documentation-only The `node:http` module `OutgoingMessage.prototype.\_renderHeaders()` API is deprecated. The `OutgoingMessage.prototype.\_renderHeaders` property was never documented as an officially supported API. ### DEP0068: `node debug` Type: End-of-Life `node debug` corresponds to the legacy CLI debugger which has been replaced with a V8-inspector based CLI debugger available through `node inspect`. ### DEP0069: `vm.runInDebugContext(string)` Type: End-of-Life DebugContext has been removed in V8 and
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.02295597270131111, 0.00891672819852829, 0.020378459244966507, -0.023758454248309135, 0.07741596549749374, -0.056059829890728, -0.03305574133992195, -0.011855363845825195, 0.01470728125423193, 0.028662865981459618, 0.013226726092398167, -0.08063717931509018, -0.06784562766551971, -0.018692970275878906, 0.04178111255168915, 0.037711892277002335, -0.0400453545153141, -0.04898247495293617, 0.05595916509628296, -0.03463766723871231, 0.0014506637817248702, 0.07436811923980713, -0.015208492055535316, -0.013787227682769299, 0.05819886550307274, -0.05767156556248665, -0.02951243706047535, 0.0030770280864089727, -0.007030315697193146, -0.022559499368071556, -0.0002644625783432275, 0.09871994704008102, -0.056410051882267, -0.0356878899037838, 0.06707973778247833, 0.20700053870677948, 0.00248361611738801, -0.11504354327917099, -0.04685552045702934, -0.031299035996198654, 0.06298050284385681, 0.06675426661968231, -0.008690130896866322, -0.07490510493516922, 0.028282376006245613, 0.02989843674004078, -0.1474989503622055, -0.01876000501215458, 0.012788528576493263, 0.006956799887120724, -0.04542035236954689, -0.03458221256732941, -0.00573377450928092, -0.052862782031297684, 0.04363255575299263, -0.0020362252835184336, 0.042716171592473984, 0.007299255114048719, 0.018466968089342117, -0.0012280490482226014, 0.014684495516121387, -0.003012321190908551, 0.029051419347524643, -0.06957203149795532, -0.0030810122843831778, 0.020257608965039253, -0.0523000992834568, -0.07305122166872025, 0.016845781356096268, 0.037594541907310486, -0.005097563844174147, -0.048405297100543976, -0.10060617327690125, 0.05417797341942787, -0.06179668381810188, 0.011285576038062572, 0.00352498353458941, -0.005261901766061783, -0.013795559294521809, 0.004956746939569712, -0.09065373241901398, -0.024903828278183937, -0.047037795186042786, -0.01841384544968605, -0.04873807728290558, 0.10676856338977814, -0.027464671060442924, 0.024064872413873672, -0.015866588801145554, 0.03811175376176834, -0.021918270736932755, -0.0684237852692604, 0.03158462047576904, 0.05853456258773804, 0.0403120331466198, 0.0116639519110322, -0.033973876386880875, 0.09833929687738419, -0.057100530713796616, 0.017993109300732613, -0.08164823800325394, 0.01746269501745701, -0.025403786450624466, -0.05620758980512619, 0.0036574138794094324, 0.02021942101418972, 0.03324700891971588, -0.042166516184806824, 0.0321149006485939, 0.027524538338184357, -0.07063253223896027, 0.055905796587467194, -0.03967127203941345, -0.013546152040362358, 0.00034108434920199215, -0.01544292364269495, 0.08636076003313065, -0.030320359393954277, 0.05344248190522194, 0.07625962048768997, 0.1027180626988411, 0.005219535902142525, -0.005708855576813221, 0.08092141896486282, 0.005552990362048149, -0.038797762244939804, 0.08597201108932495, 2.6637142800014593e-33, 0.012376703321933746, -0.05156274512410164, 0.1082163006067276, 0.11654642969369888, 0.0069706677459180355, -0.020082693547010422, 0.007510222494602203, 0.017212357372045517, -0.09896988421678543, -0.05596321076154709, -0.10538645833730698, 0.03505248576402664, -0.05483558773994446, 0.025279704481363297, 0.0006515724817290902, -0.058223187923431396, 0.06524647027254105, -0.03093036822974682, 0.09609974920749664, 0.011736145243048668, 0.01647903025150299, -0.0431549996137619, -0.07130110263824463, 0.009638653136789799, 0.02803911827504635, 0.06008909270167351, 0.017540672793984413, -0.0623420812189579, -0.010911536403000355, -0.022863348945975304, -0.054209236055612564, 0.0037624516990035772, -0.017653919756412506, 0.035627417266368866, -0.06475482881069183, -0.06500167399644852, -0.032156895846128464, 0.04582713544368744, -0.16223974525928497, -0.01933792233467102, 0.03351816162467003, 0.05463425815105438, -0.07409153133630753, 0.01802905835211277, 0.09079881012439728, -0.018946213647723198, 0.031131723895668983, 0.000976767623797059, 0.06317063421010971, 0.035524167120456696, -0.022360732778906822, 0.04633233696222305, 0.06958271563053131, -0.10678913444280624, -0.005098429974168539, -0.07298383861780167, 0.06282974034547806, 0.017083536833524704, -0.015511213801801205, -0.056787218898534775, 0.10702310502529144, 0.09478680044412613, 0.06281859427690506, 0.026162289083003998, 0.1132856160402298, 0.03803156688809395, -0.05834316834807396, 0.0005244126659817994, 0.02316126599907875, 0.07401008903980255, -0.03208521381020546, -0.01701783761382103, -0.01657414250075817, 0.03597258776426315, 0.0073312860913574696, -0.06481792777776718, -0.014265080913901329, -0.049987033009529114, -0.003683398710563779, 0.02710244432091713, 0.03664484992623329, 0.03368978202342987, -0.06989626586437225, -0.04576463997364044, 0.04249033331871033, 0.017933007329702377, -0.02288566716015339, 0.02757520042359829, 0.016329292207956314, 0.0893053486943245, 0.08669310063123703, -0.048954956233501434, -0.10349218547344208, -0.020399777218699455, -0.05187731981277466, -4.318062050336545e-33, -0.005738176871091127, -0.016175786033272743, -0.061339087784290314, 0.02679862640798092, -0.0610831044614315, -0.08559580147266388, 0.012762066908180714, 0.05559561401605606, 0.06331406533718109, 0.009520539082586765, -0.020344668999314308, 0.02540224976837635, 0.0883515477180481, -0.0062527768313884735, -0.01888754405081272, -0.0015219139168038964, -0.12238559126853943, -0.06083038076758385, 0.0003949906677007675, 0.015640076249837875, -0.03704490512609482, 0.17535138130187988, 0.011360990814864635, 0.012372903525829315, -0.05409697815775871, 0.03528708219528198, 0.07430730760097504, 0.03657130151987076, -0.022846080362796783, -0.11417969316244125, 0.01016321498900652, 0.020108509808778763, -0.015194443985819817, 0.08772318065166473, -0.008497439324855804, -0.0012870602076873183, 0.0005200988380238414, 0.10018522292375565, -0.03663230687379837, -0.05855914205312729, -0.06970726698637009, 0.0184507854282856, -0.05920720472931862, 0.00431202445179224, -0.0017084348946809769, -0.029879549518227577, 0.037195321172475815, 0.05661032348871231, 0.026564721018075943, -0.032267164438962936, 0.047269970178604126, 0.015491112135350704, -0.006992170121520758, 0.026269860565662384, 0.012508136220276356, -0.014413773082196712, -0.049966007471084595, 0.02107798494398594, 0.06526611000299454, -0.00471976725384593, 0.002482661744579673, 0.014144155196845531, 0.02262667752802372, -0.023532763123512268, -0.008109749294817448, -0.033103492110967636, -0.1252927929162979, 0.008767874911427498, -0.056566160172224045, -0.05382337048649788, 0.036890774965286255, 0.04547911509871483, 0.0009056755225174129, 0.0016272147186100483, -0.06700588017702103, -0.015500325709581375, 0.048625390976667404, 0.027922969311475754, -0.002969352062791586, 0.005305793602019548, -0.10022096335887909, 0.0297223087400198, -0.03326981142163277, 0.07312222570180893, -0.026277249678969383, -0.07756445556879044, 0.04460114613175392, 0.05575030297040939, -0.04233778268098831, 0.0647275298833847, 0.03374193608760834, -0.010010460391640663, -0.09254619479179382, 0.013379449024796486, -0.013658346608281136, -5.156563176456075e-8, 0.00002435808528389316, 0.05011875927448273, -0.06259069591760635, -0.03524824231863022, 0.04477829858660698, 0.007487195078283548, 0.06139674410223961, 0.012790028005838394, 0.03949691355228424, 0.04506196454167366, -0.02583613619208336, 0.07282496988773346, 0.029876282438635826, 0.03989218547940254, 0.005698034539818764, -0.024502811953425407, -0.037741392850875854, 0.042916350066661835, 0.005710786674171686, 0.04585843160748482, -0.053732533007860184, -0.051077134907245636, -0.04298980534076691, -0.06885693967342377, 0.01756661757826805, -0.07248692959547043, 0.055579934269189835, 0.04656803235411644, 0.041733525693416595, -0.033271536231040955, -0.05456417426466942, 0.018425866961479187, 0.015559765510261059, 0.03617258742451668, 0.007637228351086378, 0.039029430598020554, -0.030039414763450623, 0.07530053704977036, 0.024160236120224, -0.02883799560368061, -0.02977549470961094, -0.016459962353110313, -0.10157212615013123, 0.005375382956117392, -0.08888307213783264, -0.014295482076704502, 0.0045443009585142136, 0.04294018819928169, 0.021203845739364624, 0.0510440394282341, 0.00437582191079855, -0.09068175405263901, -0.021814921870827675, -0.02496715448796749, 0.007248253561556339, 0.03878634795546532, -0.0031442039180547, -0.047001346945762634, 0.061481233686208725, 0.027411408722400665, 0.08696585148572922, -0.06413990259170532, 0.057672228664159775, -0.010194807313382626 ]
0.147567
`OutgoingMessage.prototype.\_renderHeaders` property was never documented as an officially supported API. ### DEP0068: `node debug` Type: End-of-Life `node debug` corresponds to the legacy CLI debugger which has been replaced with a V8-inspector based CLI debugger available through `node inspect`. ### DEP0069: `vm.runInDebugContext(string)` Type: End-of-Life DebugContext has been removed in V8 and is not available in Node.js 10+. DebugContext was an experimental API. ### DEP0070: `async\_hooks.currentId()` Type: End-of-Life `async\_hooks.currentId()` was renamed to `async\_hooks.executionAsyncId()` for clarity. This change was made while `async\_hooks` was an experimental API. ### DEP0071: `async\_hooks.triggerId()` Type: End-of-Life `async\_hooks.triggerId()` was renamed to `async\_hooks.triggerAsyncId()` for clarity. This change was made while `async\_hooks` was an experimental API. ### DEP0072: `async\_hooks.AsyncResource.triggerId()` Type: End-of-Life `async\_hooks.AsyncResource.triggerId()` was renamed to `async\_hooks.AsyncResource.triggerAsyncId()` for clarity. This change was made while `async\_hooks` was an experimental API. ### DEP0073: Several internal properties of `net.Server` Type: End-of-Life Accessing several internal, undocumented properties of `net.Server` instances with inappropriate names is deprecated. As the original API was undocumented and not generally useful for non-internal code, no replacement API is provided. ### DEP0074: `REPLServer.bufferedCommand` Type: End-of-Life The `REPLServer.bufferedCommand` property was deprecated in favor of [`REPLServer.clearBufferedCommand()`][]. ### DEP0075: `REPLServer.parseREPLKeyword()` Type: End-of-Life `REPLServer.parseREPLKeyword()` was removed from userland visibility. ### DEP0076: `tls.parseCertString()` Type: End-of-Life `tls.parseCertString()` was a trivial parsing helper that was made public by mistake. While it was supposed to parse certificate subject and issuer strings, it never handled multi-value Relative Distinguished Names correctly. Earlier versions of this document suggested using `querystring.parse()` as an alternative to `tls.parseCertString()`. However, `querystring.parse()` also does not handle all certificate subjects correctly and should not be used. ### DEP0077: `Module.\_debug()` Type: End-of-Life `Module.\_debug()` has been removed. The `Module.\_debug()` function was never documented as an officially supported API. ### DEP0078: `REPLServer.turnOffEditorMode()` Type: End-of-Life `REPLServer.turnOffEditorMode()` was removed from userland visibility. ### DEP0079: Custom inspection function on objects via `.inspect()` Type: End-of-Life Using a property named `inspect` on an object to specify a custom inspection function for [`util.inspect()`][] is deprecated. Use [`util.inspect.custom`][] instead. For backward compatibility with Node.js prior to version 6.4.0, both can be specified. ### DEP0080: `path.\_makeLong()` Type: Documentation-only The internal `path.\_makeLong()` was not intended for public use. However, userland modules have found it useful. The internal API is deprecated and replaced with an identical, public `path.toNamespacedPath()` method. ### DEP0081: `fs.truncate()` using a file descriptor Type: End-of-Life `fs.truncate()` `fs.truncateSync()` usage with a file descriptor is deprecated. Please use `fs.ftruncate()` or `fs.ftruncateSync()` to work with file descriptors. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/fs-truncate-fd-deprecation)): ```bash npx codemod@latest @nodejs/fs-truncate-fd-deprecation ``` ### DEP0082: `REPLServer.prototype.memory()` Type: End-of-Life `REPLServer.prototype.memory()` is only necessary for the internal mechanics of the `REPLServer` itself. Do not use this function. ### DEP0083: Disabling ECDH by setting `ecdhCurve` to `false` Type: End-of-Life The `ecdhCurve` option to `tls.createSecureContext()` and `tls.TLSSocket` could be set to `false` to disable ECDH entirely on the server only. This mode was deprecated in preparation for migrating to OpenSSL 1.1.0 and consistency with the client and is now unsupported. Use the `ciphers` parameter instead. ### DEP0084: requiring bundled internal dependencies Type: End-of-Life Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for internal usage were mistakenly exposed to user code through `require()`. These modules were: \* `v8/tools/codemap` \* `v8/tools/consarray` \* `v8/tools/csvparser` \* `v8/tools/logreader` \* `v8/tools/profile\_view` \* `v8/tools/profile` \* `v8/tools/SourceMap` \* `v8/tools/splaytree` \* `v8/tools/tickprocessor-driver` \* `v8/tools/tickprocessor` \* `node-inspect/lib/\_inspect` (from 7.6.0) \* `node-inspect/lib/internal/inspect\_client` (from 7.6.0) \* `node-inspect/lib/internal/inspect\_repl` (from 7.6.0) The `v8/\*` modules do not have any exports, and if not imported in a specific order would in fact throw errors. As such there are virtually no legitimate use cases for importing them through `require()`. On the other hand, `node-inspect` can be installed locally through a package manager, as it is published on
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.06092652305960655, 0.024572599679231644, 0.05355139076709747, 0.043625932186841965, 0.13503198325634003, -0.09178590774536133, -0.0408811941742897, 0.033819686621427536, -0.0032187094911932945, 0.0034571904689073563, -0.04878642410039902, -0.07337113469839096, -0.06453187763690948, -0.01942739635705948, 0.03692944720387459, 0.0500367097556591, 0.07647544890642166, -0.03739553317427635, 0.052129779011011124, 0.01791706122457981, -0.030725428834557533, 0.05192026495933533, -0.008117225021123886, 0.0397581085562706, 0.049921147525310516, 0.008976629935204983, -0.05063391476869583, -0.01503960881382227, -0.013692830689251423, -0.00970959197729826, 0.05856432393193245, -0.02536803111433983, -0.029389020055532455, 0.03165114298462868, -0.029249116778373718, 0.05689524859189987, 0.05118156969547272, -0.05062546208500862, -0.047321420162916183, 0.013603120110929012, 0.05455487221479416, 0.09311345964670181, -0.11170710623264313, -0.10495936125516891, 0.04270968213677406, -0.06309518963098526, -0.05702638626098633, -0.006619895342737436, -0.09255125373601913, 0.017195865511894226, 0.08149562031030655, 0.021839208900928497, 0.05052643641829491, -0.042332302778959274, 0.022008001804351807, -0.012400190345942974, -0.006485226564109325, 0.02208338864147663, -0.004254823084920645, 0.09137794375419617, -0.018824653699994087, -0.03995766118168831, 0.0016793691320344806, 0.00014261773321777582, -0.007717997767031193, 0.06284774839878082, 0.0701247975230217, -0.006564220879226923, 0.03338685631752014, 0.0035614019725471735, -0.005686277989298105, -0.005403950344771147, -0.054644469171762466, -0.034737322479486465, -0.043455082923173904, 0.08401826024055481, -0.010499534197151661, 0.017593303695321083, -0.0761418491601944, -0.1261247992515564, 0.008620749227702618, -0.027524463832378387, 0.02453375793993473, 0.07802893966436386, -0.018884707242250443, 0.09846575558185577, -0.031720105558633804, -0.010480266995728016, 0.0035662350710481405, 0.08612266927957535, -0.08576107770204544, -0.056527819484472275, -0.06554356217384338, 0.07203996181488037, 0.01019721943885088, 0.010147199966013432, 0.002623233711346984, 0.019618239253759384, -0.03447340056300163, 0.008783549070358276, -0.02036242187023163, -0.04014521837234497, 0.04012582451105118, -0.01529773697257042, 0.0849105641245842, 0.0003479866136331111, 0.012738269753754139, -0.03662068024277687, -0.054642271250486374, -0.03694523498415947, 0.009521286934614182, 0.002010725438594818, 0.052486859261989594, -0.02026284858584404, 0.05846415087580681, 0.016504719853401184, 0.00035346212098374963, -0.013354632072150707, 0.1348777413368225, 0.011388908140361309, 0.15806786715984344, 0.019846897572278976, -0.013924792408943176, 0.0440894290804863, 0.03982916846871376, 0.016153328120708466, -0.008041096851229668, 5.958343561396103e-33, 0.0022256639786064625, -0.03559252247214317, 0.03483954444527626, 0.10765538364648819, 0.09682117402553558, -0.009129540994763374, -0.007145467214286327, 0.02323976904153824, -0.051085297018289566, 0.021098095923662186, -0.03197213634848595, -0.00408193888142705, 0.03019328974187374, 0.018500275909900665, 0.04242066293954849, -0.033588290214538574, -0.043179791420698166, -0.009970435872673988, 0.011467316187918186, 0.01689527928829193, -0.02557733841240406, -0.07914348691701889, -0.05398621782660484, -0.017643868923187256, 0.004547905642539263, 0.0780695453286171, -0.0029338139574974775, 0.03810245171189308, -0.031046420335769653, -0.006456159055233002, 0.002327634720131755, 0.04567515850067139, 0.03218039125204086, 0.04285990074276924, -0.0024580403696745634, -0.07926563918590546, -0.03941331058740616, -0.03879954665899277, -0.10103778541088104, -0.003702618181705475, -0.001954871229827404, 0.0013501718640327454, -0.14066900312900543, -0.01854764111340046, -0.05676812678575516, -0.05994606018066406, -0.06597685068845749, -0.013304519467055798, 0.021698124706745148, -0.052805863320827484, 0.003086566459387541, 0.048724520951509476, 0.04632012918591499, -0.07259166985750198, 0.058315906673669815, -0.00394412549212575, 0.06716591864824295, -0.03991365432739258, 0.029498504474759102, 0.06605338305234909, 0.03998475894331932, 0.03679951652884483, -0.06856710463762283, -0.018000878393650055, 0.022748200222849846, 0.040863294154405594, -0.05130642652511597, -0.019211335107684135, -0.011069122701883316, -0.05178733915090561, -0.026876887306571007, 0.014407123439013958, -0.013557224534451962, 0.023351218551397324, 0.06005385145545006, 0.004579336382448673, -0.04245070368051529, 0.025702007114887238, 0.0195373073220253, -0.008481119759380817, 0.0631198137998581, -0.02527959644794464, -0.01678341254591942, -0.05063510313630104, 0.08303598314523697, -0.017710695043206215, -0.0341205894947052, -0.017493553459644318, 0.01451707724481821, 0.07546208798885345, -0.011928465217351913, -0.05287886783480644, 0.0027458523400127888, -0.032190967351198196, -0.07507234811782837, -7.441419233422489e-33, -0.05834813043475151, -0.016629014164209366, -0.12744060158729553, 0.08415906131267548, -0.037221550941467285, -0.004722109530121088, 0.004983613267540932, 0.017726130783557892, 0.05073128640651703, -0.012064115144312382, 0.018248511478304863, 0.06879142671823502, -0.006827257107943296, 0.07132598012685776, 0.006512748543173075, 0.07350803911685944, -0.0959557443857193, -0.11746908724308014, 0.03802400082349777, -0.09443368017673492, 0.04088252782821655, -0.01210934016853571, 0.05417362228035927, -0.04657139256596565, -0.08578837662935257, -0.037472277879714966, 0.061997901648283005, 0.002789223799481988, -0.02304392121732235, -0.1407908946275711, 0.0026856970507651567, 0.08226732909679413, -0.01679183356463909, 0.06561560183763504, 0.014518586918711662, -0.05955306440591812, 0.03621334582567215, -0.030115026980638504, -0.01816796138882637, -0.0434790775179863, 0.024780655279755592, 0.000939803256187588, 0.015498330816626549, 0.010496972128748894, 0.04239431396126747, 0.03277575969696045, -0.08821611851453781, -0.03475731238722801, 0.003738149767741561, 0.0018570917891338468, -0.0034192774910479784, -0.04677829146385193, 0.04942242428660393, 0.07187778502702713, -0.08830706030130386, -0.0650961622595787, 0.056389980018138885, 0.04796433448791504, 0.04775188863277435, 0.03453628346323967, 0.0807795450091362, -0.06459666788578033, -0.028812024742364883, -0.049195751547813416, -0.004988556262105703, 0.010456687770783901, -0.033607516437768936, 0.026442673057317734, 0.02195540815591812, -0.04792248457670212, 0.026375003159046173, -0.10744915157556534, -0.12218426167964935, -0.0414835587143898, -0.04503114894032478, 0.03450236842036247, -0.009697213768959045, -0.13153748214244843, 0.008528394624590874, 0.0392770953476429, -0.08786682784557343, -0.022368915379047394, -0.022080058231949806, 0.02961261384189129, 0.09151992201805115, -0.033630020916461945, -0.1022486463189125, 0.12304320186376572, 0.001864881138317287, 0.03542904555797577, -0.005872149020433426, -0.003443459514528513, -0.08976080268621445, 0.07036940008401871, -0.008494645357131958, -5.7000104192184153e-8, -0.05176493525505066, 0.009763848036527634, -0.06290197372436523, -0.041082143783569336, 0.03540985286235809, 0.01631219871342182, 0.08465640246868134, -0.006078836973756552, 0.016570791602134705, -0.021991943940520287, -0.03365388140082359, 0.020053254440426826, 0.014540868811309338, 0.034296926110982895, 0.04485461115837097, -0.0020482796244323254, -0.04809725284576416, 0.010761129669845104, 0.01391508150845766, -0.08895327150821686, 0.049200668931007385, 0.05169154331088066, -0.05686791613698006, 0.010108321905136108, -0.06574101001024246, -0.07819027453660965, 0.07203042507171631, 0.068642258644104, -0.0020374988671392202, -0.07408241182565689, -0.07157613337039948, 0.07297373563051224, -0.003791414201259613, -0.04889648035168648, 0.021179301664233208, 0.05205453932285309, -0.0040687257423996925, 0.004589772317558527, 0.0752699077129364, 0.06734935194253922, 0.032101936638355255, -0.024491338059306145, -0.07316727936267853, -0.03488777205348015, -0.034960512071847916, 0.05132492631673813, 0.029257915914058685, 0.05554474517703056, -0.0014349849661812186, 0.10575837641954422, 0.026023367419838905, 0.021490665152668953, -0.06033697724342346, 0.05372335761785507, -0.07199035584926605, -0.06921444833278656, -0.011044391430914402, -0.08568910509347916, 0.02024494856595993, 0.023989738896489143, 0.014336635358631611, -0.02260429412126541, 0.10730049759149551, 0.006785361561924219 ]
0.079677
do not have any exports, and if not imported in a specific order would in fact throw errors. As such there are virtually no legitimate use cases for importing them through `require()`. On the other hand, `node-inspect` can be installed locally through a package manager, as it is published on the npm registry under the same name. No source code modification is necessary if that is done. ### DEP0085: AsyncHooks sensitive API Type: End-of-Life The AsyncHooks sensitive API was never documented and had various minor issues. Use the `AsyncResource` API instead. See . ### DEP0086: Remove `runInAsyncIdScope` Type: End-of-Life `runInAsyncIdScope` doesn't emit the `'before'` or `'after'` event and can thus cause a lot of issues. See . ### DEP0089: `require('node:assert')` Type: Deprecation revoked Importing assert directly was not recommended as the exposed functions use loose equality checks. The deprecation was revoked because use of the `node:assert` module is not discouraged, and the deprecation caused developer confusion. ### DEP0090: Invalid GCM authentication tag lengths Type: End-of-Life Node.js used to support all GCM authentication tag lengths which are accepted by OpenSSL when calling [`decipher.setAuthTag()`][]. Beginning with Node.js v11.0.0, only authentication tag lengths of 128, 120, 112, 104, 96, 64, and 32 bits are allowed. Authentication tags of other lengths are invalid per [NIST SP 800-38D][]. ### DEP0091: `crypto.DEFAULT\_ENCODING` Type: End-of-Life The `crypto.DEFAULT\_ENCODING` property only existed for compatibility with Node.js releases prior to versions 0.9.3 and has been removed. ### DEP0092: Top-level `this` bound to `module.exports` Type: Documentation-only Assigning properties to the top-level `this` as an alternative to `module.exports` is deprecated. Developers should use `exports` or `module.exports` instead. ### DEP0093: `crypto.fips` is deprecated and replaced Type: Runtime The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/crypto-fips-to-getFips)). ```bash npx codemod@latest @nodejs/crypto-fips-to-getFips ``` ### DEP0094: Using `assert.fail()` with more than one argument Type: End-of-Life Using `assert.fail()` with more than one argument is deprecated. Use `assert.fail()` with only one argument or use a different `node:assert` module method. ### DEP0095: `timers.enroll()` Type: End-of-Life `timers.enroll()` has been removed. Please use the publicly documented [`setTimeout()`][] or [`setInterval()`][] instead. ### DEP0096: `timers.unenroll()` Type: End-of-Life `timers.unenroll()` has been removed. Please use the publicly documented [`clearTimeout()`][] or [`clearInterval()`][] instead. ### DEP0097: `MakeCallback` with `domain` property Type: Runtime Users of `MakeCallback` that add the `domain` property to carry context, should start using the `async\_context` variant of `MakeCallback` or `CallbackScope`, or the high-level `AsyncResource` class. ### DEP0098: AsyncHooks embedder `AsyncResource.emitBefore` and `AsyncResource.emitAfter` APIs Type: End-of-Life The embedded API provided by AsyncHooks exposes `.emitBefore()` and `.emitAfter()` methods which are very easy to use incorrectly which can lead to unrecoverable errors. Use [`asyncResource.runInAsyncScope()`][] API instead which provides a much safer, and more convenient, alternative. See . ### DEP0099: Async context-unaware `node::MakeCallback` C++ APIs Type: Compile-time Certain versions of `node::MakeCallback` APIs available to native addons are deprecated. Please use the versions of the API that accept an `async\_context` parameter. ### DEP0100: `process.assert()` Type: End-of-Life `process.assert()` is deprecated. Please use the [`assert`][] module instead. This was never a documented feature. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/createCredentials-to-createSecureContext)). ```bash npx codemod@latest @nodejs/createCredentials-to-createSecureContext ``` ### DEP0101: `--with-lttng` Type: End-of-Life The `--with-lttng` compile-time option has been removed. ### DEP0102: Using `noAssert` in `Buffer#(read|write)` operations Type: End-of-Life Using the `noAssert` argument has no functionality anymore. All input is verified regardless of the value of `noAssert`. Skipping the verification could lead to hard-to-find errors and crashes. ### DEP0103: `process.binding('util').is[...]` typechecks Type: Documentation-only (supports [`--pending-deprecation`][]) Using `process.binding()` in general should be avoided. The type checking methods in particular can be replaced by using [`util.types`][]. This deprecation has been superseded by the deprecation of the `process.binding()` API ([DEP0111](#DEP0111)).
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.10634265840053558, 0.055781979113817215, -0.04493578523397446, 0.12231989204883575, 0.0872107446193695, -0.0734860971570015, -0.11010725796222687, -0.009619672782719135, -0.0399579219520092, 0.04170013219118118, 0.005114035680890083, -0.005965713877230883, -0.017352379858493805, -0.00798580888658762, 0.0006303258705884218, 0.030518410727381706, 0.038791242986917496, -0.07339698076248169, -0.008529426530003548, 0.02548358403146267, -0.05005095154047012, 0.025242654606699944, 0.01960754580795765, 0.02132801152765751, -0.03440527617931366, -0.061384595930576324, -0.07892534136772156, -0.06946642696857452, -0.008594776503741741, -0.023899048566818237, -0.03511388599872589, -0.023563001304864883, 0.0025042116176337004, 0.06377167254686356, 0.00727201160043478, 0.15627560019493103, 0.037920236587524414, -0.08632360398769379, -0.06119712442159653, -0.02937762252986431, 0.11769639700651169, 0.05599312111735344, -0.07643105089664459, -0.030092179775238037, -0.01794026792049408, -0.06327688694000244, -0.06580474227666855, -0.04309745505452156, -0.034266117960214615, 0.01187307108193636, -0.05900169163942337, 0.041051141917705536, -0.012146901339292526, -0.034374482929706573, -0.029253695160150528, 0.07275433838367462, 0.07274428755044937, 0.033367007970809937, -0.02470862679183483, 0.07329721003770828, 0.01690133847296238, -0.021517083048820496, -0.02615887112915516, -0.0023990802001208067, -0.005608041305094957, 0.09259497374296188, -0.03468967601656914, -0.03576350584626198, 0.0682489275932312, 0.06464894860982895, -0.015312490053474903, -0.04997728392481804, -0.016147930175065994, 0.03364748880267143, -0.042569853365421295, 0.04535573348402977, -0.013176447711884975, 0.0009185169474221766, -0.043360620737075806, -0.10865815728902817, -0.001907522790133953, -0.05247819051146507, -0.0196579210460186, 0.002768272766843438, -0.018626932054758072, 0.11921538412570953, -0.04302114248275757, -0.06921840459108353, 0.04104617238044739, 0.08511503785848618, 0.006147659383714199, -0.07654546201229095, -0.06563910841941833, -0.010845483280718327, 0.10813561826944351, 0.018241066485643387, 0.05576359108090401, 0.07215824723243713, -0.048199303448200226, 0.003058991627767682, -0.059934765100479126, 0.015570863150060177, 0.01377266738563776, -0.01085597462952137, 0.0007090955623425543, -0.012934532016515732, -0.01956716738641262, -0.1664341539144516, 0.011362036690115929, 0.03064529411494732, 0.04170212894678116, 0.029663484543561935, 0.0021424375008791685, -0.03927776589989662, 0.06451655924320221, 0.06678769737482071, 0.07603903114795685, -0.007672411389648914, 0.02871059812605381, 0.08901776373386383, 0.061999477446079254, 0.03334643319249153, 0.03330707550048828, 0.025846971198916435, 0.06359757483005524, -0.0177583210170269, 0.052203718572854996, 6.613717661494022e-33, 0.012233063578605652, -0.02499719336628914, 0.019153699278831482, 0.025134271010756493, 0.02940163016319275, 0.025509722530841827, 0.09944373369216919, -0.033204395323991776, -0.07930006086826324, -0.04871191084384918, 0.0027372376061975956, 0.03649608790874481, -0.018251933157444, -0.04130003601312637, 0.025243952870368958, -0.03208345174789429, 0.04483652114868164, -0.03084762580692768, 0.05151735991239548, 0.006002185866236687, 0.014042184688150883, -0.10272328555583954, -0.0867178738117218, 0.02750711888074875, 0.00629343930631876, -0.03119918704032898, 0.0006393906660377979, 0.06923338770866394, 0.028915749862790108, -0.0022299590054899454, -0.0033721565268933773, 0.022175593301653862, -0.05721617117524147, 0.04442146420478821, -0.015683183446526527, -0.030982142314314842, -0.06964792311191559, -0.018173035234212875, -0.09915392845869064, -0.07090645283460617, -0.05255765840411186, 0.0777977928519249, -0.03419812023639679, 0.06789703667163849, -0.0500255785882473, -0.10858596861362457, 0.024344172328710556, -0.03836479410529137, 0.12140561640262604, 0.021682558581233025, -0.05832327529788017, 0.02229720540344715, 0.05360561981797218, -0.07705800980329514, 0.019058145582675934, -0.04437829181551933, 0.0730341374874115, -0.052607230842113495, 0.022166524082422256, 0.022232381626963615, 0.10286012291908264, -0.029062481597065926, -0.015292530879378319, 0.0055753677152097225, 0.07111774384975433, -0.006232899148017168, -0.10484838485717773, 0.008691016584634781, -0.03242378681898117, -0.026885177940130234, -0.051022615283727646, -0.02116299420595169, -0.06763701140880585, -0.018579700961709023, 0.05054156109690666, 0.0422884002327919, 0.003100896952673793, 0.02097570337355137, -0.004774121567606926, -0.10850907862186432, 0.05715944245457649, -0.05816749855875969, 0.02101306989789009, 0.04637051001191139, -0.034998174756765366, 0.0473257414996624, 0.01803259737789631, 0.003017101436853409, 0.0809473991394043, 0.05996755510568619, 0.07684320211410522, -0.022882694378495216, 0.010798357427120209, -0.042114388197660446, -0.06960708647966385, -7.945291948166585e-33, -0.02957632951438427, 0.024373918771743774, -0.04468497633934021, 0.06449741125106812, 0.01848534122109413, -0.046242453157901764, -0.027889147400856018, -0.031941190361976624, 0.012096647173166275, 0.013922798447310925, -0.02770249731838703, 0.011320872232317924, 0.06391843408346176, -0.026140354573726654, 0.03187021240592003, 0.07159453630447388, -0.01272067241370678, -0.04725976288318634, 0.05188014730811119, -0.04875804856419563, 0.05159251019358635, 0.11092477291822433, 0.04336819797754288, 0.029866598546504974, -0.04475492984056473, -0.0092941178008914, 0.01045690942555666, -0.009257667697966099, -0.043967507779598236, -0.01044536754488945, 0.020264195278286934, 0.06020994856953621, -0.029125558212399483, 0.07644039392471313, -0.05337865278124809, -0.06498030573129654, -0.008418706245720387, 0.04093656688928604, -0.033001601696014404, -0.036968644708395004, 0.06510656327009201, 0.07114669680595398, -0.07029397040605545, -0.026151981204748154, -0.005651664454489946, -0.03358801081776619, -0.02845710702240467, 0.06048399582505226, -0.060181379318237305, -0.05192341282963753, -0.06227807328104973, 0.030169902369379997, 0.006245846394449472, 0.012238413095474243, -0.06480591744184494, -0.010427433997392654, 0.07307099550962448, 0.07930076867341995, 0.028160855174064636, -0.044434547424316406, 0.07498239725828171, -0.011746183037757874, -0.04593849182128906, -0.08095037192106247, -0.011539672501385212, -0.03881814330816269, 0.006601360626518726, 0.011707133613526821, 0.05954679101705551, 0.00612058537080884, -0.024415088817477226, 0.02482535131275654, -0.03394738584756851, 0.0023530435282737017, -0.042737603187561035, 0.0017157591646537185, -0.02015167847275734, -0.053011633455753326, 0.017349259927868843, 0.08236383646726608, -0.096042200922966, 0.04089687764644623, 0.024524269625544548, 0.07028961181640625, 0.011964584700763226, -0.02916865423321724, 0.027844263240695, 0.03198366239666939, -0.04117543622851372, 0.07533712685108185, 0.03162916749715805, -0.05427468195557594, -0.09637507051229477, 0.06167293339967728, 0.09328964352607727, -5.801262403792862e-8, -0.015584415756165981, 0.021760186180472374, -0.033613421022892, 0.009203575551509857, 0.10384789854288101, -0.06733786314725876, 0.04067408666014671, 0.02599848434329033, 0.023012369871139526, 0.05404458940029144, -0.05800778046250343, 0.006396687123924494, 0.017526714131236076, -0.04830334708094597, -0.03733132407069206, -0.011388051323592663, 0.036744214594364166, 0.03811625763773918, -0.04505844786763191, -0.031720228493213654, -0.013122388161718845, -0.01733468845486641, -0.04484513774514198, 0.052660197019577026, -0.01067421492189169, 0.022131159901618958, 0.09132419526576996, 0.053639285266399384, 0.017368348315358162, -0.05512699857354164, -0.08024079352617264, 0.0006684993277303874, 0.06237204000353813, -0.08021564781665802, -0.05791957676410675, 0.005506529007107019, -0.043310072273015976, -0.015278792940080166, 0.09043845534324646, 0.06116034463047981, -0.08616757392883301, 0.03783303499221802, 0.018260786309838295, 0.05047270655632019, -0.099601611495018, -0.025692645460367203, 0.011615099385380745, -0.0050025987438857555, 0.007224998436868191, 0.008388389833271503, 0.015486500225961208, -0.09435935318470001, -0.06420731544494629, 0.061094168573617935, -0.01334439218044281, 0.007194210309535265, -0.03719634190201759, -0.05300567299127579, -0.06220865249633789, -0.001160366809926927, 0.07498664408922195, -0.015039829537272453, 0.11492115259170532, -0.06254960596561432 ]
0.074048
Skipping the verification could lead to hard-to-find errors and crashes. ### DEP0103: `process.binding('util').is[...]` typechecks Type: Documentation-only (supports [`--pending-deprecation`][]) Using `process.binding()` in general should be avoided. The type checking methods in particular can be replaced by using [`util.types`][]. This deprecation has been superseded by the deprecation of the `process.binding()` API ([DEP0111](#DEP0111)). ### DEP0104: `process.env` string coercion Type: Documentation-only (supports [`--pending-deprecation`][]) When assigning a non-string property to [`process.env`][], the assigned value is implicitly converted to a string. This behavior is deprecated if the assigned value is not a string, boolean, or number. In the future, such assignment might result in a thrown error. Please convert the property to a string before assigning it to `process.env`. ### DEP0105: `decipher.finaltol` Type: End-of-Life `decipher.finaltol()` has never been documented and was an alias for [`decipher.final()`][]. This API has been removed, and it is recommended to use [`decipher.final()`][] instead. ### DEP0106: `crypto.createCipher` and `crypto.createDecipher` Type: End-of-Life `crypto.createCipher()` and `crypto.createDecipher()` have been removed as they use a weak key derivation function (MD5 with no salt) and static initialization vectors. It is recommended to derive a key using [`crypto.pbkdf2()`][] or [`crypto.scrypt()`][] with random salts and to use [`crypto.createCipheriv()`][] and [`crypto.createDecipheriv()`][] to obtain the [`Cipheriv`][] and [`Decipheriv`][] objects respectively. ### DEP0107: `tls.convertNPNProtocols()` Type: End-of-Life This was an undocumented helper function not intended for use outside Node.js core and obsoleted by the removal of NPN (Next Protocol Negotiation) support. ### DEP0108: `zlib.bytesRead` Type: End-of-Life Deprecated alias for [`zlib.bytesWritten`][]. This original name was chosen because it also made sense to interpret the value as the number of bytes read by the engine, but is inconsistent with other streams in Node.js that expose values under these names. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/zlib-bytesread-to-byteswritten)): ```bash npx codemod@latest @nodejs/zlib-bytesread-to-byteswritten ``` ### DEP0109: `http`, `https`, and `tls` support for invalid URLs Type: End-of-Life Some previously supported (but strictly invalid) URLs were accepted through the [`http.request()`][], [`http.get()`][], [`https.request()`][], [`https.get()`][], and [`tls.checkServerIdentity()`][] APIs because those were accepted by the legacy `url.parse()` API. The mentioned APIs now use the WHATWG URL parser that requires strictly valid URLs. Passing an invalid URL is deprecated and support will be removed in the future. ### DEP0110: `vm.Script` cached data Type: Documentation-only The `produceCachedData` option is deprecated. Use [`script.createCachedData()`][] instead. ### DEP0111: `process.binding()` Type: Documentation-only (supports [`--pending-deprecation`][]) `process.binding()` is for use by Node.js internal code only. While `process.binding()` has not reached End-of-Life status in general, it is unavailable when the [permission model][] is enabled. ### DEP0112: `dgram` private APIs Type: End-of-Life The `node:dgram` module previously contained several APIs that were never meant to accessed outside of Node.js core: `Socket.prototype.\_handle`, `Socket.prototype.\_receiving`, `Socket.prototype.\_bindState`, `Socket.prototype.\_queue`, `Socket.prototype.\_reuseAddr`, `Socket.prototype.\_healthCheck()`, `Socket.prototype.\_stopReceiving()`, and `dgram.\_createSocketHandle()`. These have been removed. ### DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()` Type: End-of-Life `Cipher.setAuthTag()` and `Decipher.getAuthTag()` are no longer available. They were never documented and would throw when called. ### DEP0114: `crypto.\_toBuf()` Type: End-of-Life The `crypto.\_toBuf()` function was not designed to be used by modules outside of Node.js core and was removed. ### DEP0115: `crypto.prng()`, `crypto.pseudoRandomBytes()`, `crypto.rng()` Type: Documentation-only (supports [`--pending-deprecation`][]) In recent versions of Node.js, there is no difference between [`crypto.randomBytes()`][] and `crypto.pseudoRandomBytes()`. The latter is deprecated along with the undocumented aliases `crypto.prng()` and `crypto.rng()` in favor of [`crypto.randomBytes()`][] and might be removed in a future release. ### DEP0116: Legacy URL API Type: Deprecation revoked The [legacy URL API][] is deprecated. This includes [`url.format()`][], [`url.parse()`][], [`url.resolve()`][], and the [legacy `urlObject`][]. Please use the [WHATWG URL API][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url)). ```bash npx codemod@latest @nodejs/node-url-to-whatwg-url ``` ### DEP0117: Native crypto handles Type: End-of-Life Previous versions of Node.js exposed handles to internal native objects through the `\_handle` property of the `Cipher`, `Decipher`, `DiffieHellman`, `DiffieHellmanGroup`, `ECDH`, `Hash`, `Hmac`,
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.07189050316810608, 0.014709481969475746, 0.005389552563428879, -0.01680273935198784, 0.008976307697594166, -0.10350224375724792, 0.06442714482545853, 0.06240321695804596, -0.008037472143769264, 0.04733247309923172, -0.019080638885498047, -0.026614166796207428, 0.007982485927641392, 0.039378631860017776, 0.036331627517938614, 0.041894443333148956, 0.05432833358645439, -0.08590279519557953, -0.01685415580868721, 0.00713467737659812, 0.015035511925816536, 0.029808178544044495, -0.022217124700546265, 0.07033071666955948, -0.042516760528087616, -0.08109794557094574, -0.096349336206913, -0.003527141408994794, 0.047426480799913406, 0.028634648770093918, 0.009648269973695278, 0.06950260698795319, -0.09873354434967041, 0.0004960392252542078, 0.07866121083498001, 0.12990137934684753, 0.04355710372328758, -0.0891008973121643, -0.008613345213234425, 0.00683384807780385, 0.020105652511119843, 0.024694260209798813, -0.09610141068696976, -0.04032832756638527, -0.006259151268750429, -0.026565035805106163, -0.019976157695055008, -0.028418846428394318, -0.10507559776306152, -0.044187892228364944, 0.026281090453267097, 0.05366294085979462, 0.00022109801648184657, -0.05578702688217163, 0.014784133061766624, -0.0027051279321312904, 0.020048268139362335, 0.06715811043977737, -0.015107613056898117, -0.0035445804242044687, 0.001988311531022191, -0.01132182963192463, -0.07556319981813431, -0.011673972941935062, 0.0015332920011132956, 0.09520445019006729, 0.006919997278600931, -0.08150306344032288, 0.07081037014722824, 0.0752045139670372, -0.04259372502565384, -0.0013898537727072835, -0.0026188595220446587, 0.07521070539951324, -0.0022908486425876617, -0.018432235345244408, 0.05228395387530327, -0.05710330232977867, 0.004057737998664379, -0.1361897587776184, -0.048350509256124496, -0.054537463933229446, -0.05065491423010826, 0.07076650112867355, 0.03201974183320999, 0.03170507773756981, 0.0003066112694796175, -0.0448162741959095, 0.10546611994504929, 0.0670895054936409, -0.020142247900366783, -0.10136236995458603, 0.026148812845349312, 0.051894865930080414, 0.09529043734073639, 0.09395671635866165, -0.028336700052022934, 0.04511794447898865, -0.06626832485198975, 0.0369022861123085, -0.04945042356848717, 0.03792409971356392, 0.03226057440042496, -0.04569007456302643, 0.11077108234167099, -0.023693818598985672, 0.018640093505382538, -0.09260618686676025, -0.01770894229412079, -0.026299377903342247, 0.0022651953622698784, -0.01739233173429966, 0.05476018786430359, 0.04356471076607704, -0.05098756030201912, 0.11812636256217957, 0.056847892701625824, 0.0010244081495329738, -0.007145434617996216, 0.04897415265440941, 0.08129572123289108, 0.014791574329137802, 0.06242096796631813, -0.0001981065870495513, 0.014361082576215267, -0.033723004162311554, 0.030139388516545296, 3.3856827064673536e-33, 0.039860568940639496, -0.0633004680275917, 0.021171195432543755, 0.09965740889310837, 0.03811837360262871, 0.020462308079004288, 0.045649535953998566, -0.009815124794840813, -0.10850202292203903, -0.021682649850845337, 0.018064267933368683, 0.0330798402428627, -0.049965906888246536, -0.02466822788119316, 0.03456946834921837, 0.019171802327036858, 0.08917499333620071, 0.03967595100402832, -0.026662608608603477, 0.057072706520557404, 0.10573183000087738, -0.07982450723648071, -0.10615521669387817, -0.03558087721467018, -0.03567256033420563, 0.008821986615657806, -0.07180552184581757, 0.05360988527536392, 0.04859425127506256, -0.003268894972279668, -0.05245215445756912, -0.05567173287272453, 0.04000198096036911, 0.0839332640171051, -0.009938321076333523, -0.049109816551208496, 0.05358971655368805, 0.021504703909158707, -0.04936424270272255, -0.11591224372386932, 0.012057570740580559, 0.02860340103507042, -0.02825191617012024, 0.024555562064051628, 0.052221886813640594, -0.07355368882417679, 0.012544255703687668, 0.028201112523674965, 0.03468915447592735, -0.02398761920630932, 0.04528273642063141, 0.09129320830106735, 0.03796549141407013, -0.02219768613576889, -0.04561353474855423, -0.10412837564945221, 0.04196977615356445, 0.02861899510025978, 0.013820899650454521, -0.05050269886851311, 0.014909107238054276, 0.028540128841996193, -0.07001801580190659, -0.0021215782035142183, 0.02984950877726078, 0.0006893252721056342, -0.054644256830215454, 0.016578417271375656, 0.056681230664253235, -0.047706931829452515, -0.06585144996643066, -0.009832896292209625, -0.07831896096467972, 0.012117709033191204, 0.10938721895217896, -0.044656816869974136, 0.03162257745862007, -0.064239002764225, -0.01620972529053688, -0.0041151950135827065, 0.04058706760406494, 0.04326503351330757, -0.04763127863407135, 0.05916484072804451, -0.01363473478704691, -0.06082436814904213, -0.03167223930358887, 0.013179156929254532, 0.06902528554201126, -0.02655543014407158, -0.05535757914185524, -0.010306093841791153, -0.042317382991313934, -0.027545081451535225, -0.027773186564445496, -5.104502668525195e-33, 0.0030140788294374943, -0.07936516404151917, -0.056258831173181534, 0.0561763197183609, -0.06387507915496826, -0.05610840767621994, 0.03505028411746025, -0.05629628524184227, 0.04979269579052925, -0.11494391411542892, 0.06971918791532516, -0.08342115581035614, 0.05983318015933037, 0.05693305656313896, -0.032439205795526505, 0.014309669844806194, -0.1671438068151474, -0.09931262582540512, 0.0656786635518074, 0.02216726914048195, 0.06358423829078674, 0.0993586853146553, 0.0032140477560460567, 0.11402614414691925, -0.06280475109815598, 0.014947894029319286, -0.00932605005800724, -0.009537411853671074, -0.011567126028239727, -0.0042232912965118885, 0.021911146119236946, 0.07097281515598297, -0.05364999920129776, 0.024609224870800972, -0.05166037008166313, -0.09378185868263245, 0.04237201064825058, 0.12041910737752914, -0.014642209745943546, -0.026447806507349014, 0.09122004359960556, 0.004887616727501154, -0.0062465304508805275, -0.007600386627018452, 0.029378624632954597, -0.03253939747810364, 0.09149311482906342, 0.03136298060417175, 0.01899542100727558, 0.03325607627630234, 0.04831898584961891, -0.03878677636384964, -0.00601199921220541, 0.04112973436713219, 0.002586191752925515, -0.015302132815122604, 0.012814861722290516, -0.08026892691850662, -0.030986009165644646, 0.028483785688877106, -0.02074669860303402, -0.0007623264100402594, 0.012101447209715843, 0.0031243404373526573, -0.011119166389107704, -0.0020326438825577497, -0.04269595444202423, 0.02586364559829235, 0.07866913080215454, -0.05133849009871483, 0.06903360038995743, -0.03507445752620697, -0.07541698217391968, -0.05048832297325134, 0.04366612061858177, 0.01825077086687088, 0.013460955582559109, -0.02617642842233181, 0.04116177186369896, 0.049245405942201614, -0.05449261888861656, 0.0069139557890594006, 0.03545082360506058, 0.02855107933282852, -0.001315584871917963, -0.02008191868662834, -0.03744278848171234, 0.04109060764312744, -0.07062652707099915, 0.05154361575841904, 0.02402637153863907, -0.039558444172143936, -0.058035921305418015, 0.007962136529386044, -0.04373590275645256, -5.613463116560524e-8, -0.06447834521532059, 0.026736468076705933, -0.08686503022909164, 0.04197291284799576, 0.0115263806656003, -0.025100823491811752, 0.017656465992331505, -0.05689219757914543, 0.05479820445179939, 0.01744838058948517, -0.054388128221035004, -0.0016906713135540485, -0.05507908761501312, -0.004494229331612587, -0.0027360692620277405, -0.027196034789085388, 0.02996819093823433, 0.036812011152505875, -0.07355211675167084, -0.054128315299749374, 0.0326383113861084, -0.08924549072980881, -0.040795400738716125, -0.03936867415904999, -0.02462979592382908, -0.05148262903094292, 0.041725534945726395, 0.008044482208788395, 0.0031436076387763023, -0.022152142599225044, -0.0695875734090805, 0.03663698583841324, 0.00011334256851114333, -0.0034085449296981096, 0.03130924329161644, 0.06700017303228378, 0.010794101282954216, 0.052219457924366, 0.020775694400072098, 0.038784101605415344, 0.05321317911148071, 0.046167369931936264, -0.09281571954488754, -0.018469147384166718, 0.00038150252657942474, 0.0018591274274513125, 0.0013597365468740463, 0.058338701725006104, 0.02408764325082302, 0.019699743017554283, -0.02261250652372837, 0.003948695957660675, 0.04668053612112999, 0.04271768033504486, -0.08778220415115356, 0.06963898986577988, -0.04084363952279091, -0.0011117263929918408, -0.01067967526614666, 0.004222666844725609, 0.05877434462308884, -0.07832495868206024, 0.06678242236375809, -0.018136460334062576 ]
0.017351
[legacy `urlObject`][]. Please use the [WHATWG URL API][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url)). ```bash npx codemod@latest @nodejs/node-url-to-whatwg-url ``` ### DEP0117: Native crypto handles Type: End-of-Life Previous versions of Node.js exposed handles to internal native objects through the `\_handle` property of the `Cipher`, `Decipher`, `DiffieHellman`, `DiffieHellmanGroup`, `ECDH`, `Hash`, `Hmac`, `Sign`, and `Verify` classes. The `\_handle` property has been removed because improper use of the native object can lead to crashing the application. ### DEP0118: `dns.lookup()` support for a falsy host name Type: End-of-Life Previous versions of Node.js supported `dns.lookup()` with a falsy host name like `dns.lookup(false)` due to backward compatibility. This has been removed. ### DEP0119: `process.binding('uv').errname()` private API Type: Documentation-only (supports [`--pending-deprecation`][]) `process.binding('uv').errname()` is deprecated. Please use [`util.getSystemErrorName()`][] instead. ### DEP0120: Windows Performance Counter support Type: End-of-Life Windows Performance Counter support has been removed from Node.js. The undocumented `COUNTER\_NET\_SERVER\_CONNECTION()`, `COUNTER\_NET\_SERVER\_CONNECTION\_CLOSE()`, `COUNTER\_HTTP\_SERVER\_REQUEST()`, `COUNTER\_HTTP\_SERVER\_RESPONSE()`, `COUNTER\_HTTP\_CLIENT\_REQUEST()`, and `COUNTER\_HTTP\_CLIENT\_RESPONSE()` functions have been deprecated. ### DEP0121: `net.\_setSimultaneousAccepts()` Type: End-of-Life The undocumented `net.\_setSimultaneousAccepts()` function was originally intended for debugging and performance tuning when using the `node:child\_process` and `node:cluster` modules on Windows. The function is not generally useful and is being removed. See discussion here: ### DEP0122: `tls` `Server.prototype.setOptions()` Type: End-of-Life Please use `Server.prototype.setSecureContext()` instead. ### DEP0123: setting the TLS ServerName to an IP address Type: End-of-Life Setting the TLS ServerName to an IP address is not permitted by [RFC 6066][]. ### DEP0124: using `REPLServer.rli` Type: End-of-Life This property is a reference to the instance itself. ### DEP0125: `require('node:\_stream\_wrap')` Type: End-of-Life The `node:\_stream\_wrap` module is deprecated. ### DEP0126: `timers.active()` Type: End-of-Life The previously undocumented `timers.active()` has been removed. Please use the publicly documented [`timeout.refresh()`][] instead. If re-referencing the timeout is necessary, [`timeout.ref()`][] can be used with no performance impact since Node.js 10. ### DEP0127: `timers.\_unrefActive()` Type: End-of-Life The previously undocumented and "private" `timers.\_unrefActive()` has been removed. Please use the publicly documented [`timeout.refresh()`][] instead. If unreferencing the timeout is necessary, [`timeout.unref()`][] can be used with no performance impact since Node.js 10. ### DEP0128: modules with an invalid `main` entry and an `index.js` file Type: Runtime Modules that have an invalid `main` entry (e.g., `./does-not-exist.js`) and also have an `index.js` file in the top level directory will resolve the `index.js` file. That is deprecated and is going to throw an error in future Node.js versions. ### DEP0129: `ChildProcess.\_channel` Type: End-of-Life The `\_channel` property of child process objects returned by `spawn()` and similar functions is not intended for public use. Use `ChildProcess.channel` instead. ### DEP0130: `Module.createRequireFromPath()` Type: End-of-Life Use [`module.createRequire()`][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/create-require-from-path)): ```bash npx codemod@latest @nodejs/create-require-from-path ``` ### DEP0131: Legacy HTTP parser Type: End-of-Life The legacy HTTP parser, used by default in versions of Node.js prior to 12.0.0, is deprecated and has been removed in v13.0.0. Prior to v13.0.0, the `--http-parser=legacy` command-line flag could be used to revert to using the legacy parser. ### DEP0132: `worker.terminate()` with callback Type: End-of-Life Passing a callback to [`worker.terminate()`][] is deprecated. Use the returned `Promise` instead, or a listener to the worker's `'exit'` event. ### DEP0133: `http` `connection` Type: Documentation-only Prefer [`response.socket`][] over [`response.connection`][] and [`request.socket`][] over [`request.connection`][]. ### DEP0134: `process.\_tickCallback` Type: Documentation-only (supports [`--pending-deprecation`][]) The `process.\_tickCallback` property was never documented as an officially supported API. ### DEP0135: `WriteStream.open()` and `ReadStream.open()` are internal Type: End-of-Life [`WriteStream.open()`][] and [`ReadStream.open()`][] are undocumented internal APIs that do not make sense to use in userland. File streams should always be opened through their corresponding factory methods [`fs.createWriteStream()`][] and [`fs.createReadStream()`][]) or by passing a file descriptor in options. ### DEP0136: `http` `finished` Type: Documentation-only [`response.finished`][] indicates whether [`response.end()`][] has been called, not whether `'finish'` has been emitted and the underlying data is
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.09912768751382828, 0.050426971167325974, 0.016704805195331573, -0.01853305660188198, 0.04876292869448662, -0.13237710297107697, -0.08053383976221085, -0.005585927050560713, 0.006238252855837345, 0.04796072840690613, -0.06932121515274048, -0.014915102161467075, -0.04044941067695618, 0.049510203301906586, 0.04255594313144684, 0.05291103571653366, -0.05807900056242943, 0.04318350553512573, 0.017130659893155098, 0.04318490996956825, 0.028372347354888916, 0.03849850967526436, 0.04042079299688339, -0.02647409960627556, -0.023395391181111336, -0.09523425251245499, -0.02261255495250225, 0.05950448289513588, 0.009770735166966915, -0.015371576882898808, 0.02389027364552021, 0.049816425889730453, -0.06197144836187363, -0.021065976470708847, -0.014361735433340073, 0.16792230308055878, 0.03867268189787865, -0.030567409470677376, -0.043230243027210236, -0.06063143536448479, 0.09183823317289352, 0.07125010341405869, -0.006490691099315882, -0.08011970669031143, -0.03078075498342514, 0.010137920267879963, -0.07942182570695877, 0.0020971945486962795, -0.04919155687093735, -0.012979584746062756, 0.015149052254855633, -0.08203346282243729, -0.02165091224014759, -0.022904030978679657, -0.01455103512853384, 0.06316324323415756, -0.07303345948457718, 0.012953594326972961, 0.037190478295087814, 0.0328676775097847, 0.013267246074974537, 0.006707494612783194, 0.021148398518562317, -0.01367075927555561, 0.01004781387746334, 0.026886265724897385, -0.05285331979393959, -0.06702709197998047, -0.0120194461196661, 0.05823199823498726, 0.025555716827511787, -0.007168445270508528, -0.05888059735298157, 0.01910424791276455, -0.04716499149799347, -0.02875903993844986, -0.05032404884696007, -0.029481803998351097, -0.0352294035255909, -0.014373081736266613, 0.026430198922753334, -0.047004636377096176, -0.01728815957903862, 0.0874611958861351, -0.004737867042422295, 0.10576704889535904, -0.02208823151886463, -0.0355052575469017, 0.05138678103685379, 0.06768306344747543, -0.020299842581152916, -0.08481598645448685, 0.0008443488623015583, 0.045810163021087646, 0.0054143755696713924, 0.01565248891711235, 0.06291259825229645, 0.07992449402809143, -0.04985908418893814, -0.0022490634582936764, -0.0036427804734557867, -0.010302199050784111, 0.04703648015856743, -0.07660016417503357, 0.024500565603375435, 0.02818569354712963, 0.02760074846446514, 0.01517206709831953, 0.019815906882286072, 0.031798575073480606, -0.017824027687311172, 0.04814023897051811, -0.06050720438361168, -0.06679530441761017, -0.015619398094713688, -0.009669842198491096, 0.0035774835851043463, -0.04304610192775726, 0.045676715672016144, 0.10985300689935684, 0.04320963844656944, 0.06864602118730545, -0.02837579883635044, 0.051579248160123825, -0.03339165821671486, -0.024998392909765244, 0.06588011234998703, 1.7299708116723373e-33, 0.005736575927585363, -0.015991246327757835, 0.004385783802717924, 0.04441868141293526, 0.054312124848365784, -0.027520930394530296, 0.06183790788054466, -0.004168403800576925, -0.12796659767627716, -0.024933375418186188, -0.0405067577958107, 0.028755534440279007, -0.0007274826057255268, -0.08834443241357803, -0.040016837418079376, 0.003697487525641918, 0.01947864517569542, -0.052522748708724976, 0.11161058396100998, 0.05624518543481827, 0.06370113790035248, 0.0020145538728684187, -0.007960150018334389, 0.029189009219408035, 0.042129531502723694, -0.00664918776601553, 0.03195945918560028, 0.0010275393724441528, -0.004628733266144991, -0.009194174781441689, 0.02624104544520378, 0.0014416648773476481, -0.035930782556533813, -0.005948489997535944, -0.0329863578081131, -0.013298827223479748, 0.047812625765800476, 0.01480603963136673, -0.15290813148021698, -0.07398424297571182, 0.04463282600045204, 0.04103336110711098, -0.10861796140670776, 0.04983140900731087, 0.025356171652674675, -0.06643961369991302, 0.007751669269055128, -0.04704970121383667, 0.032894860953092575, 0.09757658839225769, -0.08329895883798599, -0.04390278831124306, 0.013478589244186878, -0.08191914111375809, -0.03793567046523094, -0.0919748842716217, 0.04582790657877922, -0.054580964148044586, -0.053615354001522064, -0.019958658143877983, 0.061387963593006134, 0.06228948384523392, -0.012884065508842468, -0.029995592311024666, 0.027303924784064293, 0.010740358382463455, 0.006761929951608181, -0.00821309071034193, -0.08393872529268265, 0.06201627105474472, -0.05458083003759384, 0.02555215358734131, -0.0026111644692718983, 0.01916121132671833, 0.01705240085721016, -0.03576818108558655, -0.08842455595731735, -0.017759956419467926, 0.059527669101953506, -0.042991820722818375, 0.07336397469043732, -0.04937555268406868, -0.04281149059534073, 0.07617666572332382, 0.017124349251389503, 0.0362587571144104, 0.0023581015411764383, -0.04135957732796669, 0.020178819075226784, 0.04090849682688713, 0.0734996423125267, -0.04067961499094963, 0.0033421129919588566, -0.06561565399169922, -0.0942884311079979, -3.309271165560089e-33, 0.01019168272614479, -0.04420730844140053, -0.029174866154789925, 0.11057842522859573, -0.04555123671889305, -0.0660407543182373, -0.022857336327433586, 0.009753569029271603, 0.10547979176044464, -0.047398220747709274, -0.010869219899177551, 0.028313754126429558, 0.1497373729944229, -0.027927741408348083, 0.06486826390028, 0.035612959414720535, -0.12522506713867188, -0.019241128116846085, 0.024976758286356926, -0.022160690277814865, -0.042247869074344635, 0.11273214221000671, -0.07377876341342926, 0.036968063563108444, -0.04707007855176926, 0.0037205114495009184, 0.005518959369510412, 0.024067984893918037, 0.003707371186465025, -0.08480212837457657, -0.019677363336086273, 0.014239833690226078, 0.008759917691349983, 0.06394627690315247, -0.037260692566633224, -0.034047335386276245, -0.0521380715072155, 0.09940671175718307, 0.06847495585680008, -0.10380058735609055, 0.02279077284038067, -0.01387456152588129, -0.03368697315454483, 0.04293482378125191, 0.00338004226796329, 0.005160043481737375, -0.057665761560201645, 0.05939825624227524, 0.05177975445985794, 0.030221665278077126, 0.0011751804267987609, -0.02781910076737404, 0.04627499356865883, -0.022554051131010056, 0.009492078796029091, 0.0030419721733778715, -0.002375016687437892, 0.037664346396923065, 0.0014562918804585934, -0.003608729923143983, 0.0623137429356575, -0.03352222591638565, -0.008651179261505604, 0.06383680552244186, -0.012386476621031761, -0.003535551019012928, -0.16041724383831024, 0.014848239719867706, 0.01973586529493332, 0.018508756533265114, -0.021793045103549957, -0.0013287648325785995, -0.004132241476327181, -0.044006820768117905, 0.038593728095293045, -0.044193752110004425, 0.08483868092298508, -0.05199494585394859, 0.03259408101439476, 0.04291751980781555, -0.06896311789751053, 0.0825330913066864, -0.01197575032711029, 0.01976337656378746, 0.09125423431396484, -0.020632397383451462, -0.00917114783078432, 0.06435869634151459, -0.03953677415847778, 0.046138882637023926, 0.009567782282829285, 0.06302939355373383, -0.09518773853778839, -0.01199356373399496, 0.004552696831524372, -5.316028151014507e-8, -0.028000006452202797, 0.06310614198446274, -0.1374656707048416, 0.020576385781168938, 0.04831934720277786, 0.024450378492474556, 0.07078824192285538, 0.020735014230012894, 0.06484873592853546, 0.08167368173599243, -0.00941835343837738, 0.04607633873820305, 0.04631698876619339, 0.02975492738187313, 0.0029724868945777416, 0.030176611617207527, -0.023746436461806297, 0.03332546353340149, -0.02586025930941105, -0.032202113419771194, -0.06037714704871178, -0.028286898508667946, -0.03970188647508621, -0.005950054153800011, -0.002754093147814274, -0.04292885959148407, 0.013410140760242939, 0.01426912471652031, -0.061018895357847214, -0.0022786150220781565, -0.1323922723531723, 0.0011306507512927055, 0.007877243682742119, -0.0016650130273774266, -0.023021910339593887, 0.08536286652088165, -0.09029301255941391, 0.01693994551897049, 0.06222344562411308, 0.028170863166451454, 0.017444059252738953, -0.0020075207576155663, 0.00025420336169190705, -0.007627911400049925, -0.08596206456422806, -0.015400837175548077, 0.07905664294958115, 0.10387684404850006, 0.054449066519737244, 0.09143732488155365, 0.013386149890720844, -0.02938936837017536, -0.06307965517044067, -0.03373675048351288, -0.026789214462041855, 0.07898712903261185, -0.04190769046545029, -0.09772007167339325, 0.0054431878961622715, -0.018766412511467934, 0.08160772919654846, -0.022842146456241608, 0.055073775351047516, 0.01609589345753193 ]
0.030137
to use in userland. File streams should always be opened through their corresponding factory methods [`fs.createWriteStream()`][] and [`fs.createReadStream()`][]) or by passing a file descriptor in options. ### DEP0136: `http` `finished` Type: Documentation-only [`response.finished`][] indicates whether [`response.end()`][] has been called, not whether `'finish'` has been emitted and the underlying data is flushed. Use [`response.writableFinished`][] or [`response.writableEnded`][] accordingly instead to avoid the ambiguity. To maintain existing behavior `response.finished` should be replaced with `response.writableEnded`. ### DEP0137: Closing fs.FileHandle on garbage collection Type: End-of-Life Allowing a [`fs.FileHandle`][] object to be closed on garbage collection used to be allowed, but now throws an error. Please ensure that all `fs.FileHandle` objects are explicitly closed using `FileHandle.prototype.close()` when the `fs.FileHandle` is no longer needed: ```js const fsPromises = require('node:fs').promises; async function openAndClose() { let filehandle; try { filehandle = await fsPromises.open('thefile.txt', 'r'); } finally { if (filehandle !== undefined) await filehandle.close(); } } ``` ### DEP0138: `process.mainModule` Type: Documentation-only [`process.mainModule`][] is a CommonJS-only feature while `process` global object is shared with non-CommonJS environment. Its use within ECMAScript modules is unsupported. It is deprecated in favor of [`require.main`][], because it serves the same purpose and is only available on CommonJS environment. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/process-main-module)): ```bash npx codemod@latest @nodejs/process-main-module ``` ### DEP0139: `process.umask()` with no arguments Type: Documentation-only Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential security vulnerability. There is no safe, cross-platform alternative API. ### DEP0140: Use `request.destroy()` instead of `request.abort()` Type: Documentation-only Use [`request.destroy()`][] instead of [`request.abort()`][]. ### DEP0141: `repl.inputStream` and `repl.outputStream` Type: Documentation-only (supports [`--pending-deprecation`][]) The `node:repl` module exported the input and output stream twice. Use `.input` instead of `.inputStream` and `.output` instead of `.outputStream`. ### DEP0142: `repl.\_builtinLibs` Type: Documentation-only (supports [`--pending-deprecation`][]) The `node:repl` module exports a `\_builtinLibs` property that contains an array of built-in modules. It was incomplete so far and instead it's better to rely upon `require('node:module').builtinModules`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules)): ```bash npx codemod@latest @nodejs/repl-builtin-modules ``` ### DEP0143: `Transform.\_transformState` Type: End-of-Life `Transform.\_transformState` will be removed in future versions where it is no longer required due to simplification of the implementation. ### DEP0144: `module.parent` Type: Documentation-only (supports [`--pending-deprecation`][]) A CommonJS module can access the first module that required it using `module.parent`. This feature is deprecated because it does not work consistently in the presence of ECMAScript modules and because it gives an inaccurate representation of the CommonJS module graph. Some modules use it to check if they are the entry point of the current process. Instead, it is recommended to compare `require.main` and `module`: ```js if (require.main === module) { // Code section that will run only if current file is the entry point. } ``` When looking for the CommonJS modules that have required the current one, `require.cache` and `module.children` can be used: ```js const moduleParents = Object.values(require.cache) .filter((m) => m.children.includes(module)); ``` ### DEP0145: `socket.bufferSize` Type: Documentation-only [`socket.bufferSize`][] is just an alias for [`writable.writableLength`][]. ### DEP0146: `new crypto.Certificate()` Type: Documentation-only The [`crypto.Certificate()` constructor][] is deprecated. Use [static methods of `crypto.Certificate()`][] instead. ### DEP0147: `fs.rmdir(path, { recursive: true })` Type: End-of-Life The `fs.rmdir`, `fs.rmdirSync`, and `fs.promises.rmdir` methods used to support a `recursive` option. That option has been removed. Use `fs.rm(path, { recursive: true, force: true })`, `fs.rmSync(path, { recursive: true, force: true })` or `fs.promises.rm(path, { recursive: true, force: true })` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/rmdir)): ```bash npx codemod@latest @nodejs/rmdir ``` ### DEP0148: Folder mappings in `"exports"` (trailing `"/"`) Type: End-of-Life Using a trailing `"/"` to define subpath folder mappings in the [subpath exports][] or [subpath imports][] fields is no longer supported.
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.023128770291805267, 0.027402762323617935, -0.062386561185121536, 0.009213879704475403, 0.06047961860895157, -0.07892826944589615, -0.07042007148265839, 0.09317672997713089, 0.04252983629703522, 0.08136002719402313, -0.034359175711870193, 0.05459415167570114, -0.10615361481904984, 0.01065535843372345, -0.042513299733400345, -0.07204034179449081, -0.05988084524869919, -0.06614414602518082, -0.007495658006519079, 0.005045304074883461, 0.08207596093416214, 0.0436345636844635, 0.061755236238241196, 0.007634306326508522, -0.009737186133861542, 0.026258273050189018, -0.046188220381736755, -0.040225330740213394, -0.026354961097240448, -0.022176437079906464, 0.07127340883016586, -0.035518452525138855, -0.07562930881977081, -0.07117194682359695, -0.009706512093544006, 0.13061119616031647, 0.03489387035369873, -0.11657238006591797, -0.05502618849277496, -0.020480288192629814, 0.04036915674805641, 0.007850956171751022, -0.04299148544669151, 0.01741165667772293, -0.03530358523130417, 0.0017299860483035445, -0.014141867868602276, -0.05520777776837349, -0.047613516449928284, 0.04921822249889374, -0.042839422821998596, 0.0777837261557579, -0.04556543752551079, 0.03162522241473198, 0.044141169637441635, -0.0554434135556221, 0.004099345300346613, 0.0006295065395534039, -0.09316271543502808, 0.01514943316578865, -0.036972176283597946, -0.06761643290519714, -0.07822754234075546, -0.01581479422748089, 0.04781525954604149, 0.04688926041126251, -0.058462757617235184, 0.024074435234069824, 0.05020153149962425, -0.013263138942420483, -0.0617254264652729, 0.05063413828611374, -0.07456234842538834, -0.015672897920012474, -0.009155955165624619, -0.07099248468875885, -0.006240180227905512, 0.08658064901828766, -0.024045944213867188, -0.049228549003601074, 0.07918432354927063, -0.10677304863929749, 0.10101167112588882, 0.0031096376478672028, -0.011610280722379684, 0.07000197470188141, -0.008965296670794487, 0.04128421097993851, 0.05533400923013687, 0.0499747171998024, -0.05094946175813675, 0.04535321146249771, 0.06313184648752213, 0.0522012822329998, -0.06176260858774185, 0.05505676567554474, 0.05566073954105377, 0.03494332730770111, -0.026333635672926903, 0.0030707912519574165, 0.042407918721437454, 0.005762108601629734, 0.036505796015262604, -0.03272734209895134, 0.0868871808052063, -0.03547436743974686, -0.00914615299552679, 0.08316082507371902, -0.021512342616915703, -0.08671335875988007, -0.0036801346577703953, -0.003354923101142049, -0.040855247527360916, -0.01433661300688982, 0.010910997167229652, 0.013731984421610832, -0.03403244540095329, -0.0011834014439955354, -0.017286133021116257, 0.11181843280792236, 0.13782691955566406, 0.017674526199698448, -0.05928603559732437, 0.033771004527807236, 0.07660385966300964, -0.05997391417622566, 0.08154747635126114, 2.932208393659801e-33, -0.03488270193338394, -0.06561597436666489, -0.024504339322447777, 0.10720838606357574, 0.03881971538066864, -0.0359908863902092, 0.06508217751979828, 0.017100419849157333, -0.07227259874343872, -0.02112470380961895, -0.0008681535837240517, -0.022950418293476105, -0.041650719940662384, -0.01688985526561737, -0.028716212138533592, 0.003048115409910679, 0.015875665470957756, -0.019251538440585136, -0.014894784428179264, 0.05963221937417984, 0.08871813118457794, 0.01684725284576416, -0.016663700342178345, 0.003887268016114831, 0.01794617436826229, -0.045025233179330826, -0.01996726728975773, -0.019612060859799385, -0.05821968615055084, -0.017715491354465485, 0.019830895587801933, -0.018237030133605003, 0.029130827635526657, 0.004963121376931667, -0.0004257190739735961, -0.06104397401213646, 0.005206630565226078, -0.02936249040067196, -0.10471434891223907, -0.08362977206707001, 0.013912735506892204, 0.023021642118692398, -0.10094668716192245, 0.03839624300599098, -0.014623817056417465, -0.07873820513486862, -0.08166054636240005, 0.0242332573980093, 0.043351490050554276, 0.09532438963651657, 0.02964831329882145, 0.08235912770032883, 0.09926250576972961, -0.047711774706840515, 0.03608681634068489, 0.008631435222923756, -0.03783203288912773, -0.036797862499952316, -0.05718341842293739, -0.04986649379134178, 0.09623321145772934, 0.06631727516651154, -0.027157939970493317, -0.05413015931844711, -0.026017114520072937, -0.0343334786593914, 0.06564246118068695, 0.06955905258655548, 0.04960044100880623, -0.046578299254179, -0.06220988929271698, -0.0341852605342865, 0.02834370918571949, -0.013499272987246513, 0.04920182377099991, 0.023633962497115135, 0.008571013808250427, -0.040197353810071945, 0.04465038701891899, -0.030379367992281914, 0.09094349294900894, -0.07676845788955688, -0.04595835506916046, 0.0036097527481615543, -0.0029106924775987864, 0.005945729091763496, -0.04857253655791283, -0.03476472571492195, 0.0480756014585495, 0.04579804837703705, -0.02287314087152481, -0.006367907393723726, 0.03605082258582115, -0.014660965651273727, -0.006890653632581234, -3.877157629230121e-33, 0.08037623763084412, -0.03898132964968681, -0.10083577781915665, 0.02190656028687954, -0.03122946061193943, 0.04127172753214836, 0.025704339146614075, 0.06953004747629166, 0.05104140564799309, 0.012911174446344376, 0.007676607463508844, 0.04412702098488808, -0.006620172411203384, -0.016739068552851677, -0.047562263906002045, -0.01706733927130699, -0.0013080962235108018, -0.08276037126779556, 0.029395591467618942, -0.05193374305963516, -0.03899560123682022, -0.05367167666554451, 0.13877001404762268, 0.03865879401564598, -0.0019000646425411105, 0.0034370040521025658, -0.04266197234392166, -0.051851481199264526, -0.08024939149618149, -0.07436718046665192, 0.011857092380523682, -0.004740539938211441, 0.0020679403096437454, -0.06724528968334198, 0.052469030022621155, -0.10837175697088242, 0.02803794853389263, 0.05709773674607277, 0.011470765806734562, 0.027046605944633484, 0.1098821684718132, 0.019867824390530586, 0.015557005070149899, -0.0014520167605951428, 0.0630703717470169, -0.017892342060804367, -0.05262954533100128, 0.0009641938959248364, -0.0011051974724978209, -0.00024650292471051216, 0.0018745602574199438, -0.038884907960891724, 0.015359174460172653, 0.0029959308449178934, 0.019782770425081253, -0.009390601888298988, 0.12863628566265106, -0.08273755013942719, -0.02625209279358387, 0.019288327544927597, 0.06336726993322372, -0.07822246104478836, -0.07550013810396194, -0.03277725726366043, 0.043884504586458206, -0.05982068181037903, -0.03444734588265419, 0.031755123287439346, 0.0380176417529583, 0.03480590134859085, -0.01136960182338953, -0.03417279198765755, -0.027739983052015305, -0.007931421510875225, 0.10718327015638351, 0.035940613597631454, 0.009585738182067871, -0.12193097919225693, -0.011273497715592384, 0.07389620691537857, -0.0039396765641868114, 0.0952405110001564, -0.06961324065923691, 0.09576625376939774, 0.06674119085073471, -0.05975113809108734, 0.014067179523408413, -0.00807748083025217, -0.02956811897456646, 0.010204221121966839, 0.026154085993766785, 0.05167989432811737, -0.032088182866573334, -0.0023592510260641575, 0.009556584060192108, -4.859662183775981e-8, -0.10763686895370483, 0.016941968351602554, -0.07987840473651886, 0.040032390505075455, 0.00015049628564156592, 0.05370677635073662, 0.005925497505813837, -0.005090771242976189, 0.0642334371805191, -0.017880810424685478, -0.00790910143405199, 0.01735331304371357, 0.023359311744570732, 0.003728105453774333, -0.03297605738043785, -0.07308217883110046, 0.11314868181943893, -0.007597041316330433, -0.0284431055188179, -0.03627504035830498, 0.08381827920675278, -0.045937683433294296, -0.017835451290011406, 0.014791520312428474, -0.007993396371603012, 0.026676973327994347, 0.10172213613986969, -0.009789491072297096, -0.05128014460206032, -0.03586462512612343, -0.04541964456439018, -0.008320395834743977, 0.029658179730176926, 0.05725180730223656, -0.05664006248116493, 0.05336255580186844, 0.02362489141523838, 0.012250376865267754, -0.02739022858440876, 0.018705476075410843, 0.04896850138902664, 0.05857132002711296, -0.006400131154805422, 0.008387893438339233, 0.022784676402807236, -0.03763481229543686, 0.047848451882600784, 0.06659058481454849, -0.017732402309775352, -0.010143129155039787, -0.02213907800614834, -0.028903357684612274, -0.03981313109397888, 0.054590288549661636, -0.035747818648815155, -0.044664062559604645, 0.07691475749015808, -0.03727692365646362, -0.018336450681090355, -0.06011928245425224, 0.15760165452957153, 0.011735762469470501, 0.0032359552569687366, 0.034253157675266266 ]
0.067936
`fs.promises.rm(path, { recursive: true, force: true })` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/rmdir)): ```bash npx codemod@latest @nodejs/rmdir ``` ### DEP0148: Folder mappings in `"exports"` (trailing `"/"`) Type: End-of-Life Using a trailing `"/"` to define subpath folder mappings in the [subpath exports][] or [subpath imports][] fields is no longer supported. Use [subpath patterns][] instead. ### DEP0149: `http.IncomingMessage#connection` Type: Documentation-only Prefer [`message.socket`][] over [`message.connection`][]. ### DEP0150: Changing the value of `process.config` Type: End-of-Life The `process.config` property provides access to Node.js compile-time settings. However, the property is mutable and therefore subject to tampering. The ability to change the value will be removed in a future version of Node.js. ### DEP0151: Main index lookup and extension searching Type: Runtime Previously, `index.js` and extension searching lookups would apply to `import 'pkg'` main entry point resolution, even when resolving ES modules. With this deprecation, all ES module main entry point resolutions require an explicit [`"exports"` or `"main"` entry][] with the exact file extension. ### DEP0152: Extension PerformanceEntry properties Type: End-of-Life The `'gc'`, `'http2'`, and `'http'` {PerformanceEntry} object types used to have additional properties assigned to them that provide additional information. These properties are now available within the standard `detail` property of the `PerformanceEntry` object. The deprecated accessors have been removed. ### DEP0153: `dns.lookup` and `dnsPromises.lookup` options type coercion Type: End-of-Life Using a non-nullish non-integer value for `family` option, a non-nullish non-number value for `hints` option, a non-nullish non-boolean value for `all` option, or a non-nullish non-boolean value for `verbatim` option in [`dns.lookup()`][] and [`dnsPromises.lookup()`][] throws an `ERR\_INVALID\_ARG\_TYPE` error. ### DEP0154: RSA-PSS generate key pair options Type: End-of-Life Use `'hashAlgorithm'` instead of `'hash'`, and `'mgf1HashAlgorithm'` instead of `'mgf1Hash'`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/crypto-rsa-pss-update)): ```bash npx codemod@latest @nodejs/crypto-rsa-pss-update ``` ### DEP0155: Trailing slashes in pattern specifier resolutions Type: Runtime The remapping of specifiers ending in `"/"` like `import 'pkg/x/'` is deprecated for package `"exports"` and `"imports"` pattern resolutions. ### DEP0156: `.aborted` property and `'abort'`, `'aborted'` event in `http` Type: Documentation-only Move to {Stream} API instead, as the [`http.ClientRequest`][], [`http.ServerResponse`][], and [`http.IncomingMessage`][] are all stream-based. Check `stream.destroyed` instead of the `.aborted` property, and listen for `'close'` instead of `'abort'`, `'aborted'` event. The `.aborted` property and `'abort'` event are only useful for detecting `.abort()` calls. For closing a request early, use the Stream `.destroy([error])` then check the `.destroyed` property and `'close'` event should have the same effect. The receiving end should also check the [`readable.readableEnded`][] value on [`http.IncomingMessage`][] to get whether it was an aborted or graceful destroy. ### DEP0157: Thenable support in streams Type: End-of-Life An undocumented feature of Node.js streams was to support thenables in implementation methods. This is now deprecated, use callbacks instead and avoid use of async function for streams implementation methods. This feature caused users to encounter unexpected problems where the user implements the function in callback style but uses e.g. an async method which would cause an error since mixing promise and callback semantics is not valid. ```js const w = new Writable({ async final(callback) { await someOp(); callback(); }, }); ``` ### DEP0158: `buffer.slice(start, end)` Type: Documentation-only This method was deprecated because it is not compatible with `Uint8Array.prototype.slice()`, which is a superclass of `Buffer`. Use [`buffer.subarray`][] which does the same thing instead. ### DEP0159: `ERR\_INVALID\_CALLBACK` Type: End-of-Life This error code was removed due to adding more confusion to the errors used for value type validation. ### DEP0160: `process.on('multipleResolves', handler)` Type: End-of-Life This event was deprecated and removed because it did not work with V8 promise combinators which diminished its usefulness. ### DEP0161: `process.\_getActiveRequests()` and `process.\_getActiveHandles()` Type: Documentation-only The `process.\_getActiveHandles()` and `process.\_getActiveRequests()` functions are not intended for public use and can be
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.048926714807748795, -0.02109883911907673, 0.015277493745088577, -0.014906838536262512, 0.1393686830997467, -0.10801129788160324, -0.033813029527664185, 0.03153260052204132, 0.09071922302246094, 0.05555998533964157, 0.0017495661741122603, 0.001776798046194017, 0.005326921120285988, 0.04090997204184532, 0.04951927065849304, 0.027434425428509712, -0.08436606079339981, -0.011225753463804722, 0.037557948380708694, -0.004290154669433832, -0.012521306984126568, 0.0716550201177597, 0.08186972141265869, -0.015142997726798058, 0.03371339663863182, -0.0022618072107434273, -0.0898660346865654, -0.006276331376284361, -0.06302068382501602, 0.0011367544066160917, 0.025571545585989952, 0.07397063821554184, -0.03627052158117294, -0.032282374799251556, 0.022061826661229134, 0.2167142778635025, 0.006000713910907507, -0.04679030179977417, -0.031747810542583466, -0.0012923009926453233, 0.07411713153123856, 0.07983289659023285, 0.03014306165277958, -0.10894103348255157, 0.002070458373054862, -0.06427914649248123, -0.04433503374457359, -0.01396861020475626, -0.04624420776963234, 0.03298301622271538, -0.017422109842300415, 0.015360563062131405, -0.07665570825338364, -0.04731512814760208, 0.04732954874634743, 0.09019336104393005, -0.028988463804125786, 0.023678723722696304, 0.021878933534026146, -0.0024186635855585337, 0.041137754917144775, -0.06511697918176651, 0.07143416255712509, -0.059783801436424255, 0.006058169063180685, 0.0186709426343441, -0.04286457598209381, 0.018785733729600906, 0.022876063361763954, 0.05365702882409096, 0.0437614880502224, 0.06605794280767441, -0.10443295538425446, -0.016264701262116432, -0.04105248302221298, -0.026411786675453186, -0.0346645824611187, 0.05076487362384796, -0.030670152977108955, -0.006657941732555628, -0.02550027333199978, -0.05842825770378113, 0.014094247482717037, 0.007464845199137926, -0.09505322575569153, 0.0966271460056305, -0.012717845849692822, -0.04434555023908615, 0.05956769734621048, -0.0006097002769820392, -0.015327678993344307, -0.14040492475032806, -0.0165240615606308, 0.06513214856386185, -0.10130146145820618, -0.034183163195848465, -0.04478326439857483, 0.08968660980463028, -0.012930850498378277, -0.0186538677662611, 0.0034376613330096006, -0.029796915128827095, 0.05702994763851166, -0.11912956833839417, -0.011591053567826748, 0.036021262407302856, -0.008169883862137794, -0.018407076597213745, -0.0508803091943264, 0.03170476481318474, -0.02664748951792717, 0.056145038455724716, -0.035462960600852966, 0.023250190541148186, 0.031075619161128998, -0.0037590672727674246, -0.017919575795531273, -0.030800262466073036, 0.015628159046173096, 0.1812061220407486, 0.062363460659980774, 0.018990706652402878, 0.03759318217635155, 0.0446334183216095, 0.021105684340000153, -0.03750684857368469, 0.034012239426374435, 2.2638153262845404e-33, -0.0011613041860982776, 0.009786109440028667, 0.054990071803331375, 0.07239328324794769, 0.14049972593784332, -0.04026356339454651, 0.011721077375113964, -0.02204035595059395, -0.06370431929826736, -0.004001896362751722, -0.029256664216518402, 0.02320721000432968, -0.056906551122665405, -0.0791744738817215, -0.033096179366111755, -0.031053366139531136, 0.08087065815925598, -0.06377056986093521, 0.06872463971376419, 0.03309093415737152, 0.05937629193067551, 0.026899589225649834, -0.04031515121459961, 0.015281775034964085, 0.025567930191755295, -0.07126064598560333, 0.01733929105103016, 0.012531151995062828, 0.08831486850976944, -0.041452884674072266, -0.002603334141895175, 0.03621349856257439, -0.0026460441295057535, 0.035224635154008865, -0.02741388790309429, 0.02961164154112339, -0.0014373757876455784, -0.004642991814762354, -0.1652919054031372, 0.016009632498025894, 0.004041101783514023, 0.024464737623929977, -0.11333096027374268, 0.05910050496459007, 0.02575642615556717, -0.05962537229061127, 0.025282764807343483, -0.028790481388568878, 0.11483455449342728, 0.05572130158543587, -0.06085548922419548, -0.017306910827755928, 0.12011858075857162, -0.0928717777132988, 0.06163762882351875, -0.05193789675831795, 0.005320876371115446, -0.049031320959329605, -0.006843755953013897, -0.05804980546236038, 0.09234709292650223, -0.0625644251704216, -0.022636959329247475, -0.04113360866904259, 0.0395875982940197, -0.01589028164744377, -0.04258626699447632, -0.002479038666933775, -0.04542083293199539, 0.031880151480436325, -0.030269494280219078, 0.01717311702668667, -0.03796793520450592, 0.03335312753915787, 0.020105963572859764, -0.030567679554224014, -0.04045708477497101, 0.0063148848712444305, 0.060647595673799515, -0.0366085059940815, -0.03016299568116665, -0.02339370921254158, -0.09054345637559891, 0.07589324563741684, 0.07795866578817368, 0.017357492819428444, -0.05347762629389763, 0.004642856772989035, 0.027151495218276978, 0.02441987581551075, 0.05548745393753052, -0.05644017085433006, -0.012845315039157867, -0.060641366988420486, -0.05355675145983696, -4.2288328455595174e-33, 0.043590009212493896, 0.013286031782627106, -0.0072388253174722195, 0.044876400381326675, -0.02028634399175644, -0.02194024994969368, 0.03158333897590637, 0.03268895298242569, 0.054132066667079926, -0.03395422175526619, -0.10836166888475418, 0.05070929601788521, 0.1286982297897339, -0.019105596467852592, -0.018330251798033714, 0.0017377830808982253, -0.013960661366581917, -0.04990910738706589, -0.02262813039124012, -0.08192344754934311, -0.003618984017521143, 0.09696252644062042, 0.004748637787997723, 0.027577880769968033, -0.11356177181005478, 0.007216397672891617, -0.03310094028711319, 0.016092756763100624, -0.0543208122253418, -0.05805109813809395, -0.03650053218007088, 0.01907140016555786, -0.02494133450090885, 0.00247592362575233, -0.006924410816282034, -0.061738401651382446, -0.05881491303443909, 0.09743323922157288, 0.012419545091688633, -0.04594367742538452, -0.0186407882720232, -0.03284325823187828, -0.05936766415834427, -0.021266376599669456, 0.010457459837198257, -0.011767174117267132, 0.013584780506789684, -0.03641769662499428, 0.021860482171177864, 0.00500882975757122, -0.010490871034562588, 0.013357918709516525, -0.02420586720108986, -0.008390656672418118, 0.020620081573724747, 0.02247454598546028, -0.02033255062997341, -0.007409883197396994, 0.07110597938299179, 0.015148273669183254, 0.02493209019303322, -0.033578384667634964, -0.03583541512489319, 0.022319959476590157, -0.033033572137355804, -0.06198006868362427, -0.11964637786149979, -0.003012290457263589, 0.06836941838264465, 0.021483441814780235, -0.033347517251968384, 0.03391299024224281, -0.0004495769098866731, 0.017366647720336914, 0.024960430338978767, -0.07350290566682816, 0.0011398058850318193, -0.0704263225197792, 0.01599653623998165, 0.06293153017759323, -0.05161425843834877, 0.0803600549697876, -0.032095469534397125, 0.06595627963542938, 0.013561166822910309, -0.03401603177189827, 0.05775367468595505, -0.015030317939817905, -0.02023041807115078, 0.028906553983688354, 0.06243189796805382, -0.05026187747716904, 0.018322214484214783, -0.03464476391673088, -0.06774784624576569, -5.1592561334246057e-8, -0.09693864732980728, 0.0697922632098198, -0.06773937493562698, 0.020588336512446404, 0.04006529599428177, 0.019474977627396584, 0.062479037791490555, 0.02125389315187931, 0.06486451625823975, 0.054204683750867844, -0.05019151419401169, 0.08069511502981186, 0.016358397901058197, 0.017180154100060463, 0.0023388562258332968, 0.00043990364065393806, 0.05354027822613716, 0.05009607970714569, -0.010775173082947731, -0.031213250011205673, -0.0200598556548357, 0.010260634124279022, -0.032542914152145386, 0.04287407547235489, 0.03715001791715622, 0.0002510835765860975, 0.0407182015478611, 0.024780966341495514, 0.0010011120466515422, -0.05269570276141167, -0.12015993893146515, -0.040136322379112244, 0.029224496334791183, 0.012023738585412502, -0.055110614746809006, -0.01968327909708023, 0.004325941205024719, 0.014799647964537144, 0.02875332161784172, 0.0027229157276451588, -0.01766396127641201, 0.005515215452760458, -0.003581907832995057, -0.017820371314883232, -0.09848380833864212, -0.0450151301920414, 0.01628168672323227, 0.0875357836484909, 0.009990370832383633, 0.022834081202745438, 0.021588485687971115, -0.023561539128422737, -0.09815914928913116, 0.01814054511487484, 0.06825060397386551, 0.02110246941447258, 0.000006437439424189506, -0.013468614779412746, -0.027429010719060898, -0.04900624603033066, 0.05655660480260849, -0.0021792538464069366, 0.04150165244936943, -0.10460686683654785 ]
0.039619
for value type validation. ### DEP0160: `process.on('multipleResolves', handler)` Type: End-of-Life This event was deprecated and removed because it did not work with V8 promise combinators which diminished its usefulness. ### DEP0161: `process.\_getActiveRequests()` and `process.\_getActiveHandles()` Type: Documentation-only The `process.\_getActiveHandles()` and `process.\_getActiveRequests()` functions are not intended for public use and can be removed in future releases. Use [`process.getActiveResourcesInfo()`][] to get a list of types of active resources and not the actual references. ### DEP0162: `fs.write()`, `fs.writeFileSync()` coercion to string Type: End-of-Life Implicit coercion of objects with own `toString` property, passed as second parameter in [`fs.write()`][], [`fs.writeFile()`][], [`fs.appendFile()`][], [`fs.writeFileSync()`][], and [`fs.appendFileSync()`][] is deprecated. Convert them to primitive strings. ### DEP0163: `channel.subscribe(onMessage)`, `channel.unsubscribe(onMessage)` Type: Deprecation revoked These methods were deprecated because their use could leave the channel object vulnerable to being garbage-collected if not strongly referenced by the user. The deprecation was revoked because channel objects are now resistant to garbage collection when the channel has active subscribers. ### DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer Type: End-of-Life Values other than `undefined`, `null`, integer numbers, and integer strings (e.g., `'1'`) are deprecated as value for the `code` parameter in [`process.exit()`][] and as value to assign to [`process.exitCode`][]. ### DEP0165: `--trace-atomics-wait` Type: End-of-Life The `--trace-atomics-wait` flag has been removed because it uses the V8 hook `SetAtomicsWaitCallback`, that will be removed in a future V8 release. ### DEP0166: Double slashes in imports and exports targets Type: Runtime Package imports and exports targets mapping into paths including a double slash (of \_"/"\_ or \_"\\"\_) are deprecated and will fail with a resolution validation error in a future release. This same deprecation also applies to pattern matches starting or ending in a slash. ### DEP0167: Weak `DiffieHellmanGroup` instances (`modp1`, `modp2`, `modp5`) Type: Documentation-only The well-known MODP groups `modp1`, `modp2`, and `modp5` are deprecated because they are not secure against practical attacks. See [RFC 8247 Section 2.4][] for details. These groups might be removed in future versions of Node.js. Applications that rely on these groups should evaluate using stronger MODP groups instead. ### DEP0168: Unhandled exception in Node-API callbacks Type: Runtime The implicit suppression of uncaught exceptions in Node-API callbacks is now deprecated. Set the flag [`--force-node-api-uncaught-exceptions-policy`][] to force Node.js to emit an [`'uncaughtException'`][] event if the exception is not handled in Node-API callbacks. ### DEP0169: Insecure url.parse() Type: Application (non-`node\_modules` code only) [`url.parse()`][] behavior is not standardized and prone to errors that have security implications. Use the [WHATWG URL API][] instead. CVEs are not issued for `url.parse()` vulnerabilities. ### DEP0170: Invalid port when using `url.parse()` Type: End-of-Life [`url.parse()`][] used to accept URLs with ports that are not numbers. This behavior might result in host name spoofing with unexpected input. These URLs will throw an error (which the [WHATWG URL API][] also does). ### DEP0171: Setters for `http.IncomingMessage` headers and trailers Type: Documentation-only In a future version of Node.js, [`message.headers`][], [`message.headersDistinct`][], [`message.trailers`][], and [`message.trailersDistinct`][] will be read-only. ### DEP0172: The `asyncResource` property of `AsyncResource` bound functions Type: End-of-Life Older versions of Node.js would add the `asyncResource` when a function is bound to an `AsyncResource`. It no longer does. ### DEP0173: the `assert.CallTracker` class Type: End-of-Life The `assert.CallTracker` API has been removed. ### DEP0174: calling `promisify` on a function that returns a `Promise` Type: Runtime Calling [`util.promisify`][] on a function that returns a `Promise` will ignore the result of said promise, which can lead to unhandled promise rejections. ### DEP0175: `util.toUSVString` Type: Documentation-only The [`util.toUSVString()`][] API is deprecated. Please use [`String.prototype.toWellFormed`][] instead. ### DEP0176: `fs.F\_OK`, `fs.R\_OK`, `fs.W\_OK`, `fs.X\_OK` Type: End-of-Life `F\_OK`, `R\_OK`, `W\_OK` and `X\_OK` getters exposed directly on `node:fs` were removed. Get them from `fs.constants` or `fs.promises.constants` instead. An automated
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.14167414605617523, -0.015744619071483612, -0.06566878408193588, 0.03821070119738579, 0.09883860498666763, -0.10055901110172272, 0.09312859177589417, 0.08786468207836151, 0.0028396237175911665, -0.01641731522977352, -0.08272385597229004, -0.0010830998653545976, -0.06983282417058945, 0.013665644451975822, 0.0043436442501842976, 0.025273432955145836, -0.011621428653597832, -0.0568372868001461, 0.004530112259089947, -0.014183429069817066, 0.07028459012508392, 0.029502132907509804, 0.018643151968717575, 0.011054673232138157, -0.04211221635341644, -0.07356217503547668, -0.10958050191402435, -0.03979116305708885, 0.03163841739296913, -0.01730545237660408, 0.06476683169603348, 0.06093916296958923, -0.11584509909152985, -0.07373091578483582, 0.12197581678628922, 0.12245921045541763, 0.020524557679891586, -0.08308130502700806, 0.023649627342820168, -0.010346279479563236, 0.08903057873249054, 0.034180715680122375, -0.03457295894622803, -0.0408456027507782, -0.04415341094136238, -0.03849092125892639, -0.042260244488716125, -0.029083138331770897, -0.055766064673662186, -0.03368136286735535, -0.010666216723620892, 0.03442085534334183, -0.02392912097275257, -0.011695509776473045, 0.0478411428630352, -0.021480035036802292, 0.014243019744753838, -0.02825518324971199, -0.01824825629591942, 0.07652407139539719, -0.018474915996193886, -0.056784436106681824, -0.049932997673749924, -0.0029822916258126497, -0.03550129011273384, 0.12884187698364258, 0.007159268483519554, -0.07126078009605408, 0.047334760427474976, -0.020641719922423363, -0.07963410764932632, 0.03745809197425842, -0.06191394478082657, -0.004852776415646076, 0.03473720699548721, -0.04460720717906952, -0.003273853799328208, -0.015841420739889145, -0.032400380820035934, -0.14440780878067017, 0.027402320876717567, -0.08019153028726578, 0.04725175350904465, 0.04652189463376999, 0.04734264314174652, 0.06439559906721115, -0.049812257289886475, -0.012182609178125858, 0.15327978134155273, 0.0927482470870018, -0.05656116455793381, -0.025035500526428223, 0.003910098224878311, 0.07739614695310593, -0.001833318267017603, 0.06069882959127426, 0.002001600107178092, 0.020375946536660194, -0.028285155072808266, 0.03453017398715019, -0.01801176182925701, 0.026277905330061913, 0.09835340827703476, -0.04467584937810898, 0.07754962891340256, 0.03445915877819061, -0.08811824768781662, -0.002405705163255334, -0.012910529971122742, -0.02644474245607853, -0.05612469092011452, -0.006549179088324308, 0.03354182466864586, 0.004114566836506128, -0.009672855027019978, 0.060674820095300674, 0.03838172182440758, -0.028508389368653297, 0.004094338044524193, 0.04244593530893326, 0.164723202586174, 0.03387676924467087, 0.06244751811027527, -0.027850661426782608, -0.0006939726881682873, -0.10316881537437439, -0.0286071989685297, 4.96441239458198e-33, 0.014438947662711143, -0.042485106736421585, 0.018288245424628258, 0.08459427207708359, -0.0055618202313780785, 0.004413857124745846, 0.0398419015109539, 0.014411273412406445, -0.04943837225437164, -0.03604326769709587, -0.011683901771903038, 0.10027424991130829, -0.10699925571680069, -0.08020828664302826, -0.01911018043756485, 0.0004022753855679184, 0.054197411984205246, 0.06013616919517517, 0.03408388793468475, 0.08842183649539948, 0.06756953150033951, -0.0033708212431520224, -0.07050885260105133, 0.03500153124332428, 0.00330173596739769, 0.022259077057242393, -0.03459649533033371, 0.07242100685834885, -0.009278753772377968, -0.021334504708647728, 0.01892607845366001, -0.04653099179267883, -0.020203180611133575, 0.04226537421345711, 0.02945791557431221, -0.0003929143422283232, -0.07668450474739075, -0.019321070984005928, -0.04225228354334831, -0.0638582706451416, -0.0028780472930520773, 0.02857878990471363, -0.016994860023260117, 0.0025369348004460335, -0.007457272615283728, -0.07512947171926498, -0.06024712696671486, 0.014481313526630402, 0.08593152463436127, 0.021948767825961113, 0.03634074330329895, 0.01267008762806654, 0.0967753678560257, -0.036029472947120667, -0.03443194180727005, -0.06379219144582748, -0.04785126820206642, 0.09512310475111008, 0.05076155811548233, -0.002656449330970645, 0.07811551541090012, -0.027137069031596184, -0.061497755348682404, -0.024090440943837166, 0.03936315327882767, 0.013113885186612606, -0.020022470504045486, -0.011794699355959892, 0.011214176192879677, 0.027028772979974747, -0.029056569561362267, 0.03684717044234276, 0.017148157581686974, -0.010565979406237602, 0.1043684110045433, -0.060890696942806244, -0.00508863152936101, -0.07673291116952896, -0.0791853666305542, 0.0412483774125576, 0.04331693798303604, 0.004715336952358484, -0.04155976325273514, 0.10003378242254257, -0.015272325836122036, -0.04707946628332138, -0.04869256913661957, -0.022100158035755157, 0.021051010116934776, -0.005273124668747187, -0.045155927538871765, -0.022829929366707802, -0.05389266088604927, -0.044353559613227844, -0.0797870010137558, -6.683272396916146e-33, 0.0644870400428772, -0.021206064149737358, -0.04838162288069725, 0.0426509827375412, -0.06918879598379135, -0.027177752926945686, 0.011801136657595634, 0.0024803373962640762, 0.03780428320169449, -0.02627815119922161, 0.06702849268913269, -0.03084036149084568, 0.04932399094104767, -0.021378960460424423, -0.01328164804726839, 0.009299693629145622, -0.10338762402534485, -0.04780525714159012, 0.013394228182733059, -0.017563557252287865, -0.03677743673324585, 0.10795361548662186, 0.04895045980811119, 0.05844995751976967, -0.09434060752391815, 0.020168373361229897, -0.013870013877749443, -0.06839756667613983, -0.026265284046530724, -0.026227356866002083, -0.033262949436903, 0.08539105951786041, -0.029309378936886787, 0.06320126354694366, 0.022039536386728287, -0.057195208966732025, 0.03871461749076843, 0.0757087841629982, 0.02654166705906391, -0.02407947927713394, 0.16447702050209045, 0.05439411476254463, 0.0013564599212259054, -0.050867434591054916, 0.014930310659110546, 0.038647495210170746, 0.005724188406020403, -0.03899139538407326, -0.02644933946430683, -0.014264937490224838, 0.03920239582657814, -0.05404478311538696, -0.04924187809228897, -0.010366317816078663, 0.015520518645644188, -0.01160574983805418, 0.058069195598363876, -0.06594796478748322, 0.016357367858290672, 0.0056030782870948315, 0.039042942225933075, 0.015412908978760242, -0.0581221841275692, -0.008724140003323555, 0.0053993710316717625, 0.0017561668064445257, -0.06487993896007538, -0.061408448964357376, 0.03287463262677193, -0.023504110053181648, 0.03643631190061569, -0.03605331480503082, -0.09413313120603561, -0.015142927877604961, -0.03325088694691658, 0.01647632010281086, 0.0060527813620865345, -0.1578712910413742, 0.012298270128667355, 0.06786611676216125, -0.03417680040001869, 0.008595434948801994, 0.05339100584387779, 0.04932050779461861, -0.06448641419410706, -0.0324280671775341, 0.004519324284046888, 0.06352407485246658, 0.000594239798374474, 0.007413299288600683, -0.015917740762233734, 0.00015349073510151356, -0.0056742895394563675, 0.03755341097712517, -0.04041130095720291, -5.9162651666611055e-8, -0.027258342131972313, 0.08037173748016357, -0.04959549009799957, 0.025938229635357857, 0.01331358216702938, 0.01850360631942749, -0.005143730901181698, 0.012991867028176785, 0.03638570010662079, 0.03797241300344467, -0.047991324216127396, -0.04472276195883751, 0.02454042062163353, -0.024299465119838715, 0.03855812922120094, -0.000610925315413624, 0.022414909675717354, 0.0486733540892601, -0.06957156211137772, -0.004804542288184166, 0.06049821898341179, -0.06879149377346039, -0.01663678139448166, -0.010203497484326363, -0.018033545464277267, -0.06997422873973846, 0.05909324064850807, 0.03594151884317398, 0.02140585146844387, -0.020140191540122032, -0.025813711807131767, -0.003590945154428482, 0.0242645014077425, -0.017123805359005928, -0.028467800468206406, 0.05850238725543022, -0.09192917495965958, -0.0015674806199967861, 0.06051994115114212, 0.08012427389621735, -0.006370064802467823, 0.023349126800894737, -0.10192146897315979, 0.03534117341041565, 0.014394626952707767, 0.011581297032535076, -0.06251620501279831, 0.00543395709246397, -0.010202141478657722, 0.01008521392941475, -0.03504613786935806, 0.02709697000682354, 0.013629631139338017, 0.07108114659786224, -0.08302200585603714, 0.03577636927366257, -0.0031102770008146763, -0.015108395367860794, 0.0044070701114833355, -0.06442699581384659, 0.0883198231458664, -0.009186282753944397, 0.052589837461709976, 0.029409412294626236 ]
0.107525
which can lead to unhandled promise rejections. ### DEP0175: `util.toUSVString` Type: Documentation-only The [`util.toUSVString()`][] API is deprecated. Please use [`String.prototype.toWellFormed`][] instead. ### DEP0176: `fs.F\_OK`, `fs.R\_OK`, `fs.W\_OK`, `fs.X\_OK` Type: End-of-Life `F\_OK`, `R\_OK`, `W\_OK` and `X\_OK` getters exposed directly on `node:fs` were removed. Get them from `fs.constants` or `fs.promises.constants` instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/fs-access-mode-constants)): ```bash npx codemod@latest @nodejs/fs-access-mode-constants ``` ### DEP0177: `util.types.isWebAssemblyCompiledModule` Type: End-of-Life The `util.types.isWebAssemblyCompiledModule` API has been removed. Please use `value instanceof WebAssembly.Module` instead. ### DEP0178: `dirent.path` Type: End-of-Life The `dirent.path` property has been removed due to its lack of consistency across release lines. Please use [`dirent.parentPath`][] instead. ### DEP0179: `Hash` constructor Type: Runtime Calling `Hash` class directly with `Hash()` or `new Hash()` is deprecated due to being internals, not intended for public use. Please use the [`crypto.createHash()`][] method to create Hash instances. ### DEP0180: `fs.Stats` constructor Type: Runtime Calling `fs.Stats` class directly with `Stats()` or `new Stats()` is deprecated due to being internals, not intended for public use. ### DEP0181: `Hmac` constructor Type: Runtime Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the [`crypto.createHmac()`][] method to create Hmac instances. ### DEP0182: Short GCM authentication tags without explicit `authTagLength` Type: End-of-Life For ciphers in GCM mode, the [`decipher.setAuthTag()`][] function used to accept authentication tags of any valid length (see also [DEP0090](#DEP0090)). This exception has been removed to better align with recommendations per [NIST SP 800-38D][], and applications that intend to use authentication tags that are shorter than the default authentication tag length (i.e., shorter than 16 bytes for AES-GCM) must explicitly set the `authTagLength` option of the [`crypto.createDecipheriv()`][] function to the appropriate length. ### DEP0183: OpenSSL engine-based APIs Type: Documentation-only OpenSSL 3 has deprecated support for custom engines with a recommendation to switch to its new provider model. The `clientCertEngine` option for `https.request()`, [`tls.createSecureContext()`][], and [`tls.createServer()`][]; the `privateKeyEngine` and `privateKeyIdentifier` for [`tls.createSecureContext()`][]; and [`crypto.setEngine()`][] all depend on this functionality from OpenSSL. ### DEP0184: Instantiating `node:zlib` classes without `new` Type: Runtime Instantiating classes without the `new` qualifier exported by the `node:zlib` module is deprecated. It is recommended to use the `new` qualifier instead. This applies to all Zlib classes, such as `Deflate`, `DeflateRaw`, `Gunzip`, `Inflate`, `InflateRaw`, `Unzip`, and `Zlib`. ### DEP0185: Instantiating `node:repl` classes without `new` Type: End-of-Life Instantiating classes without the `new` qualifier exported by the `node:repl` module is deprecated. The `new` qualifier must be used instead. This applies to all REPL classes, including `REPLServer` and `Recoverable`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-classes-with-new)): ```bash npx codemod@latest @nodejs/repl-classes-with-new ``` ### DEP0187: Passing invalid argument types to `fs.existsSync` Type: Runtime Passing non-supported argument types is deprecated and, instead of returning `false`, will throw an error in a future version. ### DEP0188: `process.features.ipv6` and `process.features.uv` Type: Documentation-only These properties are unconditionally `true`. Any checks based on these properties are redundant. ### DEP0189: `process.features.tls\_\*` Type: Documentation-only `process.features.tls\_alpn`, `process.features.tls\_ocsp`, and `process.features.tls\_sni` are deprecated, as their values are guaranteed to be identical to that of `process.features.tls`. ### DEP0190: Passing `args` to `node:child\_process` `execFile`/`spawn` with `shell` option `true` Type: Runtime When an `args` array is passed to [`child\_process.execFile`][] or [`child\_process.spawn`][] with the option `{ shell: true }`, the values are not escaped, only space-separated, which can lead to shell injection. ### DEP0191: `repl.builtinModules` Type: Documentation-only (supports [`--pending-deprecation`][]) The `node:repl` module exports a `builtinModules` property that contains an array of built-in modules. This was incomplete and matched the already deprecated `repl.\_builtinLibs` ([DEP0142][]) instead it's better to rely upon `require('node:module').builtinModules`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules)): ```bash npx codemod@latest @nodejs/repl-builtin-modules ``` ### DEP0192: `require('node:\_tls\_common')` and `require('node:\_tls\_wrap')` Type: Runtime The `node:\_tls\_common` and `node:\_tls\_wrap` modules
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.08793176710605621, 0.06398966163396835, 0.015726257115602493, 0.03621434420347214, 0.1293381005525589, -0.06994027644395828, -0.06543192267417908, 0.03687504306435585, 0.018112586811184883, 0.021805141121149063, -0.012301783077418804, -0.03457774966955185, -0.0003048461221624166, 0.01600831374526024, 0.08831855654716492, -0.009054696187376976, -0.040349770337343216, -0.020917868241667747, -0.01481349766254425, 0.01694357581436634, 0.03636582940816879, 0.04226846992969513, 0.05602669715881348, -0.023968098685145378, 0.04447118937969208, -0.012921834364533424, -0.1352408230304718, -0.016339750960469246, 0.015155562199652195, 0.0008181006414815784, -0.0024463022127747536, 0.08145543187856674, -0.07554898411035538, -0.027292899787425995, 0.00603965250775218, 0.14072750508785248, 0.040528327226638794, -0.09725166112184525, -0.05647996440529823, -0.024477643892169, 0.023562341928482056, 0.07553993165493011, -0.0550307035446167, -0.030360890552401543, 0.019138647243380547, -0.02843962050974369, -0.0018851966597139835, -0.017293782904744148, -0.07007911056280136, 0.0017862969543784857, -0.013932110741734505, -0.009698504582047462, 0.01139957644045353, -0.055007677525281906, -0.0031413629185408354, -0.00561527069658041, -0.03369259834289551, -0.0021161006297916174, 0.019241467118263245, 0.004886105190962553, 0.03596504032611847, -0.08392172306776047, -0.010589689016342163, 0.03469497710466385, 0.0090523986145854, -0.010408761911094189, -0.01929550990462303, 0.00009776038496056572, 0.03085380233824253, 0.049325134605169296, 0.007903371937572956, -0.03803388029336929, -0.09560035914182663, 0.06822136044502258, 0.009512913413345814, 0.03992628678679466, 0.0159342959523201, 0.007542787119746208, 0.027103690430521965, -0.05499656870961189, -0.027848631143569946, -0.09365414083003998, -0.0052061062306165695, 0.024465251713991165, -0.08478640764951706, 0.11606637388467789, -0.023833995684981346, -0.030256209895014763, 0.06679705530405045, 0.015359080396592617, -0.01977870985865593, -0.1422899067401886, -0.0028694209177047014, 0.06399395316839218, -0.013864366337656975, -0.02785523608326912, -0.02493029460310936, 0.023313486948609352, -0.07655695080757141, 0.009801728650927544, -0.07467229664325714, -0.018199637532234192, 0.0844954401254654, -0.06001248583197594, -0.01374872401356697, 0.018920214846730232, -0.029276765882968903, -0.042967140674591064, -0.014526700600981712, -0.0008800497162155807, -0.003370059421285987, 0.052197378128767014, 0.0005949771730229259, -0.01878254860639572, 0.026136545464396477, -0.012569691054522991, 0.004473591223359108, -0.0852038636803627, 0.06960640102624893, 0.10529621690511703, 0.12225092947483063, 0.0407261922955513, 0.01568278856575489, 0.0869634747505188, -0.0267789289355278, -0.00020827222033403814, 0.0134270703420043, 1.4898947331226051e-33, 0.02233380265533924, -0.01380118541419506, 0.05447561293840408, 0.0544368214905262, 0.06793997436761856, -0.03123764507472515, 0.0694577544927597, -0.005152343772351742, -0.08064892888069153, -0.00620071729645133, -0.054564621299505234, 0.0690695270895958, -0.07246363908052444, -0.04706821218132973, 0.008383245207369328, -0.03779210150241852, 0.11650973558425903, -0.0820646658539772, 0.05195940285921097, 0.09379064291715622, 0.05155448243021965, 0.0012029280187562108, -0.01233646459877491, -0.003263202728703618, 0.022986970841884613, -0.009341241791844368, 0.011813533492386341, -0.003605589270591736, 0.0781296044588089, -0.033190902322530746, -0.05038145184516907, -0.032522451132535934, 0.04117990657687187, 0.03595175966620445, -0.0085490383207798, -0.014580224640667439, 0.0063809980638325214, -0.01925988867878914, -0.15614981949329376, -0.04172202944755554, 0.011591429822146893, 0.06748822331428528, -0.06484480202198029, 0.05452628806233406, 0.07570941001176834, -0.055952299386262894, -0.030969955027103424, -0.009874876588582993, 0.06718000769615173, 0.05876357480883598, -0.009501244872808456, 0.1096530333161354, 0.058557476848363876, -0.056476298719644547, 0.05642366036772728, -0.06001168489456177, 0.06316173821687698, 0.009733675047755241, -0.031842611730098724, -0.059458568692207336, 0.05248037725687027, -0.022094979882240295, 0.010504522360861301, -0.02160196378827095, 0.033799465745687485, 0.04333428293466568, -0.01113949529826641, 0.021329350769519806, -0.08581322431564331, 0.027013272047042847, -0.10037307441234589, 0.04537373408675194, -0.04124749079346657, 0.03072315640747547, 0.06940612196922302, -0.07477481663227081, -0.04044942930340767, -0.03394082188606262, 0.04926588386297226, -0.07007048279047012, 0.06031680479645729, -0.03200232610106468, -0.11077474802732468, 0.1102723702788353, 0.0006854791427031159, -0.007597635965794325, -0.029549794271588326, -0.03639017045497894, 0.05097886174917221, 0.0205878596752882, 0.03689475357532501, -0.048952002078294754, -0.00264516519382596, -0.051806677132844925, -0.05445002391934395, -3.93807395054164e-33, 0.024574067443609238, -0.004104970954358578, -0.07644743472337723, 0.13051696121692657, -0.002755531342700124, -0.00853114202618599, 0.0052773975767195225, 0.037338774651288986, 0.0807618796825409, -0.07774452865123749, -0.03782320395112038, -0.0033415909856557846, 0.05518832802772522, -0.053366366773843765, 0.02562602236866951, 0.014063013717532158, -0.03033245913684368, -0.052303049713373184, 0.0005373515305109322, -0.05032668635249138, 0.012083945795893669, 0.12335588783025742, 0.02992679923772812, 0.0350150428712368, -0.05689936876296997, 0.004113051574677229, 0.0052353995852172375, -0.002721382537856698, -0.07515978068113327, -0.07734206318855286, -0.01207244023680687, 0.0035651270300149918, -0.052613548934459686, 0.03159617632627487, 0.03507491946220398, -0.05516792833805084, -0.01044355146586895, 0.15239594876766205, -0.06855060160160065, -0.040528666228055954, 0.06644682586193085, -0.019567927345633507, -0.04043642804026604, 0.0010935597820207477, 0.00018453292432241142, 0.008598838932812214, -0.047337766736745834, -0.02148965559899807, 0.05235692858695984, -0.008675596676766872, 0.03183286264538765, -0.05113326013088226, -0.027629241347312927, 0.027026420459151268, 0.012855163775384426, -0.07966143637895584, 0.0197741836309433, -0.008526872843503952, 0.034151069819927216, 0.0550580658018589, 0.008152458816766739, -0.04584380239248276, -0.025515524670481682, -0.021175097674131393, 0.002271940466016531, -0.002134601818397641, -0.16146337985992432, -0.0011679782764986157, 0.08945931494235992, 0.008063205517828465, 0.02079547755420208, -0.09793898463249207, -0.006151050794869661, 0.011237368918955326, -0.019067224115133286, -0.002644804073497653, 0.01694035902619362, -0.1332586407661438, 0.04149245843291283, 0.020553428679704666, -0.061164457350969315, 0.0719805657863617, 0.012919857166707516, 0.11929971724748611, 0.10650777071714401, -0.05502632260322571, 0.022108767181634903, 0.02789263427257538, -0.022981401532888412, 0.06193835660815239, 0.040070440620183945, -0.032098062336444855, -0.04105255380272865, 0.03566005080938339, 0.01707836613059044, -5.527558499807128e-8, -0.047233689576387405, 0.06285605579614639, -0.1141994446516037, -0.019809504970908165, 0.016874929890036583, 0.025892343372106552, 0.03995182365179062, -0.05377475917339325, 0.031571824103593826, 0.015867548063397408, -0.02172287181019783, 0.055708881467580795, 0.04971180483698845, 0.00917019508779049, 0.015931883826851845, 0.0168057382106781, 0.02835688553750515, 0.04273059591650963, -0.0638572946190834, -0.029619500041007996, -0.06618919968605042, 0.02089749649167061, -0.0356530137360096, -0.03660385683178902, -0.0027982143219560385, 0.005176596809178591, -0.01083800382912159, 0.05521804094314575, 0.05317564681172371, -0.01734640821814537, -0.079423688352108, -0.055247046053409576, 0.044651128351688385, 0.03020731545984745, -0.05939517915248871, 0.021739182993769646, -0.051350682973861694, -0.006519251968711615, 0.06495340168476105, -0.0014812955632805824, -0.005536253564059734, -0.00201942166313529, -0.04050253704190254, 0.01825958490371704, -0.08274003118276596, -0.030291788280010223, 0.04599182307720184, 0.04649946093559265, 0.010279149748384953, 0.023330172523856163, -0.012251796200871468, -0.05809643864631653, -0.07820664346218109, 0.006911145057529211, -0.014136161655187607, -0.001634873216971755, 0.009851506911218166, -0.014990337193012238, 0.021349310874938965, -0.0772479921579361, 0.0712420716881752, -0.07821519672870636, 0.09611627459526062, 0.014599842950701714 ]
0.044897
a `builtinModules` property that contains an array of built-in modules. This was incomplete and matched the already deprecated `repl.\_builtinLibs` ([DEP0142][]) instead it's better to rely upon `require('node:module').builtinModules`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules)): ```bash npx codemod@latest @nodejs/repl-builtin-modules ``` ### DEP0192: `require('node:\_tls\_common')` and `require('node:\_tls\_wrap')` Type: Runtime The `node:\_tls\_common` and `node:\_tls\_wrap` modules are deprecated as they should be considered an internal nodejs implementation rather than a public facing API, use `node:tls` instead. ### DEP0193: `require('node:\_stream\_\*')` Type: End-of-Life The `node:\_stream\_duplex`, `node:\_stream\_passthrough`, `node:\_stream\_readable`, `node:\_stream\_transform`, `node:\_stream\_wrap` and `node:\_stream\_writable` modules are deprecated as they should be considered an internal nodejs implementation rather than a public facing API, use `node:stream` instead. ### DEP0194: HTTP/2 priority signaling Type: End-of-Life The support for priority signaling has been removed following its deprecation in the [RFC 9113][]. ### DEP0195: Instantiating `node:http` classes without `new` Type: Documentation-only Instantiating classes without the `new` qualifier exported by the `node:http` module is deprecated. It is recommended to use the `new` qualifier instead. This applies to all http classes, such as `OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/http-classes-with-new)): ```bash npx codemod@latest @nodejs/http-classes-with-new ``` ### DEP0196: Calling `node:child\_process` functions with `options.shell` as an empty string Type: Documentation-only Calling the process-spawning functions with `{ shell: '' }` is almost certainly unintentional, and can cause aberrant behavior. To make [`child\_process.execFile`][] or [`child\_process.spawn`][] invoke the default shell, use `{ shell: true }`. If the intention is not to invoke a shell (default behavior), either omit the `shell` option, or set it to `false` or a nullish value. To make [`child\_process.exec`][] invoke the default shell, either omit the `shell` option, or set it to a nullish value. If the intention is not to invoke a shell, use [`child\_process.execFile`][] instead. ### DEP0197: `util.types.isNativeError()` Type: Documentation-only The [`util.types.isNativeError`][] API is deprecated. Please use [`Error.isError`][] instead. An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/types-is-native-error)): ```bash npx codemod@latest @nodejs/types-is-native-error ``` ### DEP0198: Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLength` Type: Runtime Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLength` is deprecated. ### DEP0199: `require('node:\_http\_\*')` Type: Documentation-only The `node:\_http\_agent`, `node:\_http\_client`, `node:\_http\_common`, `node:\_http\_incoming`, `node:\_http\_outgoing` and `node:\_http\_server` modules are deprecated as they should be considered an internal nodejs implementation rather than a public facing API, use `node:http` instead. ### DEP0200: Closing fs.Dir on garbage collection Type: Documentation-only Allowing a [`fs.Dir`][] object to be closed on garbage collection is deprecated. In the future, doing so might result in a thrown error that will terminate the process. Please ensure that all `fs.Dir` objects are explicitly closed using `Dir.prototype.close()` or `using` keyword: ```mjs import { opendir } from 'node:fs/promises'; { await using dir = await opendir('/async/disposable/directory'); } // Closed by dir[Symbol.asyncDispose]() { using dir = await opendir('/sync/disposable/directory'); } // Closed by dir[Symbol.dispose]() { const dir = await opendir('/unconditionally/iterated/directory'); for await (const entry of dir) { // process an entry } // Closed by iterator } { let dir; try { dir = await opendir('/legacy/closeable/directory'); } finally { await dir?.close(); } } ``` [DEP0142]: #dep0142-repl\_builtinlibs [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 [RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4 [RFC 9113]: https://datatracker.ietf.org/doc/html/rfc9113#section-5.3.1 [WHATWG URL API]: url.md#the-whatwg-url-api [`"exports"` or `"main"` entry]: packages.md#main-entry-point-export [`'uncaughtException'`]: process.md#event-uncaughtexception [`--force-node-api-uncaught-exceptions-policy`]: cli.md#--force-node-api-uncaught-exceptions-policy [`--pending-deprecation`]: cli.md#--pending-deprecation [`--throw-deprecation`]: cli.md#--throw-deprecation [`--unhandled-rejections`]: cli.md#--unhandled-rejectionsmode [`Buffer.allocUnsafeSlow(size)`]: buffer.md#static-method-bufferallocunsafeslowsize [`Buffer.from(array)`]: buffer.md#static-method-bufferfromarray [`Buffer.from(buffer)`]: buffer.md#static-method-bufferfrombuffer [`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj [`Cipheriv`]: crypto.md#class-cipheriv [`Decipheriv`]: crypto.md#class-decipheriv [`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error/isError [`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand [`ReadStream.open()`]: fs.md#class-fsreadstream [`Server.getConnections()`]: net.md#servergetconnectionscallback [`Server.listen({fd: })`]: net.md#serverlistenhandle-backlog-callback [`String.prototype.toWellFormed`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/toWellFormed [`WriteStream.open()`]: fs.md#class-fswritestream [`assert`]: assert.md [`asyncResource.runInAsyncScope()`]: async\_context.md#asyncresourceruninasyncscopefn-thisarg-args [`buffer.subarray`]: buffer.md#bufsubarraystart-end [`child\_process.execFile`]: child\_process.md#child\_processexecfilefile-args-options-callback [`child\_process.exec`]: child\_process.md#child\_processexeccommand-options-callback [`child\_process.spawn`]: child\_process.md#child\_processspawncommand-args-options [`child\_process`]: child\_process.md [`clearInterval()`]: timers.md#clearintervaltimeout [`clearTimeout()`]: timers.md#cleartimeouttimeout [`console.error()`]: console.md#consoleerrordata-args [`console.log()`]: console.md#consolelogdata-args [`crypto.Certificate()` constructor]: crypto.md#legacy-api [`crypto.createCipheriv()`]: crypto.md#cryptocreatecipherivalgorithm-key-iv-options [`crypto.createDecipheriv()`]: crypto.md#cryptocreatedecipherivalgorithm-key-iv-options [`crypto.createHash()`]: crypto.md#cryptocreatehashalgorithm-options [`crypto.createHmac()`]: crypto.md#cryptocreatehmacalgorithm-key-options [`crypto.fips`]: crypto.md#cryptofips [`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback [`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback [`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback [`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags [`decipher.final()`]: crypto.md#decipherfinaloutputencoding [`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding [`dirent.parentPath`]: fs.md#direntparentpath [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.0913962796330452, 0.004770839121192694, -0.021260898560285568, -0.02026098407804966, 0.08503309637308121, -0.08769101649522781, -0.0364764928817749, -0.04653497785329819, -0.03397466614842415, 0.012293300591409206, 0.021787453442811966, -0.024172840639948845, -0.027288129553198814, 0.02836799807846546, 0.08941283822059631, 0.05194627121090889, -0.005238433834165335, 0.024240592494606972, 0.03357536718249321, -0.06083207204937935, -0.030788028612732887, 0.05429613217711449, 0.03835386410355568, 0.03428945317864418, -0.011184641160070896, -0.04195971414446831, -0.05813639983534813, 0.07679608464241028, -0.0023969411849975586, 0.01098915096372366, -0.02163197100162506, 0.016265688464045525, -0.03219034522771835, -0.03347732499241829, -0.0005971032660454512, 0.17534789443016052, -0.008935568854212761, -0.04276823252439499, -0.05053262785077095, -0.057302772998809814, 0.10351605713367462, 0.09458727389574051, -0.043345075100660324, -0.048988524824380875, -0.017054179683327675, -0.02056249976158142, -0.022534644231200218, -0.057807810604572296, -0.07576350122690201, -0.031297773122787476, 0.01452775951474905, -0.04337165132164955, 0.029289966449141502, -0.04436560720205307, -0.029318083077669144, 0.03358528017997742, -0.04444798082113266, 0.03938961774110794, 0.05053435638546944, 0.06331072002649307, 0.012364673428237438, 0.01350652240216732, 0.010921357199549675, -0.05031159520149231, -0.03665446117520332, 0.04635122790932655, -0.02710437960922718, -0.0006321623804979026, 0.042967334389686584, 0.05217314511537552, -0.02892254665493965, -0.007863059639930725, -0.0013536453479900956, 0.03786241635680199, -0.06948702037334442, -0.031862132251262665, -0.013179984875023365, -0.013242922723293304, 0.0023600112181156874, -0.018125716596841812, -0.08208711445331573, -0.03207044303417206, -0.019856376573443413, 0.055513445287942886, -0.05656101554632187, 0.07081370055675507, 0.03144438564777374, 0.00648469477891922, 0.060411032289266586, -0.022401338443160057, 0.013967089354991913, -0.10438854247331619, -0.024811824783682823, 0.05061429738998413, 0.04144880548119545, -0.0029872574377804995, -0.017139077186584473, 0.021090282127261162, -0.05432773754000664, 0.014183820225298405, -0.03160971775650978, -0.0037174266763031483, 0.03405046463012695, -0.04645552113652229, -0.004155650269240141, 0.039364248514175415, -0.015248262323439121, 0.01958455704152584, -0.030402004718780518, 0.0526219867169857, 0.015902476385235786, 0.04969606176018715, -0.003689682809635997, -0.08359329402446747, 0.015933707356452942, 0.04176324978470802, 0.00032161216950044036, -0.0135581623762846, 0.10416710376739502, 0.09038353711366653, 0.04329730570316315, 0.013977652415633202, 0.017919307574629784, 0.0339776948094368, 0.034454453736543655, -0.029726389795541763, -0.018882207572460175, 2.6883089278985233e-33, 0.022730959579348564, -0.013884182088077068, 0.005773947574198246, 0.17443573474884033, 0.06068061292171478, -0.0013272450305521488, 0.026875421404838562, -0.008969803340733051, -0.10715961456298828, -0.05129031464457512, -0.027847837656736374, 0.0080662677064538, -0.0913410410284996, 0.05898480862379074, 0.03051711432635784, -0.03870188444852829, 0.0240628644824028, -0.041128143668174744, 0.08807279169559479, 0.03937384858727455, -0.027254387736320496, 0.012209927663207054, 0.0014631811063736677, 0.013746121898293495, 0.030169164761900902, -0.024990590289235115, 0.08397197723388672, -0.03210204467177391, -0.0034749137703329325, -0.013678818941116333, 0.02105860970914364, 0.005693928804248571, 0.044704340398311615, 0.08299686014652252, 0.0140353012830019, 0.02076239138841629, -0.006189347244799137, 0.04478366672992706, -0.08164124935865402, 0.002884458750486374, 0.03727265074849129, 0.08634580671787262, -0.06739721447229385, -0.01955237053334713, 0.05112693831324577, -0.08815913647413254, 0.010969657450914383, -0.014842914417386055, 0.1168985664844513, -0.003983890637755394, -0.025973515585064888, 0.0402594618499279, 0.008500343188643456, -0.12871982157230377, 0.010926428250968456, -0.0862543061375618, 0.06353382766246796, 0.048236846923828125, 0.046669699251651764, -0.05955921858549118, 0.020385634154081345, 0.02811431512236595, -0.043620459735393524, 0.04275177791714668, 0.06874720007181168, 0.09253628551959991, -0.0779600590467453, -0.0016349737998098135, -0.044998154044151306, 0.033630385994911194, -0.029945870861411095, 0.07045549154281616, -0.05383514612913132, 0.0274845939129591, 0.0241989828646183, -0.014871946536004543, -0.005380640272051096, 0.0100512420758605, 0.10508184880018234, -0.02543734945356846, 0.03439871221780777, -0.012661555781960487, -0.07438871264457703, 0.0355561338365078, 0.003044240176677704, -0.027116654440760612, -0.03454774245619774, 0.03189529851078987, 0.02649456448853016, 0.006797839887440205, 0.08190850913524628, -0.031892891973257065, -0.05704623460769653, -0.0644773319363594, -0.10627322643995285, -3.943784281692744e-33, 0.013125780038535595, 0.007411569822579622, 0.012276319786906242, 0.07232937216758728, 0.002037967322394252, -0.0862869918346405, -0.08073470741510391, -0.04125600308179855, 0.11368706822395325, -0.003289317712187767, -0.02164984494447708, 0.007649347651749849, 0.09774945676326752, 0.037996772676706314, -0.00008601888112025335, 0.018784653395414352, -0.12662120163440704, -0.06084464117884636, 0.017588037997484207, -0.09519971162080765, -0.027080444619059563, 0.12221682816743851, 0.026057478040456772, 0.05214376747608185, -0.0083009023219347, -0.0074446843937039375, -0.046543266624212265, 0.01476016640663147, 0.015556043945252895, -0.07383877784013748, -0.041006192564964294, -0.011577975936233997, -0.028987785801291466, 0.0633942186832428, -0.03885657712817192, 0.012845929712057114, -0.06354178488254547, 0.10268377512693405, 0.008197682909667492, -0.08314284682273865, -0.0008928254246711731, -0.037785205990076065, -0.05506819114089012, -0.0749724730849266, -0.006305395159870386, -0.07160500437021255, -0.006888870615512133, -0.00304867303930223, 0.029374485835433006, -0.046909864991903305, -0.024374250322580338, 0.03452017530798912, -0.008050649426877499, -0.04814283177256584, -0.002684310544282198, -0.0762624442577362, 0.003544851206243038, 0.12027119845151901, 0.056374646723270416, -0.03784947842359543, 0.02380230464041233, -0.05227674916386604, 0.0417565293610096, 0.007639524061232805, -0.014791252091526985, 0.0063787102699279785, -0.11565573513507843, 0.0051476117223501205, 0.05150984227657318, 0.021386267617344856, -0.007715327199548483, 0.01866895519196987, -0.05194723978638649, -0.0720415860414505, -0.016618948429822922, -0.022646671161055565, 0.030824963003396988, 0.07446012645959854, 0.016445593908429146, 0.02846694551408291, -0.08340141922235489, 0.026151910424232483, -0.03716664016246796, 0.0010884323855862021, 0.06641878187656403, -0.04804819077253342, 0.033778924494981766, 0.04279434308409691, 0.02046208828687668, 0.0648253858089447, 0.05870376154780388, 0.004713917151093483, -0.08203840255737305, 0.04083925113081932, 0.04296841844916344, -5.3080110973269257e-8, -0.019835328683257103, 0.07225540280342102, -0.16762307286262512, 0.008788028731942177, 0.0665617361664772, 0.019207937642931938, 0.12039624154567719, 0.025426676496863365, 0.037140898406505585, 0.03869800642132759, -0.009108883328735828, 0.06409363448619843, 0.024353615939617157, 0.07629580795764923, -0.07627756148576736, 0.04324997588992119, -0.09326440095901489, 0.01539603341370821, -0.00724835367873311, -0.03601374104619026, -0.013468350283801556, -0.011576798744499683, -0.03468582406640053, 0.0510721281170845, -0.04877782240509987, -0.03527400270104408, 0.032270416617393494, 0.03248336911201477, -0.015861529856920242, 0.002685276558622718, -0.04645898565649986, -0.008434553630650043, -0.04072033241391182, -0.0799834355711937, 0.0374801903963089, 0.009773481637239456, -0.052523691207170486, 0.038296889513731, 0.07403966784477234, 0.03249005973339081, -0.07033762335777283, -0.008987529203295708, -0.01890902779996395, 0.031138306483626366, -0.05332029610872269, -0.06949089467525482, -0.030822448432445526, 0.08278561383485794, -0.041871681809425354, 0.03825829550623894, 0.09366076439619064, -0.04403470829129219, -0.05382252857089043, -0.05415603145956993, -0.07979650795459747, 0.065904401242733, -0.005695685278624296, 0.028325265273451805, 0.015978144481778145, -0.0705004632472992, 0.05809962376952171, -0.099948450922966, 0.1112232431769371, -0.02339436486363411 ]
0.006464
assert.md [`asyncResource.runInAsyncScope()`]: async\_context.md#asyncresourceruninasyncscopefn-thisarg-args [`buffer.subarray`]: buffer.md#bufsubarraystart-end [`child\_process.execFile`]: child\_process.md#child\_processexecfilefile-args-options-callback [`child\_process.exec`]: child\_process.md#child\_processexeccommand-options-callback [`child\_process.spawn`]: child\_process.md#child\_processspawncommand-args-options [`child\_process`]: child\_process.md [`clearInterval()`]: timers.md#clearintervaltimeout [`clearTimeout()`]: timers.md#cleartimeouttimeout [`console.error()`]: console.md#consoleerrordata-args [`console.log()`]: console.md#consolelogdata-args [`crypto.Certificate()` constructor]: crypto.md#legacy-api [`crypto.createCipheriv()`]: crypto.md#cryptocreatecipherivalgorithm-key-iv-options [`crypto.createDecipheriv()`]: crypto.md#cryptocreatedecipherivalgorithm-key-iv-options [`crypto.createHash()`]: crypto.md#cryptocreatehashalgorithm-options [`crypto.createHmac()`]: crypto.md#cryptocreatehmacalgorithm-key-options [`crypto.fips`]: crypto.md#cryptofips [`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback [`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback [`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback [`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags [`decipher.final()`]: crypto.md#decipherfinaloutputencoding [`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding [`dirent.parentPath`]: fs.md#direntparentpath [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback [`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options [`domain`]: domain.md [`ecdh.setPublicKey()`]: crypto.md#ecdhsetpublickeypublickey-encoding [`emitter.listenerCount(eventName)`]: events.md#emitterlistenercounteventname-listener [`events.listenerCount(emitter, eventName)`]: events.md#eventslistenercountemitterortarget-eventname [`fs.Dir`]: fs.md#class-fsdir [`fs.FileHandle`]: fs.md#class-filehandle [`fs.access()`]: fs.md#fsaccesspath-mode-callback [`fs.appendFile()`]: fs.md#fsappendfilepath-data-options-callback [`fs.appendFileSync()`]: fs.md#fsappendfilesyncpath-data-options [`fs.createReadStream()`]: fs.md#fscreatereadstreampath-options [`fs.createWriteStream()`]: fs.md#fscreatewritestreampath-options [`fs.exists(path, callback)`]: fs.md#fsexistspath-callback [`fs.lchmod(path, mode, callback)`]: fs.md#fslchmodpath-mode-callback [`fs.lchmodSync(path, mode)`]: fs.md#fslchmodsyncpath-mode [`fs.lchown(path, uid, gid, callback)`]: fs.md#fslchownpath-uid-gid-callback [`fs.lchownSync(path, uid, gid)`]: fs.md#fslchownsyncpath-uid-gid [`fs.read()`]: fs.md#fsreadfd-buffer-offset-length-position-callback [`fs.readSync()`]: fs.md#fsreadsyncfd-buffer-offset-length-position [`fs.stat()`]: fs.md#fsstatpath-options-callback [`fs.write()`]: fs.md#fswritefd-buffer-offset-length-position-callback [`fs.writeFile()`]: fs.md#fswritefilefile-data-options-callback [`fs.writeFileSync()`]: fs.md#fswritefilesyncfile-data-options [`http.ClientRequest`]: http.md#class-httpclientrequest [`http.IncomingMessage`]: http.md#class-httpincomingmessage [`http.ServerResponse`]: http.md#class-httpserverresponse [`http.get()`]: http.md#httpgetoptions-callback [`http.request()`]: http.md#httprequestoptions-callback [`https.get()`]: https.md#httpsgetoptions-callback [`https.request()`]: https.md#httpsrequestoptions-callback [`message.connection`]: http.md#messageconnection [`message.headersDistinct`]: http.md#messageheadersdistinct [`message.headers`]: http.md#messageheaders [`message.socket`]: http.md#messagesocket [`message.trailersDistinct`]: http.md#messagetrailersdistinct [`message.trailers`]: http.md#messagetrailers [`module.createRequire()`]: module.md#modulecreaterequirefilename [`os.networkInterfaces()`]: os.md#osnetworkinterfaces [`os.tmpdir()`]: os.md#ostmpdir [`process.env`]: process.md#processenv [`process.exit()`]: process.md#processexitcode [`process.exitCode`]: process.md#processexitcode\_1 [`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo [`process.mainModule`]: process.md#processmainmodule [`punycode`]: punycode.md [`readable.readableEnded`]: stream.md#readablereadableended [`request.abort()`]: http.md#requestabort [`request.connection`]: http.md#requestconnection [`request.destroy()`]: http.md#requestdestroyerror [`request.socket`]: http.md#requestsocket [`require.extensions`]: modules.md#requireextensions [`require.main`]: modules.md#accessing-the-main-module [`response.connection`]: http.md#responseconnection [`response.end()`]: http.md#responseenddata-encoding-callback [`response.finished`]: http.md#responsefinished [`response.socket`]: http.md#responsesocket [`response.writableEnded`]: http.md#responsewritableended [`response.writableFinished`]: http.md#responsewritablefinished [`script.createCachedData()`]: vm.md#scriptcreatecacheddata [`setInterval()`]: timers.md#setintervalcallback-delay-args [`setTimeout()`]: timers.md#settimeoutcallback-delay-args [`socket.bufferSize`]: net.md#socketbuffersize [`timeout.ref()`]: timers.md#timeoutref [`timeout.refresh()`]: timers.md#timeoutrefresh [`timeout.unref()`]: timers.md#timeoutunref [`tls.SecureContext`]: tls.md#tlscreatesecurecontextoptions [`tls.TLSSocket`]: tls.md#class-tlstlssocket [`tls.checkServerIdentity()`]: tls.md#tlscheckserveridentityhostname-cert [`tls.createSecureContext()`]: tls.md#tlscreatesecurecontextoptions [`tls.createServer()`]: tls.md#tlscreateserveroptions-secureconnectionlistener [`url.format()`]: url.md#urlformaturlobject [`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost [`url.resolve()`]: url.md#urlresolvefrom-to [`util.\_extend()`]: util.md#util\_extendtarget-source [`util.getSystemErrorName()`]: util.md#utilgetsystemerrornameerr [`util.inspect()`]: util.md#utilinspectobject-options [`util.inspect.custom`]: util.md#utilinspectcustom [`util.isArray()`]: util.md#utilisarrayobject [`util.promisify`]: util.md#utilpromisifyoriginal [`util.toUSVString()`]: util.md#utiltousvstringstring [`util.types.isNativeError`]: util.md#utiltypesisnativeerrorvalue [`util.types`]: util.md#utiltypes [`util`]: util.md [`worker.exitedAfterDisconnect`]: cluster.md#workerexitedafterdisconnect [`worker.terminate()`]: worker\_threads.md#workerterminate [`writable.writableLength`]: stream.md#writablewritablelength [`zlib.bytesWritten`]: zlib.md#zlibbyteswritten [alloc]: buffer.md#static-method-bufferallocsize-fill-encoding [alloc\_unsafe\_size]: buffer.md#static-method-bufferallocunsafesize [from\_arraybuffer]: buffer.md#static-method-bufferfromarraybuffer-byteoffset-length [from\_string\_encoding]: buffer.md#static-method-bufferfromstring-encoding [legacy URL API]: url.md#legacy-url-api [legacy `urlObject`]: url.md#legacy-urlobject [permission model]: permissions.md#permission-model [static methods of `crypto.Certificate()`]: crypto.md#class-certificate [subpath exports]: packages.md#subpath-exports [subpath imports]: packages.md#subpath-imports [subpath patterns]: packages.md#subpath-patterns
https://github.com/nodejs/node/blob/main//doc/api/deprecations.md
main
nodejs
[ -0.04803498834371567, -0.0014797498006373644, -0.1096782311797142, 0.02974492311477661, 0.041726190596818924, -0.05233503505587578, 0.013129385188221931, 0.02052323892712593, 0.002838010201230645, 0.022009890526533127, -0.0368758924305439, -0.027249567210674286, -0.042710352689027786, 0.0660109594464302, -0.02094435505568981, 0.0034038922749459743, -0.032912883907556534, -0.012078523635864258, 0.04241388291120529, -0.0320642814040184, 0.05352640524506569, 0.03797680512070656, 0.06245959550142288, 0.0792871043086052, -0.034798763692379, -0.004004335030913353, -0.023922860622406006, -0.06605242937803268, 0.00077344587771222, -0.05185716599225998, 0.04244180768728256, -0.020787512883543968, 0.006466741673648357, -0.10916253924369812, 0.08257926255464554, 0.1615312695503235, 0.04759735241532326, -0.013288833200931549, -0.0420118011534214, 0.0020971617195755243, 0.16061842441558838, 0.06833286583423615, -0.10640718042850494, -0.05269560590386391, -0.030167115852236748, -0.11863847076892853, -0.022873880341649055, -0.07463683187961578, -0.03359073027968407, 0.018971631303429604, 0.004048451315611601, 0.015764666721224785, -0.055117473006248474, -0.015206193551421165, 0.00528812687844038, 0.007188160438090563, 0.029563916847109795, 0.004447105340659618, 0.037322819232940674, 0.036681871861219406, 0.0015821141423657537, -0.013009053654968739, -0.0806964635848999, -0.02728170156478882, 0.009165473282337189, 0.11065801978111267, 0.001648370991460979, -0.015320160426199436, 0.040758974850177765, -0.001879897085018456, -0.02416464313864708, 0.03399411216378212, -0.02956290729343891, 0.07408784329891205, -0.04556622356176376, 0.03720051422715187, 0.02914416790008545, -0.007336325477808714, -0.05170020833611488, -0.11440490931272507, -0.061290182173252106, -0.0740344226360321, -0.05937429890036583, -0.043197207152843475, -0.016318323090672493, 0.08562639355659485, 0.04572019726037979, -0.042978014796972275, 0.04060165211558342, 0.0014850083971396089, 0.03531071916222572, 0.014955486170947552, -0.07323774695396423, 0.04747992753982544, 0.0798192098736763, 0.008006067015230656, -0.039628416299819946, 0.028858687728643417, 0.029188089072704315, -0.026408160105347633, -0.043853793293237686, 0.015604975633323193, 0.010381851345300674, 0.030105073004961014, 0.0234121885150671, 0.005374340806156397, 0.03892940282821655, -0.045474983751773834, -0.07534173130989075, -0.017178984358906746, 0.0035736896097660065, 0.024204133078455925, 0.08725343644618988, 0.08919978141784668, 0.05763725936412811, 0.052624255418777466, 0.038751937448978424, -0.0009369135950691998, -0.0508708618581295, 0.06375465542078018, 0.13423967361450195, 0.03577980399131775, 0.014504526741802692, -0.02460271492600441, 0.006416340824216604, -0.023701291531324387, 0.016315987333655357, 5.362557106651289e-33, 0.034234046936035156, -0.09466345608234406, 0.04961259663105011, 0.07210910320281982, 0.08290036767721176, 0.06084055081009865, 0.03367788717150688, 0.011541377753019333, -0.005525860004127026, 0.0495670884847641, -0.07232026755809784, -0.05293911695480347, -0.000363457715138793, -0.09855043888092041, -0.011757909320294857, -0.012598088011145592, 0.012851988896727562, 0.049771107733249664, 0.011385382153093815, 0.08441648632287979, 0.04025004431605339, 0.05183640867471695, -0.13668964803218842, -0.03531024232506752, 0.01982123591005802, -0.06250064074993134, -0.030856667086482048, 0.04249949008226395, 0.049286969006061554, 0.012750737369060516, 0.03721698746085167, 0.06015999615192413, -0.04586605355143547, 0.030484680086374283, -0.032685499638319016, -0.09111380577087402, 0.031870558857917786, 0.036000825464725494, -0.05414047837257385, -0.02894679270684719, -0.03411681577563286, -0.053928881883621216, -0.06484977900981903, 0.07470326125621796, -0.04214872792363167, -0.18170928955078125, -0.0855790451169014, -0.020579569041728973, 0.0795462429523468, 0.04405088722705841, 0.07053365558385849, 0.05431992933154106, 0.026369594037532806, -0.07867318391799927, -0.005649057682603598, 0.001893040956929326, -0.03138314560055733, 0.0011905181454494596, 0.045973967760801315, 0.031154336407780647, 0.08657053858041763, -0.032325342297554016, -0.09611634910106659, -0.02903207764029503, -0.020211871713399887, -0.07946616411209106, 0.011705657467246056, -0.028392286971211433, 0.007453991565853357, -0.042171791195869446, -0.038228992372751236, 0.0018361463444307446, -0.014971914701163769, -0.05283381789922714, 0.03274577111005783, -0.06058336794376373, 0.030731763690710068, 0.00881169456988573, -0.11085976660251617, -0.045142460614442825, 0.009706721641123295, -0.052605316042900085, -0.03638547658920288, -0.018768711015582085, -0.03457140550017357, -0.004127460531890392, -0.05512034893035889, -0.03456204757094383, -0.000785857904702425, -0.03716294839978218, -0.05624596029520035, -0.05336196348071098, -0.011093066073954105, -0.06464733928442001, -0.08174534887075424, -7.220657720918217e-33, 0.17541781067848206, -0.06800717115402222, 0.03535398095846176, 0.03531569242477417, 0.019596735015511513, -0.015985315665602684, 0.053013093769550323, 0.02897699922323227, -0.0675252228975296, -0.0015735927736386657, -0.05501960217952728, 0.04314221814274788, 0.01398406270891428, -0.013697322458028793, -0.01026677992194891, 0.028590457513928413, 0.015799039974808693, -0.022163018584251404, 0.04057479277253151, -0.022545114159584045, 0.07578453421592712, 0.03336265683174133, 0.04865892603993416, 0.03443201258778572, 0.0006144760409370065, -0.0261588916182518, -0.03159944340586662, 0.011929234489798546, 0.026113266125321388, 0.007719976827502251, -0.031748175621032715, 0.04151993989944458, -0.05265241116285324, 0.05958882346749306, -0.0125478720292449, -0.033331818878650665, 0.04840373992919922, 0.015072210691869259, -0.04780818894505501, -0.015018744394183159, 0.08703874796628952, 0.0395188070833683, -0.06500669568777084, -0.02269824780523777, 0.033408958464860916, 0.07440031319856644, 0.12374863028526306, -0.030258681625127792, -0.0205704178661108, 0.004112845752388239, 0.03687640652060509, -0.03439902141690254, 0.028781792148947716, 0.09225159883499146, -0.0221695639193058, -0.041022591292858124, 0.10943770408630371, -0.08179239183664322, -0.0063297338783741, 0.05682101100683212, 0.09378684312105179, 0.00004910658753942698, -0.03598912060260773, -0.08201510459184647, -0.043072327971458435, 0.03042079135775566, -0.07071439921855927, 0.02833719737827778, 0.039055779576301575, 0.02513188309967518, -0.032841846346855164, -0.029316561296582222, -0.051020994782447815, 0.023867320269346237, -0.01689307764172554, 0.08347783237695694, -0.04037866368889809, -0.1341397911310196, 0.0006658220081590116, 0.09259018301963806, -0.0002591275842860341, 0.0014560663839802146, -0.024425311014056206, 0.020172299817204475, -0.02718757651746273, -0.03453793376684189, -0.0012380616972222924, 0.022277703508734703, -0.04952665790915489, 0.041957199573516846, -0.006221577059477568, -0.04593952000141144, -0.006611344870179892, -0.011238480918109417, 0.06827294081449509, -5.227022370490886e-8, -0.03144809603691101, 0.003290451830253005, 0.00982205756008625, 0.0005016443319618702, 0.0021579961758106947, -0.06784950941801071, -0.02140417881309986, -0.055712778121232986, 0.05451098084449768, -0.04580008611083031, -0.05239393189549446, -0.06589502841234207, 0.0664905309677124, 0.016314854845404625, 0.0028999794740229845, -0.03175418823957443, -0.014353684149682522, -0.01564347743988037, 0.041319943964481354, -0.04931410402059555, -0.021280840039253235, 0.0110288942232728, 0.019152628257870674, 0.01452763844281435, -0.04890989139676094, -0.0009107871446758509, 0.0494590625166893, 0.04547237232327461, -0.061930101364851, 0.02802293561398983, 0.04071660339832306, -0.02601880580186844, 0.035868000239133835, 0.063909612596035, -0.053370747715234756, 0.03373236954212189, -0.01597929559648037, 0.07460232824087143, 0.037242695689201355, 0.018806092441082, -0.019791247323155403, 0.06473642587661743, -0.03663613647222519, -0.007560973986983299, 0.007955316454172134, -0.07837801426649094, -0.11321530491113663, 0.08183415234088898, -0.02394513040781021, 0.0017925497377291322, 0.022882811725139618, -0.04027272388339043, -0.023408332839608192, 0.01436129305511713, 0.027381306514143944, -0.01299485843628645, 0.036203909665346146, -0.10549187660217285, -0.013140498660504818, 0.08980956673622131, 0.06457186490297318, 0.020185723900794983, 0.08126277476549149, -0.04055028781294823 ]
0.027897
# Debugger > Stability: 2 - Stable Node.js includes a command-line debugging utility. The Node.js debugger client is not a full-featured debugger, but simple stepping and inspection are possible. To use it, start Node.js with the `inspect` argument followed by the path to the script to debug. ```console $ node inspect myscript.js < Debugger listening on ws://127.0.0.1:9229/621111f9-ffcb-4e82-b718-48a145fa5db8 < For help, see: https://nodejs.org/en/docs/inspector < connecting to 127.0.0.1:9229 ... ok < Debugger attached. < ok Break on start in myscript.js:2 1 // myscript.js > 2 global.x = 5; 3 setTimeout(() => { 4 debugger; debug> ``` The debugger automatically breaks on the first executable line. To instead run until the first breakpoint (specified by a [`debugger`][] statement), set the `NODE\_INSPECT\_RESUME\_ON\_START` environment variable to `1`. ```console $ cat myscript.js // myscript.js global.x = 5; setTimeout(() => { debugger; console.log('world'); }, 1000); console.log('hello'); $ NODE\_INSPECT\_RESUME\_ON\_START=1 node inspect myscript.js < Debugger listening on ws://127.0.0.1:9229/f1ed133e-7876-495b-83ae-c32c6fc319c2 < For help, see: https://nodejs.org/en/docs/inspector < connecting to 127.0.0.1:9229 ... ok < Debugger attached. < < hello < break in myscript.js:4 2 global.x = 5; 3 setTimeout(() => { > 4 debugger; 5 console.log('world'); 6 }, 1000); debug> next break in myscript.js:5 3 setTimeout(() => { 4 debugger; > 5 console.log('world'); 6 }, 1000); 7 console.log('hello'); debug> repl Press Ctrl+C to leave debug repl > x 5 > 2 + 2 4 debug> next < world < break in myscript.js:6 4 debugger; 5 console.log('world'); > 6 }, 1000); 7 console.log('hello'); 8 debug> .exit $ ``` The `repl` command allows code to be evaluated remotely. The `next` command steps to the next line. Type `help` to see what other commands are available. Pressing `enter` without typing a command will repeat the previous debugger command. ## Watchers It is possible to watch expression and variable values while debugging. On every breakpoint, each expression from the watchers list will be evaluated in the current context and displayed immediately before the breakpoint's source code listing. To begin watching an expression, type `watch('my\_expression')`. The command `watchers` will print the active watchers. To remove a watcher, type `unwatch('my\_expression')`. ## Command reference ### Stepping \* `cont`, `c`: Continue execution \* `next`, `n`: Step next \* `step`, `s`: Step in \* `out`, `o`: Step out \* `pause`: Pause running code (like pause button in Developer Tools) ### Breakpoints \* `setBreakpoint()`, `sb()`: Set breakpoint on current line \* `setBreakpoint(line)`, `sb(line)`: Set breakpoint on specific line \* `setBreakpoint('fn()')`, `sb(...)`: Set breakpoint on a first statement in function's body \* `setBreakpoint('script.js', 1)`, `sb(...)`: Set breakpoint on first line of `script.js` \* `setBreakpoint('script.js', 1, 'num < 4')`, `sb(...)`: Set conditional breakpoint on first line of `script.js` that only breaks when `num < 4` evaluates to `true` \* `clearBreakpoint('script.js', 1)`, `cb(...)`: Clear breakpoint in `script.js` on line 1 It is also possible to set a breakpoint in a file (module) that is not loaded yet: ```console $ node inspect main.js < Debugger listening on ws://127.0.0.1:9229/48a5b28a-550c-471b-b5e1-d13dd7165df9 < For help, see: https://nodejs.org/en/docs/inspector < connecting to 127.0.0.1:9229 ... ok < Debugger attached. < Break on start in main.js:1 > 1 const mod = require('./mod.js'); 2 mod.hello(); 3 mod.hello(); debug> setBreakpoint('mod.js', 22) Warning: script 'mod.js' was not loaded yet. debug> c break in mod.js:22 20 // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 >22 exports.hello = function() { 23 return 'hello from module'; 24 }; debug> ``` It is also possible to set a conditional breakpoint that only breaks when a given expression evaluates to `true`: ```console $ node inspect main.js < Debugger listening on ws://127.0.0.1:9229/ce24daa8-3816-44d4-b8ab-8273c8a66d35 < For help, see: https://nodejs.org/en/docs/inspector < connecting to 127.0.0.1:9229 ... ok < Debugger attached. Break on start in main.js:7 5 }
https://github.com/nodejs/node/blob/main//doc/api/debugger.md
main
nodejs
[ -0.042225468903779984, -0.04427562281489372, 0.041800741106271744, 0.07289500534534454, 0.0832347720861435, -0.06090063974261284, -0.09320195019245148, 0.04702940210700035, -0.01332549937069416, 0.037775687873363495, -0.09789139777421951, -0.005001053214073181, -0.06767288595438004, -0.061462998390197754, 0.009431649930775166, 0.06320357322692871, 0.006644478999078274, -0.004405132494866848, 0.04934383183717728, 0.006969555746763945, -0.06599468737840652, -0.02323324605822563, -0.039154063910245895, -0.022157620638608932, -0.06012190878391266, 0.014014278538525105, -0.03861422464251518, 0.03163614124059677, 0.02516898140311241, 0.015916287899017334, 0.04298342019319534, -0.08879224210977554, -0.05340111255645752, 0.05782122164964676, 0.0037779854610562325, 0.11665426194667816, 0.034931428730487823, -0.002497064881026745, -0.07305847108364105, 0.01738501340150833, 0.07152554392814636, 0.11787670105695724, -0.03306419029831886, -0.05197715386748314, 0.07757163792848587, -0.07077394425868988, -0.128421351313591, 0.07277751713991165, -0.045507948845624924, 0.02839011326432228, 0.0024566343054175377, 0.022591296583414078, 0.03710636869072914, -0.0014274572022259235, 0.01453731395304203, 0.004699714481830597, 0.02577276900410652, 0.03286685794591904, 0.025507336482405663, 0.09661085903644562, -0.0196150541305542, 0.003454579273238778, 0.04932950809597969, -0.049178626388311386, 0.08392529934644699, 0.10515335202217102, 0.010997047647833824, 0.010255742818117142, -0.008406287059187889, 0.13034747540950775, -0.019985724240541458, 0.011857890523970127, -0.07529540359973907, -0.023603297770023346, -0.060414303094148636, -0.0026373914442956448, -0.06735716760158539, -0.03796340897679329, -0.017411544919013977, -0.01539357379078865, -0.04555440694093704, -0.07728982716798782, 0.01103515550494194, 0.02792257070541382, -0.026232564821839333, 0.08683522790670395, -0.035446785390377045, -0.07317125797271729, 0.048087649047374725, 0.03582865372300148, -0.12221577018499374, -0.02321801520884037, -0.05094108730554581, 0.02723543718457222, 0.05989643558859825, 0.046420130878686905, 0.01305790152400732, 0.049193527549505234, -0.05399239808320999, -0.04468975588679314, -0.03600388392806053, -0.004494362510740757, 0.01967884600162506, -0.0005044037825427949, 0.054493553936481476, -0.04597695171833038, 0.020174041390419006, -0.0067154839634895325, 0.010936110280454159, -0.009522113017737865, -0.004036702215671539, 0.08124435693025589, 0.0155106782913208, -0.0009690570295788348, 0.04011261463165283, 0.057931508868932724, 0.13424329459667206, 0.03685241565108299, 0.042124729603528976, 0.07999632507562637, 0.1483106166124344, 0.038834404200315475, -0.04913575202226639, -0.001424285932444036, 0.05428532883524895, -0.03442351147532463, 0.08269394934177399, 4.3101652996929115e-33, -0.0034748956095427275, -0.08819092810153961, 0.06004102900624275, 0.0477411262691021, 0.02222892828285694, -0.01657567359507084, 0.02370011992752552, 0.02973567135632038, -0.09103239327669144, 0.08704051375389099, 0.02045697346329689, 0.004212577361613512, 0.040965717285871506, -0.06434653699398041, 0.007913180626928806, -0.013905981555581093, 0.05482059717178345, -0.07256466150283813, -0.00039550408837385476, 0.0258035771548748, 0.012659183703362942, -0.14800825715065002, -0.021229831501841545, 0.040146999061107635, 0.046119753271341324, 0.028354166075587273, -0.01681729406118393, 0.06927837431430817, 0.011361565440893173, 0.0163692869246006, -0.03381672874093056, 0.010385523550212383, -0.07985381036996841, -0.021195152774453163, -0.006127999164164066, -0.13344670832157135, -0.039330579340457916, 0.04261859506368637, -0.042802587151527405, 0.009459923021495342, -0.060442984104156494, -0.03982409089803696, -0.0809972956776619, -0.03441912680864334, -0.0044180466793477535, -0.08234025537967682, -0.09293156117200851, -0.02797187678515911, 0.012083835899829865, -0.009965810924768448, -0.008523362688720226, 0.08101531118154526, -0.012844229117035866, -0.0454016737639904, 0.041376858949661255, -0.025093959644436836, 0.07935179024934769, -0.05493350327014923, -0.060328658670186996, 0.06306767463684082, 0.027944223955273628, -0.017962660640478134, -0.03566260635852814, -0.001463178894482553, 0.037077490240335464, -0.04569769278168678, -0.0846046581864357, 0.03331978619098663, -0.009790625423192978, 0.016857430338859558, -0.07638230919837952, 0.03608497977256775, 0.09450642764568329, 0.031148921698331833, 0.024537619203329086, 0.005906114354729652, -0.028704291209578514, 0.05534893274307251, 0.02963775210082531, 0.009802605956792831, 0.08896751701831818, -0.038947366178035736, 0.001119790249504149, -0.008663404732942581, 0.0712776854634285, 0.021419581025838852, -0.05145449936389923, -0.043663278222084045, 0.0028970823623239994, 0.020209956914186478, 0.038058046251535416, 0.04086925461888313, 0.038378529250621796, -0.07757219672203064, -0.024349242448806763, -6.631534482432642e-33, -0.05424270033836365, -0.02686365693807602, -0.05892736464738846, 0.08229578286409378, -0.03926270827651024, -0.06728094816207886, -0.06577436625957489, -0.01870974898338318, 0.07448107749223709, 0.057767316699028015, -0.004375393036752939, -0.009137849323451519, -0.08945736289024353, 0.034960824996232986, -0.012184289284050465, 0.06463902443647385, -0.09111165255308151, -0.016661319881677628, 0.11962079256772995, -0.015751168131828308, 0.05163033679127693, 0.002327526919543743, 0.06930765509605408, -0.012347671203315258, -0.06538707762956619, -0.03039195016026497, 0.06001100689172745, -0.03348177298903465, -0.03582174330949783, -0.029436303302645683, -0.05396385118365288, 0.09482196718454361, 0.04289218410849571, 0.09361075609922409, 0.0255605299025774, -0.028612568974494934, -0.037142787128686905, -0.01767086423933506, 0.04593520984053612, -0.053159940987825394, 0.062031641602516174, 0.03716937452554703, 0.008909371681511402, -0.010694270953536034, 0.016614757478237152, 0.030002886429429054, -0.03854483738541603, 0.034670811146497726, -0.07776415348052979, -0.01887042075395584, -0.053665343672037125, 0.019774852320551872, 0.01852998323738575, 0.09605630487203598, -0.07080648839473724, -0.06266459822654724, 0.00823090597987175, 0.02493399940431118, -0.011447472497820854, 0.06678193062543869, 0.03152075037360191, -0.05879708006978035, -0.00022491681738756597, 0.05455524101853371, 0.0017584620509296656, -0.04872988536953926, -0.07085620611906052, 0.05415376275777817, 0.07344446331262589, -0.03479535132646561, -0.02132732979953289, -0.019301053136587143, -0.041411831974983215, 0.03516171872615814, -0.05890601873397827, 0.07196632027626038, -0.04585881158709526, -0.13132363557815552, 0.00493032718077302, 0.045252833515405655, -0.01855548657476902, 0.07010684907436371, -0.07915984094142914, -0.02542537823319435, -0.0004187219892628491, -0.001702772220596671, -0.07992468774318695, 0.09991477429866791, -0.024794040247797966, -0.03370080515742302, -0.028479158878326416, -0.00628769351169467, -0.09261707961559296, -0.055484943091869354, -0.0343070849776268, -5.227417787523336e-8, -0.03673261031508446, -0.00271127512678504, -0.0783245638012886, 0.015074251219630241, 0.001194000942632556, 0.014097727835178375, -0.037177808582782745, 0.013469316065311432, 0.006394548807293177, 0.032323721796274185, -0.010855072177946568, 0.05390409007668495, 0.011385266669094563, 0.03087337501347065, -0.036897461861371994, -0.03656815364956856, 0.0186272244900465, 0.007504581939429045, 0.03772465139627457, -0.013504985719919205, 0.014280850067734718, 0.0448298417031765, 0.03522616624832153, 0.03610149025917053, -0.10070974379777908, -0.08265787363052368, 0.03025810606777668, 0.022041238844394684, -0.02903386391699314, -0.08637481182813644, -0.07598717510700226, 0.06932581216096878, 0.021310346201062202, 0.015431942418217659, -0.032501690089702606, 0.027260227128863335, -0.045066919177770615, -0.007720980327576399, 0.04084613546729088, 0.004554375074803829, 0.04166407510638237, 0.09194282442331314, -0.04272228851914406, -0.018687793985009193, -0.08178433775901794, 0.023849328979849815, 0.08423960953950882, 0.06599366664886475, 0.02904459275305271, -0.0028621135279536247, 0.00830100104212761, -0.02800046093761921, -0.015278135426342487, -0.025636358186602592, -0.016980817541480064, 0.03914389759302139, -0.0370425209403038, -0.09267359226942062, -0.023372026160359383, 0.03241667523980141, -0.015386275947093964, 0.0013149268925189972, 0.02302115596830845, -0.0016060027992352843 ]
-0.006959
It is also possible to set a conditional breakpoint that only breaks when a given expression evaluates to `true`: ```console $ node inspect main.js < Debugger listening on ws://127.0.0.1:9229/ce24daa8-3816-44d4-b8ab-8273c8a66d35 < For help, see: https://nodejs.org/en/docs/inspector < connecting to 127.0.0.1:9229 ... ok < Debugger attached. Break on start in main.js:7 5 } 6 > 7 addOne(10); 8 addOne(-1); 9 debug> setBreakpoint('main.js', 4, 'num < 0') 1 'use strict'; 2 3 function addOne(num) { > 4 return num + 1; 5 } 6 7 addOne(10); 8 addOne(-1); 9 debug> cont break in main.js:4 2 3 function addOne(num) { > 4 return num + 1; 5 } 6 debug> exec('num') -1 debug> ``` ### Information \* `backtrace`, `bt`: Print backtrace of current execution frame \* `list(5)`: List scripts source code with 5 line context (5 lines before and after) \* `watch(expr)`: Add expression to watch list \* `unwatch(expr)`: Remove expression from watch list \* `unwatch(index)`: Remove expression at specific index from watch list \* `watchers`: List all watchers and their values (automatically listed on each breakpoint) \* `repl`: Open debugger's repl for evaluation in debugging script's context \* `exec expr`, `p expr`: Execute an expression in debugging script's context and print its value \* `profile`: Start CPU profiling session \* `profileEnd`: Stop current CPU profiling session \* `profiles`: List all completed CPU profiling sessions \* `profiles[n].save(filepath = 'node.cpuprofile')`: Save CPU profiling session to disk as JSON \* `takeHeapSnapshot(filepath = 'node.heapsnapshot')`: Take a heap snapshot and save to disk as JSON ### Execution control \* `run`: Run script (automatically runs on debugger's start) \* `restart`: Restart script \* `kill`: Kill script ### Various \* `scripts`: List all loaded scripts \* `version`: Display V8's version ## Advanced usage ### V8 inspector integration for Node.js V8 Inspector integration allows attaching Chrome DevTools to Node.js instances for debugging and profiling. It uses the [Chrome DevTools Protocol][]. V8 Inspector can be enabled by passing the `--inspect` flag when starting a Node.js application. It is also possible to supply a custom port with that flag, e.g. `--inspect=9222` will accept DevTools connections on port 9222. Using the `--inspect` flag will execute the code immediately before debugger is connected. This means that the code will start running before you can start debugging, which might not be ideal if you want to debug from the very beginning. In such cases, you have two alternatives: 1. `--inspect-wait` flag: This flag will wait for debugger to be attached before executing the code. This allows you to start debugging right from the beginning of the execution. 2. `--inspect-brk` flag: Unlike `--inspect`, this flag will break on the first line of the code as soon as debugger is attached. This is useful when you want to debug the code step by step from the very beginning, without any code execution prior to debugging. So, when deciding between `--inspect`, `--inspect-wait`, and `--inspect-brk`, consider whether you want the code to start executing immediately, wait for debugger to be attached before execution, or break on the first line for step-by-step debugging. ```console $ node --inspect index.js Debugger listening on ws://127.0.0.1:9229/dc9010dd-f8b8-4ac5-a510-c1a114ec7d29 For help, see: https://nodejs.org/en/docs/inspector ``` (In the example above, the UUID dc9010dd-f8b8-4ac5-a510-c1a114ec7d29 at the end of the URL is generated on the fly, it varies in different debugging sessions.) If the Chrome browser is older than 66.0.3345.0, use `inspector.html` instead of `js\_app.html` in the above URL. Chrome DevTools doesn't support debugging [worker threads][] yet. [ndb][] can be used to debug them. [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/ [`debugger`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger [ndb]: https://github.com/GoogleChromeLabs/ndb/ [worker threads]: worker\_threads.md
https://github.com/nodejs/node/blob/main//doc/api/debugger.md
main
nodejs
[ -0.05701054260134697, 0.004028879106044769, 0.06489579379558563, 0.00915613304823637, 0.06149919331073761, -0.013415640220046043, -0.05490909889340401, -0.0038603111170232296, -0.003045241814106703, 0.045650456100702286, -0.059127602726221085, -0.04647897183895111, -0.0538974292576313, -0.022201620042324066, 0.04372825846076012, 0.05280449986457825, -0.029300576075911522, 0.0012401830172166228, 0.018047908321022987, -0.05331919714808464, 0.026612751185894012, 0.02107134275138378, -0.05557272955775261, 0.01065044291317463, -0.04235644266009331, 0.002531712409108877, -0.04911649227142334, 0.03315882384777069, 0.07761050760746002, -0.02263796143233776, 0.014879362657666206, -0.049302589148283005, -0.048026520758867264, 0.09016969054937363, -0.012768993154168129, 0.12156327813863754, -0.020650029182434082, -0.02426358312368393, -0.08837607502937317, 0.00284044211730361, 0.0522393062710762, 0.06199716776609421, 0.0032038125209510326, -0.05976240336894989, 0.062257781624794006, -0.050610657781362534, -0.09066388756036758, 0.08196011930704117, -0.018930979073047638, 0.029052358120679855, -0.008416779339313507, 0.040157467126846313, 0.003702480113133788, 0.013855020515620708, 0.04346303269267082, -0.02352425456047058, -0.012214494869112968, 0.01691281981766224, 0.014313766732811928, 0.051810335367918015, -0.020372530445456505, -0.00508985435590148, 0.0432235449552536, -0.0669383853673935, 0.11532783508300781, 0.04123042896389961, -0.026601914316415787, 0.04960405454039574, -0.03493023291230202, 0.16978959739208221, -0.03716384619474411, -0.026878872886300087, -0.03237771615386009, -0.019599825143814087, -0.04450085014104843, 0.04608483985066414, -0.04164828732609749, -0.04275574907660484, -0.028158873319625854, 0.01948411762714386, -0.039457641541957855, -0.06294329464435577, -0.005219001788645983, -0.037737663835287094, -0.007288326974958181, 0.06583458185195923, -0.06545332819223404, -0.03647488355636597, 0.10544022172689438, 0.00048817991046234965, -0.11201979964971542, -0.020136181265115738, -0.0892372727394104, 0.024597281590104103, 0.09924709051847458, 0.027170253917574883, -0.02464793622493744, 0.03244935721158981, -0.048885222524404526, 0.005666387267410755, 0.0034288049209862947, 0.054836805909872055, 0.02586761675775051, -0.06011787801980972, 0.08065427839756012, -0.0784897655248642, -0.006226282566785812, 0.0029903592076152563, -0.03608403354883194, -0.032186273485422134, 0.017452241852879524, 0.05923142656683922, 0.07188957184553146, -0.05736334249377251, 0.015385421924293041, 0.02040775492787361, 0.13957034051418304, 0.03179139643907547, -0.01825723797082901, 0.04405948519706726, 0.10742303729057312, 0.012301232665777206, -0.019731570035219193, 0.029591409489512444, 0.023000139743089676, -0.02803770825266838, 0.06278637796640396, 8.889151463739495e-33, 0.03466822952032089, -0.1275254487991333, -0.00163979921489954, -0.013037214055657387, 0.03649676591157913, 0.019020410254597664, -0.027728911489248276, 0.06108568236231804, -0.0834931880235672, 0.09458650648593903, -0.010814891196787357, -0.034901756793260574, 0.017955876886844635, -0.09957023710012436, 0.05943163484334946, 0.04005672037601471, 0.13146038353443146, -0.057222891598939896, -0.019808229058980942, 0.0321417972445488, -0.015083381906151772, -0.16542242467403412, -0.06987740844488144, 0.021236354485154152, 0.0372953899204731, 0.010040324181318283, -0.04021948203444481, 0.03411518409848213, 0.005915611516684294, -0.03922135755419731, -0.027919940650463104, 0.01192678976804018, -0.025516636669635773, 0.013359926640987396, 0.04572707787156105, -0.05251206457614899, -0.044738657772541046, 0.052283890545368195, -0.023394152522087097, -0.031543049961328506, -0.09578154236078262, -0.04318995773792267, -0.06118294969201088, 0.011899152770638466, 0.039802033454179764, -0.10402632504701614, -0.0772341787815094, 0.008261172100901604, 0.027986599132418633, -0.0421573705971241, -0.0009548066300339997, 0.11963453143835068, -0.027723705396056175, -0.0482432059943676, 0.022540520876646042, -0.010759762488305569, 0.04237160459160805, 0.049763403832912445, -0.07737792283296585, 0.06418463587760925, -0.01411721482872963, -0.031028272584080696, -0.03712768480181694, 0.014893748797476292, -0.024972978979349136, -0.028281081467866898, -0.09815973788499832, 0.036941614001989365, 0.046285226941108704, 0.02740531973540783, -0.10013299435377121, 0.043278731405735016, 0.012930866330862045, 0.05561300739645958, -0.007813075557351112, -0.03213387355208397, -0.03664636239409447, 0.07402846217155457, 0.05235980078577995, -0.051959678530693054, 0.10919459164142609, 0.016663387417793274, 0.04583585262298584, 0.06834245473146439, 0.04175076261162758, 0.03876945748925209, -0.06633275747299194, -0.04906399920582771, -0.010448590852320194, -0.03580320626497269, 0.04027285426855087, 0.03484058752655983, 0.034230198711156845, -0.06620761007070541, -0.017071140930056572, -1.0088285740640788e-32, -0.06023043394088745, 0.0367153137922287, -0.04339669644832611, 0.04270492121577263, -0.07638083398342133, -0.012047450989484787, -0.009409751743078232, -0.04470019415020943, 0.027372824028134346, 0.03409774228930473, 0.06251682341098785, -0.001270052744075656, -0.023033328354358673, 0.05456635728478432, -0.051784902811050415, 0.03188467398285866, -0.09270269423723221, 0.02168147638440132, 0.13274919986724854, 0.01061632763594389, 0.018176231533288956, 0.07017318904399872, 0.04515968635678291, -0.010241611860692501, -0.031244633719325066, -0.008211602456867695, 0.047105323523283005, -0.05625635385513306, -0.017594357952475548, -0.007368199061602354, -0.062467511743307114, 0.07670938968658447, 0.008950033225119114, 0.10136289894580841, 0.056815098971128464, -0.03543326258659363, -0.01103975810110569, 0.05776384472846985, 0.01557899359613657, 0.03007493168115616, 0.10246164351701736, 0.0021446601022034883, -0.0311642624437809, 0.015613503754138947, -0.01058293879032135, -0.027702007442712784, 0.011408548802137375, 0.029830966144800186, -0.10659725219011307, -0.03011452965438366, -0.03234206512570381, -0.0339389331638813, 0.028858354315161705, 0.07544656842947006, -0.0617317333817482, -0.06216145306825638, -0.049886833876371384, -0.03953135758638382, 0.00016685969603713602, 0.0016345191979780793, -0.0016727553447708488, -0.08255384117364883, 0.0022248863242566586, 0.04471489414572716, -0.009804045781493187, -0.04909253120422363, -0.09604271501302719, 0.05783366784453392, 0.04743656516075134, -0.028161000460386276, 0.02481207437813282, 0.039079733192920685, -0.043905530124902725, -0.031625859439373016, -0.06647100299596786, 0.02450926974415779, -0.042764514684677124, -0.11330283433198929, -0.0016399846645072103, 0.0780661404132843, -0.05484296381473541, 0.06777087599039078, -0.06839180737733841, -0.05171774700284004, -0.007824243977665901, 0.01803109422326088, -0.01985635794699192, 0.11892230063676834, -0.03497540205717087, -0.021529318764805794, -0.046162594109773636, 0.06491328775882721, -0.08755432814359665, -0.05359265208244324, -0.11077041923999786, -6.214055758846371e-8, -0.019714318215847015, -0.017874781042337418, -0.09985333681106567, -0.03786306455731392, 0.009288945235311985, 0.03293082118034363, 0.015397767536342144, -0.021120967343449593, -0.007738431915640831, 0.059424255043268204, -0.020049234852194786, 0.056970659643411636, 0.025526240468025208, 0.00040852470556274056, -0.04179072752594948, -0.04151826724410057, 0.026370879262685776, -0.007474014535546303, -0.0003331633342895657, 0.04245409369468689, 0.031163658946752548, 0.07170853763818741, -0.005857966840267181, 0.042843930423259735, -0.04502762481570244, -0.08496174216270447, 0.0064681172370910645, 0.02539902925491333, -0.03664911165833473, -0.03196563944220543, -0.016115935519337654, 0.03600447624921799, -0.004581349436193705, 0.05683872103691101, -0.06801342219114304, 0.05618401989340782, -0.028747430071234703, 0.06707455217838287, 0.04696621000766754, 0.069393090903759, 0.011406305246055126, 0.022566504776477814, -0.053074195981025696, 0.02287125773727894, -0.06069212779402733, 0.026089442893862724, 0.09026650339365005, 0.005358309950679541, 0.054538410156965256, -0.006890335585922003, -0.01979866623878479, 0.003012703265994787, 0.016507798805832863, -0.06421869248151779, 0.02022196352481842, -0.0020346094388514757, -0.004152708686888218, -0.012027380056679249, -0.05405504256486893, 0.09523940831422806, -0.036444563418626785, -0.024621322751045227, 0.055853474885225296, -0.012955068610608578 ]
0.029554
of `js\_app.html` in the above URL. Chrome DevTools doesn't support debugging [worker threads][] yet. [ndb][] can be used to debug them. [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/ [`debugger`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger [ndb]: https://github.com/GoogleChromeLabs/ndb/ [worker threads]: worker\_threads.md
https://github.com/nodejs/node/blob/main//doc/api/debugger.md
main
nodejs
[ -0.0836608037352562, -0.05229265242815018, 0.021143166348338127, 0.011340712197124958, 0.03380967304110527, -0.07837244123220444, -0.06490480154752731, -0.025133399292826653, -0.015961863100528717, -0.035854633897542953, -0.05407994985580444, -0.02878362312912941, -0.05700810253620148, -0.03513973206281662, -0.020493272691965103, 0.04425574094057083, 0.0510735958814621, -0.07343994826078415, 0.06019236519932747, -0.009282120503485203, -0.05445381999015808, -0.0036335266195237637, -0.025907207280397415, 0.0435660220682621, 0.028857555240392685, -0.017399802803993225, -0.009551431983709335, -0.024525556713342667, 0.030463863164186478, -0.045982226729393005, 0.07664038985967636, -0.12269315868616104, -0.0727921575307846, 0.01490772608667612, 0.04872208088636398, 0.04896799847483635, -0.01236667763441801, -0.0661487877368927, -0.1242322325706482, 0.022129785269498825, 0.04751939699053764, 0.09084824472665787, -0.08655306696891785, 0.003116860520094633, -0.007601744960993528, -0.09542333334684372, -0.09221301227807999, -0.010843442752957344, -0.04142750799655914, -0.0279849823564291, -0.0010213683126494288, -0.01203236822038889, 0.01724904030561447, -0.015329161658883095, 0.03992088511586189, 0.02788863331079483, 0.03157425299286842, -0.088551826775074, 0.052528802305459976, 0.15093854069709778, 0.08282725512981415, 0.007241994608193636, 0.006209790240973234, 0.008007238619029522, 0.09789685904979706, 0.0871168002486229, 0.05542603135108948, 0.011254140175879002, -0.03416633978486061, -0.013840611092746258, -0.014431812800467014, 0.009781377390027046, 0.025363419204950333, -0.07673864811658859, -0.047435320913791656, -0.03370748832821846, -0.0413191132247448, 0.007014647126197815, 0.009995710104703903, -0.026135573163628578, -0.045423269271850586, -0.05526745319366455, 0.08662779629230499, 0.11102110147476196, 0.0733405202627182, 0.055788882076740265, -0.0023377956822514534, 0.010273008607327938, 0.04914617910981178, 0.02067350409924984, -0.06351499259471893, -0.045735858380794525, -0.05297071486711502, 0.06135845556855202, -0.01858345791697502, -0.006704320665448904, 0.045098528265953064, 0.07050710171461105, -0.07208210229873657, -0.013831200078129768, 0.005483316723257303, 0.005117582622915506, 0.057879265397787094, -0.06672129034996033, -0.021777305752038956, 0.06716277450323105, -0.00022525005624629557, 0.024141183122992516, -0.024578262120485306, 0.0026146587915718555, 0.007215992547571659, 0.07477448880672455, -0.0016950755380094051, 0.00015460318536497653, -0.020770147442817688, -0.027249841019511223, 0.04028055816888809, -0.07590293139219284, 0.05934523418545723, 0.11068957298994064, 0.08545610308647156, 0.08655980974435806, -0.10893190652132034, -0.036481864750385284, 0.021455688402056694, 0.0496554896235466, -0.02985146827995777, 6.861642345928527e-35, 0.13648436963558197, -0.07942993938922882, 0.03559892997145653, -0.008302856236696243, 0.04581868648529053, -0.0013843592023476958, -0.020115388557314873, 0.0740625336766243, 0.0013205587165430188, 0.009320576675236225, 0.09303279221057892, 0.04150112345814705, -0.0405542328953743, -0.060007184743881226, -0.032777417451143265, 0.022446542978286743, -0.004975670482963324, 0.04851003736257553, 0.044559553265571594, 0.0769597515463829, -0.06765060871839523, -0.03405941277742386, -0.08160749822854996, 0.0268013384193182, -0.013172353617846966, 0.11501584202051163, -0.06319524347782135, 0.034242160618305206, -0.06376227736473083, 0.04379449039697647, -0.002680415753275156, -0.009334941394627094, -0.07241343706846237, 0.09701519459486008, 0.013714248314499855, -0.05151240900158882, -0.02768285758793354, 0.010699555277824402, -0.0756564810872078, 0.043683454394340515, -0.028042927384376526, 0.00015394414367619902, -0.07821185886859894, -0.04533179849386215, -0.03607118874788284, -0.05800565332174301, -0.039991118013858795, -0.06706837564706802, 0.01841273531317711, -0.022730158641934395, -0.019801929593086243, 0.014054813422262669, 0.03208880499005318, -0.047607120126485825, 0.09849584847688675, -0.012238215655088425, 0.04684841260313988, -0.04668313264846802, 0.04315212368965149, 0.04377061873674393, 0.013308942317962646, 0.011324570514261723, -0.07340077310800552, -0.03474771976470947, -0.005780848208814859, -0.042010463774204254, -0.030215060338377953, 0.06972959637641907, -0.008511711843311787, -0.034016720950603485, -0.04006040096282959, 0.03858703747391701, 0.08738264441490173, 0.057646993547677994, 0.010100070387125015, 0.007092954590916634, -0.032715894281864166, -0.03195041045546532, -0.03377192094922066, 0.002412504982203245, 0.11418472230434418, -0.020042164251208305, -0.041822317987680435, -0.08012600243091583, 0.034479912370443344, 0.02865380235016346, 0.0075521585531532764, -0.010034156031906605, -0.005528981331735849, 0.06227264925837517, 0.014379870146512985, 0.013307684101164341, -0.029897700995206833, -0.06909019500017166, -0.059900812804698944, -2.785419822297814e-33, -0.06121555715799332, -0.0236278735101223, -0.10386013239622116, 0.05385763570666313, 0.035216785967350006, -0.03347638249397278, -0.01465318351984024, 0.03895329311490059, 0.07314340770244598, 0.014899889938533306, -0.024131953716278076, -0.0423501618206501, -0.06894964724779129, 0.04309457167983055, 0.007363326381891966, 0.07765117287635803, -0.03705569729208946, -0.08272895961999893, 0.03436104208230972, -0.0627337396144867, 0.02806565910577774, 0.038616180419921875, 0.09742622822523117, -0.004895471967756748, 0.017600281164050102, -0.02378561720252037, 0.016706367954611778, -0.06671570241451263, 0.027439987286925316, -0.02548336051404476, -0.011241085827350616, 0.0982479453086853, -0.03660726174712181, 0.030283577740192413, 0.028785884380340576, 0.0031282673589885235, -0.01883048750460148, 0.026230165734887123, 0.11508970707654953, -0.12184077501296997, 0.05042368918657303, 0.021054765209555626, 0.0661446750164032, 0.02989739179611206, -0.01523344125598669, 0.06360773742198944, -0.062350690364837646, -0.05589514225721359, 0.0067670815624296665, -0.014539583586156368, 0.023111285641789436, -0.05353054776787758, 0.007519183214753866, 0.04545591026544571, -0.07078835368156433, -0.00832787062972784, 0.054427772760391235, -0.07660935074090958, 0.009922643192112446, 0.051802314817905426, 0.014952397905290127, -0.01158950850367546, -0.04390198364853859, -0.0029741956386715174, -0.05623042583465576, -0.0258280411362648, -0.06516285985708237, 0.05667795240879059, -0.002415094058960676, 0.03148981183767319, -0.10153806954622269, -0.006610164884477854, 0.034189336001873016, -0.0020812260918319225, -0.10485139489173889, 0.02032431960105896, -0.006855028681457043, -0.11290422827005386, -0.03746723383665085, -0.0007954809116199613, 0.04631609842181206, 0.06436372548341751, 0.016490794718265533, -0.03597215190529823, 0.08174994587898254, -0.028908446431159973, -0.00496331974864006, 0.06498430669307709, 0.007070307619869709, -0.045205626636743546, -0.03676500916481018, -0.0028190771117806435, -0.15450498461723328, 0.011655944399535656, 0.011197192594408989, -4.104102657720432e-8, 0.06138595566153526, -0.005782772786915302, -0.08747991174459457, -0.09715326130390167, 0.03564079850912094, -0.052702028304338455, -0.027050122618675232, 0.037287019193172455, 0.06404387205839157, 0.09226707369089127, 0.019042210653424263, 0.06528960913419724, -0.03911299258470535, 0.10819703340530396, -0.02329937182366848, 0.011620479635894299, 0.011138765141367912, 0.04385511204600334, 0.02348937653005123, -0.08085919916629791, -0.0140035105869174, 0.027879534289240837, 0.007394352927803993, 0.02599158324301243, -0.00439775874838233, -0.03583116829395294, 0.016844838857650757, 0.0071835992857813835, -0.003472996409982443, -0.0472324974834919, -0.0829777643084526, 0.08779912441968918, -0.019767872989177704, -0.06975257396697998, 0.0466422475874424, 0.0196808110922575, 0.04892198368906975, -0.03766442835330963, 0.0483982115983963, -0.023622218519449234, 0.011996817775070667, 0.034124936908483505, -0.026698429137468338, -0.006981966085731983, 0.0031765226740390062, 0.0008680640603415668, -0.03511565178632736, 0.05577366426587105, -0.013177051208913326, 0.034746456891298294, -0.016261013224720955, -0.04041491076350212, -0.01140887476503849, 0.01799633726477623, -0.04082917794585228, 0.03845110908150673, 0.014287213794887066, -0.09971082210540771, -0.004683017265051603, -0.014031168073415756, 0.03544064983725548, 0.050918854773044586, 0.10280764847993851, 0.012753513641655445 ]
0.079743
# Zlib > Stability: 2 - Stable The `node:zlib` module provides compression functionality implemented using Gzip, Deflate/Inflate, Brotli, and Zstd. To access it: ```mjs import zlib from 'node:zlib'; ``` ```cjs const zlib = require('node:zlib'); ``` Compression and decompression are built around the Node.js [Streams API][]. Compressing or decompressing a stream (such as a file) can be accomplished by piping the source stream through a `zlib` `Transform` stream into a destination stream: ```mjs import { createReadStream, createWriteStream, } from 'node:fs'; import process from 'node:process'; import { createGzip } from 'node:zlib'; import { pipeline } from 'node:stream'; const gzip = createGzip(); const source = createReadStream('input.txt'); const destination = createWriteStream('input.txt.gz'); pipeline(source, gzip, destination, (err) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } }); ``` ```cjs const { createReadStream, createWriteStream, } = require('node:fs'); const process = require('node:process'); const { createGzip } = require('node:zlib'); const { pipeline } = require('node:stream'); const gzip = createGzip(); const source = createReadStream('input.txt'); const destination = createWriteStream('input.txt.gz'); pipeline(source, gzip, destination, (err) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } }); ``` Or, using the promise `pipeline` API: ```mjs import { createReadStream, createWriteStream, } from 'node:fs'; import { createGzip } from 'node:zlib'; import { pipeline } from 'node:stream/promises'; async function do\_gzip(input, output) { const gzip = createGzip(); const source = createReadStream(input); const destination = createWriteStream(output); await pipeline(source, gzip, destination); } await do\_gzip('input.txt', 'input.txt.gz'); ``` ```cjs const { createReadStream, createWriteStream, } = require('node:fs'); const process = require('node:process'); const { createGzip } = require('node:zlib'); const { pipeline } = require('node:stream/promises'); async function do\_gzip(input, output) { const gzip = createGzip(); const source = createReadStream(input); const destination = createWriteStream(output); await pipeline(source, gzip, destination); } do\_gzip('input.txt', 'input.txt.gz') .catch((err) => { console.error('An error occurred:', err); process.exitCode = 1; }); ``` It is also possible to compress or decompress data in a single step: ```mjs import process from 'node:process'; import { Buffer } from 'node:buffer'; import { deflate, unzip } from 'node:zlib'; const input = '.................................'; deflate(input, (err, buffer) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } console.log(buffer.toString('base64')); }); const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64'); unzip(buffer, (err, buffer) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } console.log(buffer.toString()); }); // Or, Promisified import { promisify } from 'node:util'; const do\_unzip = promisify(unzip); const unzippedBuffer = await do\_unzip(buffer); console.log(unzippedBuffer.toString()); ``` ```cjs const { deflate, unzip } = require('node:zlib'); const input = '.................................'; deflate(input, (err, buffer) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } console.log(buffer.toString('base64')); }); const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64'); unzip(buffer, (err, buffer) => { if (err) { console.error('An error occurred:', err); process.exitCode = 1; } console.log(buffer.toString()); }); // Or, Promisified const { promisify } = require('node:util'); const do\_unzip = promisify(unzip); do\_unzip(buffer) .then((buf) => console.log(buf.toString())) .catch((err) => { console.error('An error occurred:', err); process.exitCode = 1; }); ``` ## Threadpool usage and performance considerations All `zlib` APIs, except those that are explicitly synchronous, use the Node.js internal threadpool. This can lead to surprising effects and performance limitations in some applications. Creating and using a large number of zlib objects simultaneously can cause significant memory fragmentation. ```mjs import zlib from 'node:zlib'; import { Buffer } from 'node:buffer'; const payload = Buffer.from('This is some data'); // WARNING: DO NOT DO THIS! for (let i = 0; i < 30000; ++i) { zlib.deflate(payload, (err, buffer) => {}); } ``` ```cjs const zlib = require('node:zlib'); const payload = Buffer.from('This is some data'); // WARNING: DO NOT DO THIS! for (let i = 0; i < 30000; ++i) { zlib.deflate(payload, (err, buffer) => {}); } ``` In the preceding example, 30,000 deflate
https://github.com/nodejs/node/blob/main//doc/api/zlib.md
main
nodejs
[ -0.14173524081707, 0.0875251442193985, -0.05111975595355034, 0.045963410288095474, 0.06272871047258377, -0.09471157193183899, -0.04140746593475342, 0.07713542878627777, -0.031037872657179832, -0.01949729584157467, -0.07904627174139023, 0.054640140384435654, 0.04338906705379486, 0.0032109820749610662, -0.019426140934228897, -0.020008405670523643, -0.0305948443710804, 0.12925584614276886, -0.0073419068939983845, -0.07183019071817398, 0.012147915549576283, 0.019067617133259773, 0.06527268886566162, -0.006502686999738216, 0.048491984605789185, -0.06295192241668701, -0.03314951807260513, 0.02459307573735714, 0.0956202894449234, 0.007282868027687073, 0.04110312834382057, 0.004503450356423855, -0.06771944463253021, 0.05272248759865761, -0.03830210119485855, 0.1416608691215515, 0.06233544275164604, -0.1247749850153923, -0.07008575648069382, -0.030800865963101387, 0.034699659794569016, 0.18126711249351501, -0.0712796002626419, -0.01856970600783825, -0.015040270984172821, 0.06710082292556763, 0.006020831409841776, 0.0010282620787620544, -0.11755655705928802, -0.0043610273860394955, -0.08378902077674866, -0.0481080524623394, -0.0631895586848259, 0.05514172464609146, -0.019262494519352913, 0.06405116617679596, -0.06748826056718826, -0.019929733127355576, -0.007600737735629082, 0.04567927122116089, -0.056854233145713806, 0.020608535036444664, 0.004787643440067768, 0.029534777626395226, 0.08036147058010101, 0.05096353963017464, 0.001971337478607893, 0.04261825233697891, 0.010936129838228226, -0.02054390124976635, -0.01756374165415764, -0.011553601361811161, -0.055512625724077225, 0.002313013654202223, -0.0889982208609581, -0.06963865458965302, 0.0032054458279162645, -0.02902282401919365, -0.02041836641728878, 0.05143629387021065, 0.021622607484459877, -0.08054959028959274, 0.048843611031770706, -0.001973888138309121, 0.006492314860224724, 0.04499921575188637, -0.00017498593661002815, 0.019839273765683174, -0.028396347537636757, 0.040495727211236954, -0.015308278612792492, 0.028093453496694565, -0.004865032155066729, 0.08353128284215927, -0.004492809530347586, 0.024714335799217224, 0.07245966047048569, 0.04646293818950653, 0.006286310032010078, 0.039345964789390564, 0.06209379807114601, 0.04607994109392166, 0.08498252928256989, -0.027505280449986458, 0.04047562927007675, -0.04922103509306908, 0.1035100519657135, 0.07813480496406555, -0.0851055383682251, 0.06213938072323799, -0.0269849244505167, -0.0008312527788802981, 0.03284066542983055, -0.11164527386426926, -0.013553855940699577, 0.008761628530919552, -0.007675724104046822, 0.05012042447924614, 0.015300064347684383, 0.07822220027446747, 0.015194966457784176, 0.01941964589059353, -0.050117310136556625, -0.015977580100297928, 0.064243845641613, -0.012116216123104095, -0.002492991043254733, 6.0840358662516686e-33, -0.036361273378133774, -0.014768889173865318, -0.012771569192409515, 0.10385031998157501, -0.05103774741292, 0.04958595708012581, 0.034507691860198975, -0.012705846689641476, -0.11385529488325119, -0.0023151214700192213, -0.06721345335245132, -0.015351627953350544, -0.04408257082104683, 0.008777334354817867, -0.05537556856870651, -0.09892858564853668, 0.027807950973510742, -0.004032793454825878, 0.04213077574968338, 0.07269958406686783, 0.06502646207809448, 0.0266043059527874, -0.03841783106327057, -0.051240622997283936, 0.04832141473889351, -0.03655394911766052, 0.013927668333053589, -0.0639590471982956, -0.05925266072154045, -0.02477072924375534, 0.015200377441942692, 0.004083976149559021, -0.03846224397420883, -0.03950342535972595, 0.055154088884592056, -0.04178786650300026, -0.025685105472803116, -0.013172262348234653, -0.1267467588186264, -0.11423125863075256, 0.018308071419596672, 0.02721729688346386, -0.09768096357584, 0.006481107324361801, -0.059725236147642136, -0.02147054299712181, -0.038662124425172806, -0.037865687161684036, 0.001435420592315495, -0.09829459339380264, 0.058671675622463226, 0.09434682875871658, -0.05628079175949097, 0.039437077939510345, 0.00210475898347795, 0.003956647589802742, 0.03141682595014572, -0.05339742451906204, 0.02871132269501686, 0.03186308592557907, 0.01383267343044281, 0.022038383409380913, -0.022897707298398018, 0.053207624703645706, 0.08437319844961166, 0.004415540955960751, -0.09188126027584076, -0.01658570021390915, 0.03616667538881302, 0.056092675775289536, -0.057702142745256424, -0.027001554146409035, 0.045577988028526306, 0.009978825226426125, 0.0020456283818930387, -0.007969140075147152, -0.07742449641227722, -0.051167506724596024, 0.009054393507540226, -0.044367916882038116, -0.03201565146446228, -0.054384563118219376, 0.0268953088670969, 0.041099123656749725, 0.07811155170202255, -0.03862994536757469, -0.035896800458431244, -0.030514022335410118, 0.05574839934706688, -0.025043712928891182, 0.009121112525463104, -0.06530547887086868, 0.07029704749584198, -0.11788469552993774, -0.034041013568639755, -6.126731657783457e-33, -0.01656479761004448, 0.0797758623957634, -0.06912270933389664, 0.08756539225578308, -0.01493428461253643, -0.016785647720098495, 0.007815144024789333, -0.021246138960123062, 0.007569943089038134, -0.020454775542020798, -0.09731193631887436, 0.003894080175086856, 0.05260637030005455, 0.01858297921717167, 0.02849176526069641, 0.04656378552317619, -0.05069145932793617, -0.08096001297235489, 0.03279268741607666, -0.03313714638352394, -0.07984920591115952, -0.023322857916355133, 0.07216554880142212, 0.007880473509430885, 0.00440464960411191, 0.05816711485385895, -0.03070038929581642, 0.021859856322407722, 0.029364731162786484, 0.0024498477578163147, -0.038598909974098206, 0.011790856719017029, -0.05938061699271202, -0.05646861717104912, -0.03579368069767952, -0.042791567742824554, -0.02543134056031704, 0.11863277852535248, -0.0030417656525969505, -0.04592765495181084, 0.05038651078939438, 0.026989726349711418, -0.06915454566478729, -0.016908952966332436, 0.06793557107448578, 0.027459844946861267, -0.05113588273525238, -0.01364157348871231, -0.005449116230010986, -0.023711437359452248, -0.0357026644051075, 0.05526380240917206, -0.06810040026903152, 0.01425122655928135, 0.10928617417812347, -0.03858768939971924, 0.009388510137796402, 0.00993520487099886, 0.010996518656611443, -0.02176785282790661, 0.004583912901580334, -0.05880308151245117, -0.012457702308893204, -0.06558512151241302, 0.03580509126186371, -0.018214955925941467, -0.05822413042187691, -0.031746022403240204, 0.0542597733438015, 0.02347688376903534, 0.04410761222243309, 0.06273909658193588, 0.04803706705570221, 0.04397926852107048, 0.018069656565785408, 0.02895740233361721, 0.060190822929143906, 0.011292172595858574, 0.0028831937815994024, 0.031042322516441345, 0.021011628210544586, 0.09747336804866791, -0.01518166158348322, 0.12670940160751343, 0.021810153499245644, -0.08212188631296158, 0.024455895647406578, -0.03350823372602463, 0.0012331821490079165, -0.0491107814013958, 0.01435007993131876, 0.045434679836034775, -0.05692000687122345, -0.0414699912071228, 0.006535684689879417, -4.7144308013002956e-8, -0.08475163578987122, -0.05113867297768593, -0.08735078573226929, 0.03305439651012421, -0.0264128465205431, -0.017497114837169647, 0.011936827562749386, 0.0013694997178390622, 0.07799487560987473, -0.04285615682601929, 0.02794025093317032, -0.01543770357966423, 0.004519755952060223, -0.01327364332973957, -0.0011486067669466138, 0.07813281565904617, -0.04489869251847267, 0.00773852551355958, -0.005911138840019703, 0.005063853692263365, 0.0008066871087066829, 0.033300865441560745, -0.03780626133084297, 0.13929343223571777, -0.016929570585489273, -0.04907694831490517, 0.04946723207831383, 0.0057211387902498245, 0.0027135778218507767, -0.02434723637998104, -0.05226229131221771, 0.01926426589488983, 0.0727573111653328, -0.023217543959617615, -0.00870765931904316, 0.0043209269642829895, -0.01921871304512024, -0.03940342366695404, 0.01800859160721302, 0.023475486785173416, 0.013035344891250134, 0.057699233293533325, -0.0008082438143901527, -0.00955066829919815, -0.012731892988085747, -0.05902215465903282, -0.0024172007106244564, -0.011567684821784496, -0.0007554158801212907, 0.12931592762470245, 0.06032351776957512, -0.004340305458754301, -0.05798307806253433, 0.026774510741233826, 0.09115992486476898, -0.016082417219877243, -0.025967033579945564, -0.07174185663461685, -0.011635871604084969, 0.005015592090785503, -0.0074843959882855415, 0.007306111045181751, 0.09704021364450455, -0.05167483538389206 ]
0.064209