Skip to content
50

Awesome Tiny JS

🀏 A collection of tiny JS libraries (under 2 kB) to put your bundle on a diet

780 stars13 forks79 entriesLast push Sep 24, 2024 (2 years ago)License CC0-1.0

This page lists names, links and short descriptions. The original list on GitHub is the source and belongs to its authors.

UI Frameworks

preact

React-like API (pre-hooks). Cool ecosystem of similarly tiny tools and components. Highly recommended.

In 5 listsDetails

hyperapp

vDOM framework with pure JS syntax and immutable state,

In 2 lists

redom

Hyperapp-style templates with imperative event listeners and updates,

In 2 lists

fre

React-like library with hooks and concurrency,

van

vDOM-based framework optimized for no-build setups,

In 2 lists

superfine

Hyperapp with state & effect hooks removed,

In 2 lists

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 .once method,

State Managers

zustand

Simple stores with pleasant actions and selectors. Vanilla , React

In 5 listsDetails

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.

In 4 listsDetails

storeon

Minimal redux-styled store with lots of framework connectors, . React extra + Vue, Svelte, Angular.

In 2 lists

unistore

Centralized store with actions, + React

In 2 lists

teaful

Store with useState-like API, , including React / preact connector.

In 2 lists

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 almost fit into UI frameworks category itself). Author warning: it's probably buggy.

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:

In 3 lists

@nanostores/router

Routes as a nanostores store (framework-agnostic),

navaid

History-based observable router,

In 2 lists

matchit

Route parser and matcher in

regexparam

Convert path to regexp in

qss

Parse querystrings in . Not sure you need it, URL API support is good.

API Layer

redaxios

Drop-in axios replacement for modern browsers,

wretch

Chainable API with error processing and lots of extra plugins,

In 2 lists

gretchen

Chainable API with type-safe errors,

unfetch

Loose fetch polyfill,

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 ({{hello}}, {{username}}) and custom functions for everyting else,

lingui

Small core with template strings,

In 3 lists

Dates and Time

date-fns

Not tiny as a whole, but most functions are under 1 kB each (format and parse are quite heavy).

In 5 listsDetails

dayjs

Almost moment.js-compatible API, covers most use cases,

In 6 listsDetails

tinytime

Simple date / time formatter: {h}:{mm} -> 9:33,

tinydate

Date / time formatter, only supports padded numeric output (September -> 09),

time-stamp

More of the same,

In 2 lists

ms

Parse & format ms durations, e.g. "1m" <-> 60000,

In 3 lists

timeago.js

Format dates into stuff like X minutes ago or in X hours,

In 5 listsDetails

fromnow

More of the same,

Generic Utilities

remeda

90 tree-shakable helpers (list).

rambda

187 tree-shakable helpers (list).

In 3 lists

just

82 helpers in separate packages (list).

In 2 lists

@fxts/core

96 tree-shakable helpers. Lazy evaluation support.

In 3 lists

Validation

v8n

zod-style API with fine-grained checks: v8n().string().minLength(5).first("H").last("o"). No tree shaking,

In 3 lists

banditypes

The smallest validation library:

superstruct

The most popular modular validation library with good tree-shaking,

In 3 lists

valibot

Another modular validation library,

In 2 lists

deep-waters

Composable functional validators, .

Unique ID Generation

@lukeed/uuid

Real UUIDs,

nanoid

Random IDs with larger alphabet,

In 6 listsDetails

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,

In 2 lists

randomcolor

Attractive random colors with configuration.

In 3 lists

Touch Gestures

alloyfinger

Pan, swipe, tap, doubletap, longpress, and pinch / rotate. My personal favorite. .

In 2 lists

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,

js-search

Feature-rich and customizable: multi-field indices, stop words, custom stemmers and tokenizers.

ndx

Similar to js-search, differs in ranking and is less strict for multi-word queries (compare). Supports field weights.

wade

Also similar, (compare)

libsearch

Index-free search (slower, but easier to use) with sane ordering

stemmer

porter-stemmer

fuzzy

Index-free, can highlight matches.

In 2 lists

fuzzy-search

With stateful index.

fzy.js

Matches one string at a time, tree-shakeable scores and match highlighting. total, or ~150 bytes for hasMatch only.

fuzzysearch

One string at a time, does not compute score / rank.

In 2 lists

liquidmetal

Quicksilver algorithm, prioritizes matches at start of word for command abbreviations (e.g. gp -> git push). 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.

See category
94

Awesome Rust

rust-unofficial/awesome-rust

A curated list of Rust code and resources.

Freshβ˜… 60k1833 entriesPushed today
94

Awesome Mac

jaywcjlove/awesome-mac

ο£Ώ This project is dedicated to collecting high-quality macOS software and organizing them systematically by different categories for easy search and use.

Freshβ˜… 115k1316 entriesPushed today
94

Awesome Python

vinta/awesome-python

Curated Python frameworks, libraries and resources.

Freshβ˜… 324k504 entriesPushed today
94

Awesome C++

fffaraz/awesome-cpp

A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.

Freshβ˜… 74k1358 entriesPushed yesterday
94

Awesome Go

avelino/awesome-go

Curated Go frameworks and libraries.

Freshβ˜… 186k3119 entriesPushed yesterday
94

Awesome PHP

ziadoz/awesome-php

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Freshβ˜… 33k87 entriesPushed 2 days ago