Skip to content
54

Awesome Micro npm Packages

A curated list of small, focused npm packages.

4.6k stars451 forks140 entriesLast push Dec 18, 2023 (2 years ago)License MIT

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

Articles

One-line node modules

Full-time open-sourcerer. Maker of many npm packages and apps.

In 3 lists

Module best practices

Some good practices when writing new npm modules.

In 2 lists

Evaluating Packages Part 1 - Turn to community

Evaluating Packages Part 2 - Review repository

Small modules: it’s not quite that simple

In Defense of Hyper Modular JavaScript

Tiny npm package: Guidelines to create a Node.js module following the small package philosophy

The cost of small modules

Modules >Array

is-sorted

A small module to check if an Array is sorted.

array-first

Get the first element or first n elements of an array.

array-last

Return the last element in an array.

arr-flatten

Recursively flatten an array or arrays.

dedupe

Remove duplicates from an array.

array-range

Creates a new array with given range.

arr-diff

Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.

filled-array

Returns an array filled with the specified input

map-array

Map object keys and values into an array.

in-array

Return true if any of passed values exists in array - faster than using indexOf.

unordered-array-remove

Efficiently remove an element from an unordered array without doing a splice.

array-swap

Swap position of two items in an array.

mirrarray

Creates a keymirror object from an array of valid keys.

group-array

Group array of objects into lists.

array.chunk

Split array/TypedArray to chunks of given size.

fast-cartesian

Fast cartesian product.

Modules >String

decamelize

Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow.

In 2 lists

pad-left

Left pad a string with zeros or a specified string.

to-camel-case

Convert a string to a camel case.

to-capital-case

Convert a string to a capital case.

to-constant-case

Convert a string to a constant case.

to-dot-case

Convert a string to a dot case.

to-no-case

Remove an existing case from a string.

to-pascal-case

Convert a string to a pascal case.

to-sentence-case

Convert a string to a sentence case.

to-snake-case

Convert a string to a snake case.

to-space-case

Convert a string to a space case.

to-title-case

Convert a string to a title case.

node-slug

slugifies even utf-8 chars.

rtrim

Strip whitespace - or other characters - from the end of a string.

slice.js

Javascript library to enhance String.substring / Array.slice with python slice style.

strip-ansi

Strip ANSI escape codes.

striptags

An implementation of PHP's strip_tags in Node.js.

parse-next-json-value

Parse next JSON value from string allowing extraneous characters after value.

pluralize

A very tiny library to pluralize words

Modules >Date & Time

pretty-ms

Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s.

In 3 lists

hirestime

A wrapper around the built-in high resolution timer which simplifies the calculation of timestamps.

periods

Defined time-periods constants for Javascript, in milliseconds.

fecha

Javascript Date formatting and parsing.

In 3 lists

akamai-time-reference

Get reference time using Akamai's time reference service.

timeago.js

A tiny(~1.7kb) library used to format date with *** time ago statement.

In 5 listsDetails

count-days-in-month

Get the number of days in a given month.

time-stamp

Get a formatted timestamp.

In 2 lists

twas

Generate a relative time string (Example: "3 seconds ago")

Modules >Object

map-obj

Map object keys and values into a new object.

filter-obj

Filter object keys and values into a new object.

object-values

Get the values of an object.

object-pairs

Turn an object into list of [key, value] pairs for mapping, iterating or other purposes.

zipmap

Returns a map with the keys mapped to the corresponding vals. zipmap also accepts a single value of objects or pairs.

just-pluck

Pluck without the madness.

deep-equal

Node's assert.deepEqual() algorithm as a standalone module.

deep-assign

Recursive Object.assign().

set-value

Create nested values and any intermediaries dot notation ('a.b.c') paths.

get-value

Use property paths (a.b.c) to get a nested value from an object.

has-value

Returns true if a value exists, false if empty. Works with deeply nested values using dot notation ('a.b.c') paths.

has-key-deep

Deep-search objects for keys. Keys can be searched by providing an array of keys, or using a dot-notiation.

flatkeys

Flatten object key hierarchies into a list of strings using a custom separator.

flatten-obj

Converts an object literal with deeply nested nodes to a simple key/value object.

is-empty-object

Check if an object is empty.

stringify-object

Stringify an object/array like JSON.stringify just without all the double-quotes.

sorted-object

Returns a copy of an object with its keys sorted.

static-props

Defines static object attributes using Object.defineProperties

missing-deep-keys

Returns an array of keys from first object that are missing in second.

has-own-property

Check if an object has a local property.

merge-objects

Deep-merge two objects. Arrays that are values of the same object key get concatenated.

deep-object-diff

Deep diff two JavaScript Objects while preserving the data structure. Including nested structures of Arrays and Objects.

Modules >Function

compose-function

Compose a new function from smaller functions f(g(x)).

In 2 lists

curry

A curry function without anything too clever.

once

Run a function exactly one time.

deep-bind

Bind a context to all functions in an object, including deeply nested functions.

identity-function

Always return the input argument.

mem

An optimization technique used to speed up consecutive function calls by caching the result of calls with identical input.

In 2 lists

throttle-debounce

Throttle/debounce your functions.

compose-tiny

A very tiny and fast compose function.

Modules >Math

is-even

A good way to tell if a number is even or not (avoids type issues). Uses is-odd and is-number under the hood.

is-number

Returns true if the value is a number.

is-odd

A good way to tell if a number is odd or not (avoids type issues). Uses is-number under the hood.

easy-math.js

A tiny easy math library including addition, multiplication, subtraction, and division.

my-prime

A good way to tell if a number is prime or not.

fun-gcd

A tiny math library to get gcd of two numbers using Euclidean algorithm

Modules >Stream

through2

Tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise.

In 2 lists

through2-filter

A through2 to create an Array.prototype.filter analog for streams.

through2-map

A through2 to create an Array.prototype.map analog for streams.

stream-spigot

A readable stream generator, useful for testing or converting simple functions into Readable streams.

concat-stream

writable stream that concatenates strings or data and calls a callback with the result.

In 2 lists

JSONStream

streaming JSON.parse and stringify

In 3 lists

through2-map-promise

A small promise-based wrapper for through2.

pump

pipe streams together and close all of them if one of them closes.

In 2 lists

split

Break up a stream and reassemble it so that each line is a chunk.

In 2 lists

is-stream

Check if something is a Node.js stream.

In 2 lists

syncthrough

Transform your data as it pass by, synchronously.

Modules >Promise

pify

Promisify a callback-style function.

In 6 listsDetails

promise-all-props

Like Promise.all but for object properties.

sleep-promise

Resolves a promise after a specified delay.

is-promise

Test whether an object looks like a promises-a+ promise.

In 3 lists

Modules >Data Structure

quetie

Just the cutest and tiniest queue/deque implementation!

Modules >File System

rimraf

A deep deletion module for node (like rm -rf).

In 4 lists

mkdirp

Recursively mkdir, like mkdir -p.

In 2 lists

du

A simple JavaScript implementation of du -sb.

file-size

Lightweight filesize to human-readable / proportions w/o dependencies.

tmp

Temporary file and directory creator for node.js.

fs-promise

Node fs methods as Promise/A+ (optional fs-extra, graceful-fs).

read-git-user

Reads the username and email from .gitconfig :wrench: and returns it as json object.

Modules >Browser

delegate

Lightweight event delegation.

insert-css

Insert a string of css into the head

dom-element-value

DOM element value getter/setter.

image-promise

Load one or more <img>s in a Promise.

get-media-size

Get the original size of any img/video/svg/canvas tags or canvas context.

document-ready

Document ready listener for modern browsers.

copee

Copy text from browser to clipboard...natively!

Modules >Semver

semver

The semantic version parser used by npm.

In 3 lists

semver-max

Find maximum (or minimum) version according to semver.

semver-first-satisfied

Find minimum in an array of version that satisfies a semver range.

Modules >CLI

abbrev

Calculate the set of unique abbreviations for a given set of strings.

glob

Glob functionality for node.js.

In 2 lists

username

Get the username of the current user.

In 3 lists

minimist

Parse argument options.

In 2 lists

png-to-ico

Convert png to windows ico format.

help-version

Easily handle --help and --version arguments in your CLI application

Modules >Module management

pkg-conf

Get namespaced config from the closest package.json.

normalize-pkg

Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.

Modules >Generators

is-generator

Check whether a given value is a generator function.

Modules >Other

uuid

Generate RFC-compliant UUIDs in JavaScript.

node-mime

Comprehensive MIME type mapping API based on mime-db module.

not-defined

Checks if foo is not defined, i.e. undefined, null, an empty string, array or object.

is-fqdn

Check if a string represent a fully qualified domain name.

shurley

Parses URLs from user input (with potential typos in protocols, bad copy+paste, etc.) and returns a proper URL.

mime-type-check

Get the MIME type of a file by its extension.

nanoid

A tiny (130 bytes), secure, URL-friendly, unique string ID generator for JavaScript

In 6 listsDetails

Modules >Tools

npm-deprecated-check

Check for deprecated packages and recommend alternative packages.

In 2 lists

Small modules rockstars to follow

Sindre Sorhus

James Halliday

In 2 lists

Rod Vagg

Max Ogden

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