🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@asterql/formatter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asterql/formatter

Deterministic formatter and canonical AST serializer for AsterQL.

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
1
Created
Source

@asterql/formatter

npm install @asterql/formatter

Deterministic formatting and canonical AST serialization for AsterQL.

import { canonicalize, format } from "@asterql/formatter";

format('*.posts[status="published"]|sort(-date)[:10] {id,title}');
// *.posts[status == "published"]
// | sort(-date)[:10] {id, title}

canonicalize('*.posts[status="published"]');
// Span-free JSON over the parsed AST.

API

format(queryOrAst, { printWidth?: number }): string
canonicalAst(queryOrAst): CanonicalAst
canonicalize(queryOrAst): string
serializeCanonicalAst(queryOrAst): string

Formatting is parse-backed and idempotent. Canonicalization is intentionally separate from formatting so future view hashes do not depend on whitespace or stylistic source text.

Keywords

asterql

FAQs

Package last updated on 08 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts