Installation
Requirements
Section titled “Requirements”| Requirement | Minimum |
|---|---|
| Node.js | 18.x or later |
| TypeScript | 4.7 or later (optional) |
| Browser | Chrome 90+, Firefox 88+, Safari 14+ |
| Runtime dependencies | 0 |
Package managers
Section titled “Package managers”npm install @gouranga_samrat/log-wizyarn add @gouranga_samrat/log-wizpnpm add @gouranga_samrat/log-wizbun add @gouranga_samrat/log-wizModule formats
Section titled “Module formats”log-wiz ships four compiled targets. Your toolchain picks the right one automatically via the exports field in package.json.
| Format | Path | Used by |
|---|---|---|
| ESM | dist/esm/ | Vite, Rollup, esbuild, native import |
| CJS | dist/cjs/ | Node.js require(), Jest |
| Browser | dist/browser/ | Browser bundles — fs/path excluded |
| Types | dist/types/ | TypeScript declarations |
TypeScript setup
Section titled “TypeScript setup”log-wiz works with any reasonable tsconfig.json. For best results:
{ "compilerOptions": { "strict": true, "moduleResolution": "bundler", "esModuleInterop": true }}All types ship with the package — no @types/ package needed:
import type { WizConfig, LogEntry, LogLevel, Transport,} from "@gouranga_samrat/log-wiz";Verify installation
Section titled “Verify installation”node -e "import('@gouranga_samrat/log-wiz').then(m => m.wiz.info('install OK'))"Expected output:
INF 2024-05-15 14:32:01.123 install OK