Skip to content

lowlighter/libs

Repository files navigation

🍱 Libraries

JSR Scope Playground

This is a collection of carefully crafted TypeScript libraries. These try to be minimal, unbloated and convenient.

Most of them are written with deno in mind, but most packages in this repository honors web standards which means they can be used with other runtimes such as Node.js, bun and even browsers.

Tip

Click on a:

  • JSR badge to access the package's page on jsr.io
  • Playground badge to access the package's interactive playground
  • Coverage badge to access the package's coverage repor.
Code bundlers, formatters, minifiers and others tools.
Metadata and compatibilityFeatures
  • Lint, minify, license CSS code and check features compatibility against MDN data for each browser
  • Bundle, minify, anonymize local file paths and license TypeScript code
  • Compile Rust projects to Web assembly, hot-patch source in base64 and minify output
  • CLI utilities
Features based upon Web Crypto APIs
Metadata and compatibilityFeatures
  • Encrypt and decrypt data using a seed-salt derived private key
  • Generate time-based OTP secret key and verify tokens validity
Diff (patience algorithm)
Metadata and compatibilityFeatures
  • Compute unified patch between two string
Simple logger
Metadata and compatibilityFeatures
  • Simple logger library with configurable log level
    • Support date, time and delta stamps
    • Support caller info (file, name, line) using internal V8's Error.prepareStackTrace API
  • Automatically reads LOG_LEVEL environment variable (if available)
Object-relational mapping toolbox.
Metadata and compatibilityFeatures
  • Manage resources using an agnostic storage inteface
Pure TypeScript QRcode generator with no dependencies.
Metadata and compatibilityFeatures
  • Generate QR codes without external dependencies
  • Support console, array and SVG output (with customizable colors)
Reactive utilities for observable objects.
Metadata and compatibilityFeatures
  • Create observable contexts to track get, set, delete and call operations
  • Support inherited contexts
Testing utilities for cross-platform testing on Deno, Node.js and Bun.
Metadata and compatibilityFeatures
  • Cross-runtime testing framework
    • Support deno natively
    • Support Node.js through npx tsx --test
    • Support bun through bun test
    • Note: although tests are run on multiple runtimes, this library must be run on deno
  • Automatically skip test cases when runtime is not available on current platform
Utility types.
Metadata and compatibilityFeatures
  • Utility types such as Promisable, Nullable, MapKey, MapValue, SetValue, etc.
XML parser/stringifier with no dependencies.
Metadata and compatibilityFeatures
  • Parse XML to JavaScript object
    • Support cleaning options to remove attributes, comments, XML doctype and processing instructions from output
    • Support flatten options to flatten node content when only attributes, text or nothing is present
    • Support reviving options to trim text, replace XML entities, revive booleans and numbers
    • Also support custom reviving function
  • Stringify JavaScript object to XML
    • Support formatting options to configure indentation and text break lines
    • Support replacing options to replace XML entities
    • Also support custom replacing function

🧑‍💻 Cli utilities

A set of useful CLI scripts are also provided. Please note that these can only be run on deno runtime.

TypeScript code coverage enhancer

Enhance coverage reports generated with deno coverage by adding syntax highlighting and better styling thanks to matcha.css.

deno run jsr:@libs/bundle/ts/cli/coverage --help

CSS formatter

Format CSS code similarly to prettier or deno fmt. Can be used with --check to validate that CSS code is correctly formatted.

deno run jsr:@libs/bundle/css/cli/fmt --help

CSS features compatibility checker

Print compatibility report for CSS features against MDN data for selected browsers.

deno run jsr:@libs/bundle/css/cli/check --help

XHTML formatter

Format HTML and HTML/XML code similarly deno fmt. Can be used with --check to validate that HTML/XML code is correctly formatted.

Warning

This formatter is currently experimental and may break your documents. It requires --unstable flag to be run without --check flag.

deno run jsr:@libs/bundle/xhtml/cli/fmt --help

Web assembly builder

Compile a rust project to Web assembly and minify output.

deno run jsr:@libs/bundle/wasm/cli/build --help

📜 License

This work is licensed under the MIT License.

If you include a significant part of it in your own project, you should keep the license notice with it, including the mention of the additional original authors if any.

Important

Love these bytes ? Consider 💝 sponsoring me, even one-time contributions are greatly appreciated !