Skip to content

Latest commit

Β 

History

1,074 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

qsu - Quick & Simple Utility

license JavaScript Dart Python Commit Count Followers Stars

qsu is a library that collects frequently used utility functions β€” slugs, text case, date math, number and file size formatting, deep clone and merge, validation, hashing, file and OS helpers. Streamline repetitive code with functions that are already written and tested for you.

What makes qsu different is cross-language parity. A function has the same name, the same arguments and the same behavior in every language it supports, so moving between a Node.js backend, a Flutter app and a Python script does not mean relearning your utility belt.

// JavaScript / Node.js
import { getSlug, fileSizeFormat } from "qsu";

getSlug("Hello World!"); // 'hello-world'
fileSizeFormat(1000000); // '976.56 KB'
// Dart / Flutter
import 'package:qsu/qsu.dart';

getSlug('Hello World!'); // 'hello-world'
fileSizeFormat(1000000); // '976.56 KB'
# Python
from qsu import getSlug, fileSizeFormat

getSlug('Hello World!')  # 'hello-world'
fileSizeFormat(1000000)  # '976.56 KB'

Highlights

  • One API, three languages. The same camelCase function name, the same category and the same test cases in JavaScript, Dart and Python.
  • Lightweight. The JavaScript package has no runtime dependencies and is fully tree-shakeable; the Dart and Python packages pull in only what hashing and path handling actually require.
  • Typed. TypeScript declarations ship with the npm package, Dart signatures are fully annotated, and the Python package is py.typed for mypy and other checkers.
  • Safe. Arguments are validated and edge cases β€” null, empty values, surrogate pairs, nested arrays β€” return a sensible result instead of throwing.
  • Tested. Every package runs its suite on Linux, macOS and Windows across multiple runtime versions in CI.
  • Documented. Every function has its own reference page, in English and Korean, at qsu.cdget.com.

Getting Started

Start qsu in your preferred programming language:

Language Links Stat
JavaScript / Node.js Documentation
Changelog
npm latest package npm downloads minified size
Dart / Flutter Documentation
Changelog
Pub Version Pub Monthly Downloads Pub Likes Pub Points
Python Documentation
Changelog
PyPI version PyPI downloads PyPI python versions

Install it with the package manager you already use:

npm install qsu
dart pub add qsu
pip install qsu

What's inside

Functions are grouped into categories. JavaScript and Python ship 175+ functions, Dart 170+ β€” a handful are language-specific, and every reference page states which languages implement it.

Category JavaScript Dart Python Examples
array βœ… βœ… βœ… arrUnique, arrGroupByMaxCount, sortNumeric
crypto βœ… qsu/node βœ… βœ… md5Hash, sha256Hash, encodeBase64, objectId
date βœ… βœ… βœ… today, dayDiff, createDateListFromRange
file βœ… qsu/node βœ… βœ… getFileSize, moveFile, joinFilePath
format βœ… βœ… βœ… numberFormat, fileSizeFormat, duration
math βœ… βœ… βœ… sum, clamp, round, numPick
misc βœ… βœ… βœ… debounce, throttle, retry, sleep
net βœ… qsu/node βœ… βœ… fetchData, parseAddress
object βœ… βœ… βœ… objClone, objMerge, objPick, objGet
os βœ… qsu/node βœ… βœ… getCpu, getRamSize, getDiskSize, runCommand
string βœ… βœ… βœ… trim, truncate, strToCamelCase, pad
verify βœ… βœ… βœ… isEmail, isUrl, isEmpty, isEqual
web βœ… βœ… βœ… getSlug, escapeHtml, isMobile, isBotAgent

In JavaScript, categories marked qsu/node require a Node.js runtime and are imported from the qsu/node subpath so the browser-safe entry point stays free of Node built-ins. Two of them are split rather than wholly one or the other: in net, fetchData needs Node and parseAddress does not, and in misc only logBox does. Dart and Python have no such split; in Dart, the file helpers use dart:io and are therefore unavailable on Flutter Web.

Documentation

The full documentation lives at qsu.cdget.com, in English and Korean.

  • Introduction β€” what qsu is and what it is good for
  • Installation β€” installing the package, in the language you pick
  • Reference β€” every function, with parameters, defaults and examples
  • Changelog β€” what changed in each package, by version
  • llms.txt β€” a machine-readable index of every function, for use with LLM tooling

Cross-language parity

The rules that keep the packages interchangeable:

  • Names are camelCase in every language, including Dart and Python. This is deliberate and non-idiomatic, so that getSlug is getSlug wherever you are.
  • Behavior and test cases are ported, not just implementations. When a function changes, the tests change in all packages.
  • Optional arguments follow each language's convention. JavaScript takes an options object, Dart takes named parameters, and Python accepts either a dict or keyword arguments.
  • Not every function exists everywhere. getMacAddress and getTimezone are JavaScript-only. The language badge at the top of each reference page is the source of truth.

The same call, with the same result, in each language:

fileSizeFormat(100000000, 3, true); // '96 MB'
fileSizeFormat(100000000, decimals: 3, ceil: true); // '96 MB'
fileSizeFormat(100000000, 3, True)  # '96 MB'

Repository layout

packages/
  javascript/   # npm package `qsu` (TypeScript source in lib/, built to dist/)
  dart/         # pub package `qsu` (lib/src/<category>.dart)
  python/       # PyPI package `qsu` (qsu/<category>/<functionName>.py)
docs/           # VitePress documentation site (en + ko), published to qsu.cdget.com

Each package keeps its own README.md, CHANGELOG.md and LICENSE.

Development

Clone the repository and work inside the package you want to change:

Package Install Test Analyze / Format
JavaScript npm install npm test npm run lint / npm run format
Dart dart pub get dart test dart analyze / dart format .
Python pip install -e ".[dev]" pytest mypy

The documentation site requires Node.js 20 or later:

cd docs && npm install && npm run dev

A change to a shared function usually touches all three packages plus both documentation locales. See CLAUDE.md for the full checklist.

Contributing

Anyone can contribute to the project by reporting new issues or submitting a pull request. For more information, please see CONTRIBUTING.md. Participation is subject to the Code of Conduct.

To report a security issue, please follow the process described in SECURITY.md.

For anything that does not belong in a public issue, write to CDGet at cdget.com/contact.

Sponsor

qsu is free to use and maintained in the open. If it saves you time, you can support the work at cdget.com/donate or through the Sponsor button on GitHub.

License

Please see the LICENSE file for more information about project owners, usage rights, and more.

About

πŸ›  qsu is a utility library that contains useful and frequently used functions. Start with your preferred programming language and the modern development environment.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages