npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@elastic/esql-definitions

v4.33.0

Published

Shared definitions for the ES|QL language (commands, functions, operators).

Readme

@elastic/esql-definitions

Shared definitions for the ES|QL and PromQL languages — commands, functions, operators, settings, and their metadata.

Install

npm install @elastic/esql-definitions

Usage

The main entry holds the hand-maintained name lists and the definition TypeScript types:

import { commandsNames, functionNames } from '@elastic/esql-definitions';
import type { FunctionDefinition } from '@elastic/esql-definitions';

The full definition metadata (synced from the elasticsearch repo) is exposed via subpath exports:

import { commandDefinitions } from '@elastic/esql-definitions/commands';
import { functionDefinitions } from '@elastic/esql-definitions/functions';
import { operatorDefinitions } from '@elastic/esql-definitions/operators';
import { settingDefinitions } from '@elastic/esql-definitions/settings';
import { inlineCasts } from '@elastic/esql-definitions/inline-cast';
import { timeSeriesAggregates } from '@elastic/esql-definitions/time-series-aggregates';
import { promqlFunctionDefinitions } from '@elastic/esql-definitions/promql-functions';
import { promqlOperatorDefinitions } from '@elastic/esql-definitions/promql-operators';

timeSeriesAggregates maps each field type to the implicit aggregate ES|QL inserts for a bare column in a time-series STATS, and to the type the outer aggregate sees. counter_double becomes double, counter_integer becomes integer, counter_long becomes long, and text becomes keyword. The other entries (double, keyword, exponential_histogram, …) keep the same type.

timeSeriesAggregates.counter_double;
// { function: 'last_over_time', returnType: 'double' }

Documentation (descriptions, examples, notes, parameter docs) is split into parallel docs modules keyed by definition name:

import { functionDocs } from '@elastic/esql-definitions/function-docs';
import { operatorDocs } from '@elastic/esql-definitions/operator-docs';
import { promqlFunctionDocs } from '@elastic/esql-definitions/promql-function-docs';
import { promqlOperatorDocs } from '@elastic/esql-definitions/promql-operator-docs';

functionDocs.bucket.description;
functionDocs.bucket.params?.field; // ES|QL param docs live here, not in signatures

One asymmetry to know about: ES|QL parameter descriptions are identical across all signatures of a definition, so they live in docs.params keyed by parameter name. PromQL parameter descriptions vary per signature (e.g. lhs is "Instant vector." in one overload and "Scalar." in another).

How the definitions are synced

  • elasticsearch/ — the machine-readable language definitions that Elasticsearch publishes for Kibana, copied verbatim from docs/reference/query-languages/{esql,promql}/kibana/generated/ in the elasticsearch repo by the grammar sync CI job (.buildkite/scripts/esql_grammar_sync.sh).
  • src/generated/ — TypeScript modules generated from elasticsearch/ by scripts/generate.ts.
    pnpm --filter @elastic/esql-definitions generate
  • src/definition_types.ts — hand-written TypeScript shapes of the raw JSON, used by the codegen script and exported from the main entry.

Note: the synced commands/ data does not cover all commands (e.g. FROM, ROW, JOIN variants are missing upstream), so the hand-maintained commandsNames and functionNames lists remain the source of truth for name lists.