sindresorhus

npm packages maintained by sindresorhus

Packages
250
Weekly downloads
17.4B
Repositories
Stars
Followers

Packages

ansi-styles
ANSI escape codes for styling strings in the terminal
683M +1%7.0.0last month
strip-ansi
Strip ANSI escape codes from a string
525.8M +1%7.2.06 months ago
string-width
Get the visual width of a string - the number of columns required to display it
507.9M +1%8.2.22 months ago
chalk
Terminal string styling done right
502.7M -0%6.0.0last month
supports-color
Detect whether a terminal supports color
499.4M +0%11.0.0last month
ansi-regex
Regular expression for matching ANSI escape codes
497.8M +1%6.3.03 weeks ago
type-fest
A collection of essential TypeScript types
385.5M +1%5.9.02 days ago
wrap-ansi
Wordwrap a string with ANSI escape codes
364.4M -16%10.0.12 weeks ago
escape-string-regexp
Escape RegExp special characters
359.7M +1%5.0.05 years ago
p-limit
Run multiple promise-returning & async functions with limited concurrency
331.8M +1%7.3.2yesterday
locate-path
Get the first path that exists on disk of multiple paths
316.6M +0%8.0.012 months ago
p-locate
Get the first fulfilled promise that satisfies the provided testing function
315.4M +0%7.0.07 months ago
path-key
Get the PATH environment variable key cross-platform
278.3M +1%4.0.05 years ago
find-up
Find a file or directory by walking up parent directories
271.3M -16%8.0.012 months ago
has-flag
Check if argv has a specific flag
267.3M -16%5.0.15 years ago
is-fullwidth-code-point
Check if the character represented by a given Unicode code point is fullwidth
265M +1%5.1.0last year
globals
Global identifiers from different JavaScript environments
264.8M -2%17.12.0today
resolve-from
Resolve the path of a module like `require.resolve()` but from a given path
244.4M -0%5.0.07 years ago
path-exists
Check if a path exists
231.5M +0%5.0.05 years ago
shebang-regex
Regular expression for matching a shebang line
228.9M +0%4.0.05 years ago
strip-json-comments
Strip comments from JSON. Lets you use comments in your JSON files!
211.4M -1%5.0.3last year
get-stream
Get a stream as a string, Buffer, ArrayBuffer or array
206.1M +2%9.0.12 years ago
yocto-queue
Tiny queue data structure
192.8M -0%1.2.210 months ago
onetime
Ensure a function is only called once
182.2M +2%8.0.07 months ago
execa
Process execution for humans
170.2M +3%10.0.1last month
object-assign
ES2015 `Object.assign()` ponyfill
168.7M -1%4.1.110 years ago
is-stream
Check if something is a Node.js stream
164.1M -16%4.0.13 years ago
callsites
Get callsites from the V8 stack trace API
155.7M -1%4.2.02 years ago
camelcase
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
154.1M -15%9.0.010 months ago
strip-bom
Strip UTF-8 byte order mark (BOM) from a string
154M +2%5.0.05 years ago
import-fresh
Import a module while bypassing the cache
151.9M -2%4.0.06 months ago
npm-run-path
Get your PATH prepended with locally installed binaries
150.4M +2%6.0.02 years ago
make-dir
Make a directory and its parents if needed - Think `mkdir -p`
146.3M +2%5.1.012 months ago
open
Open stuff like URLs, files, executables. Cross-platform.
145M +3%11.0.23 days ago
parent-module
Get the path of the parent module
141.9M -2%3.2.012 months ago
slash
Convert Windows backslash paths to slash paths
140.6M +2%5.1.03 years ago
parse-json
Parse JSON with more helpful errors
138.1M +2%8.3.0last year
is-wsl
Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)
132.1M +2%3.1.17 months ago
ansi-escapes
ANSI escape codes for manipulating the terminal
128.9M +2%7.3.07 months ago
is-plain-obj
Check if a value is a plain object
128.3M +2%4.1.04 years ago
strip-final-newline
Strip the final newline character from a string or Uint8Array
127.8M +2%4.0.03 years ago
merge-descriptors
Merge objects using their property descriptors
127M +2%2.0.03 years ago
is-docker
Check if the process is running inside a Docker container
123M +2%4.0.012 months ago
cli-cursor
Toggle the CLI cursor
121.6M +1%5.0.02 years ago
restore-cursor
Gracefully restore the CLI cursor on exit
121.6M +1%5.1.02 years ago
pify
Promisify a callback-style function
119.2M -2%6.1.04 years ago
slice-ansi
Slice a string with ANSI escape codes
117.8M +1%9.0.05 months ago
indent-string
Indent each line in a string
106.5M +2%5.0.05 years ago
log-symbols
Colored symbols for various log levels. Example: `✔︎ Success`
105.4M +2%7.0.1last year
p-try
`Start a promise chain
104.6M +3%3.0.05 years ago
path-type
Check if a path is a file, directory, or symlink
103.7M +1%6.0.02 years ago
define-lazy-prop
Define a lazily evaluated property on an object
98.2M +3%3.0.05 years ago
error-ex
Easy error subclassing and stack customization
97.3M +2%1.3.412 months ago
globby
User-friendly glob matching
96.9M +2%16.2.42 weeks ago
is-unicode-supported
Detect whether the terminal supports Unicode
94.2M -15%2.1.02 years ago
binary-extensions
List of binary file extensions
93.8M -2%3.1.0last year
strip-indent
Strip leading whitespace from each line in a string
91.6M +2%4.1.111 months ago
ora
Elegant terminal spinner
90.6M +2%9.4.12 months ago
env-paths
Get paths for storing things like data, config, cache, etc
86.5M +2%4.0.07 months ago
p-map
Map over promises concurrently
82.9M +2%7.0.75 days ago
figures
Unicode symbols with fallbacks for older terminals
80.3M +2%6.1.02 years ago
get-east-asian-width
Determine the East Asian Width of a Unicode character
77.6M +4%1.6.04 months ago
is-binary-path
Check if a file path is a binary file
75.8M -18%3.0.02 years ago
decamelize
Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow
72.1M +2%6.0.1last year
redent
Strip redundant indentation and indent the string
69.3M +1%4.0.05 years ago
is-interactive
Check if stdout or stderr is interactive
68.3M +2%2.0.05 years ago
leven
Measure the difference between two strings using the Levenshtein distance algorithm
65.2M +2%4.1.012 months ago
cli-spinners
Spinners for use in the terminal
63.8M -15%3.4.08 months ago
min-indent
Get the shortest leading whitespace from lines in a string
63.6M +1%1.0.16 years ago
mimic-response
Mimic a Node.js HTTP response stream
61.1M -17%4.0.05 years ago
@sindresorhus/is
Type check values
61M +1%8.1.04 months ago
is-obj
Check if a value is an object
59.7M +2%3.0.05 years ago
wsl-utils
Utilities for working with Windows Subsystem for Linux (WSL)
59M +5%1.0.03 weeks ago
file-type
Detect the file type of a file, stream, or data
58.7M +5%22.0.22 weeks ago
is-path-inside
Check if a path is inside another path
57.4M -15%4.0.05 years ago
default-browser
Get the default browser
56.9M +4%5.5.12 weeks ago
default-browser-id
Get the bundle identifier of the default browser (macOS). Example: com.apple.Safari
55.9M +3%5.0.110 months ago
read-pkg
Read a package.json file
55.4M +0%10.1.07 months ago
run-applescript
Run AppleScript and get the result
55.2M +4%7.1.012 months ago
mz
modernize node.js to current ECMAScript standards
54.5M -1%2.7.09 years ago
cli-truncate
Truncate a string to a specific width in the terminal
54.5M +1%6.1.12 months ago
dot-prop
Get, set, or delete a property from a nested object using a dot path
53.6M +2%10.2.0last month
bundle-name
Get bundle name from a bundle identifier (macOS): `com.apple.Safari` → `Safari`
53.5M +3%4.1.03 years ago
defaults
Easily handle defaults for your options
53.3M +1%3.0.03 years ago
string-length
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
53.2M +2%7.0.17 months ago
array-union
Create an array of unique values, in order, from the input arrays
52.7M -17%3.0.16 years ago
decompress-response
Decompress a HTTP response if needed
52.5M +0%10.0.011 months ago
p-retry
Retry a promise-returning or async function
52M +4%8.0.1today
import-local
Let a globally installed package use a locally installed version of itself if available
50.5M +1%3.2.02 years ago
p-timeout
Timeout a promise after a specified amount of time
50.1M +4%7.0.111 months ago
unicorn-magic
Some useful utilities I often need
49.5M -14%0.4.010 months ago
resolve-cwd
Resolve the path of a module like `require.resolve()` but from the current working directory
49.2M +1%3.0.07 years ago
clean-stack
Clean up error stack traces
48.6M +1%6.0.010 months ago
detect-newline
Detect the dominant newline character of a string
48.3M +1%4.0.13 years ago
normalize-url
Normalize a URL
47.8M -0%9.0.13 months ago
emittery
Simple and modern async event emitter
47.7M +1%2.0.06 months ago
is-inside-container
Check if the process is running inside a container (Docker/Podman)
47M -14%1.0.04 years ago
quick-lru
Simple “Least Recently Used” (LRU) cache
45.9M +1%7.3.011 months ago
thenify-all
Promisifies all the selected functions in an object
45.9M -17%1.6.012 years ago
mimic-function
Make a function mimic another one
45.5M +2%5.0.12 years ago
yn
Parse yes/no like values
45.4M -0%5.1.0last year
meow
CLI app helper
42.7M +2%14.1.06 months ago
arrify
Convert a value to an array
42.5M -16%3.0.05 years ago
is-generator-fn
Check if something is a generator function
42.3M +2%3.0.05 years ago
got
Human-friendly and powerful HTTP request library for Node.js
41.1M +0%16.0.02 days ago
aggregate-error
Create an error from multiple errors
41.1M +1%5.0.03 years ago
lowercase-keys
Lowercase the keys of an object
40.7M +0%4.0.17 months ago
supports-hyperlinks
Detect whether a terminal supports hyperlinks
40.4M +3%4.5.02 months ago
pretty-ms
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
40.1M +4%9.3.14 days ago
parse-ms
Parse milliseconds into an object
39.7M +3%4.0.03 years ago
@sindresorhus/merge-streams
Merge multiple streams into a unified stream
39.7M +5%4.0.02 years ago
widest-line
Get the visual width of the widest line in a string - the number of columns required to display it
39.3M +2%6.0.07 months ago
yoctocolors
The smallest and fastest command-line coloring package on the internet
37.8M +6%2.2.0last month
log-update
Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc.
37.7M -17%8.0.05 months ago
environment
Check which JavaScript environment your code is running in at runtime: browser, Node.js, Bun, etc
37.7M +2%1.1.02 years ago
p-cancelable
Create a promise that can be canceled
37.4M -0%4.0.14 years ago
map-obj
Map object keys and values into a new object
36.3M +1%6.0.012 months ago
p-queue
Promise queue with concurrency control
35.9M +4%9.3.3last month
responselike
A response-like object for mocking a Node.js HTTP response stream
33.7M -0%4.0.211 months ago
component-emitter
Simple event emitter
33.6M +1%2.0.03 years ago
cli-boxes
Boxes for use in the terminal
33.4M +2%4.0.12 years ago
tagged-tag
Unique tag for use in the type-fest Tagged type
33.2M +6%1.0.0last year
serialize-error
Serialize/deserialize an error into a plain object
32.8M +3%13.0.18 months ago
pretty-bytes
Convert bytes to a human readable string: 1337 → 1.34 kB
32.2M +1%7.1.24 days ago
yoctocolors-cjs
CommonJS version - The smallest and fastest command-line coloring package on the internet
31.2M -1%2.1.3last year
crypto-random-string
Generate a cryptographically strong random string
30.2M -0%6.0.0last month
boxen
Create boxes in the terminal
30.1M -0%8.0.12 years ago
unique-string
Generate a unique random string
29.9M -0%3.0.05 years ago
stdin-discarder
Discard stdin input except for Ctrl+C
29.6M +3%0.3.25 months ago
uint8array-extras
Useful utilities for working with Uint8Array (and Buffer)
29.2M +5%1.5.0last year
http2-wrapper
HTTP2 client, just with the familiar `https` API
28.8M -0%2.2.13 years ago
is-regexp
Check if a value is a regular expression
28.5M +2%3.1.05 years ago
detect-indent
Detect the indentation of code
26.8M +1%7.0.212 months ago
load-json-file
Read and parse a JSON file
26.7M +2%7.0.15 years ago
debounce
Delay function calls until a set time elapses after the last invocation
25.5M +1%3.0.010 months ago
get-port
Get an available port
25.5M +2%7.2.05 months ago
query-string
Parse and stringify URL query strings
25.3M +1%9.5.1today
stringify-object
Stringify an object/array like JSON.stringify just without all the double-quotes
25.1M +2%7.0.02 months ago
is-installed-globally
Check if your package was installed globally
24.6M +1%1.0.03 years ago
powershell-utils
Utilities for executing PowerShell commands
23.5M -6%0.2.13 days ago
camelcase-keys
Convert object keys to camel case
22.6M +1%10.0.27 months ago
temp-dir
Get the real path of the system temp directory
21.9M +0%3.0.04 years ago
builtin-modules
A static list of the Node.js builtin modules from the latest Node.js version
21.8M +3%5.3.02 months ago
terminal-link
Create clickable links in the terminal
21.2M +2%5.0.012 months ago
gzip-size
Get the gzipped size of a string or buffer
21.2M -1%7.0.05 years ago
is-in-ssh
Check if the process is running in an SSH session
21.1M +8%1.0.010 months ago
registry-url
Get the set npm registry URL
21.1M +0%7.2.0last year
xdg-basedir
Get XDG Base Directory paths
20.9M +2%5.1.05 years ago
clone-response
Clone a Node.js HTTP response stream
19.9M +1%2.0.04 years ago
throttleit
Throttle a function to limit its execution rate
19.6M +2%3.0.02 months ago
trim-newlines
Trim newlines from the start and/or end of a string
19.4M +0%5.0.03 years ago
untildify
Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`
18.5M +0%6.0.012 months ago
is-network-error
Check if a value is a Fetch network error
18.5M +3%1.3.24 months ago
filter-obj
Filter object keys and values into a new object
18.5M -15%6.1.02 years ago
configstore
Easily load and save config without having to think about where and how
18.5M +1%8.0.07 months ago
global-directory
Get the directory of globally installed packages and binaries
17.9M +3%5.0.07 months ago
get-stdin
Get stdin as a string or Uint8Array
16.9M +0%10.0.07 months ago
is-retry-allowed
Check whether a request can be retried based on the `error.code`
16.8M +1%3.0.05 years ago
sort-keys
Sort the keys of an object
16.8M +2%6.0.12 months ago
tempy
Get a random temporary file or directory path
16.2M +0%3.2.07 months ago
to-fast-properties
Force V8 to use fast properties for an object
15.9M -17%4.0.05 years ago
import-lazy
Import a module lazily
15.9M -16%4.0.07 years ago
html-tags
List of standard HTML tags
15.6M +2%5.1.0last year
split-on-first
Split a string on the first occurance of a given separator
15.5M -15%4.0.0last year
has-ansi
Check if a string has ANSI escape codes
15.2M -2%6.0.212 months ago
auto-bind
Automatically bind methods to their class instance
14.9M +4%5.0.15 years ago
escape-goat
Escape a string for use in HTML or the inverse
14.6M +1%4.0.05 years ago
decamelize-keys
Convert object keys from camel case
14.3M -1%2.0.14 years ago
package-json
Get metadata of a package from the npm registry
14.2M +0%10.0.12 years ago
index-to-position
Convert a string index to its line and column position
13.9M +3%1.2.011 months ago
del
Delete files and directories
13.6M -1%8.0.112 months ago
p-defer
Create a deferred promise
13.5M +4%4.0.12 years ago
hard-rejection
Make unhandled promise rejections fail hard right away instead of the default silent fail
13.5M -1%2.1.07 years ago
ip-regex
Regular expression for matching IP addresses (IPv4 & IPv6)
13.3M +0%5.0.05 years ago
find-up-simple
Find a file or directory by walking up parent directories — Zero dependencies
13.2M +3%1.0.12 years ago
p-event
Promisify an event by waiting for it to be emitted
12.8M +2%7.1.08 months ago
conf
Simple config handling for your app or module
12.7M +7%15.1.07 months ago
is-npm
Check if your code is running as an npm script
12.7M +0%6.1.012 months ago
debounce-fn
Debounce a function
12.4M +8%6.0.03 years ago
is-path-cwd
Check if a path is the current working directory
12.4M -1%4.0.1last year
import-from
Import a module like with `require()` but from a given path
12.3M -1%4.0.05 years ago
hasha
Hashing made simple. Get the hash of a buffer/string/stream/file.
12M +1%7.0.012 months ago
latest-version
Get the latest version of an npm package
11.9M -0%9.0.03 years ago
matcher
Simple wildcard matching
11.9M +2%6.0.012 months ago
convert-hrtime
Convert the result of `process.hrtime.bigint()` to seconds, milliseconds, nanoseconds
11.7M +3%5.0.05 years ago
time-span
Simplified high resolution timing
11.5M +3%5.1.04 years ago
filenamify
Convert a string to a valid safe filename
11.5M +2%7.0.34 days ago
pupa
Simple micro templating
11.3M +1%3.3.012 months ago
is-builtin-module
Check if a string matches the name of a Node.js builtin module
10.7M +4%5.0.02 years ago
dargs
Reverse minimist. Convert an object of options into an array of command-line arguments.
10.6M +2%8.1.05 years ago
semver-regex
Regular expression for matching semver versions
10.4M +2%4.0.54 years ago
update-notifier
Update notifications for your CLI app
10.3M -1%7.3.12 years ago
markdown-extensions
List of Markdown file extensions
10.3M +3%2.0.03 years ago
exit-hook
Run some code when the process exits
10.2M +5%5.1.07 months ago
yocto-spinner
Tiny terminal spinner
10.2M +5%1.2.22 months ago
text-extensions
List of text file extensions
10.2M +3%3.1.02 years ago
chalk-template
Terminal string styling with tagged template literals
9.6M -15%1.1.212 months ago
is-text-path
Check if a file path is a text file
9.5M +3%3.0.02 years ago
filename-reserved-regex
Regular expression for matching reserved filename characters
9.4M -15%4.0.14 days ago
p-filter
Filter promises concurrently
9.4M +1%4.1.03 years ago
get-own-enumerable-keys
Like `Object.keys()` but also includes symbols
9.3M +5%1.0.04 years ago
array-uniq
Create an array without duplicates
9.1M +1%3.0.05 years ago
array-differ
Create an array with values that are present in the first input array but not additional ones
8.8M +2%4.0.05 years ago
default-require-extensions
Node's default require extensions as a separate module
8.8M +2%3.0.14 years ago
append-transform
Install a transform to `require.extensions` that always runs last, even if additional extensions are added later.
8.8M +2%2.0.07 years ago
multimatch
Extends `minimatch.match()` with support for multiple patterns
8.7M +2%8.0.06 months ago
clipboardy
Access the system clipboard (copy/paste)
8.7M +2%5.3.2last month
has-yarn
Check if a project is using Yarn
8.7M -0%4.0.012 months ago
find-versions
Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`
8.6M -15%6.0.02 years ago
p-is-promise
Check if something is a promise
8.6M +3%4.0.05 years ago
prepend-http
Prepend `https://` to humanized URLs like sindresorhus.com and localhost
8.5M -18%4.0.05 years ago
url-parse-lax
Lax URL parsing with support for protocol-less URLs and IPs
8.2M +0%6.0.012 months ago
is-absolute-url
Check if a URL is absolute
7.9M -0%5.0.012 months ago
read-package-up
Read the closest package.json file
7.9M -0%12.0.010 months ago
super-regex
Make a regular expression time out if it takes too long to execute
7.6M +6%1.1.010 months ago
function-timeout
Make a synchronous function have a timeout
7.6M +6%1.0.22 years ago
is-in-ci
Check if the process is running in a Continuous Integration (CI) environment
7.6M +8%2.0.0last year
eslint-plugin-unicorn
More than 300 powerful ESLint rules
7.5M +3%74.0.04 days ago
caller-path
Get the path of the caller function
7.5M +2%4.0.05 years ago
ky
Tiny and elegant HTTP client based on the Fetch API
7.4M +3%2.1.04 days ago
delay
Delay a promise a specified amount of time
7.3M +3%7.0.010 months ago
duplexer3
Modern version of `duplexer2`
6.9M +0%1.0.04 years ago
skin-tone
Change the skin tone of an emoji 👌👌🏻👌🏼👌🏽👌🏾👌🏿
6.8M -15%4.0.03 years ago
caching-transform
Wraps a transform and provides caching
6.7M -16%4.0.07 years ago
stream-to-array
Concatenate a readable stream's data into a single array
6.7M -2%2.3.011 years ago
os-locale
Get the system locale
6.6M +3%8.0.07 months ago
ink
React for CLI
6.6M +8%7.1.12 months ago
p-reduce
Reduce a list of values using promises into a promise for a value
6.4M -16%3.0.05 years ago
semver-truncate
Truncate a semver version: `1.2.3` → `1.2.0`
6.4M +3%3.0.05 years ago
invert-kv
Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`
6.1M +4%4.2.05 years ago
lcid
Mapping between standard locale identifiers and Windows locale identifiers (LCID)
6.1M +4%5.0.02 years ago
repeating
Repeat a string - fast
5.5M +2%4.0.05 years ago
strip-outer
Strip a substring from the start/end of a string
5.3M +0%2.0.05 years ago
screenfull
Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen.
5.2M +1%6.0.24 years ago
is-root
Check if the process is running as root user, for example, one started with `sudo`
5.1M -1%3.0.05 years ago
loud-rejection
Make unhandled promise rejections fail loudly instead of the default silent fail
4.6M -0%2.2.07 years ago
is-port-reachable
Check if a local or remote port is reachable
4.3M -2%4.0.05 years ago
has-own-prop
A safer `.hasOwnProperty()`
4.1M +2%3.1.05 years ago
junk
Filter out system junk files like .DS_Store and Thumbs.db
4M -18%4.0.13 years ago
hex-rgb
Convert HEX color to RGBA
3.8M +1%5.0.05 years ago
is-observable
Check if a value is an Observable
3.6M +2%3.0.04 years ago
titleize
Capitalize every word in a string: `unicorn cake` → `Unicorn Cake`
3M +8%4.0.03 years ago
system-architecture
Get the operating system CPU architecture
2.9M -11%1.0.02 years ago
is-ip
Check if a string is an IP address
2.8M +2%5.0.13 years ago
elegant-spinner
Elegant spinner for interactive CLI apps
2.8M -1%3.0.05 years ago
array-equal
Check if two arrays are equal
2.5M -14%2.0.0last year
irregular-plurals
Map of nouns to their irregular plural form
2.5M +1%4.2.010 months ago
p-wait-for
Wait for a condition to be true
2.5M -1%6.0.012 months ago
srcset
Parse and stringify the HTML `<img>` srcset attribute
2.4M -5%5.0.38 months ago
memoize
Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input
1.9M -2%11.0.06 months ago

Repositories

Repositories and contributions come from Github's GraphQL API, which has no anonymous tier. Sign in to see them.