
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
another-ansi
Advanced tools
Inspired by ansi-styles.
npm install another-ansi
import { AnotherAnsiProvider, ColorType } from 'another-ansi';
const p = new AnotherAnsiProvider();
// red text color
console.log(p.color(ColorType.Red, 'test'));
// red text color + green background color
console.log(p.bgColor(ColorType.Green, p.color(ColorType.Red, 'test')));
// red text color via hex
console.log(p.colorWithHex('#FF0000', 'test'));
// red text color via rgb
console.log(p.colorWithRgb(255, 0, 0, 'test'));
// bold text
console.log(p.modify(ModifierType.Bold, 'test'));
// clear console - only osx
console.log(p.command(CommandType.Clear));
EscapeSequence.Unicode // '\u001B' by default
EscapeSequence.Hex // '\x1b'
Can be used to define escape sequence in ansi provider:
const p = new AnotherAnsiProvider(EscapeSequence.Hex);
p.color(ColorType.Red, 'test'); // \x1b[31mtest\x1b[39m
Modifier:
enum ModifierType {
Reset,
Bold,
Dim,
Italic,
Underline,
Overline,
Inverse,
Hidden,
Strikethrough
}
Colors:
enum ColorType {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
BlackBright,
Gray,
Grey,
RedBright,
GreenBright,
YellowBright,
BlueBright,
MagentaBright,
CyanBright,
WhiteBright
}
Commands:
enum CommandType {
Clear
}
const styleObject = provider.getStyleObject();
// red text color
console.log(`${styleObject.color.red.open}test${styleObject.color.close}`);
// red background color
console.log(`${styleObject.bgColor.red.open}test${styleObject.bgColor.close}`);
// red background color
console.log(`${styleObject.bgColorBy16m(255, 0, 0)}test${styleObject.bgColor.close}`);
FAQs
Another ansi library
We found that another-ansi 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.
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.