
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
consolebridge
Advanced tools
Enhanced console logging with colorization and remote capabilities for Node.js applications.
console.text() method for remote loggingnpm install ConsoleBridge
const { createConsoleBridge } = require('ConsoleBridge');
// Initialize with default options
const ConsoleBridge = createConsoleBridge();
// Use enhanced console methods
console.log('Regular log message');
console.info('Info message in blue');
console.warn('Warning message in yellow');
console.error('Error message in red');
console.debug('Debug message in green');
// Use custom text method (for remote logging)
console.text('This can be sent to a remote server if configured');
// When done, restore original console behavior
ConsoleBridge.restore();
const { createConsoleBridge } = require('ConsoleBridge');
const ConsoleBridge = createConsoleBridge({
// Remote logging endpoint (optional)
endpoint: 'https://your-logging-api.com/logs',
// API key for authentication (optional)
apiKey: 'your-api-key',
// Enable/disable colorization (default: true)
colorize: true,
// Enable/disable console output (default: false)
silent: false
});
// src/logger.js
import { createConsoleBridge } from 'ConsoleBridge';
export const logger = createConsoleBridge({
endpoint: process.env.REACT_APP_LOGGING_ENDPOINT,
apiKey: process.env.REACT_APP_LOGGING_API_KEY
});
// src/index.js or App.js
import { logger } from './logger';
// Initialize logger early in your app
logger.init();
// Use in your components
function App() {
useEffect(() => {
console.info('App mounted');
console.text('This will be sent to the server');
// Cleanup on unmount
return () => logger.restore();
}, []);
return <div>Your App</div>;
}
// src/hooks/useLogger.js
import { useEffect } from 'react';
import { createConsoleBridge } from 'ConsoleBridge';
export function useLogger(config = {}) {
useEffect(() => {
const logger = createConsoleBridge(config);
logger.init();
return () => logger.restore();
}, []);
}
// Usage in component
function MyComponent() {
useLogger({
endpoint: 'https://api.example.com/logs',
colorize: true
});
return <div>Component with logging</div>;
}
Only the console.text() method sends logs to the remote server. Other console methods are enhanced but only output locally.
// Configure with remote endpoint
const ConsoleBridge = createConsoleBridge({
endpoint: 'https://your-logging-api.com/logs',
apiKey: 'your-api-key'
});
// This will be sent to the remote server
console.text('Important information to log remotely');
// These will only appear in the local console
console.log('Local log message');
console.info('Local info message');
const { ConsoleBridge } = require('ConsoleBridge');
// Create instance without auto-initialization
const logger = new ConsoleBridge({
colorize: true,
endpoint: 'https://your-logging-api.com/logs'
});
// Initialize when ready
logger.init();
// Use enhanced console
console.log('Console is now enhanced');
// Restore when done
logger.restore();
createConsoleBridge(config)Creates and initializes a new ConsoleBridge instance.
config (Object): Configuration options
endpoint (String): URL for remote loggingapiKey (String): Authentication key for remote endpointcolorize (Boolean): Whether to colorize console output (default: true)silent (Boolean): Whether to suppress console output (default: false)Returns an initialized ConsoleBridge instance.
ConsoleBridgeClass that provides console enhancement functionality.
init(): Overrides console methods with enhanced versionsrestore(): Restores original console behaviorSee the examples directory for more usage examples.
MIT
FAQs
Enhanced console logging with remote capabilities
The npm package consolebridge receives a total of 2 weekly downloads. As such, consolebridge popularity was classified as not popular.
We found that consolebridge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.