§ Open Source
§ Table of Contents
§ Flagship Libraries
Each one solves a certain business problem.
detergent — as a business, how do we ensure an efortless and safe copy briefs handover between teams while automating the invisible character cleaning and text formatting?
email-comb — as a business, how do we deliver the best customer experience on emails we send, considering the template file sizes are limited by truncation (in Gmail, for example) and each new code improvement (hybrid layout, for example) increases template's file size?
§ Range Libraries Σ=13
What are ranges? Composable string amendment instructions. They are arrays containing "from" and "to" string indexes.
For example, a range [1, 5]
means an instruction to delete characters which would otherwise fall into String.slice(1, 5)
.
For example, a range [2, 6, "foo"]
means an instruction to replace characters which would otherwise fall into String.slice(2, 6)
with string "foo"
.
That's all there is — we note pieces of string to be deleted or replaced using character indexes and arrays.
The whole point of ranges is to gather all the string tasks, to postpone any string-mutation actions until the end and then mutate the string, in one go.
§ HTML Processing Libraries Σ=16
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 whole 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.
It is equally vital to support mixed code because both web page and email template HTML can contain anything from templating languages to programming languages.
alt
attributes to img
tags. Non-parsing§ String Processing Libraries Σ=30
They process string inputs, which might be text, code or something else as long as it is of a string-type.
indexOf
but returns array and counts per-graphemeconsole.log
s in JS codeString.trim()
but you can choose granularly what to trim§ Object Processing Libraries Σ=23
When we say "object" we mean a plain object in JavaScript, for example, { name: "Bob" }
. 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.
"ast-
" in the library's name below just emphasises that it really works on nested objects (so-called Abstract Syntax Trees that come from parsed things).
json-comb
t.same
assert on array of objects, where element order doesn't matter§ Lerna Libraries Σ=4
While maintaining our monorepo we found that some essential tools were missing, so we created them!
If you also use Lerna monorepos, check these out:
npm-check-updates
but supports Lerna monorepos and enforces strict semver valuescommitizen
generated changelogs§ CLI Apps Σ=10
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.
For example, csv-sort
package is string-in, string-out function. It's meant to be used by websites, CLI's 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.
npm-check-updates
but supports Lerna monorepos and enforces strict semver valuesconsole.log
s in JS code§ Miscellaneous Libraries Σ=28
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 converting colour hex codes to processing arrays.
_.includes
but with wildcards_.pullAll
but with globs (wildcards)console.log
§ Contributing
All contributions are welcome!
- If you see an error, raise an issue .
- If you want a new feature but can't code it up yourself, also raise an issue . Let's discuss it.
- If you want a new feature and can code it up yourself, fork the monorepo, code it up and raise a PR .
- If you tried to use a package, but something didn't work out, also raise an issue . We'll try to help.
- If have anything to say, good or bad, email us.