Awesome Micro Npm Packages Overview
A curated list of small, focused npm packages.
🏠 Home · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 parro-it/awesome-micro-npm-packages · ⭐ 4.5K · 🏷️ Programming Languages
Awesome Micro npm Packages
A curated list of small, focused Node.js modules.
Inspired by the awesome (⭐268k) list thing.
Articles
- One-line node modules (⭐128)
- Module best practices (⭐1.5k)
- 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 (⭐21) - A small module to check if an Array is sorted.
- array-first (⭐11) - Get the first element or first n elements of an array.
- array-last (⭐34) - Return the last element in an array.
- arr-flatten (⭐60) - Recursively flatten an array or arrays.
- dedupe (⭐24) - Remove duplicates from an array.
- array-range (⭐25) - Creates a new array with given range.
- arr-diff (⭐44) - 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 (⭐41) - Returns an array filled with the specified input
- map-array (⭐4) - Map object keys and values into an array.
- in-array (⭐16) - Return true if any of passed values exists in array - faster than using indexOf.
- unordered-array-remove (⭐117) - Efficiently remove an element from an unordered array without doing a splice.
- array-swap (⭐7) - Swap position of two items in an array.
- mirrarray (⭐5) - Creates a keymirror object from an array of valid keys.
- group-array (⭐54) - Group array of objects into lists.
- array.chunk (⭐11) - Split array/TypedArray to chunks of given size.
- fast-cartesian (⭐55) - Fast cartesian product.
String
- decamelize (⭐229) - Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow.
- pad-left (⭐44) - Left pad a string with zeros or a specified string.
- to-camel-case (⭐36) - Convert a string to a camel case.
- to-capital-case (⭐11) - Convert a string to a capital case.
- to-constant-case (⭐4) - Convert a string to a constant case.
- to-dot-case (⭐5) - Convert a string to a dot case.
- to-no-case (⭐17) - Remove an existing case from a string.
- to-pascal-case (⭐3) - Convert a string to a pascal case.
- to-sentence-case (⭐6) - Convert a string to a sentence case.
- to-snake-case (⭐26) - Convert a string to a snake case.
- to-space-case (⭐6) - Convert a string to a space case.
- to-title-case (⭐17) - Convert a string to a title case.
- node-slug (⭐1.1k) - slugifies even utf-8 chars.
- rtrim (⭐0) - Strip whitespace - or other characters - from the end of a string.
- slice.js (⭐34) - Javascript library to enhance String.substring / Array.slice with python slice style.
- strip-ansi (⭐369) - Strip ANSI escape codes.
- striptags (⭐485) - An implementation of PHP's strip_tags in Node.js.
- parse-next-json-value (⭐1) - Parse next JSON value from string allowing extraneous characters after value.
- pluralize (⭐1) - A very tiny library to pluralize words
Date & Time
- pretty-ms (⭐929) - Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s.
- hirestime (⭐16) - A wrapper around the built-in high resolution timer which simplifies the calculation of timestamps.
- periods (⭐1) - Defined time-periods constants for Javascript, in milliseconds.
- fecha (⭐2k) - Javascript Date formatting and parsing.
- akamai-time-reference (⭐3) - Get reference time using Akamai's time reference service.
- timeago.js (⭐5k) - A tiny(~1.7kb) library used to format date with
*** time ago
statement. - count-days-in-month (⭐1) - Get the number of days in a given month.
- time-stamp (⭐112) - Get a formatted timestamp.
- twas (⭐245) - Generate a relative time string (Example: "3 seconds ago")
Object
- map-obj (⭐178) - Map object keys and values into a new object.
- filter-obj (⭐91) - Filter object keys and values into a new object.
- object-values (⭐26) - Get the values of an object.
- object-pairs (⭐2) - Turn an object into list of [key, value] pairs for mapping, iterating or other purposes.
- zipmap (⭐4) - Returns a map with the keys mapped to the corresponding vals. zipmap also accepts a single value of objects or pairs.
- just-pluck (⭐11) - Pluck without the madness.
- deep-equal (⭐732) - Node's assert.deepEqual() algorithm as a standalone module.
- deep-assign (⭐248) - Recursive Object.assign().
- set-value (⭐260) - Create nested values and any intermediaries dot notation (
'a.b.c'
) paths. - get-value (⭐230) - Use property paths (a.b.c) to get a nested value from an object.
- has-value (⭐27) - Returns true if a value exists, false if empty. Works with deeply nested values using dot notation (
'a.b.c'
) paths. - has-key-deep (⭐1) - Deep-search objects for keys. Keys can be searched by providing an array of keys, or using a dot-notiation.
- flatkeys (⭐3) - Flatten object key hierarchies into a list of strings using a custom separator.
- flatten-obj (⭐20) - Converts an object literal with deeply nested nodes to a simple key/value object.
- is-empty-object (⭐11) - Check if an object is empty.
- stringify-object (⭐298) - Stringify an object/array like JSON.stringify just without all the double-quotes.
- sorted-object (⭐35) - Returns a copy of an object with its keys sorted.
- static-props (⭐3) - Defines static object attributes using
Object.defineProperties
- missing-deep-keys (⭐0) - Returns an array of keys from first object that are missing in second.
- has-own-property (⭐2) - Check if an object has a local property.
- merge-objects (⭐2) - Deep-merge two objects. Arrays that are values of the same object key get concatenated.
- deep-object-diff (⭐945) - Deep diff two JavaScript Objects while preserving the data structure. Including nested structures of Arrays and Objects.
Function
- compose-function (⭐57) - Compose a new function from smaller functions
f(g(x))
. - curry (⭐314) - A curry function without anything too clever.
- once (⭐216) - Run a function exactly one time.
- deep-bind (⭐8) - Bind a context to all functions in an object, including deeply nested functions.
- identity-function - Always return the input argument.
- mem (⭐1k) - An optimization technique used to speed up consecutive function calls by caching the result of calls with identical input.
- throttle-debounce (⭐973) - Throttle/debounce your functions.
- compose-tiny (⭐46) - A very tiny and fast compose function.
Math
- is-even (⭐179) - A good way to tell if a number is even or not (avoids type issues). Uses
is-odd
andis-number
under the hood. - is-number (⭐232) - Returns
true
if the value is a number. - is-odd (⭐271) - A good way to tell if a number is odd or not (avoids type issues). Uses
is-number
under the hood. - easy-math.js (⭐7) - A tiny easy math library including addition, multiplication, subtraction, and division.
- my-prime (⭐2) - A good way to tell if a number is prime or not.
- fun-gcd (⭐1) - A tiny math library to get gcd of two numbers using Euclidean algorithm
Stream
- through2 (⭐1.9k) - Tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise.
- through2-filter (⭐35) - A through2 to create an Array.prototype.filter analog for streams.
- through2-map (⭐70) - A through2 to create an Array.prototype.map analog for streams.
- stream-spigot (⭐15) - A readable stream generator, useful for testing or converting simple functions into Readable streams.
- concat-stream (⭐570) - writable stream that concatenates strings or data and calls a callback with the result.
- JSONStream (⭐1.9k) - streaming JSON.parse and stringify
- through2-map-promise (⭐3) - A small promise-based wrapper for through2.
- pump (⭐895) - pipe streams together and close all of them if one of them closes.
- split (⭐346) - Break up a stream and reassemble it so that each line is a chunk.
- is-stream (⭐107) - Check if something is a Node.js stream.
- syncthrough (⭐76) - Transform your data as it pass by, synchronously.
Promise
- pify (⭐1.5k) - Promisify a callback-style function.
- promise-all-props (⭐10) - Like
Promise.all
but for object properties. - sleep-promise (⭐81) - Resolves a promise after a specified delay.
- is-promise (⭐277) - Test whether an object looks like a promises-a+ promise.
Data Structure
- quetie (⭐111) - Just the cutest and tiniest queue/deque implementation!
File System
- rimraf (⭐5.3k) - A deep deletion module for node (like rm -rf).
- mkdirp - Recursively mkdir, like mkdir -p.
- du (⭐29) - A simple JavaScript implementation of du -sb.
- file-size (⭐231) - Lightweight filesize to human-readable / proportions w/o dependencies.
- tmp (⭐723) - Temporary file and directory creator for node.js.
- fs-promise (⭐171) - Node fs methods as Promise/A+ (optional fs-extra, graceful-fs).
- read-git-user (⭐3) - Reads the username and email from
.gitconfig
🔧 and returns it as json object.
Browser
- delegate (⭐183) - Lightweight event delegation.
- insert-css - Insert a string of css into the head
- dom-element-value (⭐6) - DOM element value getter/setter.
- image-promise (⭐144) - Load one or more
<img>
s in a Promise. - get-media-size (⭐12) - Get the original size of any
img
/video
/svg
/canvas
tags or canvas context. - document-ready (⭐59) - Document ready listener for modern browsers.
- copee (⭐138) - Copy text from browser to clipboard...natively!
Semver
- semver (⭐4.8k) - The semantic version parser used by npm.
- semver-max (⭐3) - Find maximum (or minimum) version according to semver.
- semver-first-satisfied (⭐2) - Find minimum in an array of version that satisfies a semver range.
CLI
- abbrev (⭐158) - Calculate the set of unique abbreviations for a given set of strings.
- glob (⭐8.1k) - Glob functionality for node.js.
- username (⭐142) - Get the username of the current user.
- minimist - Parse argument options.
- png-to-ico (⭐141) - Convert png to windows ico format.
- help-version (⭐5) - Easily handle --help and --version arguments in your CLI application
Module management
- pkg-conf (⭐113) - Get namespaced config from the closest package.json.
- normalize-pkg (⭐18) - Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.
Generators
- is-generator (⭐15) - Check whether a given value is a generator function.
Other
- uuid (⭐14k) - Generate RFC-compliant UUIDs in JavaScript.
- node-mime (⭐2k) - Comprehensive MIME type mapping API based on mime-db module.
- not-defined (⭐3) - Checks if foo is not defined, i.e. undefined, null, an empty string, array or object.
- is-fqdn (⭐22) - Check if a string represent a fully qualified domain name.
- shurley (⭐6) - Parses URLs from user input (with potential typos in protocols, bad copy+paste, etc.) and returns a proper URL.
- mime-type-check (⭐5) - Get the MIME type of a file by its extension.
- nanoid (⭐22k) - A tiny (130 bytes), secure, URL-friendly, unique string ID generator for JavaScript
Tools
- npm-deprecated-check (⭐9) - Check for deprecated packages and recommend alternative packages.
Related lists
This section contains awesome lists that you may find useful if you use or write small NPM modules.
- awesome-nodejs (⭐53k) - A curated list of delightful Node.js packages and resources.
- awesome-npm (⭐4.3k) - Awesome npm resources and tips.
Small modules rockstars to follow
These people are used to develop awesome NPM modules that follows the single responsibility philosophy. Follow them to discover new great modules:
Sindre Sorhus | James Halliday | Eugene Sharygin | Isaac Z. Schlueter | Jon Schlinkert | Dominic Tarr |
Rod Vagg | Max Ogden | Brian Woodward |
Contribute
Contributions welcome! Read the contribution guidelines first.
License
To the extent possible under law, Andrea Parodi has waived all copyright and related or neighboring rights to this work.