awesome-tiny-js
by thoughtspile
š¤ A collection of tiny JS libraries (under 2 kB) to put your bundle on a diet
AI summary
Bundle trimmer
A collection of tiny JavaScript libraries to help reduce bundle size
- stars
- 705
- forks
- 12
- watching
- 15
- awesome list
- 1
- entries
- 79
What's in the list
79 links in 16 sections, with live GitHub stats.activeno commit in 2y
UI Frameworks
preact
React-like API (pre-hooks). Cool ecosystem of similarly tiny tools and components. Highly recommended
hyperapp
vDOM framework with pure JS syntax and immutable state,
redom
Hyperapp-style templates with event listeners and updates,
fre
React-like library with hooks and concurrency,
van
vDOM-based framework optimized for no-build setups,
superfine
Hyperapp with state & effect hooks removed,
arrowjs
Tagged templates + reactive data,
umbrella
jQuery-style DOM manipulation library,
Event Emitters
mitt
Plain event emitter that I use on most projects,
nanoevents
Nicer unsubscribe API, but no event,
onfire.js
Also has method,
State Managers
zustand
Simple stores with pleasant actions and selectors. Vanilla , React
nanostores
Modular store with good tree-shaking support, vanilla, + React extra. Supports all the top frameworks
exome
Atomic stores with lots of framework connectors, + React extra. Supports all the top frameworks
storeon
Minimal redux-styled store with lots of framework connectors, . React extra + Vue, Svelte, Angular
unistore
Centralized store with actions, + React
teaful
Store with useState-like API, , including React / preact connector
State Managers / Signals
@preact/signals
The OG signals from preact core, with react integration
usignal
A smaller signal implementation,
hyperactiv
4 functions to make objects observable and listen to changes,
flimsy
Signals from Solid (it fit into UI frameworks category itself). Author warning:
State Managers / Reactive Programming
flyd
Rx-styled event streams,
callbag-basics
Rx-style event streams,
Routers and URL Utils
wouter
Declarative router for React / preact, , also available as a standalone hook:
@nanostores/router
Routes as a nanostores store (framework-agnostic),
matchit
Route parser and matcher in
regexparam
Convert path to regexp in
qss
Parse querystrings in . Not sure you need it, support is good
API Layer
I18N
@nanostores/i18n
Detect locale, load dictionaries, format dates / numbers, including nanostores
eo-locale
Interpolation and dates / numbers, , or with react bindings
rosetta
Bare-bones template strings ( ) and custom functions for everyting else,
lingui
Small core with template strings,
Dates and Time
date-fns
Not tiny as a whole, but are under 1 kB each (format and parse are quite heavy)
dayjs
moment.js-compatible API, covers most use cases,
tinytime
Simple date / time formatter: ,
tinydate
Date / time formatter, only supports padded numeric output ( ),
time-stamp
More of the same,
ms
Parse & format ms durations, e.g. ,
timeago.js
Format dates into stuff like or
fromnow
More of the same,
Generic Utilities
remeda
90 tree-shakable helpers
rambda
187 tree-shakable helpers
just
82 helpers in separate packages
@fxts/core
96 tree-shakable helpers. Lazy evaluation support
Validation
v8n
zod-style API with fine-grained checks: . No tree shaking,
banditypes
The smallest validation library:
superstruct
The most popular modular validation library with good tree-shaking,
valibot
Another modular validation library,
deep-waters
Composable functional validators,
Unique ID Generation
@lukeed/uuid
Real UUIDs,
nanoid
Random IDs with larger alphabet,
uid
More of the same,
hexoid
Hexadecimal IDs,
Colors
colord
Manipulate colors and convert between spaces, . Extra features come as plugins, 150b to 1.5 kB each
colr
More of the same,
polychrome
More of the same,
randomcolor
Attractive random colors with configuration
Touch Gestures
alloyfinger
Pan, swipe, tap, doubletap, longpress, pinch / rotate. My personal favorite.
tinygesture
Configurable pan, swipe, tap, doubletap, longpress.
pointer-tracker
Unified interface for mouse, touch and pointer events,
detect-it
Detect present and primary input method (touch / mouse) and supported events,
Text Search
Text Search / Fuzzy search
fuzzy
Index-free, can highlight matches
fuzzy-search
With stateful index
fzy.js
Matches one string at a time, tree-shakeable scores and match highlighting. total, or ~150 bytes for only
fuzzysearch
One string at a time, does not compute score / rank
liquidmetal
Quicksilver algorithm, prioritizes matches at start of word for command abbreviations (e.g. -> ). One string at a time
quick-score
Another quicksilver-based lib, tweaked for long strings. Built-in list filtering and sorting, or 1.2 kB for single-string scoring
fuzzyset
Find misspellings, e.g. missipissi -> Missisipi, Commercial usage costs $42
Nothing in this list matches your filter.
Featured in 1 awesome list
Each link jumps to the spot where the list mentions awesome-tiny-js.
More related projects
xxczaki/light-date476
ngx-eco/angular-colorful10
ilyalesik/effector-localstorage30
andresz1/size-limit-action454
lironhazan/nx-size-limit12
ilyalesik/react-fetch-hook348
siddharthkp/bundlesize4.5K
thedaviddias/front-end-performance-checklist16.7K
lostpebble/koa-mobx-react-starter100
matype/picostyle360
ianfabs/nanoid76