Skip to main content

Installation

Logluxe can be installed using any package manager. It has zero dependencies and works in any JavaScript/TypeScript environment.

Package Managers

npm

npm install logluxe
Terminal
added 1 package in 2s

Yarn

yarn add logluxe
Terminal
Done in 1.8s

pnpm

pnpm add logluxe
Terminal
Packages: +1
Done in 1.2s

Bun

bun add logluxe
Terminal
bun add v1.0.0
installed logluxe@latest
Done in 0.3s

CDN (Browser)

For quick prototyping or browser-only usage, you can use a CDN:

<!-- ESM -->
<script type="module">
import log from 'https://esm.sh/logluxe';
log.success('Hello from CDN!');
</script>

<!-- UMD (exposes global `logluxe`) -->
<script src="https://unpkg.com/logluxe/dist/index.cjs"></script>
<script>
logluxe.success('Hello from UMD!');
</script>
Browser Console
✔ Hello from CDN!
✔ Hello from UMD!

Deno

import log from 'npm:logluxe';

log.success('Hello from Deno!');
Deno Output
✔ Hello from Deno!

Or with import maps in deno.json:

{
"imports": {
"logluxe": "npm:logluxe"
}
}

Verify Installation

After installing, verify it works:

import log from 'logluxe';

log.success('Logluxe installed successfully!');
log.info('Ready to use');
Output
✔ Logluxe installed successfully!
ℹ Ready to use
🎮 Try it yourself

TypeScript Configuration

Logluxe is written in TypeScript and ships with complete type definitions. No additional @types/* packages are needed.

For best results, ensure your tsconfig.json has:

{
"compilerOptions": {
"moduleResolution": "bundler", // or "node16", "nodenext"
"esModuleInterop": true
}
}

Module Formats

Logluxe supports both ESM and CommonJS:

import log from 'logluxe';
import { createLogger, colorize } from 'logluxe';

CommonJS

const log = require('logluxe').default;
const { createLogger, colorize } = require('logluxe');

Bundle Size

Logluxe is designed to be lightweight:

FormatSize (minified)Size (gzip)
ESM~18 KB~5 KB
CJS~18 KB~5 KB
Patch~6 KB~2 KB

The package is fully tree-shakable, so if you only import specific functions, your bundle will be even smaller.

Environment Support

EnvironmentSupportNotes
Node.js 16+✅ FullANSI colors
Node.js 18+✅ FullRecommended
Bun✅ FullNative support
Deno✅ FullUse npm: prefix
Chrome✅ FullCSS console styles
Firefox✅ FullCSS console styles
Safari✅ FullCSS console styles
Edge✅ FullCSS console styles

Next: Quick Start Guide