
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@graphene-system/cli-reporter
Advanced tools
Reporter for CLI-based tools in the Graphene Design System
Formatted console output reporter for the Graphene CLI.
To install @graphene-system/cli-reporter
in your project, you will need to run
the following command using Yarn:
yarn add @graphene-system/cli-reporter
If you prefer npm, use the following command instead:
npm install -S @graphene-system/cli-reporter
You can use the @graphene-system/cli-reporter
module in both your JavaScript
and Typescript projects, typings are already built into the package.
For both languages, you can import and use this module by doing the following in your code:
// ECMAScript Modules
import { reporter } from '@graphene-system/cli-reporter';
// CommonJS Modules
const { reporter } = require('@graphene-system/cli-reporter');
Now you're ready to start sending formatted output to the console!
The package provides 6 methods that provide pre-formatted console outputs, like this:
// Unformatted output with no tags.
reporter.log('My normal message');
// Red "ERROR" tag before message output.
reporter.error('My error message');
// Blue "INFO" tag before message output.
reporter.info('My information message');
// Green "SUCCESS" tag before message output.
reporter.success('My success message');
// Yellow "WARNING" tag before message output.
reporter.warning('My warning message');
// Default colored bold output with no tags.
reporter.header('My bold header');
You can build your own tagged messages, like this:
const tag = 'My tag';
const message = 'This a custom message!';
const color = 'bgMagenta';
reporter.custom(tag, message, color);
Make sure to use a background color supported by Chalk in order to prevent incorrect tag construction.
If you need to print an error, with or without a stacktrace (managed by the
debug
flag), you can use the stack
helper method, like this:
// Error to print
const myError = new Error('Oh, no!');
// With a stacktrace
reporter.stack(myError);
// Without a stacktrace
reporter.stack(myError, false);
The reporter will automatically format the stacktrace to have colored tags.
We're always looking for new contributors to help us fix bugs, create new features, or help us improve the project documentation. If you're interested, please, check out our Contributing Guide!
The module @graphene-system/cli-reporter
is licensed under the
Apache 2.0 License.
FAQs
Reporter for CLI-based tools in the Graphene Design System
We found that @graphene-system/cli-reporter 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.