0.0.10 • Published 2 years ago

zen-pipes v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

zen-pipes

TLDR: Humane command-line pipe functions.

cat package.json | zen trim each line  | zen add line numbers > o.txt

Challenges

Challenge 1 - Understand what the sequence below does. Hopefully its self-explanatory (that's the goal of zen).

zen new uuid  | zen uppercase  | zen remove hyphens

Challenge 2 - Perform the above with traditional command-line tooling (ideally, without referencing the manual)

...

How did it go? Did you manage it? Send your answers in to: its_painful_noone_wants_to_look_at_that@kthnxbai.com

Purpose

Infrastructure is moving to code (Yay!) - but 'code' needs to be readable, and when your build needs to do a little impromptu data maniupulation - traditional commands are not that readable - IE Can you spot the fake in: bc, renice, xy, mknod, fsck?

(And we've not even mentioned the switches/flags of those commands. If you're lucky there are --long form flags but the -s short form is normally used for extra compactness - which do you use?)

There's a tension here - command-line tools have short names because they are designed to be typed... a lot; and as you're typing them a lot, you KNOW what they mean - so short names win. However in a build script, we only need to type the commands once, but we want them to be readable for the future.

Zen keeps all the composable goodness that is the hallmark of the unix command line, but aims to be fully readable and transparent.

TODO 

Stream data through rather than read-all-in, write-all-out.
Current approach should be fine for most uses, but large files / data may not fit in memory.


Formalise injection attack protection (each language keyword must come from a separate 
command line argument - ensuring the meaning of a command can't be changed with parameters).
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago