@rzl-zone/node-only
Advanced tools
+1
-1
| { | ||
| "name": "@rzl-zone/node-only", | ||
| "version": "0.0.10", | ||
| "version": "0.0.11-beta.0", | ||
| "description": "Marker package to restrict imports to Node.js and server-only environments.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+14
-0
@@ -7,2 +7,16 @@ ## Node Only | ||
| ### Example usage | ||
| ```ts | ||
| import "@rzl-zone/node-only"; | ||
| import fs from "node:fs"; | ||
| export function readConfig() { | ||
| return fs.readFileSync("./config.json", "utf-8"); | ||
| } | ||
| ``` | ||
| If this module is imported inside a client-side environment, it will throw an error and prevent accidental usage. | ||
| [Read More Documentation](https://rzlzone.vercel.app/docs/node-only) |
3256
9.96%22
175%