The Smallest Strutvane Package: Why npx strutvane Is a Guard, Not an Installer
Zero dependencies, never downloads anything, and only ever runs your own project's code, after checking it really is your project.
Typing npx something is a small act of trust.
You're asking npm to find a package called "something" and run it on your machine, often without a second thought. That's convenient. It's also exactly how mistakes happen: a typo in a name, a package that downloads more than you expected, or a script someone left lying around in a shared folder that gets picked up and executed.
npx strutvane could have been a clever tool that does a lot. Instead, it's the safest possible thing: a guard that does one job and refuses everything else. 🛡️
What it is
strutvane is the tiny package behind npx strutvane, for apps built on Strutvane, an open-source (MIT) TypeScript framework for business (B2B) apps.
Inside a Strutvane app, these two commands do exactly the same thing:
node strut migrate
npx strutvane migrate
npx strutvane <command> finds your project and runs its own strut.js with your arguments, using the @strutvane/framework version your project already has installed. Outside a project, there's nothing to run, so it simply tells you how to create one.
That's it. That's the whole package.
Why it exists
Strutvane apps have a project command, node strut, that runs migrations, seeders, the dev server and more. It's always the right version, because it comes from the framework installed in your project.
But people naturally reach for npx <framework name>. If that name did something different from node strut (say, ran a different copy of the framework), you'd get two tools that disagree about your own project.
So npx strutvane exists to make the natural thing the same thing: it runs exactly what node strut runs, with your project's own framework, and never a second copy. What you get always matches your package.json.
What you get
Inside a project, every argument goes to your project, --version and help included, just like node strut.
Outside a project, it only prints:
| You type | What happens | Exit code |
|---|---|---|
npx strutvane, help, --help, -h |
Prints help and how to create a project | 0 |
npx strutvane --version, -v |
Prints this package's version | 0 |
npx strutvane new my-app (or create, init) |
Prints the npm create strutvane command to run |
2 |
| Anything else | Explains that the command needs a project | 2 |
For example:
$ npx strutvane
No Strutvane project was found in /home/ana or the folders above it.
Create a new app:
npm create strutvane@latest my-app
How it finds your project
Starting from the folder you're in, it looks upwards for the nearest folder that has a strut.js or a package.json listing @strutvane/framework. That folder is your project only if its package.json really lists @strutvane/framework. The command then runs from the project folder, just as node strut does.
In a project without a strut.js, it runs the strutvane program of the installed @strutvane/framework instead, which is what strut.js itself runs for framework commands.
Safe by design
This is where the "guard" part comes in. It runs only your project's own code, and only after checking it:
- Never installs or downloads anything. It has zero dependencies, and outside a project it only prints text.
- Never looks too far up. The search stops at your home folder, the temp folder and drive roots. So a
strut.jssomeone left in a shared folder above you is never run. On Linux and macOS, the project folder must also belong to you. - A
strut.jsalone isn't enough. If the nearest one sits in a folder whosepackage.jsondoesn't list@strutvane/framework, nothing runs, and you're told why. - Nothing outside the project runs. It refuses a project folder that is a link (and shows you the real folder to open instead), a
strut.jsthat is a link, and a framework install whose real location is outside the project. - No shell. Your arguments go to Node as a list, so things like
a&b,$(x)or%PATH%arrive as plain text on every platform. They can't be interpreted as shell commands, and--import=...stays an argument for your command, never a Node option. - Exit codes and signals pass through. Your command's exit code comes back unchanged. If it's stopped by a signal,
strutvanestops with the same signal (on Windows, with exit code 128 + n). Ctrl+C at a terminal is never sent twice.
When it refuses, it exits with code 1 and tells you how to fix it. A refusal should always come with a next step.
How it fits into Strutvane
strutvane is the front door, and it's intentionally small:
npm create strutvanecreates a new app.node strut <command>(ornpx strutvane <command>) runs commands inside it, powered by@strutvane/framework.- Everything else (auth, the admin UI, designs, add-ons) is installed into the project and run by the project's own framework.
The guard never competes with the framework. It just hands over to it, after making sure it's handing over to the right one.
A quick look
There's nothing to install. You use it through npx only:
npx strutvane migrate
npx strutvane --version
Please don't add it to your project as a dependency. A Strutvane app already has the strutvane program, from @strutvane/framework. Adding this package too would put two owners on the same command, and node strut doctor will point that out.
Requirements: Node.js 24.3 or newer.
⚠️ This is a 0.2 preview. Behaviour may still change before 1.0, planned for January 2027. While Strutvane is in pre-release, the "create a new app" hint may show
@nextinstead of@latest.
Built to be trusted
A package this small still gets the full treatment:
- 116 automated tests for a tool whose whole job is saying "yes, this is your project" or "no, it isn't".
- CI on Linux, Windows and macOS, on Node 24 and Node 26. Path handling, links and signals behave differently on each, which is exactly why all three matter.
- Security-reviewed and secure by default.
- Every release is staged by CI and approved by a human with two-factor authentication, and published with npm provenance, so you can check that what
npxdownloads was built from this repository.
The lesson I took from it
The smallest package in the ecosystem taught me the biggest lesson: a tool that runs other code should be boring, strict and honest. It should do less than you expect, refuse loudly, and always say why. Every clever feature you add to a launcher is another way to run the wrong thing.
Try it, and tell me what you think
- ⭐ GitHub: github.com/vishwajit-vm/strutvane-npx
- 📦 npm: npmjs.com/package/strutvane
- 💬 Feedback welcome. Can you think of a way a launcher like this could run the wrong thing? I genuinely want to hear it. (If it's a real security issue, please report it privately rather than in a public issue.)
That's the last of the nine live packages. Follow the series for what comes next: the full demo app, then queues, mail and notifications in 0.3. 🚀
— Vishwajit VM
Part of the Strutvane series. Strutvane™ is open source under the MIT licence.
About the author
- Hi, I'm Vishwajit VM, a backend & AI engineer from New Delhi. For 5+ years I've built the parts of apps you don't see: APIs, databases, queues and AI agents, for teams in hiring, real estate, finance, retail and civic tech. My rule is simple: a system should keep working when something goes wrong. Right now I'm a backend developer at SPNX, building an EU VAT-registration platform that runs in production. After hours I'm building Strutvane, an open-source TypeScript framework for business apps (I'm writing about it as a series on my blog, vishwajitvm.hashnode.dev), plus my own products such as DevFlow-AI (self-hosted AI code review) and Hopline (encrypted peer-to-peer file transfer). Day to day I work with Python, FastAPI, Node.js, TypeScript, NestJS, PostgreSQL, Redis, Docker, LangGraph and RAG, and I've shipped plenty of Laravel/PHP and React along the way. Outside work, I'm a part-time photographer. See my work at https://vishwajit-labs-web.vercel.app/
Comments
Join the discussionNo comments yet. Be the first to comment.