
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@remotex-labs/xansi
Advanced tools
A lightweight ANSI utility library for styling terminal output. xAnsi provides easy-to-use components for working with ANSI escape codes to create colorful and formatted terminal interfaces.
ANSI Component
Utility constants and functions for terminal control, including cursor movement, screen clearing, hiding/showing the cursor, and raw terminal output through the writeRaw
function.
xTerm Component
Advanced terminal styling with chainable API for colors, backgrounds, text modifiers, RGB, and hexadecimal color codes. Supports template literals and type-safe style combinations.
Environment variable flag that indicates if color output should be disabled. @see https://no-color.org/ - The NO_COLOR standard specification
npm install @remotex-labs/xansi
xAnsi supports subpath imports, allowing you to import only the specific components you need:
// Import only what you need
import { xterm } from '@remotex-labs/xansi/xterm.component';
import { writeRaw, ANSI } from '@remotex-labs/xansi/ansi.component';
import { ShadowRenderer } from '@remotex-labs/xansi/shadow.service';
import { writeRaw, ANSI } from '@remotex-labs/xansi';
// Clear the line and write text
writeRaw(ANSI.CLEAR_LINE);
writeRaw('Hello, world!');
// Move cursor to row 5, column 10
writeRaw(ANSI.SAVE_CURSOR);
writeRaw('\x1b[5;10HHello there');
writeRaw(ANSI.RESTORE_CURSOR);
import { xterm } from '@remotex-labs/xansi';
// Simple colors
console.log(xterm.red('Red text'));
console.log(xterm.bold.yellow('Bold yellow'));
// RGB and Hex colors
console.log(xterm.rgb(255, 100, 50)('RGB Text'));
console.log(xterm.bgHex('#3498db')('Background Hex'));
// Chaining multiple styles
console.log(xterm.bold.underline.hex('#ff5733').bgHex('#333')('Styled text'));
// Template literals
const name = 'Alice';
console.log(xterm.cyan`Hello ${name}!`);
import { ShadowRenderer } from '@remotex-labs/xansi';
const renderer = new ShadowRenderer(10, 40, 0, 0);
renderer.writeText(0, 0, 'Hello Shadow Renderer');
renderer.render();
For complete API documentation, examples, and guides, visit: xAnsi Documentation
Contributions are welcome!
Please see our Contributing Guide for details.
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
FAQs
A lightweight ANSI utility library for styling terminal output
The npm package @remotex-labs/xansi receives a total of 255 weekly downloads. As such, @remotex-labs/xansi popularity was classified as not popular.
We found that @remotex-labs/xansi 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.