Our npm packages
IndieWeb Rule #3: make what you need.
IndieWeb Rule #4: use what you make.
Since 2015, we’ve been making npm packages for our projects and sharing them with the world.
Have a look, maybe you’ll find something useful for your next project!
They all process HTML and CSS. Our speciality is so-called scanerless parsing algorithm — we don’t parse and then work on AST and then render. We aim to work on the source code directly while traversing it as a string.
The idea is, if you don’t parse the HTML, you can support broken or mixed code. Unless you write your parser, it becomes a bottleneck — parser throws here and there, and you can do nothing about it.
It is vital to support broken code because this allows us to make broken code-fixing programs.
Also, we often aim to support the processing of HTML mixed with other, known or unknown, source code (typically, programming or templating languages).
Range Libraries Σ=13
We needed a way to compose multiple string amendment operations. We started to mark each operation as an array, for example,
[1, 5] means “delete from string index 1 to 5”.
If you wish to put something after deletion as well, it goes as the third element in the array.
All these packages process arrays of range arrays in various ways.
They process string inputs, which might be text, code or something else as long as it is of a string-type.
Usually, plain objects come from JSON files, and often they are deeply nested. The following libraries help us to traverse them, set and delete keys and compare objects.
Array-processing libraries deal with tasks like sorting, deletion or conversion to other structures.
AST Libraries Σ=12
AST stands for Abstract Syntax Tree, it’s a fancy name for nested output of a parser. Typically, it’s an array or a plain object with many layers of nested elements.
Lerna Libraries Σ=4
While maintaining our monorepo we found that some essential tools were missing, so we created them!
CLI Apps Σ=6
All the following libraries are command-line applications. You install them using
-g flag via npm, for example,
npm i -g json-sort-cli. Often a package/library/program would have its CLI counterpart: you can use a package programmatically, inside your programs, or you can use its CLI in the terminal, as a standalone program.
csv-sort package is string-in, string-out function. It’s meant to be used by websites, CLIs and Node programs.
csv-sort-cli “taps it” and adds file I/O layer and lets you read/write/sort files directly, via a command line.
That’s all programs which don’t belong to any of the categories above. Here we have programs doing everything, from CSV sorting to Tap output parsing; from regexes to converting colour hex codes.