content large_stringlengths 3 20.5k | url large_stringlengths 53 192 ⌀ | branch large_stringclasses 4
values | source large_stringclasses 51
values | embeddings listlengths 384 384 | score float64 -0.21 0.65 |
|---|---|---|---|---|---|
# Virtual File System > Stability: 1 - Experimental The `node:vfs` module provides an in-memory virtual file system with a `node:fs`-like API. It is useful for tests, fixtures, embedded assets, and other scenarios where you need a self-contained file system without touching the actual file-system. To access it: ```mjs ... | https://github.com/nodejs/node/blob/main/doc/api/vfs.md | main | nodejs | [
-0.043954409658908844,
0.033523205667734146,
-0.03327896445989609,
0.07767536491155624,
0.12063568085432053,
-0.07420895993709564,
-0.07237380743026733,
0.12958599627017975,
0.02097971737384796,
0.025064099580049515,
0.024766774848103523,
0.05735539644956589,
-0.03693170100450516,
-0.00951... | 0.121482 |
default implementations of the derived methods (such as `readFile`, `writeFile`, `exists`, `copyFile`, `access`, etc.). ### Capability flags \* `provider.readonly` {boolean} \*\*Default:\*\* `false`. \* `provider.supportsSymlinks` {boolean} \*\*Default:\*\* `false`. \* `provider.supportsWatch` {boolean} \*\*Default:\*\... | https://github.com/nodejs/node/blob/main/doc/api/vfs.md | main | nodejs | [
-0.0661853551864624,
0.0286694448441267,
-0.04367531090974808,
0.06617919355630875,
0.060203924775123596,
0.0036304404493421316,
-0.03642081841826439,
0.0689111277461052,
-0.0544464997947216,
0.017924221232533455,
0.05590693652629852,
0.02053319290280342,
-0.05533791333436966,
0.0305950846... | 0.01825 |
# Command-line API Node.js comes with a variety of CLI options. These options expose built-in debugging, multiple ways to execute scripts, and other helpful runtime options. To view this documentation as a manual page in a terminal, run `man node`. ## Synopsis `node [options] [V8 options] [ | -e "script" | -] [--] [arg... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.09739749133586884,
0.009656929410994053,
0.015872124582529068,
0.03692946955561638,
0.0986974760890007,
-0.07805822044610977,
-0.04566112533211708,
0.0632219985127449,
0.017580118030309677,
-0.016064481809735298,
-0.060120921581983566,
0.013840461149811745,
-0.008513516746461391,
-0.055... | 0.098987 |
Active development When using the [Permission Model][], the process will not be able to spawn any child process by default. Attempts to do so will throw an `ERR\_ACCESS\_DENIED` unless the user explicitly passes the `--allow-child-process` flag when starting Node.js. Example: ```js const childProcess = require('node:ch... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.05153023079037666,
0.03635808452963829,
-0.06324741989374161,
0.043434321880340576,
0.08686351031064987,
-0.05859539285302162,
-0.026600485667586327,
0.09412673860788345,
-0.001301117823459208,
0.0916210412979126,
-0.026966748759150505,
0.044367466121912,
-0.0335785336792469,
0.05306419... | 0.076808 |
throw an `ERR\_ACCESS\_DENIED` unless the user explicitly passes the `--allow-net` flag when starting Node.js. Example: ```js const http = require('node:http'); // Attempt to bypass the permission const req = http.get('http://example.com', () => {}); req.on('error', (err) => { console.log('err', err); }); ``` ```consol... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.06986790895462036,
0.0774311050772667,
-0.007774621248245239,
0.024796707555651665,
0.057921137660741806,
-0.08750401437282562,
-0.022362908348441124,
0.016149155795574188,
-0.006495166104286909,
0.027514340355992317,
-0.006629368755966425,
0.03824298083782196,
-0.006017852108925581,
0.... | 0.073682 |
also growing over time, only a subset of the built-in modules are well tested to be serializable during the snapshot building process. The Node.js core test suite checks that a few fairly complex applications can be snapshotted. The list of built-in modules being [captured by the built-in snapshot of Node.js][] is cons... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.023529447615146637,
0.012565611861646175,
-0.008812449872493744,
0.000867171329446137,
0.08841978013515472,
0.004906064830720425,
-0.14424365758895874,
0.014512871392071247,
-0.053402550518512726,
-0.020567480474710464,
-0.02973419800400734,
0.040864672511816025,
0.020268769934773445,
0... | -0.002487 |
Stability: 1.1 - Active development Disable specific process warnings by `code` or `type`. Warnings emitted from [`process.emitWarning()`][emit\_warning] may contain a `code` and a `type`. This option will not-emit warnings that have a matching `code` or `type`. List of [deprecation warnings][]. The Node.js core warnin... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.004779782611876726,
0.0077294292859733105,
0.022941051051020622,
0.08525071293115616,
0.16085395216941833,
-0.06697112321853638,
0.01582939736545086,
0.040430948138237,
-0.05104520171880722,
0.01283683255314827,
-0.02685714326798916,
0.0038442634977400303,
0.014682452194392681,
-0.03869... | 0.130314 |
trace with // original Error.prepareStackTrace. return originalPrepareStackTrace(error, trace); }; ``` Note, enabling source maps can introduce latency to your application when `Error.stack` is accessed. If you access `Error.stack` frequently in your application, take into account the performance implications of `--ena... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
0.00498812273144722,
0.050061002373695374,
0.005612986162304878,
0.05454854667186737,
0.09583444893360138,
-0.005071563646197319,
-0.0578782893717289,
0.08612712472677231,
-0.027716204524040222,
0.043580472469329834,
-0.08450457453727722,
-0.011290100403130054,
0.004890299402177334,
-0.068... | 0.048675 |
latest version of that major release line. ```json { "$schema": "https://nodejs.org/dist/vX.Y.Z/docs/node-config-schema.json", "nodeOptions": { "import": [ "amaro/strip" ], "watch-path": "src", "watch-preserve-output": true }, "test": { "test-isolation": "process" }, "watch": { "watch-preserve-output": true } } ``` The... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.03010421060025692,
-0.008187297731637955,
-0.045492544770240784,
0.031039411202073097,
0.09868857264518738,
-0.002416122704744339,
-0.024387452751398087,
-0.0248442143201828,
-0.033224351704120636,
0.0033088410273194313,
0.01573941484093666,
0.02991475723683834,
-0.03454754501581192,
0.... | 0.113984 |
URL support, which allows passing a second `parentURL` argument for contextual resolution. Previously gated the entire `import.meta.resolve` feature. ### `--experimental-inspector-network-resource` > Stability: 1.1 - Active Development Enable experimental support for inspector network resources. ### `--experimental-loa... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.0670488253235817,
0.01404014602303505,
0.013830384239554405,
0.07785892486572266,
0.06443990021944046,
-0.046136412769556046,
-0.04707043245434761,
0.05803334340453148,
-0.06258969008922577,
-0.034261975437402725,
-0.04569850489497185,
0.008226786740124226,
-0.016741324216127396,
0.0209... | 0.050825 |
default intrinsic reference. Code may break under this flag. To allow polyfills to be added, [`--require`][] and [`--import`][] both run before freezing intrinsics. ### `--heap-prof` Starts the V8 heap profiler on start up, and writes the heap profile to disk before exit. If `--heap-prof-dir` is not specified, the gene... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.06491545587778091,
-0.01842965930700302,
-0.06581699848175049,
0.005452351178973913,
0.05007133632898331,
-0.023236343637108803,
0.020581377670168877,
0.055644694715738297,
-0.03329451009631157,
-0.04995260387659073,
-0.02362818270921707,
-0.044737979769706726,
0.027285762131214142,
0.0... | 0.048088 |
data load path. (Overrides `NODE\_ICU\_DATA`.) ### `--import=module` > Stability: 1 - Experimental Preload the specified module at startup. If the flag is provided several times, each module will be executed sequentially in the order they appear, starting with the ones provided in [`NODE\_OPTIONS`][]. Follows [ECMAScri... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.055356476455926895,
-0.01616710051894188,
-0.003634939668700099,
0.04066198319196701,
0.047590505331754684,
-0.030088210478425026,
-0.033108051866292953,
0.04110448807477951,
-0.03103458508849144,
-0.047169387340545654,
-0.008127084001898766,
0.05160364881157875,
-0.03636942058801651,
-... | 0.146978 |
on Node.js debugger. See the [security warning][] below regarding the `host` parameter usage. ### `--inspect[=[host:]port]` Activate inspector on `host:port`. Default is `127.0.0.1:9229`. If port `0` is specified, a random available port will be used. V8 inspector integration allows tools such as Chrome DevTools and ID... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.03144153952598572,
0.009172855876386166,
0.014315802603960037,
0.016347210854291916,
0.0917213186621666,
-0.09127122163772583,
-0.083205446600914,
0.016130711883306503,
0.005898567382246256,
-0.009758339263498783,
-0.05828244984149933,
-0.013143528252840042,
-0.029277518391609192,
-0.06... | 0.043289 |
Use [`--no-require-module`][] instead. Legacy alias for [`--no-require-module`][]. ### `--no-experimental-sqlite` Disable the experimental [`node:sqlite`][] module. ### `--no-experimental-websocket` Disable exposition of {WebSocket} on the global scope. ### `--no-experimental-webstorage` > Stability: 1.2 - Release cand... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.01255848165601492,
0.014443092048168182,
-0.060348041355609894,
0.07346271723508835,
0.06257450580596924,
-0.051248401403427124,
0.007171377539634705,
-0.01010789442807436,
-0.11614634096622467,
-0.009845852851867676,
0.04925532639026642,
-0.0005865935818292201,
-0.017536554485559464,
-... | 0.032395 |
as a peer dependency: ```text {appDir} ├── app │ ├── index.js │ └── node\_modules │ ├── moduleA -> {appDir}/moduleA │ └── moduleB │ ├── index.js │ └── package.json └── moduleA ├── index.js └── package.json ``` The `--preserve-symlinks` command-line flag instructs Node.js to use the symlink path for modules as opposed t... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.07644060999155045,
-0.05098072439432144,
0.05563623830676079,
0.01686418242752552,
0.13622495532035828,
-0.01848018169403076,
-0.0480184368789196,
-0.012166843749582767,
-0.009456503205001354,
0.01242217980325222,
0.10862361639738083,
0.06911967694759369,
-0.0020382259972393513,
0.04998... | -0.019966 |
the process exits due to an uncaught exception. Useful when inspecting the JavaScript stack in conjunction with native stack and other runtime environment data. ### `-r`, `--require module` Preload the specified module at startup. Follows `require()`'s module resolution rules. `module` may be either a path to a file, o... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.0934569388628006,
-0.05799412727355957,
-0.009110115468502045,
0.03588902950286865,
0.10418765246868134,
-0.08893919736146927,
-0.060141339898109436,
0.042999036610126495,
-0.02633497677743435,
-0.02396399900317192,
-0.009179078042507172,
0.04712732508778572,
-0.037063516676425934,
-0.0... | 0.095955 |
used to restore the application state. When loading a snapshot, Node.js checks that: 1. The version, architecture, and platform of the running Node.js binary are exactly the same as that of the binary that generates the snapshot. 2. The V8 flags and CPU features are compatible with that of the binary that generates the... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.06468755751848221,
0.008513658307492733,
-0.0011160102440044284,
0.02622181363403797,
0.1054411455988884,
-0.0717708021402359,
-0.1114065870642662,
-0.01770273968577385,
-0.01891941763460636,
-0.02802947349846363,
-0.053241077810525894,
0.06728838384151459,
-0.01876739412546158,
-0.0696... | 0.097636 |
in order to be executed. ### `--test-only` Configures the test runner to only execute top level tests that have the `only` option set. This flag is not necessary when test isolation is disabled. ### `--test-random-seed` Set the seed used to randomize test execution order. This applies to both test file execution order ... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.05725634843111038,
0.0017566528404131532,
-0.05223381146788597,
0.07671791315078735,
0.09560739994049072,
-0.01205423939973116,
0.014297639951109886,
-0.07342185825109482,
-0.030233386904001236,
-0.004120391793549061,
0.032597605139017105,
0.05547351390123367,
-0.02982892468571663,
-0.0... | 0.014329 |
`--tls-min-v1.2` Set default [`tls.DEFAULT\_MIN\_VERSION`][] to 'TLSv1.2'. This is the default for 12.x and later, but the option is supported for compatibility with older Node.js versions. ### `--tls-min-v1.3` Set default [`tls.DEFAULT\_MIN\_VERSION`][] to 'TLSv1.3'. Use to disable support for TLSv1.2, which is not as... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.05937124416232109,
0.058635130524635315,
-0.023943139240145683,
0.008405775763094425,
0.05666187033057213,
-0.08935082703828812,
-0.06958477944135666,
-0.00644517969340086,
0.026833442971110344,
-0.00900622271001339,
-0.04386920481920242,
0.028294827789068222,
-0.022378385066986084,
-0.... | -0.064582 |
Mozilla CA store as supplied by current Node.js version or use OpenSSL's default CA store. The default store is selectable at build-time. 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. Using OpenSSL store allows ... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.017279144376516342,
0.027614818885922432,
-0.05053572356700897,
0.07455649226903915,
0.009848503395915031,
-0.03943212330341339,
-0.08703833073377609,
-0.006170456763356924,
0.07763512432575226,
-0.04140378534793854,
0.00476983143016696,
0.07833505421876907,
0.05136477202177048,
0.02745... | -0.044175 |
major Linux distributions and other Unix-like systems. If the overriding OpenSSL environment variables (typically `SSL\_CERT\_FILE` and `SSL\_CERT\_DIR`, depending on the configuration of the OpenSSL that Node.js links to) are set, the specified paths will be used to load certificates instead. These environment variabl... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.06187247857451439,
0.020633595064282417,
-0.016512522473931313,
0.04353233426809311,
0.07035508751869202,
-0.09114275127649307,
-0.12194115668535233,
0.017802691087126732,
0.035213470458984375,
-0.07402641326189041,
-0.056813206523656845,
0.040226537734270096,
-0.010149589739739895,
-0.... | 0.053722 |
cache][] can be reused across different directory locations as long as the module layout relative to the cache directory remains the same. ### `NODE\_DEBUG=module[,…]` `','`-separated list of core modules that should print debug information. ### `NODE\_DEBUG\_NATIVE=module[,…]` `','`-separated list of core C++ modules ... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.054516635835170746,
0.030875463038682938,
-0.03720797225832939,
0.016256337985396385,
0.1175014078617096,
-0.053353436291217804,
0.004243540111929178,
0.036908138543367386,
0.004685077350586653,
-0.04428185895085335,
0.058156464248895645,
0.08012296259403229,
0.04191019758582115,
-0.043... | 0.045736 |
`--network-family-autoselection-attempt-timeout` \* `--no-addons` \* `--no-async-context-frame` \* `--no-deprecation` \* `--no-experimental-global-navigator` \* `--no-experimental-repl-await` \* `--no-experimental-sqlite` \* `--no-experimental-strip-types` \* `--no-experimental-websocket` \* `--no-experimental-webstora... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.015116668306291103,
-0.04589910805225372,
-0.06661450117826462,
0.018903782591223717,
0.024257803335785866,
-0.05866936594247818,
-0.05005987733602524,
-0.06192045658826828,
-0.06010478734970093,
-0.000900538288988173,
0.08522187173366547,
-0.022723251953721046,
-0.05119151994585991,
-0... | 0.051293 |
will be overridden and test output will be sent to stdout in the TAP format. If any other value is provided, Node.js makes no guarantees about the reporter format used or its stability. ### `NODE\_TLS\_REJECT\_UNAUTHORIZED=value` If `value` equals `'0'`, certificate validation is disabled for TLS connections. This make... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.049681637436151505,
0.06468566507101059,
0.01714172028005123,
0.04146045073866844,
0.02480660006403923,
-0.09676418453454971,
-0.03729218989610672,
-0.01879153959453106,
0.03329591080546379,
0.023783599957823753,
-0.05942152440547943,
0.041208915412425995,
0.020821621641516685,
0.026617... | 0.003878 |
`TZ` The `TZ` environment variable is used to specify the timezone configuration. While Node.js does not support all of the various [ways that `TZ` is handled in other environments][], it does support basic [timezone IDs][] (such as `'Etc/UTC'`, `'Europe/Paris'`, or `'America/New\_York'`). It may support a few other ab... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
-0.028123347088694572,
-0.005211972631514072,
-0.05233322083950043,
-0.018920987844467163,
0.06968779861927032,
-0.05220180004835129,
-0.03898432105779648,
-0.0351438969373703,
0.044295161962509155,
-0.02396620437502861,
-0.049851249903440475,
0.0009735935600474477,
-0.03480865806341171,
-... | 0.026405 |
to semi-space applies to each of the three individual semi-spaces and causes the heap size to increase by 3 MiB. The throughput improvement depends on your workload (see [#42511][]). The default value depends on the memory limit. For example, on 64-bit systems with a memory limit of 512 MiB, the max size of a semi-spac... | https://github.com/nodejs/node/blob/main/doc/api/cli.md | main | nodejs | [
0.012299624271690845,
-0.036431800574064255,
-0.036692168563604355,
0.0052964151836931705,
-0.016219178214669228,
-0.07146990299224854,
-0.09319255501031876,
0.0477193258702755,
-0.06184310466051102,
-0.005365035030990839,
-0.08925967663526535,
0.017000164836645126,
-0.030903510749340057,
... | 0.045491 |
# Crypto > Stability: 2 - Stable The `node:crypto` module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. ```mjs const { createHmac } = await import('node:crypto'); const secret = 'abcdefg'; const hash = createHmac('sha256', se... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.045105841010808945,
0.04560168832540512,
-0.011013273149728775,
0.019839169457554817,
0.04667208343744278,
-0.030177831649780273,
0.004481151234358549,
0.024999480694532394,
0.0134150804951787,
-0.01930825598537922,
-0.007253631949424744,
-0.007269340101629496,
0.01763385348021984,
-0.0... | 0.051164 |
`'slh-dsa-sha2-128s'`[^openssl35] | SLH-DSA-SHA2-128s | 2.16.840.1.101.3.4.3.20 | ✔ | ✔ | ✔ | ✔ | ✔ | | | `'slh-dsa-sha2-192f'`[^openssl35] | SLH-DSA-SHA2-192f | 2.16.840.1.101.3.4.3.23 | ✔ | ✔ | ✔ | ✔ | ✔ | | | `'slh-dsa-sha2-192s'`[^openssl35] | SLH-DSA-SHA2-192s | 2.16.840.1.101.3.4.3.22 | ✔ | ✔ | ✔ | ✔ | ✔ | | | `'... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.027349725365638733,
0.043582722544670105,
-0.020632540807127953,
-0.07359865307807922,
0.05412333086133003,
-0.084090955555439,
0.006509694270789623,
-0.08976924419403076,
0.0025163767859339714,
-0.02310258522629738,
0.035331133753061295,
-0.0028876452706754208,
0.016375450417399406,
-0.... | -0.018797 |
faster than other formats because they only contain the private scalar or seed - importing them requires deriving the public key component (e.g. elliptic curve point multiplication or seed expansion), which can be expensive. Other formats include both private and public components, avoiding that computation. ### Choosi... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.020525572821497917,
-0.007360363844782114,
-0.06441481411457062,
0.006228662561625242,
-0.0014547290047630668,
-0.00444700988009572,
-0.06983672827482224,
0.03577418252825737,
0.034206170588731766,
0.002645549364387989,
0.03258984908461571,
0.02200765162706375,
-0.030229581519961357,
-0... | 0.110531 |
}); const publicDer = generated.publicKey.export({ format: 'der', type: 'spki' }); createPrivateKey({ key: privateDer, format: 'der', type: 'pkcs8' }); createPublicKey({ key: publicDer, format: 'der', type: 'spki' }); // JWK const privateJwk = generated.privateKey.export({ format: 'jwk' }); const publicJwk = generated.... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.09249532967805862,
0.037328194826841354,
-0.0663195252418518,
0.05069633573293686,
-0.011755707673728466,
0.004212406929582357,
-0.027975820004940033,
0.08783033490180969,
0.041749339550733566,
0.019207771867513657,
0.054118379950523376,
-0.06682983785867691,
-0.00918323453515768,
-0.02... | -0.002786 |
[encoding][] of the `spkac` string. \* Returns: {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge. ```mjs const { Certificate } = await import('node:crypto'); const spkac = getSpkacSomehow(); const challenge = Certificate.exportChallenge(spkac); console.log(chal... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.002726528327912092,
0.06517371535301208,
-0.07906480878591537,
0.05098455399274826,
-0.00759181147441268,
0.026088181883096695,
0.024840330705046654,
0.01988205872476101,
0.058357495814561844,
-0.04175840690732002,
-0.02798951044678688,
-0.09190448373556137,
-0.011659117415547371,
0.043... | -0.007296 |
import('node:crypto'); const cert = Certificate(); const spkac = getSpkacSomehow(); console.log(cert.verifySpkac(Buffer.from(spkac))); // Prints: true or false ``` ```cjs const { Buffer } = require('node:buffer'); const { Certificate } = require('node:crypto'); const cert = Certificate(); const spkac = getSpkacSomehow(... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.06977637857198715,
0.09843223541975021,
-0.06790447235107422,
0.04066074639558792,
0.03827428072690964,
-0.03734252229332924,
0.015842700377106667,
0.028796382248401642,
0.040379807353019714,
-0.0766390934586525,
-0.019290629774332047,
-0.03232318162918091,
-0.0009777460945770144,
0.052... | 0.058095 |
case for aes192, it is 24 bytes (192 bits). scrypt(password, 'salt', 24, (err, key) => { if (err) throw err; // Then, we'll generate a random initialization vector randomFill(new Uint8Array(16), (err, iv) => { if (err) throw err; const cipher = createCipheriv(algorithm, key, iv); const input = createReadStream('test.js... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.08142759650945663,
0.026071637868881226,
-0.0504845455288887,
-0.012327248230576515,
-0.019427580758929253,
-0.06399445235729218,
0.008542266674339771,
0.023488642647862434,
0.03316238895058632,
-0.040040936321020126,
-0.049088988453149796,
-0.00792200118303299,
0.08811621367931366,
0.0... | 0.047479 |
data to the appropriate block size. To disable the default padding call `cipher.setAutoPadding(false)`. When `autoPadding` is `false`, the length of the entire input data must be a multiple of the cipher's block size or [`cipher.final()`][] will throw an error. Disabling automatic padding is useful for non-standard pad... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.03195051848888397,
0.0765237957239151,
-0.07307829707860947,
0.031061924993991852,
-0.14093880355358124,
-0.022210050374269485,
-0.010622049681842327,
0.017155803740024567,
-0.00934724509716034,
-0.04721733555197716,
-0.055897850543260574,
0.0038910754956305027,
0.028090767562389374,
-0... | -0.085468 |
'hex'); decipher.end(); ``` Example: Using `Decipheriv` and piped streams: ```mjs import { createReadStream, createWriteStream, } from 'node:fs'; import { Buffer } from 'node:buffer'; const { scryptSync, createDecipheriv, } = await import('node:crypto'); const algorithm = 'aes-192-cbc'; const password = 'Password used ... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.012231769040226936,
0.0202154703438282,
-0.04985513538122177,
-0.01132077258080244,
-0.06073080375790596,
-0.05621567741036415,
-0.030166510492563248,
0.08630360662937164,
-0.00037591278669424355,
-0.027037570253014565,
-0.06671401858329773,
-0.04599347710609436,
0.047107696533203125,
0... | 0.017361 |
### `decipher.setAuthTag(buffer[, encoding])` \* `buffer` {string|Buffer|ArrayBuffer|TypedArray|DataView} \* `encoding` {string} String encoding to use when `buffer` is a string. \* Returns: {Decipheriv} The same `Decipheriv` instance for method chaining. When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.039492636919021606,
0.02607295662164688,
-0.053583770990371704,
-0.026525558903813362,
-0.09292040765285492,
-0.0914296954870224,
0.07241228222846985,
-0.003975633531808853,
0.013416540808975697,
-0.040610421448946,
0.012259166687726974,
-0.04217592254281044,
0.08742847293615341,
0.0208... | -0.01297 |
of the return value. \* Returns: {Buffer | string} Computes the shared secret using `otherPublicKey` as the other party's public key and returns the computed shared secret. The supplied key is interpreted using the specified `inputEncoding`, and secret is encoded using specified `outputEncoding`. If the `inputEncoding`... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.024466438218951225,
0.015977228060364723,
-0.048848673701286316,
-0.02472737431526184,
-0.09927086532115936,
-0.04354539141058922,
0.10369408130645752,
-0.05738111212849617,
0.02964337170124054,
-0.05084116384387016,
0.015732362866401672,
-0.019294993951916695,
0.024128830060362816,
-0.... | -0.001724 |
const { createDiffieHellmanGroup } = await import('node:crypto'); const dh = createDiffieHellmanGroup('modp16'); ``` ```cjs const { createDiffieHellmanGroup } = require('node:crypto'); const dh = createDiffieHellmanGroup('modp16'); ``` The following groups are supported: \* `'modp14'` (2048 bits, [RFC 3526][] Section 3... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.048653461039066315,
0.023203236982226372,
-0.03172573074698448,
-0.0007723646122030914,
0.022551439702510834,
-0.04736095666885376,
-0.04500706121325493,
-0.015187503769993782,
-0.08671866357326508,
-0.041087836027145386,
0.04429648816585541,
-0.07514093071222305,
-0.001131222932599485,
... | 0.03142 |
returned secret is encoded using the specified `outputEncoding`. If the `inputEncoding` is not provided, `otherPublicKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. If `outputEncoding` is given a string will be returned; otherwise a [`Buffer`][] is returned. `ecdh.computeSecret` will throw an `ERR\_... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.030047347769141197,
0.04417882859706879,
-0.04126783087849617,
-0.020507346838712692,
-0.03885626792907715,
-0.0669788271188736,
0.019398340955376625,
-0.04529606178402901,
0.035022906959056854,
-0.07408339530229568,
0.067246213555336,
-0.09667184948921204,
0.07395702600479126,
-0.08467... | -0.037978 |
const alice = createECDH('secp256k1'); const bob = createECDH('secp256k1'); // This is a shortcut way of specifying one of Alice's previous private // keys. It would be unwise to use such a predictable private key in a real // application. alice.setPrivateKey( createHash('sha256').update('alice', 'utf8').digest(), ); /... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.0521736703813076,
0.01702527143061161,
-0.06479508429765701,
-0.016836687922477722,
-0.09250723570585251,
0.044250547885894775,
0.023195471614599228,
-0.01795022003352642,
0.036069922149181366,
0.035765841603279114,
0.01012241281569004,
-0.02026587538421154,
0.06001101806759834,
-0.0582... | -0.0212 |
`encoding` is provided a string will be returned; otherwise a [`Buffer`][] is returned. The `Hash` object can not be used again after `hash.digest()` method has been called. Multiple calls will cause an error to be thrown. ### `hash.update(data[, inputEncoding])` \* `data` {string|Buffer|TypedArray|DataView} \* `inputE... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.0006611282005906105,
0.020502351224422455,
-0.025001611560583115,
-0.06211652234196663,
-0.07553454488515854,
-0.08593609929084778,
0.05787593871355057,
-0.0641820952296257,
0.03947361931204796,
-0.048678282648324966,
-0.022026129066944122,
0.08183080703020096,
0.03836612403392792,
0.001... | -0.007964 |
ignored. This can be called many times with new data as it is streamed. ## Class: `KeyObject` Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, and each kind of key exposes different functions. The [`crypto.createSecretKey()`][], [`crypto.createPublicKey()`][] and [`crypto.createPrivateKey()`... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.07258857041597366,
-0.0381811261177063,
-0.04485177621245384,
0.06314142048358917,
-0.016802923753857613,
-0.05068862438201904,
0.056615497916936874,
-0.005033651366829872,
0.0552971214056015,
0.003004122758284211,
-0.0009747875737957656,
0.017909228801727295,
0.018921194598078728,
-0.0... | 0.089818 |
must be `'pkcs1'` (RSA only) or `'spki'`. For EC keys with `'raw-public'` format, may be `'uncompressed'` (default) or `'compressed'`. Ignored when `format` is `'jwk'`. For private keys, the following encoding options can be used: \* `format` {string} Must be `'pem'`, `'der'`, `'jwk'`, `'raw-private'`, or `'raw-seed'`.... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.04581678286194801,
0.03649694100022316,
-0.11047788709402084,
0.01645915023982525,
-0.017074953764677048,
0.01512144971638918,
-0.03564301133155823,
0.04146730154752731,
0.04541409760713577,
-0.0008936439990065992,
0.03179003298282623,
-0.09418706595897675,
0.0862744003534317,
-0.005135... | -0.026296 |
= await import('node:crypto'); const { privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: 2048, }); const sign = createSign('SHA256'); sign.update('some data to sign'); sign.end(); const signature = sign.sign(privateKey); const verify = createVerify('SHA256'); verify.update('some data to sign'); veri... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.040418464690446854,
0.04363332688808441,
-0.061743248254060745,
0.025225291028618813,
0.001162107801064849,
-0.055534154176712036,
-0.04996800422668457,
0.045740675181150436,
0.05093872547149658,
0.0012773418566212058,
0.01035667210817337,
-0.006686140783131123,
0.021695638075470924,
-0... | 0.026038 |
times with new data as it is streamed. ### `verify.verify(key, signature[, signatureEncoding])` \* `key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} \* `dsaEncoding` {string} \* `padding` {integer} \* `saltLength` {integer} \* `signature` {string|ArrayBuffer|Buffer|TypedArray|DataView} \*... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.03024892881512642,
0.03594746068120003,
-0.05917784199118614,
-0.02019047737121582,
-0.07611726969480515,
-0.1259925216436386,
0.12893612682819366,
0.009565808810293674,
-0.022084705531597137,
-0.06569959223270416,
-0.017211221158504486,
-0.014805998653173447,
0.05325986444950104,
-0.00... | 0.010894 |
`false`. \* `singleLabelSubdomains` {boolean} \*\*Default:\*\* `false`. \* Returns: {string|undefined} Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. Checks whether the certificate matches the given host name. If the certificate matches the given host name, the matching su... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.024788226932287216,
0.06001880392432213,
-0.0015277620404958725,
-0.0181548073887825,
-0.016055913642048836,
-0.11432424187660217,
0.012860373593866825,
-0.060991816222667694,
0.06329261511564255,
-0.05465276911854744,
-0.03341205418109894,
-0.09822705388069153,
0.08949761092662811,
0.0... | 0.002547 |
each line might be enclosed in quotes to indicate that the value is a JSON string literal. For backward compatibility, Node.js only uses JSON string literals within this property when necessary to avoid ambiguity. Third-party code should be prepared to handle both possible entry formats. ### `x509.issuer` \* Type: {str... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.03385745733976364,
0.11178658902645111,
0.00357820768840611,
0.02071908488869667,
0.016941770911216736,
-0.01360247004777193,
0.03574183210730553,
0.08072580397129059,
-0.018518516793847084,
-0.025018619373440742,
-0.03622773289680481,
-0.0630354955792427,
0.07402157783508301,
0.0469763... | 0.004641 |
Argon2. \* `parallelism` {number} REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be at least `1` and at most `2\*\*24-1`. \* `tagLength` {number} REQUIRED, the length of the key to generate. Must be at least `4` and at most `2\*\*32-1`. \* `memory` {number} REQUIRED, m... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.007126817479729652,
0.027794452384114265,
-0.14902977645397186,
-0.06226005405187607,
-0.15507209300994873,
-0.09579908102750778,
0.07580769062042236,
0.02098851464688778,
-0.04221658408641815,
-0.01461122091859579,
-0.03723852336406708,
-0.08925987780094147,
0.08587959408760071,
-0.1177... | 0.122457 |
input, similar to the salt, that should \*\*NOT\*\* be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2\*\*32-1` bytes. \* `associatedData` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Additional data to be adde... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.03740686550736427,
-0.0018522334285080433,
-0.10652358084917068,
-0.03512659668922424,
-0.1072574332356453,
-0.08060938119888306,
0.11189461499452591,
-0.003536211559548974,
0.055224187672138214,
-0.07914461940526962,
-0.0026206516195088625,
0.012352079153060913,
0.09096645563840866,
-0... | 0.205403 |
vector (`iv`). The `options` argument controls stream behavior and is optional except when a cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the authentication tag in bytes, see [CCM mode][]. In GCM mode, the `authTagLength` opti... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.04562697559595108,
0.07906563580036163,
-0.06860563158988953,
-0.01877790130674839,
-0.00798568595200777,
-0.024303214624524117,
0.04516709968447685,
0.04253678768873215,
-0.01591014489531517,
-0.0710458979010582,
0.02869797870516777,
-0.004766927100718021,
0.04226640984416008,
-0.01490... | 0.017917 |
supplied `prime` and an optional specific `generator`. The `generator` argument can be a number, string, or [`Buffer`][]. If `generator` is not specified, the value `2` is used. If `primeEncoding` is specified, `prime` is expected to be a string; otherwise a [`Buffer`][], `TypedArray`, or `DataView` is expected. If `ge... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.0020178642589598894,
0.04600469395518303,
-0.0885898694396019,
0.00804336741566658,
-0.09656976163387299,
-0.07078719139099121,
0.05133528634905815,
0.05809961259365082,
-0.06927216798067093,
-0.06995579600334167,
-0.04889054596424103,
-0.05705787241458893,
0.052531518042087555,
-0.05137... | 0.010673 |
not exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). Example: generating the sha256 HMAC of a file ```mjs import { createReadStream, } from 'node:fs'; import { argv } from 'node:process'; const { createHmac, } = await import('node:crypto'); const filename = argv[2]; const hmac = createHmac('sha256', '... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.03243463858962059,
0.038694147020578384,
-0.0483679436147213,
-0.020170271396636963,
0.02119193598628044,
-0.09176475554704666,
-0.04188928008079529,
-0.009761394001543522,
0.007395865395665169,
0.02919674851000309,
-0.041365791112184525,
0.0678153708577156,
0.04539545252919197,
-0.0682... | 0.001015 |
`KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned and it will be impossible to extract the private key from the returned object. ### `crypto.createSecretKey(key[, encoding])` \* `key` {string|ArrayBuffer|Buffer|TypedArray|DataView} \* `encod... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.02490011416375637,
0.03380085900425911,
-0.11065483838319778,
0.03837184980511665,
-0.04340294376015663,
-0.0809905007481575,
0.015273644588887691,
0.019121913239359856,
-0.023710360750555992,
-0.03820974379777908,
-0.06722137331962585,
0.005950222257524729,
-0.011575739830732346,
0.002... | 0.027911 |
\* `'ec'`[^openssl32] DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256) \* `'x25519'`[^openssl32] DHKEM(X25519, HKDF-SHA256) \* `'x448'`[^openssl32] DHKEM(X448, HKDF-SHA512) \* `'ml-kem-512'`[^openssl35] ML-KEM \* `'ml-kem-768'`[^openssl35] ML-KEM \* `'ml-kem-1024'`[^openssl35] ML-KEM If `... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.023402299731969833,
0.03526981547474861,
-0.0518985390663147,
-0.023844506591558456,
0.02537163347005844,
-0.07397989928722382,
0.024100620299577713,
-0.04680410400032997,
-0.008675048127770424,
-0.06739664822816849,
0.05661087483167648,
-0.04975656792521477,
0.01810719631612301,
-0.089... | 0.01976 |
}, }, (err, publicKey, privateKey) => { // Handle errors and use the generated key pair. }); ``` ```cjs const { generateKeyPair, } = require('node:crypto'); generateKeyPair('rsa', { modulusLength: 4096, publicKeyEncoding: { type: 'spki', format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.13349267840385437,
0.09080754965543747,
-0.05340899899601936,
0.048922568559646606,
-0.025657810270786285,
-0.016528313979506493,
-0.008718925528228283,
0.06002043932676315,
0.06370005756616592,
-0.01559645775705576,
0.018448077142238617,
-0.007186860777437687,
0.0188140906393528,
-0.02... | 0.044562 |
`length`. The `type` will determine which validations will be performed on the `length`. ```mjs const { generateKeySync, } = await import('node:crypto'); const key = generateKeySync('hmac', { length: 512 }); console.log(key.export().toString('hex')); // e89..........41e ``` ```cjs const { generateKeySync, } = require('... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.02180519513785839,
0.07297876477241516,
-0.02939051389694214,
-0.008566629141569138,
0.012537244707345963,
-0.048299290239810944,
-0.03956087306141853,
0.07867823541164398,
-0.00677387323230505,
-0.014969618991017342,
-0.00841356161981821,
-0.04306026175618172,
0.04907013103365898,
-0.0... | -0.029831 |
> 2` would contradict the condition enforced by `options.safe`. \* `options.rem` is ignored if `options.add` is not given. Both `options.add` and `options.rem` must be encoded as big-endian sequences if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. By default, the prime is encod... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.013049188069999218,
0.06504464894533157,
-0.06299688667058945,
0.021267814561724663,
0.013469873927533627,
-0.10777407139539719,
-0.050847411155700684,
0.08448860794305801,
-0.044656746089458466,
0.0005780692445114255,
-0.040570832788944244,
-0.002754304790869355,
0.028450213372707367,
-... | -0.006443 |
bobSecret should be the same \*/ console.log(aliceSecret === bobSecret); ``` ### `crypto.getFips()` \* Returns: {number} `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. ### `crypto.getHashes()` \... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.038128070533275604,
0.02082405798137188,
-0.0487980842590332,
-0.006806329824030399,
-0.03489910811185837,
-0.05653969570994377,
0.02834632433950901,
0.0324021652340889,
0.010361269116401672,
-0.026288751512765884,
-0.0328882597386837,
0.0034503552597016096,
0.001500082784332335,
-0.043... | 0.092211 |
`callback` {Function} \* `err` {Error} \* `derivedKey` {ArrayBuffer} HKDF is a simple key derivation function defined in RFC 5869. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.011530076153576374,
0.04127912595868111,
-0.010948880575597286,
-0.01782684028148651,
-0.04826929047703743,
-0.06097695231437683,
0.07598762214183807,
0.03645952790975571,
0.0030227545648813248,
-0.031105944886803627,
0.026682443916797638,
-0.03809936344623566,
0.06645742058753967,
-0.0... | 0.0688 |
as possible. It is recommended that a salt is random and at least 16 bytes long. See [NIST SP 800-132][] for details. When passing strings for `password` or `salt`, please consider [caveats when using strings as inputs to cryptographic APIs][]. ```mjs const { pbkdf2, } = await import('node:crypto'); pbkdf2('secret', 's... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.04474817216396332,
0.04433474689722061,
-0.05153380334377289,
-0.03751268610358238,
-0.021505208685994148,
-0.034915465861558914,
0.051699403673410416,
0.06321263313293457,
0.004192815162241459,
-0.077062226831913,
-0.03779015690088272,
-0.03872260823845863,
0.10546649992465973,
-0.0283... | 0.013525 |
encrypted content. Encrypts `buffer` with `privateKey`. The returned data can be decrypted using the corresponding public key, for example using [`crypto.publicDecrypt()`][]. If `privateKey` is not a [`KeyObject`][], this function behaves as if `privateKey` had been passed to [`crypto.createPrivateKey()`][]. If it is a... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
0.0008858958026394248,
0.011486380361020565,
-0.11501247435808182,
0.03308698907494545,
-0.05401702597737312,
-0.02927510440349579,
0.03931393101811409,
0.05054016411304474,
0.05166418477892876,
0.0032231018412858248,
-0.01816551946103573,
-0.013739541172981262,
0.013692065142095089,
-0.02... | -0.02853 |
as a [`Buffer`][]. An error will be thrown if there is a problem generating the bytes. ```mjs // Synchronous const { randomBytes, } = await import('node:crypto'); const buf = randomBytes(256); console.log( `${buf.length} bytes of random data: ${buf.toString('hex')}`); ``` ```cjs // Synchronous const { randomBytes, } = ... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.012975117191672325,
0.03294410929083824,
-0.051591869443655014,
0.057798899710178375,
0.04056163132190704,
-0.0680026262998581,
-0.006287898402661085,
-0.030604984611272812,
0.025481723248958588,
-0.01877472922205925,
-0.06912814825773239,
0.008302737958729267,
0.03623112291097641,
-0.0... | 0.017939 |
}); const b = new DataView(new ArrayBuffer(10)); randomFill(b, (err, buf) => { if (err) throw err; console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) .toString('hex')); }); const c = new ArrayBuffer(10); randomFill(c, (err, buf) => { if (err) throw err; console.log(Buffer.from(buf).toString('hex')); })... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.00006618493353016675,
-0.006803398951888084,
-0.08163338899612427,
-0.06184571608901024,
-0.03471521660685539,
-0.0546206571161747,
0.057532649487257004,
-0.03201056644320488,
0.0345732681453228,
-0.05805857852101326,
-0.07038327306509018,
-0.023764636367559433,
0.007131799589842558,
-0... | 0.026876 |
up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`. \*\*Default:\*\* `false`. \* Returns: {string} Generates a random [RFC 4122][] version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator. ### `crypto.randomUUIDv7([options])` \* `opti... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.05623849108815193,
0.03479688987135887,
-0.025310233235359192,
0.05718408524990082,
0.03198067471385002,
-0.07997847348451614,
-0.006401175167411566,
-0.0578453503549099,
0.05808991193771362,
0.013904733583331108,
-0.06338218599557877,
0.010167383588850498,
0.009745674207806587,
-0.0912... | 0.030116 |
\* `parallelization` {number} Parallelization parameter. \*\*Default:\*\* `1`. \* `N` {number} Alias for `cost`. Only one of both may be specified. \* `r` {number} Alias for `blockSize`. Only one of both may be specified. \* `p` {number} Alias for `parallelization`. Only one of both may be specified. \* `maxmem` {numbe... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.05251231789588928,
-0.03197944164276123,
-0.08847486227750778,
-0.07980425655841827,
-0.04197441041469574,
-0.017182428389787674,
0.052588753402233124,
0.09396016597747803,
-0.03706129267811775,
-0.05601846054196358,
0.000043527605157578364,
0.013790737837553024,
0.10207418352365494,
-0... | 0.126465 |
not a [`KeyObject`][], this function behaves as if `key` had been passed to [`crypto.createPrivateKey()`][]. If it is an object, the following additional properties can be passed: \* `dsaEncoding` {string} For DSA and ECDSA, this option specifies the format of the generated signature. It can be one of the following: \*... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.0957048088312149,
0.05331077054142952,
-0.1147000789642334,
-0.0038899732753634453,
-0.008930960670113564,
-0.0492095910012722,
0.034326691180467606,
0.05060713365674019,
0.037551235407590866,
-0.03789800405502319,
0.020280880853533745,
0.012344569899141788,
-0.0058091809041798115,
-0.0... | 0.084725 |
|| s` as proposed in IEEE-P1363. \* `padding` {integer} Optional padding value for RSA, one of the following: \* `crypto.constants.RSA\_PKCS1\_PADDING` (default) \* `crypto.constants.RSA\_PKCS1\_PSS\_PADDING` `RSA\_PKCS1\_PSS\_PADDING` will use MGF1 with the same hash function used to sign the message as specified in s... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.028965510427951813,
0.029505399987101555,
-0.10933913290500641,
-0.04749487712979317,
0.023951580747961998,
-0.056662723422050476,
0.04875413700938225,
0.08045250177383423,
0.024126634001731873,
-0.058325111865997314,
0.016114491969347,
0.027023587375879288,
0.08868171274662018,
-0.0006... | 0.052062 |
default instead. ### Support for weak or compromised algorithms The `node:crypto` module still supports some algorithms which are already compromised and are not recommended for use. The API also allows the use of ciphers and hashes with a small key size that are too weak for safe use. Users should take full responsibi... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.06797225028276443,
0.03758509084582329,
-0.023073585703969002,
0.004044049885123968,
0.041295602917671204,
-0.06815770268440247,
-0.08567650616168976,
0.07394441962242126,
-0.10626264661550522,
-0.014801186509430408,
-0.036573849618434906,
0.06777743995189667,
0.0008557618712075055,
-0.... | 0.13033 |
``` ```cjs const { Buffer } = require('node:buffer'); const { createCipheriv, createDecipheriv, randomBytes, } = require('node:crypto'); const key = 'keykeykeykeykeykeykeykey'; const nonce = randomBytes(12); const aad = Buffer.from('0123456789', 'hex'); const cipher = createCipheriv('aes-192-ccm', key, nonce, { authTag... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.029003560543060303,
0.054731711745262146,
-0.06037435680627823,
0.003369716927409172,
-0.07201565057039261,
-0.053726524114608765,
0.018538447096943855,
0.007301752921193838,
0.058798450976610184,
-0.005180981010198593,
0.014513092115521431,
-0.0960228368639946,
0.027154970914125443,
-0... | 0.025151 |
added in OpenSSL 0.9.6d. | | `SSL_OP_LEGACY_SERVER_CONNECT` | Allows initial connection to servers that do not support RI. | | `SSL_OP_NO_COMPRESSION` | Instructs OpenSSL to disable support for SSL/TLS compression. | | `SSL_OP_NO_ENCRYPT_THEN_MAC` | Instructs OpenSSL to disable encrypt-then-MAC. | | `SSL_OP_NO_QUERY_MT... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.0771724134683609,
0.08028267323970795,
-0.012466534972190857,
0.03418855369091034,
-0.022684698924422264,
-0.05904846638441086,
-0.11356274783611298,
-0.027482718229293823,
0.0521414615213871,
-0.07080458849668503,
0.02686464600265026,
0.05851227045059204,
0.005464776884764433,
0.040899... | 0.043346 |
9562]: https://www.rfc-editor.org/rfc/rfc9562.txt [Web Crypto API documentation]: webcrypto.md [`BN\_is\_prime\_ex`]: https://www.openssl.org/docs/man1.1.1/man3/BN\_is\_prime\_ex.html [`Buffer`]: buffer.md [`DH\_generate\_key()`]: https://www.openssl.org/docs/man3.0/man3/DH\_generate\_key.html [`DiffieHellmanGroup`]: #... | https://github.com/nodejs/node/blob/main/doc/api/crypto.md | main | nodejs | [
-0.060583408921957016,
0.05766195058822632,
-0.09901145100593567,
0.033941566944122314,
0.020498646423220634,
-0.08577463030815125,
-0.025522109121084213,
-0.019913898780941963,
-0.009674095548689365,
-0.014702592976391315,
-0.02705652080476284,
0.010591275058686733,
-0.002958576660603285,
... | 0.038831 |
# Node-API > Stability: 2 - Stable Node-API (formerly N-API) is an API for building native Addons. It is independent from the underlying JavaScript runtime (for example, V8) and is maintained as part of Node.js itself. This API will be Application Binary Interface (ABI) stable across versions of Node.js. It is intended... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.13428811728954315,
-0.0264495350420475,
0.007969599217176437,
0.051989417523145676,
0.05359925702214241,
-0.03102431818842888,
-0.08810510486364365,
0.05266978219151497,
-0.024949070066213608,
-0.048557158559560776,
-0.03906380385160446,
0.03258558362722397,
-0.037895940244197845,
-0.09... | 0.222575 |
APIs available via any of ```cpp #include #include #include #include ``` \* the libuv APIs which are also included with Node.js and available via ```cpp #include ``` \* the V8 API available via ```cpp #include ``` Thus, for an addon to remain ABI-compatible across Node.js major versions, it must use Node-API exclusivel... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.1141900047659874,
-0.03585013747215271,
-0.007975681684911251,
-0.008890215307474136,
0.04502960294485092,
-0.0315520241856575,
-0.048448897898197174,
0.0392719991505146,
-0.06512417644262314,
-0.022701632231473923,
-0.019296692684292793,
-0.02518421970307827,
-0.019591443240642548,
-0.... | 0.185509 |
therefore node-gyp, requires that Python be installed. Historically, node-gyp has been the tool of choice for building native addons. It has widespread adoption and documentation. However, some developers have run into limitations in node-gyp. #### CMake.js [CMake.js][] is an alternative build system based on [CMake][]... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.08785824477672577,
-0.0058396123349666595,
0.030289359390735626,
0.023363549262285233,
0.042565278708934784,
-0.062289539724588394,
-0.06960634142160416,
0.09316767007112503,
0.002668763045221567,
-0.006986997090280056,
-0.019548386335372925,
-0.015966251492500305,
-0.01603642851114273,
... | 0.050348 |
versions between 8 and the highest version they support and will default to providing the version 8 APIs unless an add-on opts into a higher Node-API version. This approach provides the flexibility of better optimizing existing Node-API functions while maintaining ABI stability. Existing add-ons can continue to run wit... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.05465133115649223,
-0.004587302915751934,
0.060682062059640884,
0.009193713776767254,
0.0585765540599823,
-0.006452204193919897,
-0.10687774419784546,
-0.004768014885485172,
-0.025558406487107277,
-0.024970170110464096,
-0.017544692382216454,
0.05773366615176201,
-0.07766963541507721,
-... | 0.102005 |
the Node.js implementation of Node-API or any implementation of Node-API outside of Node.js. `addon\_node.c` is a separate file that contains the Node.js specific entry point to the addon and which instantiates the addon by calling into `addon.c` when the addon is loaded into a Node.js environment. ```c // addon.h #ifn... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.08466111123561859,
0.0705641508102417,
-0.03556257113814354,
0.027898726984858513,
0.010056414641439915,
-0.012774053029716015,
-0.03162774816155434,
0.06414474546909332,
0.024295324459671974,
-0.050580162554979324,
-0.015279721468687057,
-0.01334711816161871,
-0.03951811045408249,
-0.0... | 0.191931 |
running Node.js environment. `data` can later be retrieved using `napi\_get\_instance\_data()`. Any existing data associated with the currently running Node.js environment which was set by means of a previous call to `napi\_set\_instance\_data()` will be overwritten. If a `finalize\_cb` was provided by the previous cal... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.010103804990649223,
0.07465887069702148,
-0.002235738094896078,
0.05613764375448227,
0.036409225314855576,
-0.07754881680011749,
-0.027864471077919006,
0.0063463011756539345,
0.03361586481332779,
-0.01209478359669447,
-0.016482410952448845,
0.027381982654333115,
0.0008494138019159436,
-... | 0.134431 |
a function. Calling such APIs from a synchronous finalizer will ultimately result in the termination of the application. ### `napi\_value` This is an opaque pointer that is used to represent a JavaScript value. ### `napi\_threadsafe\_function` This is an opaque pointer that represents a JavaScript function which can be... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.09412378072738647,
0.014644086360931396,
-0.018118642270565033,
-0.046922631561756134,
-0.03445873409509659,
-0.01668073609471321,
0.04182668775320053,
-0.005726618226617575,
0.04906576871871948,
-0.019661949947476387,
0.016722068190574646,
-0.01586149074137211,
-0.06633397191762924,
-0... | 0.319465 |
``` Unless for reasons discussed in [Object Lifetime Management][], creating a handle and/or callback scope inside a `napi\_callback` is not necessary. #### `node\_api\_basic\_finalize` > Stability: 1 - Experimental Function pointer type for add-on provided functions that allow the user to be notified when externally-o... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.06549221277236938,
0.06861481815576553,
-0.024195605888962746,
0.05663979426026344,
0.019369175657629967,
-0.09469598531723022,
0.0380294993519783,
0.04377960413694382,
0.015303543768823147,
0.007304861675947905,
-0.04500042647123337,
0.0013464413350448012,
-0.07095345109701157,
-0.0349... | 0.218809 |
so it is sufficient to call the JavaScript function via `napi\_call\_function` rather than via `napi\_make\_callback`. Callback functions must satisfy the following signature: ```c typedef void (\*napi\_threadsafe\_function\_call\_js)(napi\_env env, napi\_value js\_callback, void\* context, void\* data); ``` \* `[in] e... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.1121799647808075,
0.030806981027126312,
-0.038649190217256546,
-0.017393728718161583,
-0.045600540935993195,
-0.04229326546192169,
0.012792844325304031,
-0.01558882836252451,
0.030878989025950432,
-0.06049947440624237,
-0.01347519364207983,
-0.026347987353801727,
-0.028897633776068687,
... | 0.170457 |
VM specific error code. \* `error\_code`: Node-API status code for the last error. [`napi\_get\_last\_error\_info`][] returns the information for the last Node-API call that was made. Do not rely on the content or format of any of the extended information as it is not subject to SemVer and may change at any time. It is... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.021562889218330383,
0.11380654573440552,
-0.013727911747992039,
0.02253233641386032,
0.056688107550144196,
-0.04979275166988373,
-0.030227702111005783,
0.059605974704027176,
-0.03866162896156311,
0.0012572072446346283,
0.008759874850511551,
-0.056856974959373474,
0.010948900133371353,
-0... | 0.189219 |
known that the exception can be safely handled. In these cases [`napi\_get\_and\_clear\_last\_exception`][] can be used to get and clear the exception. On success, result will contain the handle to the last JavaScript `Object` thrown. If it is determined, after retrieving the exception, the exception cannot be handled ... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.03428228944540024,
0.11722787469625473,
0.01689343899488449,
0.029336251318454742,
0.00882340781390667,
-0.0033079986460506916,
0.021174311637878418,
0.019546041265130043,
-0.004901915788650513,
-0.07571747153997421,
-0.02739619091153145,
-0.01639418676495552,
0.009678197093307972,
-0.0... | 0.163582 |
JavaScript `RangeError` with the text provided. #### `node\_api\_throw\_syntax\_error` ```c NAPI\_EXTERN napi\_status node\_api\_throw\_syntax\_error(napi\_env env, const char\* code, const char\* msg); ``` \* `[in] env`: The environment that the API is invoked under. \* `[in] code`: Optional error code to be set on th... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.022507822141051292,
0.10336222499608994,
0.013831653632223606,
0.014330293983221054,
0.009381204843521118,
-0.004403502214699984,
0.042607225477695465,
0.0796755775809288,
-0.046941760927438736,
-0.09236537665128708,
-0.02747334912419319,
-0.06926190108060837,
0.07621864974498749,
0.012... | 0.159746 |
\* `[out] result`: Boolean value that is set to true if an exception is pending. Returns `napi\_ok` if the API succeeded. This API can be called even if there is a pending JavaScript exception. #### `napi\_fatal\_exception` ```c napi\_status napi\_fatal\_exception(napi\_env env, napi\_value err); ``` \* `[in] env`: The... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.06448444724082947,
0.10399181395769119,
-0.017484517768025398,
0.044139374047517776,
0.019132070243358612,
-0.0028015687130391598,
0.0340949110686779,
0.05191684141755104,
-0.002960186917334795,
-0.0514821894466877,
0.007509813643991947,
-0.015392687171697617,
0.012092151679098606,
0.00... | 0.221266 |
and all new handles will be associated with that scope while it is active. Scopes must be closed in the reverse order from which they are opened. In addition, all scopes created within a native method must be closed before returning from that method. Taking the earlier example, adding calls to [`napi\_open\_handle\_sco... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.021275341510772705,
0.07705707103013992,
-0.04913349822163582,
0.01663612201809883,
-0.0942552238702774,
-0.06710422784090042,
0.0637572854757309,
-0.016365543007850647,
-0.039733320474624634,
0.001293642446398735,
-0.02857605181634426,
-0.01592188887298107,
-0.05400075018405914,
-0.0409... | 0.143863 |
called more than once an error will be returned. This API can be called even if there is a pending JavaScript exception. ### References to values with a lifespan longer than that of the native method In some cases, an addon will need to be able to create and reference values with a lifespan longer than that of a single... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.10944294184446335,
0.052229270339012146,
-0.02612912282347679,
0.10756006091833115,
-0.05172443389892578,
-0.05703900009393692,
-0.011777136474847794,
0.0026629031635820866,
0.10064515471458435,
-0.024186812341213226,
-0.04802807420492172,
-0.0030923422891646624,
-0.010227062739431858,
... | 0.15574 |
Version 10 (`NAPI\_VERSION` is defined as `10` or higher): References can be created for all value types. The new supported value types do not support weak reference semantic and the values of these types are released when the reference count becomes 0 and cannot be accessed from the reference anymore. #### `napi\_crea... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.058812275528907776,
0.02768278680741787,
-0.08434447646141052,
-0.01406378485262394,
-0.04927736148238182,
-0.0005101261776871979,
0.03551929444074631,
0.01236431859433651,
-0.003494862699881196,
-0.07163098454475403,
-0.003027914557605982,
-0.09013349562883377,
0.02341427467763424,
0.0... | 0.2173 |
done by using [`napi\_remove\_env\_cleanup\_hook`][]. Typically, that happens when the resource for which this hook was added is being torn down anyway. For asynchronous cleanup, [`napi\_add\_async\_cleanup\_hook`][] is available. #### `napi\_remove\_env\_cleanup\_hook` ```c NAPI\_EXTERN napi\_status napi\_remove\_env\... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.017473580315709114,
0.08123753219842911,
-0.015897236764431,
0.0390983484685421,
0.048996783792972565,
-0.04717493802309036,
0.007722951006144285,
-0.07469363510608673,
-0.008015121333301067,
0.0034978105686604977,
-0.048999108374118805,
0.0059239668771624565,
-0.028910163789987564,
0.0... | 0.12905 |
desc = { "hello", NULL, Method, NULL, NULL, NULL, napi\_writable | napi\_enumerable | napi\_configurable, NULL }; status = napi\_define\_properties(env, exports, 1, &desc); if (status != napi\_ok) return NULL; return exports; } ``` To set a function to be returned by the `require()` for the addon: ```c napi\_value Init... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.05313713476061821,
0.07938093692064285,
-0.12044715136289597,
0.013010083697736263,
-0.08300270885229111,
-0.007940675131976604,
0.06151985377073288,
0.03635898977518082,
-0.10682666301727295,
-0.037615567445755005,
0.04449840262532234,
-0.10012594610452652,
-0.03853336349129677,
-0.015... | 0.185851 |
works with bit operators to build a composite filter. #### `napi\_key\_conversion` ```c typedef enum { napi\_key\_keep\_numbers, napi\_key\_numbers\_to\_strings } napi\_key\_conversion; ``` `napi\_key\_numbers\_to\_strings` will convert integer indexes to strings. `napi\_key\_keep\_numbers` will return numbers for inte... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.03437366709113121,
0.0780986025929451,
-0.033263612538576126,
-0.017972078174352646,
-0.07976804673671722,
-0.007321896497160196,
0.09512454271316528,
0.01063533779233694,
-0.03349880874156952,
-0.07719049602746964,
-0.022785628214478493,
-0.12423248589038849,
0.005834008101373911,
-0.02... | 0.224571 |
`napi\_create\_buffer` ```c napi\_status napi\_create\_buffer(napi\_env env, size\_t size, void\*\* data, napi\_value\* result) ``` \* `[in] env`: The environment that the API is invoked under. \* `[in] size`: Size in bytes of the underlying buffer. \* `[out] data`: Raw pointer to the underlying buffer. `data` can opti... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.00028061747434549034,
0.08068951964378357,
-0.06958974897861481,
0.012315364554524422,
-0.08645576238632202,
-0.07337076216936111,
0.04217187687754631,
-0.016799958422780037,
-0.008238164708018303,
-0.034510958939790726,
-0.019624868407845497,
-0.05490082502365112,
-0.011492040939629078,
... | 0.178885 |
JavaScript `ArrayBuffer`. Returns `napi\_ok` if the API succeeded. \*\*Some runtimes other than Node.js have dropped support for external buffers\*\*. On runtimes other than Node.js this method may return `napi\_no\_external\_buffers\_allowed` to indicate that external buffers are not supported. One such runtime is Ele... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.06857969611883163,
0.053608156740665436,
-0.005678572226315737,
0.04512307792901993,
-0.026993514969944954,
-0.05799074470996857,
-0.04350646212697029,
0.0364583320915699,
-0.02899392880499363,
-0.06743822991847992,
-0.04113342985510826,
-0.05234713479876518,
-0.06556305289268494,
0.008... | 0.090241 |
are `Uint8Array`s. #### `napi\_create\_object` ```c napi\_status napi\_create\_object(napi\_env env, napi\_value\* result) ``` \* `[in] env`: The environment that the API is invoked under. \* `[out] result`: A `napi\_value` representing a JavaScript `Object`. Returns `napi\_ok` if the API succeeded. This API allocates ... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.05624391511082649,
0.07164691388607025,
-0.030589105561375618,
0.07259111106395721,
-0.06061611697077751,
-0.030480744317173958,
0.009363860823214054,
0.022735964506864548,
-0.0016099323984235525,
-0.06530844420194626,
-0.05185314267873764,
-0.02380291000008583,
-0.054791685193777084,
0... | 0.258448 |
succeeded. This API creates a JavaScript `TypedArray` object over an existing `ArrayBuffer` or `SharedArrayBuffer`. `TypedArray` objects provide an array-like view over an underlying data buffer where each element has the same underlying binary scalar datatype. It is required that `(length \* size\_of\_element) + byte\... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.016309324651956558,
0.03801973909139633,
-0.027253687381744385,
0.008252877742052078,
-0.08459186553955078,
-0.015605853870511055,
0.007633045315742493,
0.03587631508708,
-0.052155155688524246,
-0.08321008831262589,
-0.10008412599563599,
-0.05555960536003113,
-0.001086713862605393,
-0.02... | 0.117211 |
to convert from the C `uint32\_t` type to the JavaScript `number` type. The JavaScript `number` type is described in [Section number type][] of the ECMAScript Language Specification. #### `napi\_create\_int64` ```c napi\_status napi\_create\_int64(napi\_env env, int64\_t value, napi\_value\* result) ``` \* `[in] env`: ... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.02964198775589466,
0.07931696623563766,
-0.005560047924518585,
0.015132598578929901,
-0.06640889495611191,
-0.0003455333935562521,
0.025338787585496902,
0.10389386862516403,
0.019391106441617012,
-0.10404534637928009,
-0.08340691775083542,
-0.07063642144203186,
-0.00643131835386157,
0.0... | 0.183531 |
result, bool\* copied); ``` \* `[in] env`: The environment that the API is invoked under. \* `[in] str`: Character buffer representing an ISO-8859-1-encoded string. \* `[in] length`: The length of the string in bytes, or `NAPI\_AUTO\_LENGTH` if it is null-terminated. \* `[in] finalize\_callback`: The function to call w... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.06061477214097977,
0.09875668585300446,
-0.02309216558933258,
0.02464263327419758,
-0.007572142872959375,
-0.047562699764966965,
0.05529376491904259,
0.03694163262844086,
0.029367800801992416,
-0.06427551060914993,
-0.028287045657634735,
-0.03265974298119545,
-0.029755905270576477,
-0.0... | 0.224037 |
already have been invoked to destroy `str`. Returns `napi\_ok` if the API succeeded. This API creates a JavaScript `string` value from a UTF16-LE-encoded C string. The native string may not be copied and must thus exist for the entire life cycle of the JavaScript value. The JavaScript `string` type is described in [Sec... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.04287005215883255,
0.12147924304008484,
0.008581695146858692,
-0.010001308284699917,
-0.06366829574108124,
-0.0587497279047966,
-0.01436567585915327,
0.04375038668513298,
0.03636575862765312,
-0.09761153161525726,
-0.03897780552506447,
-0.027713606134057045,
-0.0007528950227424502,
0.03... | 0.15664 |
length, napi\_value\* result); ``` \* `[in] env`: The environment that the API is invoked under. \* `[in] str`: Character buffer representing a UTF8-encoded string. \* `[in] length`: The length of the string in two-byte code units, or `NAPI\_AUTO\_LENGTH` if it is null-terminated. \* `[out] result`: A `napi\_value` rep... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.02181266061961651,
0.1398618221282959,
-0.033764030784368515,
0.026080681011080742,
-0.10341573506593704,
-0.036544520407915115,
0.03247310593724251,
0.06527223438024521,
0.02191006951034069,
-0.09489063173532486,
-0.050933778285980225,
-0.055048778653144836,
0.01808912679553032,
-0.025... | 0.223121 |
`[out] result`: `napi\_value` representing prototype of the given object. Returns `napi\_ok` if the API succeeded. #### `napi\_get\_typedarray\_info` ```c napi\_status napi\_get\_typedarray\_info(napi\_env env, napi\_value typedarray, napi\_typedarray\_type\* type, size\_t\* length, void\*\* data, napi\_value\* arraybu... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
0.033326342701911926,
0.1384180188179016,
-0.06463360786437988,
-0.0073308637365698814,
-0.11323440819978714,
-0.07196478545665741,
0.09929380565881729,
0.025423778221011162,
-0.03553776815533638,
-0.061362460255622864,
-0.0793740451335907,
-0.036945875734090805,
0.014127827249467373,
-0.0... | 0.201008 |
`[out] result`: C double primitive equivalent of the given JavaScript `number`. Returns `napi\_ok` if the API succeeded. If a non-number `napi\_value` is passed in it returns `napi\_number\_expected`. This API returns the C double primitive equivalent of the given JavaScript `number`. #### `napi\_get\_value\_bigint\_in... | https://github.com/nodejs/node/blob/main/doc/api/n-api.md | main | nodejs | [
-0.017619451507925987,
0.13482630252838135,
-0.0013541801599785686,
-0.0005948622711002827,
-0.01777292974293232,
-0.056045982986688614,
0.027804387733340263,
0.06689992547035217,
0.0025298739783465862,
-0.0411677360534668,
-0.06744679063558578,
-0.02307426929473877,
0.01582360453903675,
-... | 0.192591 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.