Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

 

Our npm packages

We have been publishing to npm for 10.8 years now: 156 packages in that time, roughly 14.3 a year, of which 138 are current and 18 have been retired. The oldest two are still here and still maintained — 📦 detergent and 📦 object-boolean-combinations, both from 2015. At the other end sit 📦 html-entity-codec and 📦 string-typo-match, both from 2026.

Our speciality is non-parsing code processing — algorithms which read the source as a string and never build a syntax tree, so broken and templated input stays workable. It is not an HTML-only habit: 📦 html-crush applies it to HTML, 📦 email-comb to CSS, 📦 json-comb to JSON, and 📦 csv-sort to the awkward CSV that banks export.

The shapes vary more than the subject matter suggests. That same scannerless approach turns up over 📦 Sass variables, 📦 package.json, 📦 TypeScript declarations, 📦 CSV, 📦 IANA language codes, 📦 Commitizen changelogs and 📦 plain English prose. The APIs run from classes (📦 ranges-push) through callback-only traversal (📦 ast-monkey-traverse-with-lookahead) to a dozen command-line apps (📦 csv-sort-cli), and there is a 📦 tokeniser and a 📦 parser producing our own AST design, 📦 a monkey to walk it, a linter built on Node’s EventEmitter (📦 emlint), a 📦 Gulp plugin and an 📦 ESLint one.

Then the oddities: a string uglifier built on cryptographic principles (📦 string-uglify), a program which reverse-engineers Bitbucket’s slug algorithm (📦 bitbucket-slug), one which generates all 2n boolean combinations of an options object so the unit tests can cover every one of them (📦 test-mixer), and a mock program whose only job is to normalise everybody else’s benchmark scores (📦 perf-ref).

Everything below is grouped by what it operates on: HTML and CSS, ranges, strings, plain objects and arrays, ASTs, monorepo tooling, the command line and everything that fits nowhere else — with the four flagship libraries up front.

Of the 110 packages in the monorepo, 22 (20%) declare no dependencies at all, 90 (82%) never reach outside Codsen code however deep you follow them, and another 9 bottom out at exactly one outside library. The lot pulls in 18 distinct third-party packages, while our own 📦 codsen-utils is used by 77 of them.

Every one of those 110 is gated at 100% line coverage, and 32 of them at 100% branches, functions and statements as well — a package which slips below its threshold fails the build instead of shipping. Benchmarks are checked in for 99 of them, 1,003 recorded runs so far, and a release more than 10% slower than its own baseline fails the build too. There are 852 runnable examples across 101 of the packages, all automatically tested, and 10,093 commits behind the lot.

Downloads and dependencies

See how downloads are shared across our packages and how the libraries fit together. The download window is printed on each chart.

Cumulative npm download share as current Codsen packages are added from most to least downloaded
Counts include dependency and automated installs. They measure package downloads, not unique people. Open the download chart at full size.
Follow the connections between Codsen packages

Arrows lead from a package to its dependency. Each package name links to its documentation. Dashed boxes mark packages whose outgoing dependencies are unknown. This map shows only Codsen dependencies.

Open the dependency map at full size to zoom into the labels on a small screen.

Open the Codsen package dependency map
Explore one package’s dependencies in 3D

Choose a package, then rotate or zoom its dependency graph. This snapshot includes resolved production and optional dependencies, including third-party packages; a fresh install can resolve different versions.

Open the dependency explorer on its own page. The explorer also includes a linked text list of the dependencies.

View all charts, rankings and download history or inspect the chart data.


Flagship Libraries

📦 string-strip-html 13.7.3
Strip HTML tags from strings. No parser, accepts mixed sources.
open playground
📦 email-comb 7.4.3
Remove unused CSS from email templates
open playground
📦 html-crush 6.3.3
Minify email templates
open playground
📦 detergent 9.4.7
Extract, clean, encode text and fix English style
open playground
↑ back to top

HTML Processing Libraries Σ=16

They all process HTML and CSS. Our speciality is non-parsing algorithms — 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).

📦 all-named-html-entities 3.2.1
List of all named HTML entities
📦 charcode-is-valid-xml-name-character 3.2.2
Does a given character belong to XML spec’s “Production 4 OR 4a” type (is acceptable for XML element’s name)
📦 color-shorthand-hex-to-six-digit 5.2.4
Convert shorthand hex color codes into full
📦 detect-is-it-html-or-xhtml 6.2.4
Does the string resemble an HTML or XHTML (or neither)?
📦 generate-atomic-css 3.2.4
Generate Atomic CSS
📦 html-all-known-attributes 6.2.1
All HTML attributes known to the Humanity
📦 html-entities-not-email-friendly 0.10.1
All HTML entities which are not email template friendly
📦 html-entity-codec 1.1.0
Decode, encode, and escape HTML character references
📦 html-img-alt 4.2.5
Adds missing alt attributes to img tags. Non-parsing.
📦 html-table-patcher 6.2.5
Visual helper to place templating code around table tags into correct places
📦 is-char-suitable-for-html-attr-name 4.2.3
Is given character suitable to be in an HTML attribute’s name?
📦 is-html-attribute-closing 4.2.5
Is a character on a given index a closing of an HTML attribute?
📦 is-html-tag-opening 4.2.5
Does an HTML tag start at given position?
📦 is-language-code 5.2.2
Is given string a language code (as per IANA)
open playground
📦 is-media-descriptor 5.2.5
Is given string a valid media descriptor (including media query)?
📦 is-relative-uri 5.2.1
Is given string a relative URI?
↑ back to top

Range Libraries Σ=12

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.

📦 ranges-apply 7.2.5
Take an array of string index ranges, delete/replace the string according to them
📦 ranges-crop 6.2.5
Crop array of ranges when they go beyond the reference string’s length
📦 ranges-ent-decode 6.2.5
Recursive HTML entity decoding for Ranges workflow
📦 ranges-invert 6.2.5
Invert string index ranges
📦 ranges-is-index-within 4.2.1
Checks if index is within any of the given string index ranges
📦 ranges-iterate 4.2.4
Iterate a string and any changes within given string index ranges
📦 ranges-merge 9.2.5
Merge and sort string index ranges
📦 ranges-process-outside 6.2.5
Iterate string considering ranges, as if they were already applied
📦 ranges-push 7.3.2
Gather string index ranges
📦 ranges-regex 6.2.5
Integrate regex operations into Ranges workflow
📦 ranges-sort 6.2.4
Sort string index ranges
📦 string-range-expander 4.2.5
Expands string index ranges within whitespace boundaries until letters are met
↑ back to top

String Processing Libraries Σ=27

They process string inputs, which might be text, code or something else as long as it is of a string-type.

📦 arrayiffy-if-string 5.2.3
Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
📦 edit-package-json 0.10.6
Edit package.json without parsing, as string, to keep the formatting intact
📦 email-all-chars-within-ascii 5.2.5
Scans all characters within a string and checks are they within ASCII range
📦 js-row-num 7.2.5
Update all row numbers in all console.logs in JS code
📦 str-indexes-of-plus 5.2.2
Like indexOf but returns array and counts per-grapheme
📦 string-apostrophes 4.2.6
Comprehensive, HTML-entities-aware tool to typographically-correct the apostrophes and single/double quotes
📦 string-character-is-astral-surrogate 3.2.2
Tells, is given character a part of astral character, specifically, a high and low surrogate
📦 string-collapse-leading-whitespace 7.3.1
Collapse the leading and trailing whitespace of a string
📦 string-collapse-white-space 11.2.6
Replace chunks of whitespace with a single spaces
📦 string-convert-indexes 6.2.5
Convert between native JS string character indexes and grapheme-count-based indexes
📦 string-dashes 1.4.6
Comprehensive, HTML-entities-aware tool to typographically-correct the dashes and hyphens
📦 string-extract-class-names 8.4.0
Extracts class and ID names from isolated CSS selector fragments
📦 string-extract-sass-vars 4.2.4
Parse SASS variables file into a plain object of CSS key-value pairs
📦 string-find-heads-tails 6.2.5
Finds where are arbitrary templating marker heads and tails located
📦 string-find-malformed 4.2.5
Search for a malformed string. Think of Levenshtein distance but in search.
📦 string-fix-broken-named-entities 7.2.5
Finds and fixes common and not so common broken named HTML entities, returns ranges array of fixes
📦 string-left-right 6.2.4
Looks up the first non-whitespace character to the left/right of a given index
📦 string-match-left-right 9.2.5
Match substrings on the left or right of a given index, ignoring whitespace
📦 string-process-comma-separated 4.3.4
Extracts chunks from possibly comma or whatever-separated string
📦 string-remove-duplicate-heads-tails 7.2.5
Detect and (recursively) remove head and tail wrappings around the input string
📦 string-remove-thousand-separators 7.2.5
Detects and removes thousand separators (dot/comma/quote/space) from string-type digits
📦 string-remove-widows 4.2.6
Helps to prevent widow words in a text
📦 string-split-by-whitespace 4.2.6
Split string into array by chunks of whitespace
📦 string-trim-spaces-only 5.3.1
Like String.trim() but you can choose granularly what to trim
📦 string-typo-match 1.1.0
Match typing errors against candidate strings with weighted omissions, swaps, and explainable ambiguity
📦 string-uglify 3.2.2
Shorten sets of strings deterministically
📦 string-unfancy 6.3.0
Replace all n/m dashes, curly quotes with their simpler equivalents
↑ back to top

Plain Object or Array Libraries Σ=15

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.

📦 array-group-str-omit-num-char 6.2.5
Groups array of strings by omitting number characters
📦 array-includes-with-glob 5.2.4
Check strings against whole-string wildcard patterns
📦 array-pull-all-with-glob 7.2.4
Remove array entries using whole-string wildcard patterns
📦 json-comb-core 8.2.6
The inner core of json-comb
📦 json-variables 12.2.5
Resolves custom-marked, cross-referenced paths in parsed JSON
📦 object-all-values-equal-to 4.2.4
Does the AST/nested-plain-object/array/whatever contain only one kind of value?
📦 object-boolean-combinations 6.3.4
Consumes a defaults object with booleans, generates all possible variations of it
📦 object-delete-key 4.2.5
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 11.2.5
Add missing keys into plain objects, according to a reference object
📦 object-flatten-all-arrays 7.2.4
Merge and flatten any arrays found in all values within plain objects
📦 object-flatten-referencing 7.2.5
Flatten complex nested objects according to a reference objects
📦 object-merge-advanced 14.2.4
Deeply merge JSON-like data structures
📦 object-no-new-keys 5.3.4
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 6.2.5
Recursively walk the input and set all found values in plain objects to something
📦 test-mixer 4.4.2
Test helper to generate function opts object variations
↑ back to top

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.

📦 ast-compare 4.2.5
Compare anything: AST, objects, arrays, strings and nested thereof
📦 ast-contains-only-empty-space 4.2.2
Does AST contain only empty space?
📦 ast-deep-contains 5.2.4
Like t.same assert on array of objects, where element order doesn’t matter.
📦 ast-delete-object 4.2.5
Delete all plain objects in AST if they contain a certain key/value pair
📦 ast-get-object 4.2.5
Getter/setter for nested parsed HTML AST’s, querying objects by key/value pairs
📦 ast-get-values-by-key 5.2.5
Extract values and paths from AST by keys OR set them by keys
📦 ast-is-empty 4.2.4
Find out, is nested array/object/string/AST tree is empty
📦 ast-loose-compare 4.2.4
Compare anything: AST, objects, arrays and strings
📦 ast-monkey 9.2.5
Traverse and edit AST
📦 ast-monkey-traverse 4.3.1
Utility library to traverse AST
📦 ast-monkey-traverse-with-lookahead 4.2.5
Utility library to traverse AST, reports upcoming values
📦 ast-monkey-util 3.3.1
Utility library of AST helper functions
↑ back to top

Lerna Libraries Σ=3

While maintaining our monorepo we found that some essential tools were missing, so we created them!

📦 lerna-clean-changelogs 5.2.5
Removes frivolous entries from commitizen generated changelogs
📦 lerna-clean-changelogs-cli 4.2.6
CLI application to cleanse the lerna/commitizen-generated changelogs
📦 update-versions 7.2.6
Like npm-check-updates but supports Lerna monorepos and enforces strict semver values
↑ back to top

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.

For example, 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.

📦 csv-sort-cli 4.2.6
Command line app to sort double-entry CSVs coming from internet banking statements
📦 email-all-chars-within-ascii-cli 4.2.6
Command line app to scan email templates, are all their characters within ASCII range
📦 generate-atomic-css-cli 4.2.6
Generates and updates all HTML templates’ atomic CSS
📦 js-row-num-cli 4.2.6
Update all row numbers in all console.logs in given files
📦 json-comb 0.11.6
Command line app to manage sets of JSON files
📦 json-sort-cli 4.3.1
Deep-sort JSON files or standard input; package.json retains its special key order
↑ back to top

Miscellaneous Libraries Σ=14

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.

📦 check-types-mini 8.2.4
Validate options object
📦 codsen-format-diagnostic-value 1.1.1
Safely format untrusted JavaScript values for diagnostics
📦 codsen-glob 1.1.2
Fast file globbing
📦 codsen-utils 1.10.2
Various utility functions
📦 csv-sort 7.2.5
Sort double-entry bookkeeping CSV from internet banking
📦 csv-split-easy 7.2.5
Splits the CSV string into array of arrays, each representing a row of columns
📦 extract-search-index 2.2.6
Extract unique keyword input list string for search
📦 regex-empty-conditional-comments 3.2.3
Regular expression for matching HTML empty conditional comments
📦 rehype-responsive-tables 2.2.3
Rehype plugin to stack the first column cells above their rows.
📦 remark-conventional-commit-changelog-timeline 4.0.0
Render Codsen Conventional Commits changelogs as timeline HTML.
📦 remark-typography 0.8.6
Remark plugin to fix typography: quotes, dashes and so on.
📦 tsd-extract 0.10.6
Extract any definition from TS definitions file string
📦 util-array-object-or-both 5.2.2
Validate and normalise user choice: array, object or both?
📦 util-nonempty 5.2.3
Is the input (plain object, array, string or whatever) not empty?
↑ back to top

Links

  • List of all playgrounds
  • List of all article tags
  • List of all program examples

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab