Skip to content
/ jinju Public

Opinionated Node CLI Toolkit

License

Notifications You must be signed in to change notification settings

simmo/jinju

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 29, 2025
a530a6d · Jan 29, 2025

History

15 Commits
Jan 29, 2025
Jan 29, 2025
Jan 29, 2025
Mar 20, 2023
Mar 21, 2023
Jan 29, 2025
Mar 20, 2023
Mar 20, 2023
Mar 18, 2023
Jan 29, 2025
Jan 29, 2025
Jan 29, 2025
Jan 29, 2025
Jan 29, 2025

Repository files navigation


Jinju logo

Opinionated Node CLI Toolkit

npm (latest) npm (beta) GitHub Workflow Status


API

Jump to:

Celebrate

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.

Example

import { celebrate } from 'jinju';

celebrate('Complete!');

celebrate('Complete!', 'On server A');

Debug

debug(message: string)

Renders a debug message.

Tip

Provides additional information without distracting from the core message output.

Example

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

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.

Example

import { fail } from 'jinju';

fail('Could not read file');

fail('Could not read file', './config.json');

Spinner

Returns a spinner instance.

Tip

Showing feedback during asynchronous processes.

spinner.start(message: string)

Starts the spinner with the provided message.

spinner.text

Can be used to update the spinner's message.

spinner.stop()

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.

Example

import { spinner } from 'jinju';

spinner.start('Running some process');

await someProcess();

spinner.text = 'Running another process';

await anotherProcess();

spinner.stop();

Success

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.

Example

import { success } from 'jinju';

success('Connected to server');

success('Connected to server', 'https://a.server.com');

Warn

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.

Example

import { success } from 'jinju';

success('Connected to server');

success('Connected to server', 'https://a.server.com');

© 2025 Mike Simmonds