Meta tags:
description= The best bash parser in JavaScript. Fast, complete, typed. - webpro-nl/unbash;
Headings (most frequently used words):
unbash, navigation, syntax, vs, repository, about, files, bash, footer, topics, resources, stars, watchers, forks, menu, latest, commit, history, folders, and, install, when, to, use, supported, unsupported, usage, tree, sitter, sh, parser, benchmarks, size, playgrounds, license, releases, contributors, languages, visit, print,
Text of the page (most frequently used words):
and (41), unbash (28), bash (27), #parser (22), the (19), github (15), ast (15), syntax (14), for (14), #source (12), node (11), json (11), parse (10), you (9), tree (9), shell (9), with (9), best (8), code (8), script (7), typed (7), from (7), commands (7), errors (7), type (7), build (7), repository (6), license (6), sitter (6), pnpm (6), nested (6), that (5), not (5), security (5), readme (5), typescript (5), complete (5), wasm (5), test (5), partial (5), dependency (5), see (5), support (5), all (5), import (5), your (5), navigation (4), forks (4), stars (4), 147 (4), isc (4), javascript (4), fast (4), statichost (4), process (4), command (4), substitutions (4), structured (4), expansions (4), effort (4), error (4), zero (4), its (4), input (4), word (4), cat (4), then (4), const (4), callback (4), visit (4), such (4), use (4), files (4), another (4), tsconfig (4), yaml (4), signed (4), copilot (4), docs (3), community (3), resources (3), library (3), about (3), each (3), run (3), one (3), trees (3), install (3), bench (3), using (3), 12x (3), 99x (3), file (3), recovery (3), only (3), provides (3), posix (3), fork (3), parts (3), direct (3), positions (3), parsing (3), need (3), package (3), when (3), print (3), does (3), mktemp (3), foreachchild (3), positioned (3), supported (3), scripts (3), more (3), commit (3), actions (3), quality (3), tab (3), window (3), refresh (3), session (3), reload (3), sign (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), status (2), footer (2), languages (2), releases (2), report (2), watching (2), watchers (2), custom (2), properties (2), activity (2), topics (2), unba (2), page (2), case (2), runs (2), isolated (2), ericcornelissen (2), native (2), advanced (2), per (2), herestrings (2), substitution (2), assignments (2), extglob (2), redirects (2), coproc (2), nodes (2), parameter (2), arithmetic (2), expressions (2), preserves (2), collects (2), api (2), also (2), gaps (2), covered (2), malformed (2), incomplete (2), lazy (2), recursively (2), parsed (2), synchronous (2), without (2), mksh (2), bats (2), zsh (2), cst (2), tokens (2), result (2), printer (2), child (2), while (2), echo (2), home (2), end (2), pos (2), syntaxnode (2), including (2), call (2), skip (2), are (2), open (2), compoundlist (2), returns (2), what (2), pipelines (2), generated (2), etc (2), pasted (2), analysis (2), items (2), yml (2), workspace (2), lock (2), release (2), oxfmtrc (2), gitignore (2), src (2), playground (2), fixtures (2), workflows (2), last (2), message (2), name (2), 206 (2), commits (2), latest (2), menu (2), must (2), star (2), settings (2), insights (2), projects (2), webpro (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), learn (2), business (2), fixes (2), products (2), secret (2), can, perform, action, this, time, share, personal, information, manage, cookies, contact, privacy, terms, 2026, inc, contributors, explorer, dev, playgrounds, bundle, 100k, minified, 26k, gzipped, size, used, 500ms, warmup, before, timing, least, second, iterations, measurement, results, consume, top, level, counts, timings, include, disposal, returned, fresh, reversed, order, repeats, suite, 313x, 287x, 1264x, 1838x, 15x, 13x, 16x, 10x, 19x, 114, 06x, 03x, 98x, 116, 04x, 103, 00x, 121, 102, large, 970kib, medium, 150kib, 9kib, short, 1kib, throughput, higher, better, median, p75, iteration, times, workload, apple, pro, 32gb, parentheses, show, speed, relative, benchmarks, style, array, fallthrough, descriptor, variable, select, treats, ordinary, subshells, esm, architecture, mode, rejects, specific, maintenance, now, archived, provide, asts, editor, user, smaller, friendly, loading, mature, configurable, formatting, pretty, printing, experimental, wrapper, around, robust, highly, recommended, mvdan, expression, addon, runtime, initialization, query, layer, executable, instead, grammar, missing, output, preserving, punctuation, incremental, right, choice, basic, opinionated, preserve, whitespace, comments, except, shebang, receives, return, value, ignored, reports, own, check, them, visiting, shapes, fields, migrating, slice, log, console, void, function, calls, once, which, resolve, first, access, recurse, descend, leave, subtree, unresolved, based, utf, unit, offsets, forming, half, ranges, into, full, clause, statement, usage, citty, yargs, parseargs, string, argv, tolerant, excessively, recovers, where, possible, detects, other, ksh93, fish, powershell, csh, may, produce, misleading, cmd, exe, unsupported, gate, version, accepts, older, reject, currently, non, interactive, defaults, patterns, includes, control, flows, compound, statements, heredocs, parses, gnu, explanations, visualizations, previews, conditions, attach, diagnostics, portability, checker, convert, curl, collect, executables, literal, configuration, references, classify, permission, prompts, allowlists, audit, findings, example, cases, embedded, format, inspect, structure, executing, npm, view, date, folders, history, tags, branches, main, change, notification, notifications, public, pull, requests, issues, dismiss, alert, switched, accounts, out, appearance, search, pricing, event, talks, workshops, next, partners, company, forum, events, webinars, blog, resource, connect, premium, add, ons, trust, why, evaluate, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, review, collaboration, platform, content,
Text of the page (random words):
github webpro nl unbash the best bash parser in javascript fast complete typed github skip to content navigation menu sign in products platform github repository hosting code review and collaboration copilot ai coding agent for tasks projects and automated work build ship actions ci cd and automation code quality quality analysis fixes and enforcement codespaces cloud development environments secure code security vulnerability detection and remediation secret protection secret scanning and leak prevention all features developers learn documentation training certifications build build with copilot customize copilot integrations explore trending repos github sponsors developer articles changelog changelog your source for the latest features improvements and fixes across github products all in one place businesses by stage enterprises team startups nonprofits by industry healthcare financial services manufacturing government see all industries evaluate github why github customer stories business insights trust center add ons github advanced security enterprise grade code security copilot for business enterprise grade ai features premium support enterprise grade 24 7 support resources learn connect documentation resource center blog events webinars community forum customer stories integrations support customer support training github status company about partners changelog github universe github universe the event for developers by developers talks workshops and what s next for github pricing search sign in sign up appearance settings you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session you switched accounts on another tab or window reload to refresh your session dismiss alert message webpro nl unbash repository navigation code issues 2 2 pull requests 3 3 actions projects security and quality insights more items unbash public notifications you must be signed in to change notification settings fork 9 9 star 147 147 you must be signed in to star a repository about the best bash parser in javascript fast complete typed unba sh topics ast bash parser parser library shell shell parser shell script syntax tree typescript resources readme isc license activity custom properties stars 147 stars watchers 2 watching forks 9 forks report repository main branches tags go to file code open more actions menu latest commit history 206 commits 206 commits folders and files name name last commit message last commit date github workflows github workflows bench bench docs docs fixtures fixtures playground playground src src test test gitignore gitignore oxfmtrc json oxfmtrc json release it json release it json license license readme md readme md package json package json pnpm lock yaml pnpm lock yaml pnpm workspace yaml pnpm workspace yaml statichost yml statichost yml tsconfig build json tsconfig build json tsconfig json tsconfig json view all files repository files navigation readme isc license more items unbash the best bash parser in javascript fast complete typed install npm install unbash when to use unbash use unbash when your input is bash source a pasted command a complete script or shell source embedded in another format and you need to inspect its structure without executing it it returns a typed source positioned ast example use cases classify scripts for permission prompts allowlists or audit findings collect executables and literal file configuration and dependency references import or convert commands such as curl to code build a shell portability checker using parse errors and ast analysis attach diagnostics to generated or pasted bash using source positioned errors and partial trees build explanations visualizations or structured previews of pipelines conditions expansions and nested commands supported syntax unbash parses gnu bash currently at bash v5 3 with non interactive defaults including extglob patterns supported syntax includes commands control flows pipelines redirects assignments compound statements parameter and word expansions process and nested substitutions coproc heredocs herestrings nested and generated syntax etc etc posix sh scripts parse as bash unbash does not gate syntax by version i e it accepts syntax that older bash releases reject unsupported syntax other shell languages are not supported zsh ksh93 mksh fish powershell cmd exe csh bats test files such scripts may produce errors or a misleading tree unbash is a tolerant parser for malformed incomplete or excessively nested input it recovers where possible and returns a best effort partial ast with source positioned errors for what it detects while parsing to parse process argv string use node js parseargs or a library such as yargs or citty usage import parse from unbash const ast parse if f 1 then cat 1 fi result type script commands type statement command type if clause type compoundlist commands f 1 then type compoundlist commands cat 1 see the full ast at unbash statichost page input if f positions are zero based utf 16 code unit offsets forming half open pos end ranges into the source visit foreachchild node callback calls the callback once for each direct child including word parts such as expansions and the script of a substitution which resolve on first access it does not recurse call it from the callback to descend or skip the call to leave a subtree unresolved import foreachchild parse type syntaxnode from unbash const source echo home mktemp d function visit node syntaxnode void if node type command console log source slice node pos node end foreachchild node visit visit parse source echo home mktemp d mktemp d the callback receives only the child and its return value is ignored a nested script reports its own errors so check them while visiting see migrating from v5 for the node shapes and lazy fields print basic opinionated printer does not preserve whitespace or comments except shebang import parse from unbash import print from unbash printer const ast parse if f 1 then cat 1 fi const script print ast result if f 1 then cat 1 fi unbash vs tree sitter bash tree sitter bash is the right choice when you need incremental parsing cst output preserving all tokens and punctuation error recovery with error nodes and missing tokens unbash provides a typed executable syntax ast instead of a grammar cst a synchronous zero dependency typescript package with no native addon wasm runtime parser initialization or query layer structured word parts arithmetic and test expression trees recursively parsed substitutions and direct source positions best effort error recovery that preserves a partial ast and collects errors also see tree sitter bash gaps covered by unbash unbash vs sh syntax sh syntax is a wasm wrapper around the robust mvdan sh go parser it is highly recommended if you need support for bash posix sh mksh bats and experimental zsh parsing mature configurable formatting and pretty printing unbash provides a zero dependency synchronous typescript api without wasm loading a smaller json friendly bash ast with lazy structured word parts recursively parsed substitutions and direct source positions best effort partial asts for malformed or incomplete editor and user input also see sh syntax gaps covered by unbash unbash vs bash parser bash parser and its fork ericcornelissen bash parser community dependency maintenance fork ️ now archived provide a posix only mode that rejects bash specific syntax unbash provides a zero dependency architecture a typed typescript api esm only best effort error recovery that preserves a partial ast and collects errors structured ast nodes for parameter expansions arithmetic expressions and test expressions bash parser treats as ordinary commands and as nested subshells herestrings c style for select process substitution coproc array assignments extglob case fallthrough bash 5 3 command substitutions and variable file descriptor redirects benchmarks parse throughput in mb s higher is better median per run p75 iteration times from 11 isolated runs per parser and workload on apple m1 pro 32gb with node js 24 19 0 parentheses show speed relative to unbash v6 parser short 1 1kib advanced 0 9kib medium 150kib large 970kib unbash v6 79 2 72 7 102 6 121 2 unbash v5 79 5 1 00x 73 3 0 99x 103 6 0 99x 116 6 1 04x unbash v4 80 8 0 98x 73 5 0 99x 99 8 1 03x 114 5 1 06x tree sitter bash native 4 23 19x 5 95 12x 15 04 7x 11 88 10x tree sitter bash wasm 5 08 16x 5 47 13x 8 50 12x 8 12 15x sh syntax 0 04 1838x 0 06 1264x 8 80 12x 14 32 8x bash parser 0 28 287x n a n a n a ericcornelissen bash parser 0 25 313x n a n a n a run the isolated suite using node js 24 2 pnpm install pnpm bench each run used 500ms of warmup one v8 gc before timing and at least one second and 64 iterations of measurement results consume top level node counts wasm tree sitter timings include disposal of returned trees each case runs in a fresh process with reversed order on repeats size the parser bundle is 100k minified and 26k gzipped playgrounds unbash statichost page ast explorer dev license isc about the best bash parser in javascript fast complete typed unba sh topics ast bash parser parser library shell shell parser shell script syntax tree typescript resources readme isc license activity custom properties stars 147 stars watchers 2 watching forks 9 forks report repository releases contributors languages footer 2026 github inc footer navigation terms privacy security status community docs contact manage cookies do not share my personal information you can t perform that action at this time
|