Shortcuts

Abbreviations for common operations to write more concise expressions.

Usage

bash
echo '[1, 2, 3]' | 1ls '.mp(x => x * 2)'
# Output: [2, 4, 6]

Available Shortcuts

ShortcutExpands To
.mp.map
.flt.filter
.rd.reduce
.fn.find
.fni.findIndex
.sm.some
.ev.every
.sl.slice
.jn.join
.rv.reverse
.st.sort
.fl.flat
.fm.flatMap
hdhead
lstlast
tltail
tktake
drpdrop
unquniq
fltnflatten
chnkchunk
cmpctcompact
kskeys
pkpick
omtomit
mrgmerge
dMrgdeepMerge
frPrsfromPairs
toPrstoPairs
hshas
plkpluck
grpBygroupBy
srtBysortBy
flrfloor
clceil
rndround
splsplit
stwstartswith
edwendswith
ltrmltrimstr
rtrmrtrimstr
tstrtostring
tnumtonumber
typtype
cntcount
empisEmpty
nilisNil
ctnscontains
pthpath
gpthgetpath
spthsetpath
recrecurse
selselect
dbgdebug
rngrange

CLI Commands

Show all shortcuts

bash
1ls --shortcuts

Expand a shortcut

bash
1ls --expand ".mp(x => x * 2)"
# Output: .map(x => x * 2)

Shorten an expression

bash
1ls --shorten ".map(x => x * 2)"
# Output: .mp(x => x * 2)