Registry / web-framework / pixi-console

pixi-console

JSON →
library4.0.0jsnpmunverified

Pixi-console is a console overlay class for Pixi.js v6/v7 (peer dep) that displays log and error messages on screen, primarily for mobile game debugging. Current stable version is 4.0.0, with support for Pixi v7 added in December 2023. It automatically hooks into console.log and console.error, showing on error, and maintains a singleton pattern. Differentiators: no external dependencies besides Pixi.js, simple API with customizable configuration, and typed via included TypeScript definitions.

npm install pixi-console
INSTALL
IMPORT
SIG · PIXI-CONSOLE
P
pixi-console
web-frameworkjavascriptv4.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PixiConsole
import { PixiConsole } from 'pixi-console'
const PixiConsole = require('pixi-console')
ESM-only; package does not provide a CommonJS dist. Use named import.
PixiConsoleConfig
import { PixiConsoleConfig } from 'pixi-console'
import PixiConsoleConfig from 'pixi-console'
Named export, not default.
PixiConsole.getInstance
import { PixiConsole } from 'pixi-console'; const instance = PixiConsole.getInstance();
import PixiConsole from 'pixi-console'; const instance = new PixiConsole();
PixiConsole is a singleton; use getInstance() to access the existing instance or create first via new. Constructing again throws.

Shows how to import, configure, and attach PixiConsole to a Pixi app stage. Also demonstrates automatic log/error interception.

import { PixiConsole, PixiConsoleConfig } from 'pixi-console'; import * as PIXI from 'pixi.js'; // Create a Pixi application const app = new PIXI.Application({ width: 800, height: 600 }); document.body.appendChild(app.view); // Configure console const config = new PixiConsoleConfig(); config.consoleWidth = 400; config.consoleHeight = 300; config.fontSize = 14; // Create and add to stage const console = new PixiConsole(config); app.stage.addChild(console); // Now console.log and console.error will show on screen globalThis.__PIXI_APP__ = app; console.log('Debug message'); console.error('Error message');
Debug
Known issues
gotchaPixiConsole is a singleton; calling new PixiConsole() more than once throws an error.
fix
Use PixiConsole.getInstance() to get the existing instance, or ensure constructor is called only once.
affects: >=4.0.0
breakingPeer dependency requires Pixi.js v6 or v7. Not compatible with Pixi v5 or v4 in v4.0.0.
fix
Use pixi-console v3.0.0 for Pixi v5, v2.5.0 for Pixi v4.
affects: >=4.0.0
deprecatedPixiConsoleConfig has no named exports; must be imported via named import. No deprecation but may cause confusion.
fix
Ensure import { PixiConsoleConfig } from 'pixi-console'.
affects: >=4.0.0
gotchaPackage does not provide a CommonJS entry; require() will fail. Only ESM import works.
fix
Use ESM import syntax in Node.js or bundler with ES module resolution.
affects: >=4.0.0
Errors
Common errors & fixes
TypeError: PixiConsole is not a constructor
Using require() instead of import; package is ESM-only.
fix
Use 'import { PixiConsole } from "pixi-console";' or use dynamic import().
Error: PixiConsole is singleton..
Attempting to create more than one instance via 'new PixiConsole()'.
fix
Use PixiConsole.getInstance() to get the existing instance.
Module not found: Can't resolve 'pixi-console'
Missing peer dependency pixi.js or PixiConsoleConfig not installed correctly.
fix
Run 'npm install pixi.js pixi-console'.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
pixi.jsrequiredPeer dependency; PixiConsole is a display object that must be added to a Pixi stage.
Agent activity
2 hits · last 30 days
node
2
Resources
pixi-console — npm install pixi-console · libregistry