gitwtfhub

wtf is static-injector?

patrickjs/static-injector — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2022-01-29

Audience · developerComplexity · 3/5DormantSetup · moderate

TL;DR

A standalone TypeScript dependency injection system, modeled on Angular's DI, that wires components together at compile time using decorators.

Mindmap

mindmap
  root((repo))
    What it does
      Dependency injection
      Compile-time wiring
      Decorator-based
    Tech stack
      TypeScript
      Decorators
      Custom transformer
    Use cases
      Wire large TS apps
      Reduce boilerplate
      Angular-style DI
    Audience
      TypeScript developers
      Angular-familiar devs
    Build tools
      Webpack
      Rollup
      Plain TypeScript

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Automatically wire dependencies between classes instead of manually passing objects around

REASON 2

Reduce boilerplate in a large TypeScript project where many components reference each other

REASON 3

Bring Angular-style dependency injection to a non-Angular TypeScript codebase

REASON 4

Make code easier to test and refactor by decoupling how components get their dependencies

What's in the stack?

TypeScript

How it stacks up

patrickjs/static-injector0verflowme/alarm-clock0verflowme/seclists
LanguageCSS
Last pushed2022-01-292022-10-032020-05-03
MaintenanceDormantDormantDormant
Setup difficultymoderateeasyeasy
Complexity3/52/51/5
Audiencedevelopervibe coderops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires wiring a custom TypeScript transformer into your build tool (webpack, rollup, etc.).

Yoink these prompts

Prompt 1
Show me how to mark a class with @Injectable and create an Injector using static-injector.
Prompt 2
Help me set up the custom TypeScript transformer this repo needs with webpack's ts-loader.
Prompt 3
Explain how static-injector's compile-time wiring differs from Angular's runtime dependency injection.
Prompt 4
Walk me through configuring static-injector with Rollup based on this repo's example projects.

Frequently asked questions

wtf is static-injector?

A standalone TypeScript dependency injection system, modeled on Angular's DI, that wires components together at compile time using decorators.

Is static-injector actively maintained?

Dormant — no commits in 2+ years (last push 2022-01-29).

How hard is static-injector to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is static-injector for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.