AWK functions in TypeScript

TypeScript implementations of 10 AWK standard library functions across 1 module. Each function is individually importable and tree-shakeable.

builtin

We have 10 AWK functions so far - help us add more

Got a rainy Sunday afternoon and a taste for a porting puzzle?

  • Get inspiration from the GNU AWK manual.
  • Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.

We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.

Upstream Surface Inventory 10/42 shipped · 29 next 24%

Locutus tracks 1 upstream namespace for AWK and sorts them into what is already shipped, what we still want, what we intentionally keep, and what still needs a decision.

24% catalog shipped
Shipped Next Explicit non-goals
builtin 24%
Tracked namespaces 1
Shipped 10/42
Next to port 29
Explicit non-goals 3

GNU AWK built-ins

GNU AWK 5.3 · Catalog source: manual inventory https://www.gnu.org/software/gawk/manual/

26% shipped
10/39 shipped 29 next 3 explicit non-goals
Shipped (10)

Next

AWK built-ins are mostly pure text and numeric helpers with a good plain-value fit.

  • and
  • asort
  • asorti
  • atan2
  • bindtextdomain
  • compl
  • dcgettext
  • dcngettext
  • fflush
  • gensub
  • gsub
  • index
  • isarray
  • lshift
  • match
  • mkbool
  • mktime
  • or
  • patsplit
  • rand
  • rshift
  • split
  • sprintf
  • strftime
  • strtonum
  • sub
  • systime
  • typeof
  • xor
Explicit non-goals (3)
  • close Skip File and pipe handle lifecycle is outside Locutus' value-only model.
  • srand Skip Global RNG seeding mutates ambient runtime state.
  • system Skip Shell execution is outside Locutus' portability scope.