Jump to:
celebrate(message: string, context?: string)
Renders a celebration message
, with optional context
. If context
is provided it is rendered dimmer than the message
.
Tip
Much like success
, it can be used as a different type of positive message, like completing the process.
import { celebrate } from 'jinju';
celebrate('Complete!');
celebrate('Complete!', 'On server A');
debug(message: string)
Renders a debug message
.
Tip
Provides additional information without distracting from the core message output.
Debug is enabled by default.
import { debug } from 'jinju';
debug('Found record');
You can disable debug message by setting the config
's debug
value to false
. In the example below the debug message will not be output.
import { config, debug } from 'jinju';
config.debug = false;
debug('Found record');
fail(message: string, context?: string)
Renders a failure message
, with optional context
. If context
is provided it is rendered dimmer than the message
.
Tip
Can be used to indicate a failure or error.
import { fail } from 'jinju';
fail('Could not read file');
fail('Could not read file', './config.json');
Returns a spinner instance.
Tip
Showing feedback during asynchronous processes.
Starts the spinner with the provided message.
Can be used to update the spinner's message.
Stops the spinner and removes it from the output.
Note If you don't call
spinner.stop()
, the process will not end until explicitly exited.
import { spinner } from 'jinju';
spinner.start('Running some process');
await someProcess();
spinner.text = 'Running another process';
await anotherProcess();
spinner.stop();
success(message: string, context?: string)
Renders a success message
, with optional context
. If context
is provided it is rendered dimmer than the message
.
Tip
Can be used to indicate an action has resolved as expected.
import { success } from 'jinju';
success('Connected to server');
success('Connected to server', 'https://a.server.com');
warn(message: string, context?: string)
Renders a warning message
, with optional context
. If context
is provided it is rendered dimmer than the message
.
Tip
Can be used to provide awareness to a non-ideal resolution.
import { success } from 'jinju';
success('Connected to server');
success('Connected to server', 'https://a.server.com');
© 2025 Mike Simmonds