A tool to compile human-readable ZeroTier rule scripts into the binary format required by ZeroTier network controllers. Current stable version is 1.2.2-2. This package is part of the ZeroTier ecosystem and is used internally by ZeroTier Central's rules editor. It provides both a library API and a CLI interface. Unlike manual rule construction, this compiler validates syntax and ensures correct encoding. The package is available on npm and has minimal dependencies. Release cadence is irregular, tied to ZeroTierOne updates.
npm install zerotier-rule-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a simple ZeroTier rule script and then stringifies the result back to human-readable format.
Wrap calls to compile in try/catch blocks.
Use the programmatic API with async I/O for large scripts.
Upgrade to >=1.0.0 and update imports to ESM.
Ensure each rule statement is on its own line or separated by semicolons.
Use 'import' syntax, or if using Node <13, set 'type': 'module' in package.json.
Optimize rules by reducing complexity or combining conditions.