Open Source

(っ◔◡◔)っ fig. 1. Inter-dependencies within the monorepo.

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?

📦 detergent 8.0.1
Extracts, cleans and encodes text
📦 email-comb 6.0.1
Remove unused CSS from email templates
📦 html-crush 5.0.1
Minifies HTML/CSS: valid or broken, pure or mixed with other languages

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.

Read more

📦 ranges-push 6.0.1
Gather string index ranges
📦 ranges-apply 6.0.1
Take an array of string index ranges, delete/replace the string according to them
📦 ranges-merge 8.0.1
Merge and sort string index ranges
📦 ranges-sort 5.0.1
Sort string index ranges
📦 ranges-offset 3.0.1
Increment or decrement each index in every range
📦 string-range-expander 3.0.1
Expands string index ranges within whitespace boundaries until letters are met
📦 ranges-crop 5.0.1
Crop array of ranges when they go beyond the reference string's length
📦 ranges-ent-decode 5.0.1
Recursive HTML entity decoding for Ranges workflow
📦 ranges-invert 5.0.1
Invert string index ranges
📦 ranges-is-index-within 3.0.1
Checks if index is within any of the given string index ranges
📦 ranges-iterate 3.0.1
Iterate a string and any changes within given string index ranges
📦 ranges-process-outside 5.0.1
Iterate string considering ranges, as if they were already applied
📦 ranges-regex 5.0.1
Integrate regex operations into Ranges workflow

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.

📦 emlint 5.0.1
Pluggable email template code linter
📦 html-crush 5.0.1
Minifies HTML/CSS: valid or broken, pure or mixed with other languages
📦 stristri 4.0.1
Extracts or deletes HTML, CSS, text and/or templating tags from string
📦 string-strip-html 9.0.1
Strips HTML tags from strings. No parser, accepts mixed sources
📦 detect-is-it-html-or-xhtml 5.0.1
Answers, is the string input string more an HTML or XHTML (or neither)
📦 detect-templating-language 3.0.1
Detects various templating languages present in string
📦 html-table-patcher 5.0.1
Visual helper to place templating code around table tags into correct places
📦 is-html-tag-opening 3.0.1
Does an HTML tag start at given position?
📦 is-html-attribute-closing 3.0.1
Is a character on a given index a closing of an HTML attribute?
📦 is-language-code 4.0.1
Is given string a language code (as per IANA)

Open playground

📦 html-img-alt 3.0.1
Adds missing alt attributes to img tags. Non-parsing
📦 is-media-descriptor 4.0.1
Is given string a valid media descriptor (including media query)?

Open playground

📦 is-relative-uri 4.0.1
Is given string a relative URI?
📦 is-char-suitable-for-html-attr-name 3.0.1
Is given character suitable to be in an HTML attribute's name?
📦 html-entities-not-email-friendly 0.6.1
All HTML entities which are not email template friendly
📦 html-all-known-attributes 5.0.1
All HTML attributes known to the Humanity

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.

📦 edit-package-json 0.5.1
Edit package.json without parsing, as string, to keep the formatting intact
📦 easy-replace 5.0.1
Replace strings with optional lookarounds, but without regexes
📦 str-indexes-of-plus 4.0.1
Like indexOf but returns array and counts per-grapheme
📦 bitbucket-slug 3.0.1
Generate BitBucket readme header anchor slug URLs. Unofficial, covers whole ASCII and a bit beyond
📦 email-all-chars-within-ascii 4.0.1
Scans all characters within a string and checks are they within ASCII range
📦 js-row-num 5.0.1
Update all row numbers in all console.logs in JS code
📦 line-column-mini 2.0.1
Convert string index to line-column position
📦 string-apostrophes 2.0.1
Comprehensive, HTML-entities-aware tool to typographically-correct the apostrophes and single/double quotes

Open playground

📦 string-character-is-astral-surrogate 2.0.1
Tells, is given character a part of astral character, specifically, a high and low surrogate
📦 string-collapse-leading-whitespace 6.0.1
Collapse the leading and trailing whitespace of a string
📦 string-collapse-white-space 10.0.1
Replace chunks of whitespace with a single spaces

Open playground

📦 string-convert-indexes 5.0.1
Convert between native JS string character indexes and grapheme-count-based indexes
📦 string-extract-class-names 7.0.1
Extracts CSS class/id names from a string
📦 string-extract-sass-vars 3.0.1
Parse SASS variables file into a plain object of CSS key-value pairs
📦 string-find-heads-tails 5.0.1
Finds where are arbitrary templating marker heads and tails located
📦 string-find-malformed 3.0.1
Search for a malformed string. Think of Levenshtein distance but in search
📦 string-fix-broken-named-entities 6.0.1
Finds and fixes common and not so common broken named HTML entities, returns ranges array of fixes

Open playground

📦 string-left-right 5.0.1
Looks up the first non-whitespace character to the left/right of a given index
📦 string-match-left-right 8.0.1
Match substrings on the left or right of a given index, ignoring whitespace
📦 string-overlap-one-on-another 3.0.1
Lay one string on top of another, with an optional offset
📦 string-process-comma-separated 3.0.1
Extracts chunks from possibly comma or whatever-separated string
📦 string-range-expander 3.0.1
Expands string index ranges within whitespace boundaries until letters are met
📦 string-remove-duplicate-heads-tails 6.0.1
Detect and (recursively) remove head and tail wrappings around the input string
📦 string-remove-thousand-separators 6.0.1
Detects and removes thousand separators (dot/comma/quote/space) from string-type digits
📦 string-remove-widows 3.0.1
Helps to prevent widow words in a text

Open playground

📦 string-split-by-whitespace 3.0.1
Split string into array by chunks of whitespace
📦 string-strip-html 9.0.1
Strips HTML tags from strings. No parser, accepts mixed sources
📦 string-trim-spaces-only 4.0.1
Like String.trim() but you can choose granularly what to trim
📦 string-uglify 2.0.1
Shorten sets of strings deterministically, to be git-friendly
📦 string-unfancy 5.0.1
Replace all n/m dashes, curly quotes with their simpler equivalents

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).

📦 ast-monkey 8.0.1
Traverse and edit AST
📦 ast-monkey-traverse 3.0.1
Utility library to traverse AST
📦 ast-monkey-util 2.0.1
Utility library of AST helper functions
📦 json-comb-core 7.0.1
The inner core of json-comb
📦 json-variables 11.0.1
Resolves custom-marked, cross-referenced paths in parsed JSON

Open playground

📦 object-merge-advanced 13.0.1
Recursively, deeply merge of anything (objects, arrays, strings or nested thereof), which weighs contents by type hierarchy to ensure the maximum content is retained
📦 object-boolean-combinations 5.0.1
Consumes a defaults object with booleans, generates all possible variations of it
📦 ast-compare 3.0.1
Compare anything: AST, objects, arrays, strings and nested thereof
📦 ast-contains-only-empty-space 3.0.1
Does AST contain only empty space?
📦 ast-deep-contains 4.0.1
Like t.same assert on array of objects, where element order doesn't matter
📦 ast-delete-object 3.0.1
Delete all plain objects in AST if they contain a certain key/value pair
📦 ast-get-object 3.0.1
Getter/setter for nested parsed HTML AST's, querying objects by key/value pairs
📦 ast-get-values-by-key 4.0.1
Extract values and paths from AST by keys OR set them by keys
📦 ast-is-empty 3.0.1
Find out, is nested array/object/string/AST tree is empty
📦 ast-loose-compare 3.0.1
Compare anything: AST, objects, arrays and strings
📦 ast-monkey-traverse-with-lookahead 3.0.1
Utility library to traverse AST, reports upcoming values
📦 object-all-values-equal-to 3.0.1
Does the AST/nested-plain-object/array/whatever contain only one kind of value?
📦 object-delete-key 3.0.1
Delete keys from all arrays or plain objects, nested within anything, by key or by value or by both, and clean up afterwards. Accepts wildcards
📦 object-fill-missing-keys 9.0.1
Add missing keys into plain objects, according to a reference object
📦 object-flatten-all-arrays 6.0.1
Merge and flatten any arrays found in all values within plain objects
📦 object-flatten-referencing 6.0.1
Flatten complex nested objects according to a reference objects
📦 object-no-new-keys 4.0.1
Check, does a plain object (AST/JSON) has any unique keys, not present in a reference object (another AST/JSON)
📦 object-set-all-values-to 5.0.1
Recursively walk the input and set all found values in plain objects to something

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:

📦 lerna-clean-changelogs-cli 2.0.1
CLI application to cleanse the lerna/commitizen-generated changelogs
📦 lerna-link-dep 2.0.0
Like lerna add but does just the symlinking, works on CLI bins too
📦 update-versions 5.0.1
Like npm-check-updates but supports Lerna monorepos and enforces strict semver values
📦 lerna-clean-changelogs 3.0.1
Removes frivolous entries from commitizen 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.

📦 json-comb 0.6.1
Command line app to manage sets of JSON files
📦 update-versions 5.0.1
Like npm-check-updates but supports Lerna monorepos and enforces strict semver values
📦 lerna-clean-changelogs-cli 2.0.1
CLI application to cleanse the lerna/commitizen-generated changelogs
📦 lerna-link-dep 2.0.0
Like lerna add but does just the symlinking, works on CLI bins too
📦 lect 0.18.1
Maintenance CLI for internal consumption
📦 csv-sort-cli 2.0.1
Command line app to sort double-entry CSVs coming from internet banking statements
📦 email-all-chars-within-ascii-cli 2.0.1
Command line app to scan email templates, are all their characters within ASCII range
📦 generate-atomic-css-cli 2.0.1
Generates and updates all HTML templates' atomic CSS
📦 js-row-num-cli 2.0.1
Update all row numbers in all console.logs in JS code
📦 json-sort-cli 2.0.1
Command line app to deep sort JSON files, retains package.json special key order

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.

📦 all-named-html-entities 2.0.1
List of all named HTML entities
📦 array-group-str-omit-num-char 5.0.1
Groups array of strings by omitting number characters
📦 array-includes-with-glob 4.0.1
Like _.includes but with wildcards
📦 array-of-arrays-into-ast 3.0.1
Turns an array of arrays of data into a nested tree of plain objects
📦 array-of-arrays-sort-by-col 4.0.1
Sort array of arrays by column, rippling the sorting outwards from that column
📦 array-pull-all-with-glob 6.0.1
Like _.pullAll but with globs (wildcards)
📦 arrayiffy-if-string 4.0.1
Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else
📦 charcode-is-valid-xml-name-character 2.0.1
Does a given character belong to XML spec's "Production 4 OR 4a" type (is acceptable for XML element's name)
📦 check-types-mini 7.0.1
Validate options object
📦 codsen-parser 0.12.1
Parser aiming at broken or mixed code, especially HTML & CSS
📦 codsen-tokenizer 6.0.1
HTML and CSS lexer aimed at code with fatal errors, accepts mixed coding languages
📦 color-shorthand-hex-to-six-digit 4.0.1
Convert shorthand hex color codes into full
📦 csv-sort 6.0.1
Sorts double-entry bookkeeping CSV coming from internet banking
📦 csv-split-easy 6.0.1
Splits the CSV string into array of arrays, each representing a row of columns
📦 email-homey 3.0.0
Generate homepage in the Browsersync root with links/screenshots to all your email templates
📦 eslint-plugin-row-num 2.0.1
ESLint plugin to update row numbers on each console.log
📦 eslint-plugin-test-num 2.0.1
ESLint plugin to update unit test numbers automatically
📦 generate-atomic-css 2.0.1
Generate Atomic CSS
📦 gulp-email-remove-unused-css 4.0.1
Gulp plugin to remove unused CSS classes/id's from styles in HTML HEAD and inline within BODY
📦 helga 2.0.1
Your next best friend when editing complex nested code
📦 regex-empty-conditional-comments 2.0.1
Regular expression for matching HTML empty conditional comments
📦 regex-is-jinja-nunjucks 3.0.1
Regular expression for detecting Jinja or Nunjucks code
📦 regex-is-jsp 3.0.1
Regular expression for detecting JSP (Java Server Pages) code
📦 regex-jinja-specific 3.0.1
Regular expression for detecting Python-specific Jinja code
📦 tap-parse-string-to-object 3.0.1
Parses raw Tap: string-to-object or stream-to-a-promise-of-an-object
📦 test-mixer 3.0.1
Test helper to generate function opts object variations
📦 util-array-object-or-both 4.0.1
Validate and normalise user choice: array, object or both?
📦 util-nonempty 4.0.1
Is the input (plain object, array, string or whatever) not empty?


All contributions are welcome!