npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

leftpad-os

v1.0.0

Published

An operating system for strings with insufficient left margin

Readme

Leftpad OS

Leftpad OS takes left-pad to the next level by making it an operating system. It boots inside Node.js, manages the space to the left of your strings, and ships with fewer background services than any other modern OS.

It is kind of an Operating System

The OS terminology is not entirely marketing. Leftpad OS is analogous to an operating system if you are willing to be extremely generous about both words.

Traditional OS | Leftpad OS --- | --- kernel | index.js device drivers | the ch argument shell | the Node.js REPL processes | strings executables | padding operations users | npm dependents ACLs | requested output lengths bootloader | require('leftpad-os') ??? | Unicode outside the BMP

Our "kernel" legitimately performs several kernel-like duties: it accepts system calls, allocates space, schedules a loop, and returns control to the caller. The crucial difference is that all allocated space appears on the left.

Padding characters are like device drivers: they provide a small abstraction over an otherwise bewildering variety of spaces, zeroes, dashes, and asterisks. The third argument selects the hardware.

Traditional operating systems manage memory, processes, and files. Leftpad OS manages strings that are not wide enough yet. This tighter scope is why the entire system can boot synchronously from node_modules.

Inspired by Cloudflare OS's strikingly reasonable version of this comparison.

Install

npm install leftpad-os

Usage

const leftPad = require('leftpad-os')

leftPad('foo', 5)
// => '  foo'

leftPad('kernel', 10, '0')
// => '0000kernel'

leftPad(17, 5, 0)
// => '00017'

leftPad(value, length[, character])

Returns value as a string, padded on the left until it reaches length. character defaults to a space and should be a single character.

In keeping with upstream behavior, strings that are already at least length characters long are returned unchanged. Characters outside the Unicode Basic Multilingual Plane count as two UTF-16 code units. That is not a bug; it is a legacy device interface.

System requirements

  • Node.js
  • At least one string that could stand to move a little to the right

Provenance and license

The runtime implementation and TypeScript declaration are derived from left-pad 1.3.0. The original MIT copyright notice is preserved in LICENSE, and more detailed attribution is in NOTICE.

The new Leftpad OS documentation, tests, and package metadata are also released under the MIT License.