
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A flexible and customizable logging utility for Node.js applications, supporting both ESM and CommonJS modules, with TypeScript support. LogMux provides a simple way to log messages with customizable colors, timestamps, labels, and file logging capabilities.
Log), error logs (ErrorLog), and warning logs (WarnLog).Install LogMux via npm:
npm install logmux
import LogMux from 'logmux';
const LogMux = require('logmux');
const logger = new LogMux({
textColour: 'blue',
errorColour: 'red',
warnColour: 'yellow',
includeLabel: true,
includeTimeStamp: true,
timeStampFormat: 'iso',
recordFile: true,
uppercaseLabel: true,
});
// Standard log
await logger.Log('This is an info message');
// Error log
await logger.ErrorLog('This is an error message');
// Warning log
await logger.WarnLog('This is a warning message');
When creating a LogMux instance, you can pass a configuration object with the following properties:
| Option | Type | Default | Description |
|---|---|---|---|
textColour | string | 'white' | ANSI color for standard logs (e.g., 'blue', 'green'). |
errorColour | string | 'red' | ANSI color for error logs. |
warnColour | string | 'yellow' | ANSI color for warning logs. |
includeLabel | boolean | true | Include a label (e.g., [INFO], [ERROR]) in the log. |
includeTimeStamp | boolean | true | Include a timestamp in the log. |
timeStampFormat | string | 'unix' | Timestamp format: 'unix' (milliseconds) or 'iso' (ISO 8601). |
recordFile | boolean | false | Save logs to a file (logs.txt by default). |
uppercaseLabel | boolean | false | Convert labels to uppercase (e.g., [INFO] instead of [info]). |
const logger = new LogMux({
textColour: 'cyan',
timeStampFormat: 'unix',
recordFile: true,
uppercaseLabel: true,
});
await logger.Log('Custom log message', 'CUSTOM');
// Output: 1746654321000 [CUSTOM] - Custom log message (in cyan)
await logger.ErrorLog('Something went wrong');
// Output: 1746654321000 [ERROR] - Something went wrong (in red)
LogMux is fully typed and works seamlessly with TypeScript. Here's an example:
import LogMux from 'logmux';
const logger = new LogMux({
textColour: 'green',
timeStampFormat: 'iso',
recordFile: true,
});
async function main() {
await logger.Log('Hello, TypeScript!', 'INFO');
await logger.WarnLog({ warning: 'Low battery' }, 'BATTERY');
await logger.ErrorLog(new Error('Critical failure'), 'CRITICAL');
}
main();
When recordFile is set to true, logs are saved to logs.txt in the project directory. You can customize the file path by modifying the logToFile function in src/utils.ts if needed.
LogMux Classconst logger = new LogMux(config);
Log(message: any, label?: string): Promise<void>
Logs a standard message with optional custom label.ErrorLog(message: any, label?: string): Promise<void>
Logs an error message with optional custom label.WarnLog(message: any, label?: string): Promise<void>
Logs a warning message with optional custom label.LogMux supports the following ANSI colors for console output:
black, red, green, yellow, blue, magenta, cyan, whitebrightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhiteTo contribute to LogMux or build it locally:
Clone the repository:
git clone https://github.com/HarshDev1809/logmux.git
Install dependencies:
npm install
Build the project:
npm run build
Run tests (if available):
npm test
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please submit a pull request or open an issue on the GitHub repository for bug reports, feature requests, or suggestions.
For questions or support, please open an issue on the GitHub repository or contact the maintainers.
FAQs
A logger multiplexer
We found that logmux demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.