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
# Using Components and Bundles ## Component Dependencies Component dependencies are automatically determined from the arguments to a component constructor. Most components have a few dependencies, and use a struct named `dependencies` to represent them: ```go type dependencies struct { fx.In Lc fx.Lifecycle Params inte...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/deprecated-components-documentation/using-components.md
main
datadog-agent
[ -0.04296743869781494, -0.06597072631120682, 0.03356076404452324, 0.021994706243276596, 0.06349547207355499, 0.0012276505585759878, 0.03713182359933853, 0.0764424204826355, -0.05412803217768669, -0.06872356683015823, 0.05723642557859421, -0.049387138336896896, -0.05693061277270317, 0.121469...
0.019253
# Purpose of component guidelines This section describes the mechanics of implementing [apps](defining-apps.md), [components](../../components/creating-components.md), and [bundles](defining-bundles.md). The guidelines are quite prescriptive, with the intent of making all components "look the same". This reduces cognit...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/deprecated-components-documentation/purpose.md
main
datadog-agent
[ -0.047803279012441635, -0.013662781566381454, -0.018933724611997604, -0.04822457581758499, 0.04674829915165901, 0.02951015718281269, -0.016920188441872597, 0.0516328364610672, -0.03607788309454918, -0.0069186752662062645, 0.0332198441028595, 0.021303698420524597, -0.0013675781665369868, 0....
0.053463
# Component Subscriptions Subscriptions are a common form of registration, and have support in the `pkg/util/subscriptions` package. In defining subscriptions, the component that transmits messages is the \_collecting\_ component, and the processes receiving components are the \_providing\_ components. These are matche...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/deprecated-components-documentation/subscriptions.md
main
datadog-agent
[ -0.051814403384923935, -0.06232200562953949, -0.043536730110645294, 0.0029598192777484655, -0.012664168141782284, -0.004562919028103352, 0.12042930722236633, 0.010035746730864048, 0.011877444572746754, -0.04433249309659004, 0.03930698335170746, -0.04580329358577728, 0.055272288620471954, 0...
0.109134
# Go guidelines ----- ## Imports The imports defined in the `imports ( ... )` block of each Go file should be separated into the following sections, in order. 1. Standard library packages (e.g. `fmt`, `net/http`) 1. External packages (e.g. `github.com/stretchr/testify/assert`, `github.com/DataDog/datadog-agent/pkg/util...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/go.md
main
datadog-agent
[ -0.036104392260313034, 0.03478075563907623, -0.05573585629463196, -0.03197559714317322, 0.02957397885620594, -0.05266847088932991, -0.0407794751226902, 0.04909910634160042, -0.0363425612449646, -0.002432461129501462, 0.08070392906665802, -0.022508325055241585, 0.037902530282735825, 0.11917...
0.007345
\_very\_ low-level concept and full of subtle gotchas and dramatic performance differences across platforms. If you can use something higher-level, such as something from the standard library's `sync` [package](https://pkg.go.dev/sync), prefer to do so. Otherwise, if you are in search of performance, be sure to benchma...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/go.md
main
datadog-agent
[ -0.028376346454024315, 0.02635311521589756, -0.06267900764942169, -0.020298775285482407, 0.04539470374584198, -0.039146676659584045, -0.060515161603689194, -0.029467584565281868, -0.005752283148467541, -0.07871057093143463, 0.015120130032300949, -0.049943361431360245, -0.02618146687746048, ...
0.047699
major source of flakes. If you find yourself thinking something like "the ticker should run three times in 500ms", you will be disappointed at how often that is not true in CI. Even if that test is not flaky, it will take at least 500ms to run. Summing such delays over thousands of tests means \_very\_ long test runs a...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/go.md
main
datadog-agent
[ -0.07175754755735397, -0.010650021024048328, -0.06903818249702454, 0.09744445979595184, 0.035569626837968826, -0.11363758891820908, -0.04184365272521973, 0.017242703586816788, 0.054914526641368866, -0.021330708637833595, -0.0284590907394886, -0.044448766857385635, -0.04427694156765938, -0....
0.073773
# Rust in the Datadog Agent This document describes how Rust components are built and integrated in the Datadog Agent repository. ## Overview The Datadog Agent uses [rules\_rust](https://github.com/bazelbuild/rules\_rust) for building Rust code with Bazel and [rules\_rs](https://github.com/dzbarsky/rules\_rs) to manage...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/RUST.md
main
datadog-agent
[ -0.12061067670583725, 0.02556389570236206, -0.04402400553226471, 0.06495342403650284, -0.019102009013295174, -0.0458456389605999, 0.00028084509540349245, 0.03332933783531189, -0.060971587896347046, -0.07070942968130112, -0.0067756096832454205, -0.046453043818473816, 0.09359651058912277, 0....
0.164111
= true` (never a version number): ```toml [dependencies] serde.workspace = true ``` 3. \*\*Add the dependency to your `BUILD.bazel`:\*\* ```starlark rust\_library( name = "my\_lib", # ... deps = [ "@crates//:serde", ], ) ``` 4. \*\*Regenerate `Cargo.lock`:\*\* ```bash cargo generate-lockfile ``` 5. \*\*Commit both the ...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/RUST.md
main
datadog-agent
[ -0.09131269156932831, -0.023012259975075722, -0.024091752246022224, -0.0003605300444178283, 0.045764148235321045, 0.03349359333515167, 0.05065832659602165, 0.007489811163395643, -0.03226707503199577, -0.0577271468937397, -0.025836342945694923, -0.06019113212823868, 0.03303506597876549, -0....
0.05956
edition = "2024", deps = [":my\_lib"], ) ``` ### rust\_test For unit and integration tests: ```starlark # Unit tests (embedded in library) rust\_test( name = "my\_lib\_test", crate = ":my\_lib", edition = "2024", deps = ["@crates//:tempfile"], # dev-dependencies ) # Integration tests (standalone test files) rust\_test(...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/languages/RUST.md
main
datadog-agent
[ -0.025848645716905594, 0.006623982451856136, -0.01896030828356743, 0.031009472906589508, 0.060894884169101715, -0.0687725841999054, 0.05705855414271355, 0.10526926070451736, -0.05964348465204239, -0.06835044920444489, -0.016648640856146812, -0.055319901555776596, 0.050800930708646774, -0.0...
0.050151
# Test Categories The Datadog Agent employs a comprehensive testing strategy with four distinct categories of tests, each serving a specific purpose in ensuring code quality, functionality, and reliability. This document serves as both a reference guide and decision-making framework for choosing the appropriate test ty...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/testing/test-categories.md
main
datadog-agent
[ -0.048308115452528, -0.020032469183206558, -0.014715082012116909, 0.03197779878973961, -0.029515540227293968, -0.07427555322647095, -0.05703141540288925, -0.03079765848815441, -0.023881662636995316, -0.00585223687812686, 0.03227870911359787, -0.06236565113067627, 0.05426766723394394, -0.00...
0.108088
per test). - \*\*Environment Specific\*\*: May require specific OS features or permissions. \*\*Examples\*\*: ```go // Testing DogStatsD metric forwarding pipeline func TestDogStatsDMetricPipeline(t \*testing.T) { // Start Agent with test configuration agent := startTestAgent(t, &Config{ DogStatsDPort: 8125, APIKey: "t...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/testing/test-categories.md
main
datadog-agent
[ -0.02891857922077179, -0.022040968760848045, -0.0544680692255497, -0.00198597670532763, -0.07941261678934097, -0.08137329667806625, -0.04356959089636803, 0.047568075358867645, -0.03166358545422554, -0.0038396483287215233, 0.028164999559521675, -0.07638943940401077, -0.010541257448494434, 0...
0.068861
integration tests for external dependencies, use system tests for component interactions, and implement E2E tests for critical user workflows.
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/testing/test-categories.md
main
datadog-agent
[ -0.052262358367443085, -0.046141061931848526, 0.019318340346217155, -0.037009116262197495, 0.042911045253276825, -0.06991855055093765, -0.013774704188108444, 0.09770875424146652, -0.03523281216621399, -0.026871105656027794, -0.01513337530195713, -0.09506213665008545, -0.011332170106470585, ...
0.2314
# Logging ## Writing a good log message In general, there are a few rules and a few suggestions to follow when it comes to writing good log messages: - Messages must be written in English, preferably in American English. - Use proper spelling and grammar when possible. Because not everyone is a native English speaker, ...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/conventions/logging.md
main
datadog-agent
[ 0.0015897245611995459, 0.020294204354286194, 0.07138456404209137, -0.006224885117262602, 0.0794091448187828, -0.015955986455082893, 0.10356465727090836, 0.06457474082708359, 0.02365932986140251, 0.0308259017765522, -0.020418770611286163, -0.03240523859858513, -0.009413029998540878, 0.03460...
0.131892
# Developer environment reference ----- The developer environments are [container images](https://github.com/DataDog/datadog-agent-buildimages/tree/main/dev-envs) that use the [builders](builders.md) as a base image. These images are only intended for use by the [`dda env dev`](https://datadoghq.dev/datadog-agent-dev/r...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/reference/images/dev.md
main
datadog-agent
[ 0.0022504047956317663, 0.006239218171685934, -0.011753044091165066, -0.0371648408472538, 0.07745110988616943, -0.09812982380390167, -0.11312989890575409, 0.009833264164626598, 0.009083383716642857, 0.03719695284962654, 0.022283397614955902, -0.07528970390558243, 0.05974447727203369, 0.0032...
0.048426
# Build image reference ----- All non-macOS release artifacts are produced within [container images](https://github.com/DataDog/datadog-agent-buildimages) that are hosted on the [Datadog Docker Hub](https://hub.docker.com/u/datadog). /// note These images are not meant to be used directly outside of CI scenarios. Inste...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/reference/images/builders.md
main
datadog-agent
[ -0.03995808959007263, 0.0357833206653595, -0.010592099279165268, -0.04046012461185455, 0.05703369155526161, -0.1311667412519455, -0.09759027510881424, 0.004033874254673719, -0.0020980502013117075, 0.02890358492732048, 0.056533847004175186, -0.09148155897855759, 0.07815572619438171, -0.0107...
0.091269
# Agent components ## Agent binaries The "Agent" is not distributed as a single binary. Instead, running an Agent on a given host will usually involve multiple processes communicating with each other, spawned from different binaries[^1]. These binaries have a good amount of code shared between them, but are all buildab...
https://github.com/DataDog/datadog-agent/blob/main/docs/public/reference/builds/components.md
main
datadog-agent
[ 0.020114870741963387, -0.036606110632419586, -0.08057501167058945, -0.05491853877902031, 0.04426971822977066, -0.04092932865023613, -0.04125590994954109, 0.0034511133562773466, -0.04302859678864479, -0.009202945046126842, -0.022877583280205727, -0.02463672123849392, 0.06587023288011551, -0...
0.122404
# Endpoints exposed by the Agent The core Agent exposes a variety of HTTP and GRPC endpoints that can be organized into two groups: 1. \*\*Control\*\*: These endpoints are used to send commands that can control and inspect the state of the running Agent. 2. \*\*Inter-process communication\*\*: These endpoints are used ...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/agent_api.md
main
datadog-agent
[ -0.030623361468315125, -0.0018140854081138968, -0.12285076826810837, -0.06373530626296997, -0.017463453114032745, -0.07427965849637985, -0.013645654544234276, 0.0025590267032384872, 0.035845495760440826, 0.004342244006693363, 0.03448430448770523, -0.022248564288020134, 0.0016365820774808526,...
0.240548
# How to add a `replace` directive to `go.mod` `go.mod` files allow different types of directives including `require` or `replace`. This document describes how and when to add a `replace` directive to our go.mod files. ## Why we should avoid `replace` directives `replace` directives replace a given dependency code on t...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/gomodreplace.md
main
datadog-agent
[ -0.06218688189983368, 0.04022234305739403, 0.06765664368867874, -0.022366277873516083, 0.07408348470926285, 0.005505289416760206, -0.02975550852715969, -0.02910716086626053, 0.001661518239416182, -0.02593863382935524, 0.10767783224582672, 0.06408359110355377, -0.01878545805811882, 0.064615...
0.019789
# Developer Guide This guide will help you to develop and contribute code to the project. ## Table of Content \* [Custom checks developer guide](checks/README.md) \* [Python builtin modules](checks/builtins) \* [Agent IPC API](agent\_api.md) \* [How to build the Agent packages][agent-omnibus] \* [Testing guide][testing...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/README.md
main
datadog-agent
[ 0.01312316581606865, -0.0021671191789209843, -0.13440315425395966, -0.052104610949754715, 0.0122047895565629, -0.01854565739631653, -0.0015276143094524741, 0.043130602687597275, -0.09609148651361465, 0.038331419229507446, 0.029964588582515717, -0.011162495240569115, 0.02459673024713993, 0....
0.134423
# Agent Configuration This doc describes how to define new configuration parameters for the Agent. 1. Define your config. 2. Add it to the config template (optional). 3. Use your config in your code. 4. Request a review from the Agent configuration team (team/agent-configuration) If you have any questions, head over to...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/config.md
main
datadog-agent
[ 0.007184459362179041, -0.021839747205376625, -0.08813302218914032, 0.034702084958553314, -0.02097424678504467, -0.027705175802111626, 0.01673518307507038, 0.058654990047216415, -0.12018077075481415, -0.026192782446742058, 0.06120800971984863, -0.049417294561862946, 0.10760537534952164, -0....
0.06548
# Legal You must sign [our CLA](https://gist.github.com/bits-bot/55bdc97a4fdad52d97feb4d6c3d1d618) before we can accept your contributions. The first time you submit a PR, a bot will walk you through the automated process. On subsequent contributions you will not be prompted unless the content of the agreement has chan...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/legal.md
main
datadog-agent
[ -0.08095084130764008, 0.03678271174430847, -0.012566815130412579, -0.08344880491495132, 0.030113089829683304, 0.007287835236638784, 0.040576234459877014, -0.009894328191876411, 0.025004666298627853, 0.0418967679142952, 0.05665934830904007, 0.01290240976959467, 0.028348905965685844, -0.0315...
-0.024741
# Kubernetes Autodiscovery and Pod Check Annotations This document describes how the Datadog Agent uses Kubernetes pod annotations for integration (check) autodiscovery and how to avoid common pitfalls. ## Pod check annotations Many customers use Kubernetes pod annotations to run checks. The annotation format is: - \*\...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/kubernetes-autodiscovery-annotations.md
main
datadog-agent
[ 0.015325351618230343, 0.038922764360904694, 0.02770605869591236, -0.01494504977017641, 0.02544134296476841, -0.041500627994537354, 0.04007306322455406, -0.054366033524274826, 0.0627155676484108, 0.018172847107052803, 0.028075596317648888, -0.07447578758001328, 0.0015123593620955944, 0.0272...
0.154786
# Development Caveats This document provides a list of known development caveats ## Windows ### COM Caveats The COM concurrency model may be set in different ways, it also has to be called for every thread that might indeed interact with the COM library. Furthermore, once a concurrency model is set for a thread, it can...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/caveats.md
main
datadog-agent
[ -0.0713273361325264, -0.11025971919298172, -0.04071146622300148, -0.018047934398055077, -0.051180846989154816, -0.0751228779554367, -0.008096674457192421, -0.004988444037735462, -0.0043702214024960995, -0.029243309050798416, -0.010030907578766346, 0.013218524865806103, 0.02747403457760811, ...
0.100005
# Custom checks developer guide For more informations about what a Custom check is and whether they are a good fit for your use case, please [refer to the official documentation][custom-checks]. ## JMX-based checks JMX-based checks are executed by a component of the Agent called `jmxfetch`. See the [JMXFetch repo](http...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/README.md
main
datadog-agent
[ 0.009364168159663677, -0.014978800900280476, -0.034806154668331146, -0.04759921133518219, 0.0027349311858415604, -0.0728241503238678, 0.04894659295678139, -0.0006225417600944638, -0.04937856271862984, -0.010599992237985134, 0.053711216896772385, 0.03606010600924492, 0.033000629395246506, -...
0.091367
- [aggregator](builtins/aggregator.md) - [containers](builtins/containers.md) - [datadog\_agent](builtins/datadog\_agent.md) - [kubeutil](builtins/kubeutil.md) - [tagger](builtins/tagger.md) - [util](builtins/util.md) [custom-checks]: https://docs.datadoghq.com/developers/write\_agent\_check/?tab=agentv6 [collector]: /...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/README.md
main
datadog-agent
[ 0.007451518438756466, 0.04231390729546547, -0.04018425568938255, -0.020816365256905556, -0.0260848980396986, -0.07508613914251328, 0.00535196578130126, -0.026954885572195053, 0.02643546275794506, 0.035699695348739624, 0.04961738362908363, -0.11765847355127335, 0.07025350630283356, -0.03121...
0.075099
have dependencies, specifically on the open source `redisdb` package. In this case, we need to install the `deps` explicitly. ``` python3 -m pip install --user './redisdb[deps]' ``` That's it! Your local build should now have the correct packages to be able to run the `redisdb` check. (You may need to set the correct `...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/README.md
main
datadog-agent
[ -0.018772870302200317, -0.07345838099718094, -0.03658114746212959, 0.004803359974175692, -0.02284889481961727, -0.04419771581888199, -0.02215658128261566, 0.01822051964700222, -0.02288842387497425, 0.021181782707571983, -0.016958603635430336, -0.03187417611479759, 0.03926127031445503, 0.03...
-0.048996
# \_util > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. The module exposes low level functions to run proc...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/_util.md
main
datadog-agent
[ -0.04993937164545059, 0.03739093616604805, -0.057432085275650024, 0.009314913302659988, -0.06270824372768402, -0.11040029674768448, 0.04174398258328438, 0.03755994513630867, -0.018341058865189552, -0.038724515587091446, 0.021923167631030083, -0.05774400755763054, 0.0607944056391716, 0.0277...
0.055653
# tagger > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. The module exposes [tagger](/comp/core/tagger) fun...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/tagger.md
main
datadog-agent
[ -0.03631575405597687, 0.06769201159477234, -0.09884117543697357, -0.0013564719120040536, -0.021509161219000816, -0.14674736559391022, 0.060899291187524796, 0.06438235938549042, -0.06662862747907639, -0.02228112518787384, 0.05409843474626541, -0.05242098122835159, 0.06619179993867874, 0.016...
0.064013
# datadog\_agent > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. The `datadog\_agent` module exposes featur...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/datadog_agent.md
main
datadog-agent
[ 0.0063306912779808044, 0.05510137602686882, -0.08052442967891693, -0.022836588323116302, -0.010505023412406445, -0.06611624360084534, 0.021182077005505562, -0.012817731127142906, -0.0552946999669075, -0.03262350335717201, 0.08210481703281403, -0.001286866725422442, 0.04643307626247406, 0.0...
0.032389
# kubeutil > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. This modules provides specific functionalities t...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/kubeutil.md
main
datadog-agent
[ 0.009173281490802765, 0.013555056415498257, -0.060499805957078934, 0.01275703962892294, -0.08158863335847855, -0.04073319211602211, 0.03493760526180267, -0.004242576193064451, 0.06408520042896271, -0.006855455227196217, 0.029465192928910255, -0.1188431903719902, 0.02783023752272129, -0.045...
0.139601
# containers > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. The module exposes functionalities used to col...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/containers.md
main
datadog-agent
[ 0.005353084299713373, 0.12176565825939178, -0.025371219962835312, 0.014658763073384762, 0.006038764026015997, -0.1150558739900589, 0.07748515158891678, -0.010565138421952724, 0.0009334989590570331, -0.06627749651670456, 0.04936109110713005, -0.04983999580144882, 0.1073707565665245, 0.01717...
0.051071
# util > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. This module exists only to provide backward compatib...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/util.md
main
datadog-agent
[ -0.04208947718143463, 0.07097289711236954, -0.05289207026362419, 0.003552235895767808, -0.028076931834220886, -0.10314134508371353, 0.020375173538923264, -0.010646829381585121, -0.0358419269323349, 0.012691291980445385, 0.04160688817501068, -0.03730642795562744, 0.08316710591316223, -0.003...
0.029249
# aggregator > \*\*This module is intended for internal use and should never be imported directly.\*\* > Checks should use the methods exposed by the `AgentCheck` class instead, see > [dedicated docs](https://datadoghq.dev/integrations-core/base/about/) for > more details. The `aggregator` module allows a Python check ...
https://github.com/DataDog/datadog-agent/blob/main/docs/dev/checks/builtins/aggregator.md
main
datadog-agent
[ -0.06003102287650108, -0.023238634690642357, -0.08139725774526596, 0.04336385056376457, -0.04464327543973923, -0.06165837496519089, 0.03125523775815964, 0.0107381297275424, -0.01191606093198061, -0.0036401518154889345, 0.05053750425577164, -0.04619915783405304, 0.06218108534812927, -0.0017...
0.083311
# Buffer > Stability: 2 - Stable `Buffer` objects are used to represent a fixed-length sequence of bytes. Many Node.js APIs support `Buffer`s. The `Buffer` class is a subclass of JavaScript's {Uint8Array} class and extends it with methods that cover additional use cases. Node.js APIs accept plain {Uint8Array}s wherever...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ -0.010107012465596199, 0.004429360385984182, -0.01048326212912798, 0.021127475425601006, -0.036448657512664795, -0.05708445608615875, -0.004163931589573622, 0.05271921679377556, -0.01529567688703537, -0.06869561970233917, -0.10029745101928711, 0.09426730126142502, -0.02427849732339382, -0....
0.10969
Node.js buffers accept all case variations of encoding strings that they receive. For example, UTF-8 can be specified as `'utf8'`, `'UTF8'`, or `'uTf8'`. The character encodings currently supported by Node.js are the following: \* `'utf8'` (alias: `'utf-8'`): Multi-byte encoded Unicode characters. Many web pages and ot...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.021966004744172096, -0.019273903220891953, 0.06181001290678978, -0.021022073924541473, -0.024043168872594833, -0.028155183419585228, -0.01884309947490692, 0.00017445118282921612, 0.0929156020283699, -0.019759994000196457, -0.04405747354030609, 0.021591635420918465, -0.015928518027067184, ...
0.046107
represented. ``` ```cjs const { Buffer } = require('node:buffer'); Buffer.from('1ag123', 'hex'); // Prints , data truncated when first non-hexadecimal value // ('g') encountered. Buffer.from('1a7', 'hex'); // Prints , data truncated when data ends in single digit ('7'). Buffer.from('1634', 'hex'); // Prints , all data ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ -0.02084585465490818, 0.0653528943657875, -0.015306835062801838, -0.031504660844802856, -0.06841886788606644, -0.07235626131296158, 0.037688959389925, 0.02893863245844841, 0.023841246962547302, -0.06987906992435455, 0.0017881046514958143, 0.014708301983773708, -0.02716720849275589, -0.0087...
0.066903
use only a portion of the underlying {ArrayBuffer} by passing in `byteOffset` and `length` parameters. ```mjs import { Buffer } from 'node:buffer'; const arr = new Uint16Array(20); const buf = Buffer.from(arr.buffer, 0, 16); console.log(buf.length); // Prints: 16 ``` ```cjs const { Buffer } = require('node:buffer'); co...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.06030559912323952, 0.0683722198009491, -0.016797954216599464, -0.03311898559331894, -0.06842853128910065, -0.04230180010199547, 0.05462424084544182, 0.03455192595720291, -0.03901979327201843, -0.07371741533279419, -0.10318928956985474, 0.028555572032928467, -0.046733032912015915, -0.0094...
0.092723
content of the `Blob` to be read. ### `blob.text()` \* Returns: {Promise} Returns a promise that fulfills with the contents of the `Blob` decoded as a UTF-8 string. ### `blob.type` \* Type: {string} The content-type of the `Blob`. ### `Blob` objects and `MessageChannel` Once a {Blob} object is created, it can be sent v...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.014500211924314499, -0.0036303275264799595, 0.02631775662302971, 0.08376660943031311, -0.0583152137696743, -0.07914996147155762, 0.08393298089504242, 0.012861935421824455, 0.06564458459615707, -0.062460023909807205, -0.020892580971121788, 0.04136761650443077, 0.02068883739411831, 0.02505...
0.140145
are unknown and \_may contain sensitive data\_. Use [`Buffer.alloc()`][] instead to initialize `Buffer` instances with zeroes. ```mjs import { Buffer } from 'node:buffer'; const buf = Buffer.allocUnsafe(10); console.log(buf); // Prints (contents may vary): buf.fill(0); console.log(buf); // Prints: ``` ```cjs const { Bu...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.026723530143499374, 0.019543901085853577, -0.03563183173537254, 0.003562150988727808, -0.01346930954605341, -0.041682980954647064, 0.05756397172808647, 0.08423744887113571, 0.005462929606437683, -0.05808302387595177, -0.022560305893421173, -0.008981761522591114, -0.0324152335524559, -0.0...
0.074516
encoded using `encoding`. This is not the same as [`String.prototype.length`][], which does not account for the encoding that is used to convert the string into bytes. For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. For strings that contain non-base64/hex-encoded data (e.g. whitespace), t...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.049376532435417175, 0.0769246518611908, 0.007810190785676241, 0.008548939600586891, -0.08523166924715042, -0.03727421909570694, -0.004728957545012236, 0.08401670306921005, 0.031000124290585518, -0.02256002463400364, -0.0803389623761177, 0.019175661727786064, 0.03955766558647156, -0.03083...
0.019752
\* `length` {integer} The number of elements from `view` to copy. \*\*Default:\*\* `view.length - offset`. \* Returns: {Buffer} Copies the underlying memory of `view` into a new `Buffer`. ```js const u16 = new Uint16Array([0, 0xffff]); const buf = Buffer.copyBytesFrom(u16, 1, 1); u16[1] = 0; console.log(buf.length); //...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.059504520148038864, 0.016997866332530975, -0.04555239528417587, -0.019181393086910248, -0.03013317845761776, -0.04438336193561554, 0.06820755451917648, -0.0062836166471242905, -0.006666306406259537, -0.10391969233751297, -0.052942823618650436, -0.002007322618737817, 0.002801095135509968, ...
0.14616
Buffer } from 'node:buffer'; const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements console.log(arrA.buffer === arrB.buffer); // true const buf = Buffer.from(arrB.buffer); console.log(buf); // Prints: ``` ```cjs const { Buffer } = require('nod...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.06705643981695175, 0.03566710650920868, -0.06554261595010757, 0.009067971259355545, -0.06296570599079132, -0.038891006261110306, 0.06940337270498276, -0.033801645040512085, -0.013117215596139431, -0.055647917091846466, -0.07613358646631241, 0.003728315932676196, -0.059414178133010864, -0...
0.059148
const { Buffer } = require('node:buffer'); Buffer.isBuffer(Buffer.alloc(10)); // true Buffer.isBuffer(Buffer.from('foo')); // true Buffer.isBuffer('a string'); // false Buffer.isBuffer([]); // false Buffer.isBuffer(new Uint8Array(1024)); // false ``` ### Static method: `Buffer.isEncoding(encoding)` \* `encoding` {strin...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.04259154573082924, 0.008888552896678448, -0.023408783599734306, -0.01935482583940029, -0.05355464294552803, -0.03026178851723671, 0.040172114968299866, 0.004498573951423168, 0.008493103086948395, -0.0561671182513237, -0.035081785172224045, -0.03904798626899719, 0.005717181134968996, 0.04...
0.084877
3, 4, 5, 6, 7, 8, 9]); // When casting the Node.js Buffer to an Int8Array, use the byteOffset // to refer only to the part of `nodeBuffer.buffer` that contains the memory // for `nodeBuffer`. new Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length); ``` ```cjs const { Buffer } = require('node:buffer')...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.04004471004009247, 0.02705405466258526, -0.0003743574197869748, -0.03956298157572746, -0.026839395985007286, -0.010672890581190586, 0.04227714240550995, 0.08177607506513596, 0.0017743055941537023, -0.07370787858963013, -0.17070411145687103, 0.008450117893517017, -0.06405304372310638, -0....
0.082661
`buf` from which to begin copying. \*\*Default:\*\* `0`. \* `sourceEnd` {integer} The offset within `buf` at which to stop copying (not inclusive). \*\*Default:\*\* [`buf.length`][]. \* Returns: {integer} The number of bytes copied. Copies data from a region of `buf` to a region in `target`, even if the `target` memory...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.02926049381494522, 0.0034222600515931845, -0.0298185832798481, -0.01653263531625271, -0.06308307498693466, -0.020090334117412567, 0.060990866273641586, -0.042368195950984955, 0.0051658679731190205, -0.085453100502491, -0.08619413524866104, 0.018186505883932114, -0.004263752605766058, -0....
0.14144
= Buffer.from('ABC'); const buf2 = Buffer.from('414243', 'hex'); const buf3 = Buffer.from('ABCD'); console.log(buf1.equals(buf2)); // Prints: true console.log(buf1.equals(buf3)); // Prints: false ``` ### `buf.fill(value[, offset[, end]][, encoding])` \* `value` {string|Buffer|Uint8Array|integer} The value with which to...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07279937714338303, 0.04404471814632416, -0.04310811683535576, -0.0496407188475132, -0.11745886504650116, -0.01406062114983797, 0.07783554494380951, 0.0376608744263649, 0.013561884872615337, -0.11245787888765335, -0.10230857133865356, -0.0521029494702816, 0.008098279125988483, -0.02629659...
0.059801
Prints: true console.log(buf.includes('this', 4)); // Prints: false ``` ### `buf.indexOf(value[, start[, end]][, encoding])` \* `value` {string|Buffer|Uint8Array|integer} What to search for. \* `start` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. \*\*Default...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.04095599427819252, 0.06466822326183319, -0.03142639249563217, -0.008760519325733185, 0.0051673525013029575, 0.04058363288640976, 0.09214559942483902, 0.007646170444786549, 0.005365521181374788, -0.10278677940368652, -0.031939227133989334, -0.03428870812058449, 0.00631125969812274, -0.022...
0.088711
(const key of buf.keys()) { console.log(key); } // Prints: // 0 // 1 // 2 // 3 // 4 // 5 ``` ```cjs const { Buffer } = require('node:buffer'); const buf = Buffer.from('buffer'); for (const key of buf.keys()) { console.log(key); } // Prints: // 0 // 1 // 2 // 3 // 4 // 5 ``` ### `buf.lastIndexOf(value[, start[, end]][, ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.03627919405698776, 0.07288897037506104, -0.027919838204979897, -0.011430958285927773, -0.028548922389745712, 0.060897305607795715, 0.07719506323337555, 0.03585177659988403, 0.028456183150410652, -0.0886121615767479, -0.05880539119243622, -0.01725199818611145, 0.00013050033885519952, -0.0...
0.080817
Returns the number of bytes in `buf`. ```mjs import { Buffer } from 'node:buffer'; // Create a `Buffer` and write a shorter string to it using UTF-8. const buf = Buffer.alloc(1234); console.log(buf.length); // Prints: 1234 buf.write('some string', 0, 'utf8'); console.log(buf.length); // Prints: 1234 ``` ```cjs const { ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.06322850286960602, 0.01255392748862505, -0.00043491710675880313, -0.009433114901185036, -0.07467906177043915, 0.013248498551547527, -0.00026138441171497107, 0.08537322282791138, 0.061296962201595306, -0.03337375074625015, -0.03243960067629814, -0.01867293007671833, 0.009728341363370419, ...
0.055195
= require('node:buffer'); const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); console.log(buf.readDoubleLE(0)); // Prints: 5.447603722011605e-270 console.log(buf.readDoubleLE(1)); // Throws ERR\_OUT\_OF\_RANGE. ``` ### `buf.readFloatBE([offset])` \* `offset` {integer} Number of bytes to skip before starting to read. Mus...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.0794692113995552, 0.027085455134510994, -0.038132164627313614, -0.034562159329652786, -0.018921373412013054, -0.045612845569849014, 0.008030172437429428, 0.05881313979625702, -0.018701422959566116, -0.05004983767867088, -0.08689956367015839, -0.04398282244801521, -0.01973341591656208, -0...
0.059145
console.log(buf.readInt32BE(0)); // Prints: 5 ``` ### `buf.readInt32LE([offset])` \* `offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. \*\*Default:\*\* `0`. \* Returns: {integer} Reads a signed, little-endian 32-bit integer from `buf` at the specified `off...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07656168192625046, 0.03361210972070694, -0.025947289541363716, -0.02318522334098816, -0.014915059320628643, -0.027394738048315048, 0.046258702874183655, 0.09419924765825272, 0.0014868942089378834, -0.07634907960891724, -0.07285602390766144, -0.0003112986159976572, 0.0003538057208061218, ...
0.102989
of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. \*\*Default:\*\* `0`. \* Returns: {integer} Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. This function is also available under the `readUint16LE` alias. ```mjs import { Buffer } from 'node:bu...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07280564308166504, 0.029368622228503227, -0.04612578824162483, -0.04152309149503708, -0.031208999454975128, -0.01730469986796379, 0.009879026561975479, 0.09553369134664536, 0.006546466611325741, -0.06651078909635544, -0.027618180960416794, 0.002084085252135992, -0.00433359993621707, -0.0...
0.066977
new `Buffer` will end (not inclusive). \*\*Default:\*\* [`buf.length`][]. \* Returns: {Buffer} Returns a new `Buffer` that references the same memory as the original, but offset and cropped by the `start` and `end` indexes. Specifying `end` greater than [`buf.length`][] will return the same result as that of `end` equa...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.04996481537818909, 0.01598936691880226, -0.0010092946467921138, -0.0018460358260199428, -0.06817767769098282, -0.06302925199270248, 0.02208254300057888, 0.010761192068457603, -0.01254579983651638, -0.07574407011270523, -0.07738024741411209, 0.0674908235669136, -0.04462066665291786, -0.01...
0.12401
from 'node:buffer'; const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); console.log(buf1); // Prints: buf1.swap16(); console.log(buf1); // Prints: const buf2 = Buffer.from([0x1, 0x2, 0x3]); buf2.swap16(); // Throws ERR\_INVALID\_BUFFER\_SIZE. ``` ```cjs const { Buffer } = require('node:buffer'); const b...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.028908338397741318, -0.00855287630110979, -0.039807479828596115, -0.05699050426483154, -0.026563208550214767, -0.0713973343372345, -0.011821605265140533, 0.03140264376997948, -0.017292138189077377, -0.06965551525354385, -0.03081175684928894, 0.017293712124228477, -0.02615431137382984, -0...
0.030742
is not valid UTF-8, then each invalid byte is replaced with the replacement character `U+FFFD`. The maximum length of a string instance (in UTF-16 code units) is available as [`buffer.constants.MAX\_STRING\_LENGTH`][]. ```mjs import { Buffer } from 'node:buffer'; const buf1 = Buffer.allocUnsafe(26); for (let i = 0; i <...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07010022550821304, 0.004494056571274996, 0.0011702390620484948, -0.062009356915950775, -0.04916569963097572, -0.003251882502809167, 0.035817865282297134, 0.05217712000012398, -0.006212865933775902, -0.06124374642968178, -0.05810387060046196, -0.047049447894096375, 0.020221145823597908, 0...
0.002701
before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. \*\*Default:\*\* `0`. \* Returns: {integer} `offset` plus the number of bytes written. Writes `value` to `buf` at the specified `offset` as big-endian. `value` is interpreted and written as a two's complement signed integer. ```mjs import { Buffer...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.05863267183303833, 0.03528734669089317, -0.021406354382634163, 0.0024223155342042446, -0.03850288689136505, -0.03473113477230072, -0.0217917338013649, 0.1170562282204628, -0.019574163481593132, -0.009903579019010067, -0.035514697432518005, -0.02613384649157524, -0.019793542101979256, -0....
0.090793
`value` is anything other than a JavaScript number. ```mjs import { Buffer } from 'node:buffer'; const buf = Buffer.allocUnsafe(8); buf.writeDoubleLE(123.456, 0); console.log(buf); // Prints: ``` ```cjs const { Buffer } = require('node:buffer'); const buf = Buffer.allocUnsafe(8); buf.writeDoubleLE(123.456, 0); console....
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.04597053304314613, 0.03961874917149544, -0.04236602783203125, -0.0009610371198505163, -0.0616932138800621, 0.008677472360432148, 0.03481940180063248, 0.07702856510877609, 0.04441951960325241, -0.060037583112716675, -0.07860283553600311, -0.034262627363204956, -0.003618712769821286, -0.08...
0.102231
valid signed 16-bit integer. Behavior is undefined when `value` is anything other than a signed 16-bit integer. The `value` is interpreted and written as a two's complement signed integer. ```mjs import { Buffer } from 'node:buffer'; const buf = Buffer.allocUnsafe(2); buf.writeInt16LE(0x0304, 0); console.log(buf); // P...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07920362055301666, 0.05685478448867798, -0.0199730284512043, -0.024046458303928375, -0.03588149696588516, -0.04807267338037491, 0.021425556391477585, 0.08445124328136444, -0.015620415098965168, -0.04133112356066704, -0.05449431389570236, -0.04234511777758598, 0.00621248222887516, -0.0266...
0.060657
= require('node:buffer'); const buf = Buffer.allocUnsafe(6); buf.writeIntLE(0x1234567890ab, 0, 6); console.log(buf); // Prints: ``` ### `buf.writeUInt8(value[, offset])` \* `value` {integer} Number to be written to `buf`. \* `offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.0601101815700531, 0.03220168501138687, -0.031361062079668045, 0.025309043005108833, -0.06563479453325272, -0.017050903290510178, 0.027929704636335373, 0.07928746938705444, -0.012384623289108276, -0.036949776113033295, -0.07057376950979233, 0.003549770684912801, 0.0006988384411670268, -0....
0.092007
the number of bytes written. Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is anything other than an unsigned 32-bit integer. This function is also available under the `writeUint32LE` alias. ```mjs import { Buf...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.07221811264753342, 0.011017540469765663, -0.052743129432201385, 0.02397243306040764, -0.04697737842798233, -0.021609704941511154, -0.008311907760798931, 0.07375655323266983, 0.010132506489753723, -0.01634233631193638, -0.06556177884340286, -0.037911441177129745, 0.0022064975928515196, -0...
0.085681
of string, {ArrayBuffer}, {TypedArray}, {DataView}, {File}, or {Blob} objects, or any mix of such objects, that will be stored within the `File`. \* `fileName` {string} The name of the file. \* `options` {Object} \* `endings` {string} One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.015421025454998016, 0.0421973317861557, -0.029406169429421425, 0.056676458567380905, -0.049792177975177765, -0.025380445644259453, 0.02694587968289852, 0.06295488774776459, -0.040334612131118774, 0.014073611237108707, -0.043982673436403275, 0.005589299835264683, -0.032215531915426254, -0...
0.082509
associated {Blob} object registered using a prior call to `URL.createObjectURL()`. ### `buffer.transcode(source, fromEnc, toEnc)` \* `source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance. \* `fromEnc` {string} The current encoding. \* `toEnc` {string} To target encoding. \* Returns: {Buffer} Re-encodes the g...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ -0.030666181817650795, -0.09734299033880234, -0.07841023057699203, 0.004576132632791996, -0.15379533171653748, -0.041384536772966385, 0.03168850392103195, -0.007689128164201975, -0.0023783082142472267, -0.07698587328195572, -0.07914654165506363, -0.04247886314988136, 0.01672748290002346, 0...
0.074284
application that does not validate its input sufficiently might expect to always receive a string. Before Node.js 8.0.0, the 100 byte buffer might contain arbitrary pre-existing in-memory data, so may be used to expose in-memory secrets to a remote attacker. Since Node.js 8.0.0, exposure of memory cannot occur because ...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.012936796993017197, 0.01429812889546156, 0.008824139833450317, 0.027732014656066895, -0.019336728379130363, -0.04112999886274338, -0.013230407610535622, 0.09957318753004074, 0.04706878587603569, -0.001418216503225267, -0.03854064643383026, 0.07880640029907227, -0.027832631021738052, -0.0...
0.086934
#bufentries [`buf.fill()`]: #buffillvalue-offset-end-encoding [`buf.indexOf()`]: #bufindexofvalue-byteoffset-encoding [`buf.keys()`]: #bufkeys [`buf.length`]: #buflength [`buf.slice()`]: #bufslicestart-end [`buf.subarray`]: #bufsubarraystart-end [`buf.toString()`]: #buftostringencoding-start-end [`buf.values()`]: #bufv...
https://github.com/nodejs/node/blob/main/doc/api/buffer.md
main
nodejs
[ 0.05455327779054642, 0.01674121990799904, -0.11762005090713501, -0.07127770781517029, -0.049932558089494705, -0.018714161589741707, -0.0010608190204948187, 0.024502038955688477, -0.073134645819664, -0.0763702243566513, -0.09001369774341583, -0.052675824612379074, -0.013527773320674896, -0....
0.027905
# HTTP > Stability: 2 - Stable This module, containing both a client and server, can be imported via `require('node:http')` (CommonJS) or `import \* as http from 'node:http'` (ES module). The HTTP interfaces in Node.js are designed to support many features of the protocol which have been traditionally difficult to use....
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.04970283433794975, 0.06934317201375961, 0.02681959606707096, 0.0010236892849206924, 0.030541621148586273, -0.09825940430164337, -0.06421869248151779, 0.0010951642179861665, 0.03424397483468056, 0.013715174049139023, -0.044572461396455765, 0.04068464785814285, -0.024663709104061127, -0.0...
0.153587
`agent:false`: ```js http.get({ hostname: 'localhost', port: 80, path: '/', agent: false, // Create a new agent just for this one request }, (res) => { // Do stuff with response }); ``` ### `new Agent([options])` \* `options` {Object} Set of configurable options to set on the agent. Can have the following fields: \* `k...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.11515548825263977, 0.04959804564714432, -0.05662740021944046, 0.040152911096811295, -0.004501853603869677, -0.06898890435695648, -0.017346017062664032, -0.07672002166509628, 0.015751108527183533, 0.000061017261032247916, 0.0036611363757401705, 0.060508206486701965, -0.04294667765498161, ...
0.106133
a proxy. \* `http\_proxy` {string|undefined} Same as `HTTP\_PROXY`. If both are set, `http\_proxy` takes precedence. \* `https\_proxy` {string|undefined} Same as `HTTPS\_PROXY`. If both are set, `https\_proxy` takes precedence. \* `no\_proxy` {string|undefined} Same as `NO\_PROXY`. If both are set, `no\_proxy` takes pr...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.05873691663146019, 0.05396053194999695, -0.037988122552633286, -0.02067222073674202, -0.07150011509656906, -0.06803010404109955, -0.033752474933862686, -0.009120091795921326, -0.016141587868332863, -0.015537234023213387, 0.0016258034156635404, 0.061599764972925186, 0.004244300536811352, ...
0.031516
agent when it is no longer needed. Otherwise, sockets might stay open for quite a long time before the server terminates them. ### `agent.freeSockets` \* Type: {Object} An object which contains arrays of sockets currently awaiting use by the agent when `keepAlive` is enabled. Do not modify. Sockets in the `freeSockets`...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.07282788306474686, 0.011057127267122269, -0.07263530045747757, 0.03687566891312599, -0.011517076753079891, -0.037038881331682205, -0.012114890851080418, -0.07758446037769318, 0.05691729113459587, 0.003788500325754285, 0.013626315630972385, 0.05673656240105629, -0.018452320247888565, -0....
0.127766
thrown, identified by `code:` [`'ERR\_HTTP\_CONTENT\_LENGTH\_MISMATCH'`][]. `Content-Length` value should be in bytes, not characters. Use [`Buffer.byteLength()`][] to determine the length of the body in bytes. ### Event: `'abort'` > Stability: 0 - Deprecated. Listen for the `'close'` event instead. Emitted when the re...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.0493033267557621, 0.033049844205379486, 0.0019479437032714486, 0.007647703401744366, -0.02228691801428795, -0.11655990779399872, 0.023279840126633644, 0.009152643382549286, 0.05028251186013222, 0.01509373914450407, -0.018396621569991112, 0.04664439707994461, -0.0040617333725094795, -0.0...
0.098404
transmission over the network. It does not imply that the server has received anything yet. ### Event: `'information'` \* `info` {Object} \* `httpVersion` {string} \* `httpVersionMajor` {integer} \* `httpVersionMinor` {integer} \* `statusCode` {integer} \* `statusMessage` {string} \* `headers` {Object} \* `rawHeaders` ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.010613144375383854, 0.11017804592847824, 0.04822598770260811, 0.014274084009230137, 0.03787943348288536, -0.08748658746480942, -0.01311260275542736, -0.028382964432239532, 0.07400552928447723, 0.04069969058036804, -0.017366943880915642, 0.009417190216481686, 0.004391341470181942, -0.023...
0.073943
1337, host: '127.0.0.1', headers: { 'Connection': 'Upgrade', 'Upgrade': 'websocket', }, }; const req = http.request(options); req.end(); req.on('upgrade', (res, stream, upgradeHead) => { console.log('got upgraded!'); stream.end(); process.exit(0); }); }); ``` ### `request.abort()` > Stability: 0 - Deprecated: Use [`req...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.07332562655210495, 0.07402986288070679, -0.004611031152307987, -0.002926026936620474, 0.00008529706974513829, -0.08352895081043243, -0.06544134765863419, 0.014465205371379852, -0.004628104157745838, -0.013857312500476837, -0.04281154274940491, 0.06387650221586227, -0.06370903551578522, ...
0.061611
`Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others are not defined and \_will not work\_. ```js request.setHeader('Foo', 'bar'); request.setHeader('Cookie', ['foo=bar', 'bar=baz']); const headers = request.getHeaders(); // headers === { foo: 'bar', 'cookie': ['foo=bar', 'bar=baz'] } ``` ### `...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.1075783222913742, 0.09148980677127838, 0.00037613295717164874, -0.03662925958633423, -0.03728528693318367, -0.03329835832118988, 0.06666407734155655, 0.06040924787521362, -0.027437537908554077, -0.02718653343617916, -0.05892984941601753, -0.0652206689119339, -0.022545067593455315, -0.00...
0.002194
[`request.getHeader()`][] may return non-string values. However, the non-string values will be converted to strings for network transmission. ```js request.setHeader('Content-Type', 'application/json'); ``` or ```js request.setHeader('Cookie', ['type=ninja', 'language=javascript']); ``` When the value is a string an ex...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.013539220206439495, 0.08437483757734299, -0.021839845925569534, -0.029469266533851624, -0.011638753116130829, -0.006569246295839548, 0.03756394609808922, 0.067470483481884, 0.04168941453099251, -0.03744294494390488, -0.038252025842666626, -0.05665801838040352, 0.0023459973745048046, 0.0...
0.008078
\* `request` {http.IncomingMessage} \* `response` {http.ServerResponse} Emitted each time a request with an HTTP `Expect: 100-continue` is received. If this event is not listened for, the server will automatically respond with a `100 Continue` as appropriate. Handling this event involves calling [`response.writeContinu...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.06647751480340958, 0.022203512489795685, 0.040281083434820175, 0.024992741644382477, -0.009212945587933064, -0.13903914391994476, 0.02607598342001438, -0.022376777604222298, 0.08145086467266083, 0.05732997879385948, -0.0427054688334465, 0.002798381494358182, 0.01977803371846676, 0.01812...
0.082855
If this event is not listened for, then clients requesting a `CONNECT` method will have their connections closed. This event is guaranteed to be passed an instance of the {net.Socket} class, a subclass of {stream.Duplex}, unless the user specifies a socket type other than {net.Socket}. After this event is emitted, the ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.07750675827264786, 0.006513556465506554, 0.0008942258427850902, 0.014387874864041805, -0.05984901636838913, -0.02124202251434326, 0.07598322629928589, -0.016792723909020424, 0.09021572768688202, 0.01584877260029316, -0.023830747231841087, 0.0886383205652237, -0.03253375366330147, 0.0194...
0.121295
stream. The stream argument will typically be the {net.Socket} instance used by the request, but in some cases (such as with a request body) it may be a duplex stream. If required, you can access the raw connection underlying the request via [`request.socket`][], which is guaranteed to be an instance of {net.Socket} un...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.09366650879383087, 0.03601900488138199, -0.041485030204057693, 0.020932797342538834, 0.01414775475859642, -0.05314711853861809, -0.0205090269446373, 0.013676367700099945, 0.06244492530822754, -0.01164955273270607, -0.08074622601270676, 0.07838721573352814, -0.0767679512500763, -0.015021...
0.109411
without a reverse proxy in front. ### `server.listen()` Starts the HTTP server listening for connections. This method is identical to [`server.listen()`][] from [`net.Server`][]. ### `server.listening` \* Type: {boolean} Indicates whether or not the server is listening for connections. ### `server.maxHeadersCount` \* T...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.0546642504632473, 0.04406806826591492, -0.02789594605565071, -0.009542307816445827, -0.08459696173667908, -0.08835890144109726, -0.02182014100253582, -0.01427588053047657, 0.018351327627897263, 0.02125709317624569, -0.07446681708097458, 0.06988595426082611, 0.02835948020219803, -0.04831...
0.077797
### `server[Symbol.asyncDispose]()` Calls [`server.close()`][] and returns a promise that fulfills when the server has closed. ## Class: `http.ServerResponse` \* Extends: {http.OutgoingMessage} This object is created internally by an HTTP server, not by the user. It is passed as the second parameter to the [`'request'`...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.12192866951227188, 0.046142853796482086, 0.045478396117687225, 0.05838277190923691, 0.07458765804767609, -0.09794866293668747, 0.02763303555548191, -0.018810022622346878, 0.08059333264827728, 0.012149209156632423, -0.026652473956346512, 0.03364194929599762, -0.04893921688199043, -0.0386...
0.112692
`Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others are not defined and \_will not work\_. ```js response.setHeader('Foo', 'bar'); response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); const headers = response.getHeaders(); // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.08993682265281677, 0.0897287055850029, 0.014169178903102875, -0.01736423932015896, -0.02588641457259655, -0.025255732238292694, 0.06934460252523422, 0.07890228182077408, -0.021751731634140015, -0.02397932857275009, -0.05390916392207146, -0.052076246589422226, -0.017583530396223068, 0.01...
-0
${ip} and your source port is ${port}.`); }).listen(3000); ``` ```cjs const http = require('node:http'); const server = http.createServer((req, res) => { const ip = res.socket.remoteAddress; const port = res.socket.remotePort; res.end(`Your IP address is ${ip} and your source port is ${port}.`); }).listen(3000); ``` Th...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.09541773051023483, 0.0494840033352375, -0.01315741240978241, 0.0000460881128674373, -0.032970163971185684, -0.01335611380636692, -0.025398794561624527, 0.01564791426062584, 0.030214820057153702, 0.026617152616381645, -0.04876776784658432, 0.025720791891217232, -0.04718974977731705, -0.0...
0.040809
data was queued in user memory. `'drain'` will be emitted when the buffer is free again. ### `response.writeContinue()` Sends an HTTP/1.1 100 Continue message to the client, indicating that the request body should be sent. See the [`'checkContinue'`][] event on `Server`. ### `response.writeEarlyHints(hints[, callback])...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.06487731635570526, 0.04769974574446678, 0.0347009040415287, 0.13753736019134521, 0.000023931412215461023, -0.06099623814225197, 0.034951381385326385, 0.03024817258119583, 0.11043742299079895, -0.019846811890602112, -0.037218526005744934, 0.10830610245466232, -0.05140935257077217, -0.059...
0.107153
client. This is a generic equivalent of [`response.writeContinue()`][], [`response.writeProcessing()`][] and [`response.writeEarlyHints()`][], and can be called multiple times before the final response. After the final response headers have been sent (via [`response.writeHead()`][] or an implicit header), calling this ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.08190752565860748, 0.09301146864891052, 0.04758268594741821, 0.03720276802778244, 0.00969816092401743, -0.0995481014251709, 0.02457982301712036, 0.020045723766088486, 0.09548027813434601, 0.027862701565027237, -0.0664638876914978, 0.053473711013793945, -0.016722919419407845, 0.002839948...
0.091576
using the `in` operator. ```js // Prints something like: // // { 'user-agent': ['curl/7.22.0'], // host: ['127.0.0.1:8000'], // accept: ['\*/\*'] } console.log(request.headersDistinct); ``` ### `message.httpVersion` \* Type: {string} In case of server request, the HTTP version sent by the client. In the case of client ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.017971068620681763, 0.08357943594455719, -0.025651486590504646, -0.008452645502984524, -0.005878598429262638, -0.08471453934907913, -0.017909012734889984, -0.005810985341668129, 0.05672160163521767, 0.009559400379657745, -0.012021871283650398, 0.031784288585186005, -0.010011707432568073, ...
0.067745
Request URL string. This contains only the URL that is present in the actual HTTP request. Take the following request: ```http GET /status?name=ryan HTTP/1.1 Accept: text/plain ``` To parse the URL into its parts: ```js new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); ``` When `request.url` is `'/sta...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ 0.0034487308003008366, 0.09645864367485046, 0.02822316810488701, -0.05522054061293602, 0.034219495952129364, -0.0933782085776329, -0.04835882410407066, -0.017334509640932083, 0.09661461412906647, 0.05202827602624893, -0.04625833034515381, -0.009894303046166897, -0.05169176682829857, -0.001...
0.042417
`outgoingMessage.end()` is called or the first chunk of message data is written. It then tries to pack the headers and data into a single TCP packet. It is usually desired (it saves a TCP round-trip), but not when the first data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimi...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.03980746120214462, 0.10062452405691147, 0.06369433552026749, 0.030473722144961357, 0.014214964583516121, -0.13576559722423553, 0.038348786532878876, -0.01104758307337761, 0.04550907760858536, 0.006559782661497593, -0.04491202533245087, -0.0032545793801546097, 0.0049698613584041595, -0.0...
0.06733
the underlying socket. Usually, users will not want to access this property. After calling `outgoingMessage.end()`, this property will be nulled. ### `outgoingMessage.uncork()` See [`writable.uncork()`][] ### `outgoingMessage.writableCorked` \* Type: {number} The number of times `outgoingMessage.cork()` has been called...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ 0.003231232287362218, 0.028007276356220245, -0.05460339039564133, 0.058510322123765945, -0.006821915507316589, -0.11706622689962387, 0.08365195244550705, 0.011698403395712376, 0.012384697794914246, -0.005239877384155989, 0.0005760159692727029, 0.021166158840060234, -0.036040592938661575, -...
0.02814
socket. \*\*Default:\*\* `0`. \* `keepAliveTimeout`: The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. See [`server.keepAliveTimeout`][] for more information. \*\*Default:\*\* `5000`. \* `maxH...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.08389104902744293, 0.0739923045039177, -0.03868826851248741, 0.05398731678724289, -0.05183500796556473, -0.09651122242212296, -0.006942609325051308, -0.04406275972723961, 0.05043816566467285, 0.0006304025300778449, -0.045578885823488235, 0.049308616667985916, 0.003135073697194457, -0.06...
0.179357
without bodies, Node.js provides this convenience method. The only difference between this method and [`http.request()`][] is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to consume the response data for reasons stated in [`http.ClientRequest`][] section. Th...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.055984675884246826, 0.1236894279718399, 0.03807699307799339, 0.011486672796308994, -0.019012942910194397, -0.08626991510391235, -0.023299816995859146, 0.04305008798837662, 0.05969416722655296, 0.0285724475979805, -0.04357851296663284, 0.06862019002437592, -0.04627520963549614, -0.011844...
0.088562
a limited set of non-ASCII characters in header values, aligning with the [Fetch specification](https://fetch.spec.whatwg.org/). \* `'insecure'`: Disables all header value validation (equivalent to `insecureHTTPParser: true`). Cannot be used together with `insecureHTTPParser`. \*\*Default:\*\* `'strict'`. \* `insecureH...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.07899197190999985, 0.11042089760303497, -0.019377272576093674, 0.024170974269509315, 0.02307990938425064, -0.07030703872442245, 0.012652281671762466, -0.03281906247138977, 0.004794704262167215, -0.016895094886422157, 0.0030540572479367256, -0.09880224615335464, 0.09500576555728912, 0.02...
-0.011604
() => { console.log('No more data in response.'); }); }); req.on('error', (e) => { console.error(`problem with request: ${e.message}`); }); // Write data to request body req.write(postData); req.end(); ``` ```cjs const http = require('node:http'); const postData = JSON.stringify({ 'msg': 'Hello World!', }); const optio...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.016711024567484856, 0.07259472459554672, 0.016157181933522224, -0.0023371907882392406, -0.03734676539897919, -0.06346714496612549, -0.06497692316770554, 0.06167491152882576, 0.01431675162166357, 0.028432372957468033, -0.0021362826228141785, -0.003752959193661809, -0.04082673043012619, -...
-0.012425
emitted in the following order: \* `'socket'` \* (`req.destroy()` called here) \* `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called \* `'close'` If `req.destroy()` is called after the response is received, the following events will...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.04944111406803131, 0.003966602496802807, 0.03255505859851837, 0.051612209528684616, -0.0016638697125017643, -0.08944088220596313, 0.008462939411401749, -0.01088445819914341, 0.13120032846927643, 0.06041810289025307, 0.012140637263655663, 0.0449313148856163, -0.03507472574710846, 0.00351...
0.124042
headers. Examples: ```mjs import { validateHeaderValue } from 'node:http'; try { validateHeaderValue('x-my-header', undefined); } catch (err) { console.error(err instanceof TypeError); // --> true console.error(err.code === 'ERR\_HTTP\_INVALID\_HEADER\_VALUE'); // --> true console.error(err.message); // --> 'Invalid va...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.057843077927827835, 0.09363729506731033, 0.04547327384352684, -0.04692433774471283, 0.05311916023492813, -0.004214572254568338, -0.00425872253254056, 0.06703830510377884, 0.031046956777572632, -0.014635098166763783, 0.0002068580943159759, -0.08083955198526382, 0.061700526624917984, -0.0...
0.018792
`192.168.1.100` - Exact IP address match \* `192.168.1.1-192.168.1.100` - IP address range \* `example.com:8080` - Hostname with specific port Multiple entries should be separated by commas. ### Example To start a Node.js process with proxy support enabled for all requests sent through the default global agent, either ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.039594996720552444, 0.030551454052329063, 0.017848195508122444, -0.07453831285238266, -0.049363650381565094, -0.05610115826129913, -0.02895733155310154, 0.0059861065819859505, -0.022697174921631813, 0.030104894191026688, -0.08024653792381287, 0.051710113883018494, -0.004803328309208155, ...
-0.046292
[`message.trailers`]: #messagetrailers [`net.Server.close()`]: net.md#serverclosecallback [`net.Server`]: net.md#class-netserver [`net.Socket`]: net.md#class-netsocket [`net.createConnection()`]: net.md#netcreateconnectionoptions-connectlistener [`new URL()`]: url.md#new-urlinput-base [`outgoingMessage.setHeader(name, ...
https://github.com/nodejs/node/blob/main/doc/api/http.md
main
nodejs
[ -0.011086595244705677, -0.007780440151691437, -0.00926005095243454, -0.010104420594871044, -0.000521899841260165, -0.06296096742153168, 0.015571084804832935, -0.02780810557305813, 0.03802467882633209, 0.05515327677130699, -0.03853045031428337, 0.04991955682635307, -0.01356882881373167, -0....
0.038773
# File system > Stability: 2 - Stable The `node:fs` module enables interacting with the file system in a way modeled on standard POSIX functions. To use the promise-based APIs: ```mjs import \* as fs from 'node:fs/promises'; ``` ```cjs const fs = require('node:fs/promises'); ``` To use the callback and sync APIs: ```mj...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ -0.15448524057865143, 0.025174366310238838, -0.03009718470275402, 0.058856893330812454, 0.05172360688447952, -0.06640716642141342, -0.04353522136807442, 0.11084537953138351, 0.08615563809871674, 0.022520318627357483, -0.00513014430180192, 0.1023981049656868, -0.01369669009000063, -0.028897...
0.207335
`signal` {AbortSignal|undefined} allows aborting an in-progress writeFile. \*\*Default:\*\* `undefined` \* Returns: {Promise} Fulfills with `undefined` upon success. Alias of [`filehandle.writeFile()`][]. When operating on file handles, the mode cannot be changed from what it was set to with [`fsPromises.open()`][]. Th...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ -0.07021939009428024, 0.02681177854537964, -0.0067336964420974255, 0.04724578559398651, 0.029670536518096924, -0.06783460825681686, 0.029100388288497925, 0.06669870764017105, 0.0549548864364624, 0.010445459745824337, 0.05509376525878906, 0.07472683489322662, -0.06094291806221008, -0.006974...
0.144234
`false`. \* Returns: {fs.WriteStream} `options` may also include a `start` option to allow writing data at some position past the beginning of the file, allowed values are in the \[0, [`Number.MAX\_SAFE\_INTEGER`][]] range. Modifying a file rather than replacing it may require the `flags` `open` option to be set to `r+...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ -0.025757109746336937, 0.04321364313364029, -0.06814727187156677, 0.04336577281355858, 0.016103997826576233, -0.014549074694514275, 0.002184309996664524, 0.0653756707906723, 0.03272107243537903, 0.060652077198028564, -0.04478298872709274, 0.0468355193734169, -0.04204094782471657, 0.0028904...
0.085619
via [`stream/iter pullSync()`][]. \* `options` {Object} \* `autoClose` {boolean} Close the file handle when the stream ends. \*\*Default:\*\* `false`. \* `start` {number} Byte offset to begin reading from. When specified, reads use explicit positioning. \*\*Default:\*\* current file position. \* `limit` {number} Maximu...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ -0.051292937248945236, 0.04197577014565468, -0.04735578969120979, -0.01716446317732334, -0.03356336057186127, -0.06188244745135307, 0.01820008084177971, 0.07227014750242233, 0.0071442448534071445, 0.04061819612979889, -0.031003782525658607, 0.08043643832206726, -0.07843450456857681, -0.048...
0.118746
The number of bytes read \* `buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument. Reads data from the file and stores that in the given buffer. If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero. #### `filehandle.read(buffer[, optio...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ 0.0216801930218935, -0.00008903039270080626, -0.07703940570354462, -0.006696031428873539, -0.13792118430137634, -0.05511279031634331, 0.06541621685028076, 0.09514495730400085, -0.01783597283065319, 0.019711196422576904, -0.05993635952472687, 0.09814750403165817, -0.010477419011294842, -0.0...
0.09755
} = require('node:fs/promises'); (async () => { const file = await open('./some/file/to/read'); for await (const line of file.readLines()) { console.log(line); } })(); ``` #### `filehandle.readv(buffers[, position])` \* `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} \* `position` {integer|null} The offset from the beg...
https://github.com/nodejs/node/blob/main/doc/api/fs.md
main
nodejs
[ -0.036966681480407715, 0.014179122634232044, -0.040513355284929276, 0.03751483932137489, -0.06314317137002945, -0.010329456068575382, 0.04011804237961769, 0.09307441115379333, 0.02443201094865799, -0.012391258962452412, -0.07173164188861847, 0.08564545959234238, -0.031385358422994614, -0.0...
0.040674