install

A minimal CommonJS module loader that lets you install and synchronously require a tree of modules in any JavaScript environment.

Library
npm
v0.13.0
66stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
28/100Needs Attention
Development Activity0
Maintenance0
Community40
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
64/100Good
Architecture68
Code Quality60
Innovation62
Learning Curve65

install is a tiny CommonJS module loader created by Ben Newman that lets you register a nested tree of module factory functions and directories, then require them synchronously - the same way Node does, but without touching the filesystem. It became best known as the runtime powering Meteor’s client-side module system, where synchronous require semantics needed to work inside the browser.

Under the hood, makeInstaller() builds a virtual file tree of File objects representing directories and modules, resolves identifiers using the same relative/absolute/node_modules rules as Node’s own module resolution, and evaluates each module lazily on first require. A fallback option lets missing modules be resolved by another loader (e.g., Node’s native require), and a prefetch/install.fetch API supports asynchronously fetching modules that haven’t been installed yet - useful for streaming code to the browser on demand.

What You Get

  • A makeInstaller(options) factory for creating isolated module registries, so multiple independent module trees can coexist without polluting global state.
  • Node-compatible module resolution - relative paths, absolute paths, node_modules package lookup, package.json main/browser fields, and index.js fallback - reimplemented without touching the real filesystem.
  • A fallback hook so unresolved identifiers can be handed off to another loader (commonly Node’s native require) instead of throwing.
  • An async module.prefetch/install.fetch API for lazily fetching and installing modules that weren’t part of the original tree, useful for on-demand code delivery in the browser.

Common Use Cases

  • Bundler runtime output - bundlers can compile a whole dependency graph into the nested-object format install() expects and ship this file as the tiny runtime that stitches modules together in the browser.
  • Meteor-style synchronous browser modules - apps that need Node’s synchronous require semantics to work client-side without a full async module loader.
  • Sandboxed/dynamic module trees - testing or plugin systems that need to construct an isolated require scope from an in-memory tree of factory functions rather than real files on disk.
  • Incremental/on-demand loading - combining prefetch with a custom install.fetch implementation to stream additional modules to a running application only when they’re actually required.

Under The Hood

Architecture Read install.js: the File constructor represents either a directory or a module in a virtual tree; fileMergeContents recursively merges nested objects/arrays/functions into that tree; fileResolve implements Node-style identifier resolution (relative, absolute, and node_modules walk-up, with package.json main/browser field and index.js fallback, guarded against re-visiting the same directory via a seenDirFiles list); fileEvaluate lazily invokes a module’s factory function with (require, exports, module) and caches the result on module.exports. All state - the filesByModuleId cache, the root File, defaultExtensions, fallback, mainFields - lives in closures inside makeInstaller(options), so each call produces a fully isolated registry. The whole implementation is one ~550-line file with no submodules, so changes to the core File/Module abstractions have repo-wide blast radius, since every other function is built directly on top of them. It is compact and single-responsibility but tightly coupled through closures over shared mutable state (filesByModuleId, missing, lastPrefetchPromise) rather than explicit dependency injection.

Tech Stack package.json shows plain vanilla JavaScript with no TypeScript and no build step for the library itself - main points straight at install.js, which ships as-is. devDependencies are mocha for the test suite, docco for generating API docs (scripts/docs.sh runs docco against install.js into docs/index.html), reify (the author’s own ES module interop library) to enable import/export syntax inside tests only, and terser to produce a minified install.min.js at publish time (scripts/prepublish.sh). CI is a .travis.yml matrix running Node 4 through 12, reflecting the project’s 2013-2019 active period.

Code Quality test/run.js is a single 1173-line mocha spec covering relative/absolute/node_modules resolution edge cases, package.json main/browser field handling, dynamic prefetch, and fallback behavior - broad coverage relative to the ~550-line source, though concentrated in one file rather than split by concern. There is no TypeScript or type checking anywhere in the codebase. Error handling is explicit: makeMissingError() builds descriptive Cannot find module errors, and the fallback mechanism gives callers an escape hatch rather than silently swallowing failures. Naming is consistent throughout (fileXxx/moduleXxx prefixes tie helper functions to the object type they operate on). There is no linter configuration and no lint/type-check step in CI, which just runs npm test.

What Makes It Unique The specific technical trick is resolving and evaluating an in-memory tree of module factory functions using the same identifier-resolution algorithm Node uses for the real filesystem - relative/absolute paths, extensions, node_modules walk-up, package.json main/browser fields, index.js fallback - without ever touching disk. That is what let Meteor give browser bundles synchronous, Node-compatible require() semantics years before bundler-level dynamic import() became commonplace. The prefetch/install.fetch hook for asynchronously fetching modules not present in the original tree is a distinctive, comparatively early take on on-demand code delivery. It is not novel in a research sense - module loaders are a well-trodden problem - but faithfully emulating Node resolution in a virtual filesystem inside one small, dependency-free file is a focused, clever piece of engineering for its era.

Used by 11 apps in this directory

Python
62%
MIT

AutoGen

AI Development · Automation

60,839

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

View details
56
Repo Health
78
Technical
73
Dependency
Built with
Python62%
C#25%
TypeScript12%
Updated 4 months ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,442

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
61
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 4 weeks ago
Python
64%
MIT

Flowfile

Data Engineering

350

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python64%
Vue18%
TypeScript16%
Updated yesterday
TypeScript
99%
AGPL 3.0

fountain-ink

Blogging

64

A self-hostable, decentralized blogging platform built on Lens Protocol — own your content, audience, and distribution forever.

View details
26
Repo Health
66
Technical
66
Dependency
Built with
TypeScript99%
Updated 7 months ago
Rust
67%
Other

GitButler

Developer Tools · Devops · AI Development

21,624

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
67
Dependency
Built with
Rust67%
TypeScript20%
Svelte11%
Updated yesterday
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,586

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
89
Repo Health
86
Technical
62
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
TypeScript
98%
Other

Novu

Developer Tools

39,870

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
96%
MIT

Payload CMS

Developer Tools · Blogging · CMS

44,600

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
91
Repo Health
88
Technical
65
Dependency
Built with
TypeScript96%
Updated 3 days ago
TypeScript
53%
Other

Phase Console

Security · Devops

914

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
83
Repo Health
73
Technical
66
Dependency
Built with
TypeScript53%
Python45%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search