Back to browse
GitHub Repository

Platform-aware script runner for Node.js projects

3 starsTypeScript

Platform-aware script runner for Node.js projects

by carlos-menezes·Mar 17, 2026·3 points·0 comments

AI Analysis

MidShip It

Platform-aware npm scripts when cross-env and shell conditionals already solve this.

Strengths
  • Naming convention like build:darwin:arm64 is cleaner than shell if-statements
  • Fallback chain through platform, arch, and default handles missing variants gracefully
  • Dry-run and verbose flags help debug which script variant gets resolved
Weaknesses
  • Cross-platform script execution already solved by cross-env and platform-specific packages
  • Small utility that most monorepo tooling already handles in different ways
Target Audience

Node.js developers maintaining cross-platform monorepos

Similar To

cross-env · npm-run-all · concurrently

Post Description

Hey HN.

I made this to scratch my own itch when trying to run scripts for different operating systems (Windows and Mac) and architectures (Intel Mac and M3 Max Mac).

If you maintain a monorepo or work across Mac (Intel + Apple Silicon) and Linux/Windows, you've probably copy-pasted platform-specific commands into your CI or kept a wall of if statements in shell scripts.

`target-run` lets you define platform/arch variants of any `npm` script using a naming convention:

{ "scripts": { "build": "target-run", "build:darwin:arm64": "node dist/index-darwin-arm64.js", "build:linux:x64": "node dist/index-linux-x64.js", "build:default": "node dist/index.js" } }

Running `pnpm build` dispatches to the right variant automatically, falling back through `platform:arch`, `platform`, `arch` and, finally, `default`.

The README has more details on usage and options. Thanks for checking it out.

Similar Projects

Security●●Solid

New NPM Supply chain Attack?

Docker isolation + tcpdump catches malicious npm installs before they touch your machine.

Solve My ProblemBig Brain
adamgonda
201mo ago
AI/MLMid

Tiny project memory for coding agents

Structured context files for agents when Cursor rules and Continue configs already exist.

Ship It
SevenQin
1011d ago