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

 

Our npm packages

IndieWeb Rule #3: make what you need.
IndieWeb Rule #4: use what you make.

Here are all Codsen Open Source npm packages. Some are popular, some are esoteric and forgotten. Some have been decommissioned.

Nobody visits this page, because people search for npm libraries directly from npm. If you are reading this, you are most likely a bot or a recruiter or a recruiter’s bot. Anyway, here we go.


Flagship Libraries

📦 string-strip-html 13.6.1
Strip HTML tags from strings. No parser, accepts mixed sources.
open playground
📦 email-comb 7.2.1
Remove unused CSS from email templates
open playground
📦 html-crush 6.2.1
Minify email templates
open playground
📦 detergent 9.4.1
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.0
List of all named HTML entities
📦 charcode-is-valid-xml-name-character 3.2.1
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.0
Convert shorthand hex color codes into full
📦 detect-is-it-html-or-xhtml 6.2.0
Does the string resemble an HTML or XHTML (or neither)?
📦 detect-templating-language 4.2.0
Detects various templating languages present in string
📦 generate-atomic-css 3.2.0
Generate Atomic CSS
📦 html-all-known-attributes 6.2.0
All HTML attributes known to the Humanity
📦 html-entities-not-email-friendly 0.10.0
All HTML entities which are not email template friendly
📦 html-img-alt 4.2.1
Adds missing alt attributes to img tags. Non-parsing.
📦 html-table-patcher 6.2.1
Visual helper to place templating code around table tags into correct places
📦 is-char-suitable-for-html-attr-name 4.2.1
Is given character suitable to be in an HTML attribute’s name?
📦 is-html-attribute-closing 4.2.1
Is a character on a given index a closing of an HTML attribute?
📦 is-html-tag-opening 4.2.1
Does an HTML tag start at given position?
📦 is-language-code 5.2.0
Is given string a language code (as per IANA)
open playground
📦 is-media-descriptor 5.2.1
Is given string a valid media descriptor (including media query)?
📦 is-relative-uri 5.2.0
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.1
Take an array of string index ranges, delete/replace the string according to them
📦 ranges-crop 6.2.1
Crop array of ranges when they go beyond the reference string’s length
📦 ranges-ent-decode 6.2.1
Recursive HTML entity decoding for Ranges workflow
📦 ranges-invert 6.2.1
Invert string index ranges
📦 ranges-is-index-within 4.2.0
Checks if index is within any of the given string index ranges
📦 ranges-iterate 4.2.0
Iterate a string and any changes within given string index ranges
📦 ranges-merge 9.2.1
Merge and sort string index ranges
📦 ranges-process-outside 6.2.1
Iterate string considering ranges, as if they were already applied
📦 ranges-push 7.2.0
Gather string index ranges
📦 ranges-regex 6.2.1
Integrate regex operations into Ranges workflow
📦 ranges-sort 6.2.0
Sort string index ranges
📦 string-range-expander 4.2.0
Expands string index ranges within whitespace boundaries until letters are met
↑ back to top

String Processing Libraries Σ=26

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.1
Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
📦 edit-package-json 0.10.1
Edit package.json without parsing, as string, to keep the formatting intact
📦 email-all-chars-within-ascii 5.2.1
Scans all characters within a string and checks are they within ASCII range
📦 js-row-num 7.2.1
Update all row numbers in all console.logs in JS code
📦 str-indexes-of-plus 5.2.1
Like indexOf but returns array and counts per-grapheme
📦 string-apostrophes 4.2.1
Comprehensive, HTML-entities-aware tool to typographically-correct the apostrophes and single/double quotes
📦 string-character-is-astral-surrogate 3.2.0
Tells, is given character a part of astral character, specifically, a high and low surrogate
📦 string-collapse-leading-whitespace 7.2.0
Collapse the leading and trailing whitespace of a string
📦 string-collapse-white-space 11.2.1
Replace chunks of whitespace with a single spaces
📦 string-convert-indexes 6.2.1
Convert between native JS string character indexes and grapheme-count-based indexes
📦 string-dashes 1.4.1
Comprehensive, HTML-entities-aware tool to typographically-correct the dashes and hyphens
📦 string-extract-class-names 8.2.0
Extracts CSS class/id names from a string
📦 string-extract-sass-vars 4.2.0
Parse SASS variables file into a plain object of CSS key-value pairs
📦 string-find-heads-tails 6.2.1
Finds where are arbitrary templating marker heads and tails located
📦 string-find-malformed 4.2.1
Search for a malformed string. Think of Levenshtein distance but in search.
📦 string-fix-broken-named-entities 7.2.0
Finds and fixes common and not so common broken named HTML entities, returns ranges array of fixes
📦 string-left-right 6.2.0
Looks up the first non-whitespace character to the left/right of a given index
📦 string-match-left-right 9.2.1
Match substrings on the left or right of a given index, ignoring whitespace
📦 string-process-comma-separated 4.3.0
Extracts chunks from possibly comma or whatever-separated string
📦 string-remove-duplicate-heads-tails 7.2.1
Detect and (recursively) remove head and tail wrappings around the input string
📦 string-remove-thousand-separators 7.2.1
Detects and removes thousand separators (dot/comma/quote/space) from string-type digits
📦 string-remove-widows 4.2.1
Helps to prevent widow words in a text
📦 string-split-by-whitespace 4.2.1
Split string into array by chunks of whitespace
📦 string-trim-spaces-only 5.2.0
Like String.trim() but you can choose granularly what to trim
📦 string-uglify 3.2.0
Shorten sets of strings deterministically
📦 string-unfancy 6.2.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.1
Groups array of strings by omitting number characters
📦 array-includes-with-glob 5.2.0
Like _.includes but with wildcards
📦 array-pull-all-with-glob 7.2.0
Like _.pullAll but with globs (wildcards)
📦 json-comb-core 8.2.1
The inner core of json-comb
📦 json-variables 12.2.1
Resolves custom-marked, cross-referenced paths in parsed JSON
📦 object-all-values-equal-to 4.2.0
Does the AST/nested-plain-object/array/whatever contain only one kind of value?
📦 object-boolean-combinations 6.3.0
Consumes a defaults object with booleans, generates all possible variations of it
📦 object-delete-key 4.2.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 11.2.1
Add missing keys into plain objects, according to a reference object
📦 object-flatten-all-arrays 7.2.0
Merge and flatten any arrays found in all values within plain objects
📦 object-flatten-referencing 7.2.1
Flatten complex nested objects according to a reference objects
📦 object-merge-advanced 14.2.0
Deeply merge JSON-like data structures
📦 object-no-new-keys 5.3.0
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.1
Recursively walk the input and set all found values in plain objects to something
📦 test-mixer 4.3.0
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.1
Compare anything: AST, objects, arrays, strings and nested thereof
📦 ast-contains-only-empty-space 4.2.0
Does AST contain only empty space?
📦 ast-deep-contains 5.2.1
Like t.same assert on array of objects, where element order doesn’t matter.
📦 ast-delete-object 4.2.1
Delete all plain objects in AST if they contain a certain key/value pair
📦 ast-get-object 4.2.1
Getter/setter for nested parsed HTML AST’s, querying objects by key/value pairs
📦 ast-get-values-by-key 5.2.1
Extract values and paths from AST by keys OR set them by keys
📦 ast-is-empty 4.2.0
Find out, is nested array/object/string/AST tree is empty
📦 ast-loose-compare 4.2.0
Compare anything: AST, objects, arrays and strings
📦 ast-monkey 9.2.1
Traverse and edit AST
📦 ast-monkey-traverse 4.2.1
Utility library to traverse AST
📦 ast-monkey-traverse-with-lookahead 4.2.1
Utility library to traverse AST, reports upcoming values
📦 ast-monkey-util 3.2.0
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.1
Removes frivolous entries from commitizen generated changelogs
📦 lerna-clean-changelogs-cli 4.2.1
CLI application to cleanse the lerna/commitizen-generated changelogs
📦 update-versions 7.2.1
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.1
Command line app to sort double-entry CSVs coming from internet banking statements
📦 email-all-chars-within-ascii-cli 4.2.1
Command line app to scan email templates, are all their characters within ASCII range
📦 generate-atomic-css-cli 4.2.1
Generates and updates all HTML templates’ atomic CSS
📦 js-row-num-cli 4.2.1
Update all row numbers in all console.logs in given files
📦 json-comb 0.11.1
Command line app to manage sets of JSON files
📦 json-sort-cli 4.2.1
Command line app to deep sort JSON files, retains package.json special key order
↑ back to top

Miscellaneous Libraries Σ=16

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.0
Validate options object
📦 codsen-glob 1.1.0
Fast TypeScript file globbing
📦 codsen-utils 1.8.0
Various utility functions
📦 csv-sort 7.2.1
Sort double-entry bookkeeping CSV from internet banking
📦 csv-split-easy 7.2.1
Splits the CSV string into array of arrays, each representing a row of columns
📦 extract-search-index 2.2.1
Extract unique keyword input list string for search
📦 regex-empty-conditional-comments 3.2.1
Regular expression for matching HTML empty conditional comments
📦 regex-is-jinja-nunjucks 4.2.0
Regular expression for detecting Jinja or Nunjucks code
📦 regex-is-jsp 4.2.0
Regular expression for detecting JSP (Java Server Pages) code
📦 regex-jinja-specific 4.2.0
Regular expression for detecting Python-specific Jinja code
📦 rehype-responsive-tables 2.2.0
Rehype plugin to stack the first column cells above their rows.
📦 remark-conventional-commit-changelog-timeline 3.3.1
Remark plugin to process Conventional Commits changelogs to be displayed in a timeline.
📦 remark-typography 0.8.1
Remark plugin to fix typography: quotes, dashes and so on.
📦 tsd-extract 0.10.1
Extract any definition from TS definitions file string
📦 util-array-object-or-both 5.2.1
Validate and normalise user choice: array, object or both?
📦 util-nonempty 5.2.0
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