---
id: "wrap-once-run-managed"
type: "concept"
title: "Wrap once, run managed"
summary: "You wrap existing logic exactly once with defineServixService; from then on it behaves like an installable, controllable service."
problem: "Rewriting working logic into bespoke daemons duplicates effort and loses the original package's reusability."
why: "Wrapping instead of rewriting preserves the original code as the single source of truth while gaining lifecycle control."
mentalModel: "Take anything useful, wrap it once, then run it like a service."
audiences: ["developers"]
related: ["service-shell", "service-discovery"]
next: ["wrap-a-function"]
---
# Wrap once, run managed

The output of wrapping is not just "some code" — it becomes an installable npm package:

```txt
Existing logic → Servix wrapper → New npm package → npm install -g … → servix start/stop/pause/status/logs
```

Servix can wrap a TypeScript function, an existing npm package, a CLI command, a long-running listener, a scheduled job, or an API polling worker.