Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Clorox is a Node.js library for colorizing text using ANSI escape sequences.
npm i clorox
const { Clorox: x } = require("clorox")
Write with color.
console.log(x.red("Bonjour!"))
Chain expressions.
console.log(x.red.underline("Hello") + x.blue.bold("World") + "!")
Compose a color expression using template literals.
console.log(`
Oil: ${x.bgBlack.white(42)}
Gold: ${x.yellow(150)}
Lumber: ${x.green(10000)}
`)
Nest expressions to reuse styles.
console.log(`Normal ${x.bold(`Bold ${x.blue("Bold/Blue")} Bold`)} Normal`)
Use string substitution for easier formatting.
console.log(x.green("Total: $%f"), 1.99)
Clorox exports ANSI escape codes which you can use for manually styling console output. They can be useful for testing your actual output matches the expected output.
Each style has an open
, close
and strip
property. The strip
property is useful for removing the previously closed escape code within a nested expression.
const { STYLES } = require("clorox")
console.log(`${STYLES.red.open}Red${STYLES.red.close}`)
Colors | Background Colors | Modifiers |
---|---|---|
black | bgBlack | dim |
red | bgRed | bold |
green | bgGreen | hidden |
yellow | bgYellow | italic |
blue | bgBlue | underline |
magenta | bgMagenta | inverse |
cyan | bgCyan | |
white | bgWhite | reset |
gray |
Clorox is MIT licensed. See LICENSE.
FAQs
Node.js library for colorizing text using ANSI escape sequences.
The npm package clorox receives a total of 652 weekly downloads. As such, clorox popularity was classified as not popular.
We found that clorox 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.