One API, three languages
The same camelCase name, the same arguments and the same result in every package. Moving between a Node.js server, a Flutter app and a Python script does not mean relearning your utility belt.
What qsu is
The helpers every project ends up writing by hand, with the same name and the same behavior in JavaScript, Dart and Python. Slugs, text case, date math, file sizes, deep clone and merge, validation, hashing.
Every project grows the same folder of small utilities, and every language grows its own copy of it. qsu is that folder, written once and published to npm, pub.dev and PyPI, so the call you already know keeps working when the stack changes.
// JavaScript / Node.js
import { getSlug } from 'qsu';
getSlug('Hello World!');
// 'hello-world'// Dart / Flutter
import 'package:qsu/qsu.dart';
getSlug('Hello World!');
// 'hello-world'# Python
from qsu import getSlug
getSlug('Hello World!')
# 'hello-world'Same name, same arguments, same result.
Take a language here. Every example below is written for it, and so is every page of the reference.
import { getSlug, strToCamelCase, truncate } from 'qsu';
getSlug('Hello World'); // 'hello-world'
strToCamelCase('--foo-bar--'); // 'fooBar'
truncate('hello', 2, '...'); // 'he...'import 'package:qsu/qsu.dart';
getSlug('Hello World'); // 'hello-world'
strToCamelCase('--foo-bar--'); // 'fooBar'
truncate('hello', 2, ellipsis: '...'); // 'he...'from qsu import getSlug, strToCamelCase, truncate
getSlug('Hello World') # 'hello-world'
strToCamelCase('--foo-bar--') # 'fooBar'
truncate('hello', 2, '...') # 'he...'import { today, dayDiff, fileSizeFormat, duration } from 'qsu';
today(); // 'YYYY-MM-DD'
dayDiff(new Date('2021-01-01'), new Date('2021-01-03')); // 2
fileSizeFormat(100000000, 3); // '95.367 MB'
duration(604800000); // '7 Days'import 'package:qsu/qsu.dart';
today(); // 'YYYY-MM-DD'
dayDiff(DateTime(2021, 1, 1), DateTime(2021, 1, 3)); // 2
fileSizeFormat(100000000, decimals: 3); // '95.367 MB'
duration(604800000); // '7 Days'from datetime import datetime
from qsu import today, dayDiff, fileSizeFormat, duration
today() # 'YYYY-MM-DD'
dayDiff(datetime(2021, 1, 1), datetime(2021, 1, 3)) # 2
fileSizeFormat(100000000, 3) # '95.367 MB'
duration(604800000) # '7 Days'import { arrUnique, objMerge, isEmail } from 'qsu';
arrUnique([1, 2, 2, 3]); // [1, 2, 3]
objMerge({ a: { b: 1 } }, { a: { c: 2 } }); // { a: { b: 1, c: 2 } }
isEmail('[email protected]'); // trueimport 'package:qsu/qsu.dart';
arrUnique([1, 2, 2, 3]); // [1, 2, 3]
objMerge([{'a': {'b': 1}}, {'a': {'c': 2}}]); // {'a': {'b': 1, 'c': 2}}
isEmail('[email protected]'); // truefrom qsu import arrUnique, objMerge, isEmail
arrUnique([1, 2, 2, 3]) # [1, 2, 3]
objMerge({'a': {'b': 1}}, {'a': {'c': 2}}) # {'a': {'b': 1, 'c': 2}}
isEmail('[email protected]') # TrueThirteen categories, counted for the language you are reading in. A package that does not carry a category says so rather than showing an empty one.
array
16 functions15 functions
Creation, sorting, sampling, deduplication and grouping.
crypto
10 functions8 functions
Hashing, base64, symmetric encryption and id generation.
date
5 functions
Validation, formatting and range calculation.
file
24 functions22 functions
File and directory inspection, path handling and reading or writing.
format
7 functions
Readable sizes, durations and numbers, and parsing that does not throw.
math
12 functions
Arithmetic over argument lists or arrays, and random numbers.
misc
6 functions
Debounce, throttle, retry, sleep and other helpers around a function.
net
1 functionNot in Dart
Network requests.
object
15 functions11 functions
Traversal, merging, flattening and conversion.
os
7 functionsNot in Dart
Facts about the machine the process is running on.
string
29 functions27 functions
Transformation, capitalization, trimming and truncation.
verify
12 functions
Type, equality, range and format validation.
web
9 functions8 functions
URLs, slugs, user agents and other helpers for the browser.
153 functions across 13 categories133 functions across 11 categories
Install the package you need. The documentation follows the language you take here, and so does every page you open after it.
JavaScriptNode.js 18 or later. ESM only, with a Node.js subpath for the functions that need a runtime.npm install qsuGet started
DartDart 3.5 or later, which Flutter 3.24 and up already ship.dart pub add qsuGet started
PythonPython 3.8 or later, installable with pip, uv, Poetry or PDM.pip install qsuGet started