{"id":13479432,"url":"https://github.com/elastic/elasticsearch-js","last_synced_at":"2026-02-05T21:04:27.564Z","repository":{"id":9080136,"uuid":"10854028","full_name":"elastic/elasticsearch-js","owner":"elastic","description":"Official Elasticsearch client library for Node.js","archived":false,"fork":false,"pushed_at":"2025-09-02T16:38:03.000Z","size":31307,"stargazers_count":5288,"open_issues_count":19,"forks_count":725,"subscribers_count":425,"default_branch":"main","last_synced_at":"2025-09-07T00:33:53.294Z","etag":null,"topics":["client","elasticsearch","javascript","nodejs","rest"],"latest_commit_sha":null,"homepage":"https://ela.st/js-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"firehol/netdata","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-06-21T22:27:36.000Z","updated_at":"2025-09-04T19:15:28.000Z","dependencies_parsed_at":"2023-09-28T18:01:17.690Z","dependency_job_id":"f9d7f760-d8c0-4873-a64c-1ebc9c435d93","html_url":"https://github.com/elastic/elasticsearch-js","commit_stats":{"total_commits":2061,"total_committers":161,"mean_commits":"12.801242236024844","dds":0.7331392527899079,"last_synced_commit":"58b457eedc4fd8b5a8045ef73c58a2db22769139"},"previous_names":["elasticsearch/elasticsearch-js"],"tags_count":113,"template":false,"template_full_name":null,"purl":"pkg:github/elastic/elasticsearch-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/elasticsearch-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-js/sbom","scorecard":{"id":371210,"data":{"date":"2025-08-11","repo":{"name":"github.com/elastic/elasticsearch-js","commit":"610e9da3c06a1ec0e99ef3ada8e2df0ac9d45ea7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.3,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 16 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 4/20 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'deployments' permission set to 'write': .github/workflows/docs-build.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/docs-build.yml:18","Info: found token with 'none' permissions: .github/workflows/docs-cleanup.yml:12","Warn: jobLevel 'deployments' permission set to 'write': .github/workflows/docs-cleanup.yml:14","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/npm-publish-unstable.yml:41","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/npm-publish.yml:12","Warn: no topLevel permission defined: .github/workflows/backport.yml:1","Warn: no topLevel permission defined: .github/workflows/docs-build.yml:1","Warn: no topLevel permission defined: .github/workflows/docs-cleanup.yml:1","Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish-unstable.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/stale.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/elastic/.github/SECURITY.md:1","Info: Found linked content: github.com/elastic/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/elastic/.github/SECURITY.md:1","Info: Found text in security policy: github.com/elastic/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during GetBranch(9.1): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/npm-publish-unstable.yml:35"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs-build.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/elastic/elasticsearch-js/docs-build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs-cleanup.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/elastic/elasticsearch-js/docs-cleanup.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .buildkite/Dockerfile:14","Warn: npmCommand not pinned by hash: .buildkite/Dockerfile-make:27","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:50","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:80","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish-unstable.yml:59","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish-unstable.yml:60","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish.yml:24","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish.yml:25","Info:  12 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   5 out of   7 third-party GitHubAction dependencies pinned","Info:   2 out of   2 containerImage dependencies pinned","Info:   0 out of   8 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T13:00:28.821Z","repository_id":9080136,"created_at":"2025-08-18T13:00:28.821Z","updated_at":"2025-08-18T13:00:28.821Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274357406,"owners_count":25270674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","elasticsearch","javascript","nodejs","rest"],"created_at":"2024-07-31T16:02:15.998Z","updated_at":"2026-02-05T21:04:24.316Z","avatar_url":"https://github.com/elastic.png","language":"TypeScript","readme":"\u003cimg align=\"right\" width=\"auto\" height=\"auto\" src=\"https://www.elastic.co/static-res/images/elastic-logo-200.png\"\u003e\n\n# Elasticsearch Node.js client\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://badge.buildkite.com/15e4246eb268ea78f6e10aa90bce38c1abb0a4489e79f5a0ac.svg)](https://buildkite.com/elastic/elasticsearch-javascript-client-integration-tests/builds?branch=main) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)\n\nThe official Node.js client for Elasticsearch.\n\n## Try Elasticsearch and Kibana locally\n\nIf you want to try Elasticsearch and Kibana locally, you can run the following command:\n\n```bash\ncurl -fsSL https://elastic.co/start-local | sh\n\n```\n\nThis will run Elasticsearch at http://localhost:9200 and Kibana at http://localhost:5601.\n\nMore information is available [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html).\n\nAlternatively, you can **[download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)** manually, or\n**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page) for a free trial of Elastic Cloud**.\n\n## Installation\n\nRefer to the [Installation section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_installation)\nof the getting started documentation.\n\n## Connecting\n\nRefer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_connecting)\nof the getting started documentation.\n\n## Compatibility\n\nThe Elasticsearch client is compatible with currently maintained JS versions.\n\nLanguage clients are forward compatible; meaning that clients support\ncommunicating with greater or equal minor versions of Elasticsearch without\nbreaking. It does not mean that the client automatically supports new features\nof newer Elasticsearch versions; it is only possible after a release of a new\nclient version. For example, a 8.12 client version won't automatically support\nthe new features of the 8.13 version of Elasticsearch, the 8.13 client version\nis required for that. Elasticsearch language clients are only backwards\ncompatible with default distributions and without guarantees made.\n\n| Elasticsearch Version | Elasticsearch-JS Branch |\n| --------------------- | ----------------------- |\n| main                  | main                    |\n| 9.x                   | 9.x                     |\n| 8.x                   | 8.x                     |\n| 7.x                   | 7.x                     |\n\n## Usage\n\n- [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_creating_an_index)\n- [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_indexing_documents)\n- [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_getting_documents)\n- [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_searching_documents)\n- [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_updating_documents)\n- [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_documents)\n- [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_an_index)\n\n### Node.js support\n\nNOTE: The minimum supported version of Node.js is `v20`.\n\nThe client versioning follows the Elastic Stack versioning, this means that\nmajor, minor, and patch releases are done following a precise schedule that\noften does not coincide with the [Node.js release](https://nodejs.org/en/about/releases/) times.\n\nTo avoid support insecure and unsupported versions of Node.js, the\nclient **will drop the support of EOL versions of Node.js between minor releases**.\nTypically, as soon as a Node.js version goes into EOL, the client will continue\nto support that version for at least another minor release. If you are using the client\nwith a version of Node.js that will be unsupported soon, you will see a warning\nin your logs (the client will start logging the warning with two minors in advance).\n\nUnless you are **always** using a supported version of Node.js,\nwe recommend defining the client dependency in your\n`package.json` with the `~` instead of `^`. In this way, you will lock the\ndependency on the minor release and not the major. (for example, `~7.10.0` instead\nof `^7.10.0`).\n\n| Node.js Version | Node.js EOL date | End of support      |\n| --------------- | ---------------- | ------------------- |\n| `8.x`           | `December 2019`  | `7.11` (early 2021) |\n| `10.x`          | `April 2021`     | `7.12` (mid 2021)   |\n| `12.x`          | `April 2022`     | `8.2` (early 2022)  |\n| `14.x`          | `April 2023`     | `8.8` (early 2023)  |\n| `16.x`          | `September 2023` | `8.11` (late 2023)  |\n| `18.x`          | `April 2025`     | `9.1` (mid 2025)    |\n\n#### Browser\n\n\u003e [!WARNING]\n\u003e There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.\n\u003e We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy).\n\n## Documentation\n\n- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)\n- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage)\n- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)\n- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)\n- [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication)\n- [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)\n- [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child.html)\n- [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)\n- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)\n- [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)\n- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)\n\n## Install multiple versions\n\nIf you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.\n\nThe command you must run to install different version of the client is:\n\n```sh\nnpm install \u003calias\u003e@npm:@elastic/elasticsearch@\u003cversion\u003e\n```\n\nSo for example if you need to install `7.x` and `6.x`, you will run:\n\n```sh\nnpm install es6@npm:@elastic/elasticsearch@6\nnpm install es7@npm:@elastic/elasticsearch@7\n```\n\nAnd your `package.json` will look like the following:\n\n```json\n\"dependencies\": {\n  \"es6\": \"npm:@elastic/elasticsearch@^6.7.0\",\n  \"es7\": \"npm:@elastic/elasticsearch@^7.0.0\"\n}\n```\n\nYou will require the packages from your code by using the alias you have defined.\n\n```js\nconst { Client: Client6 } = require('es6')\nconst { Client: Client7 } = require('es7')\n\nconst client6 = new Client6({\n  cloud: { id: '\u003ccloud-id\u003e' },\n  auth: { apiKey: 'base64EncodedKey' }\n})\nconst client7 = new Client7({\n  cloud: { id: '\u003ccloud-id\u003e' },\n  auth: { apiKey: 'base64EncodedKey' }\n})\n\nclient6.info().then(console.log, console.log)\nclient7.info().then(console.log, console.log)\n```\n\nFinally, if you want to install the client for the next version of Elasticsearch\n_(the one that lives in Elasticsearch’s main branch)_, you can use the following\ncommand:\n\n```sh\nnpm install esmain@github:elastic/elasticsearch-js\n```\n\n## License\n\nThis software is licensed under the [Apache License 2.0](./LICENSE).\n","funding_links":[],"categories":["TypeScript","Repository","Data Management \u0026 Processing","JavaScript","数据搜索引擎","Clients \u0026 SDKs"],"sub_categories":["Search Engine/Word Segmentation","Database \u0026 Cloud Management","资源传输下载"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Felasticsearch-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Felasticsearch-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Felasticsearch-js/lists"}