First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

332
node_modules/ora/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,332 @@
import {type SpinnerName} from 'cli-spinners';
export type Spinner = {
readonly interval?: number;
readonly frames: string[];
};
export type Color =
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'gray';
export type PrefixTextGenerator = () => string;
export type SuffixTextGenerator = () => string;
export type Options = {
/**
The text to display next to the spinner.
*/
readonly text?: string;
/**
Text or a function that returns text to display before the spinner. No prefix text will be displayed if set to an empty string.
*/
readonly prefixText?: string | PrefixTextGenerator;
/**
Text or a function that returns text to display after the spinner text. No suffix text will be displayed if set to an empty string.
*/
readonly suffixText?: string | SuffixTextGenerator;
/**
The name of one of the provided spinners. See [`example.js`](https://github.com/BendingBender/ora/blob/main/example.js) in this repo if you want to test out different spinners. On Windows (expect for Windows Terminal), it will always use the line spinner as the Windows command-line doesn't have proper Unicode support.
@default 'dots'
Or an object like:
@example
```
{
frames: ['-', '+', '-'],
interval: 80 // Optional
}
```
*/
readonly spinner?: SpinnerName | Spinner;
/**
The color of the spinner.
@default 'cyan'
*/
readonly color?: Color | boolean;
/**
Set to `false` to stop Ora from hiding the cursor.
@default true
*/
readonly hideCursor?: boolean;
/**
Indent the spinner with the given number of spaces.
@default 0
*/
readonly indent?: number;
/**
Interval between each frame.
Spinners provide their own recommended interval, so you don't really need to specify this.
Default: Provided by the spinner or `100`.
*/
readonly interval?: number;
/**
Stream to write the output.
You could for example set this to `process.stdout` instead.
@default process.stderr
*/
readonly stream?: NodeJS.WritableStream;
/**
Force enable/disable the spinner. If not specified, the spinner will be enabled if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.
Note that `{isEnabled: false}` doesn't mean it won't output anything. It just means it won't output the spinner, colors, and other ansi escape codes. It will still log text.
*/
readonly isEnabled?: boolean;
/**
Disable the spinner and all log text. All output is suppressed and `isEnabled` will be considered `false`.
@default false
*/
readonly isSilent?: boolean;
/**
Discard stdin input (except Ctrl+C) while running if it's TTY. This prevents the spinner from twitching on input, outputting broken lines on `Enter` key presses, and prevents buffering of input while the spinner is running.
This has no effect on Windows as there's no good way to implement discarding stdin properly there.
@default true
*/
readonly discardStdin?: boolean;
};
export type PersistOptions = {
/**
Symbol to replace the spinner with.
@default ' '
*/
readonly symbol?: string;
/**
Text to be persisted after the symbol.
Default: Current `text`.
*/
readonly text?: string;
/**
Text or a function that returns text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.
Default: Current `prefixText`.
*/
readonly prefixText?: string | PrefixTextGenerator;
/**
Text or a function that returns text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.
Default: Current `suffixText`.
*/
readonly suffixText?: string | SuffixTextGenerator;
};
export type PromiseOptions<T> = {
/**
The new text of the spinner when the promise is resolved.
Keeps the existing text if `undefined`.
*/
successText?: string | ((result: T) => string) | undefined;
/**
The new text of the spinner when the promise is rejected.
Keeps the existing text if `undefined`.
*/
failText?: string | ((error: Error) => string) | undefined;
} & Options;
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface Ora {
/**
Change the text after the spinner.
*/
text: string;
/**
Change the text or function that returns text before the spinner.
No prefix text will be displayed if set to an empty string.
*/
prefixText: string;
/**
Change the text or function that returns text after the spinner text.
No suffix text will be displayed if set to an empty string.
*/
suffixText: string;
/**
Change the spinner color.
*/
color: Color | boolean;
/**
Change the spinner indent.
*/
indent: number;
/**
Get the spinner.
*/
get spinner(): Spinner;
/**
Set the spinner.
*/
set spinner(spinner: SpinnerName | Spinner);
/**
A boolean indicating whether the instance is currently spinning.
*/
get isSpinning(): boolean;
/**
The interval between each frame.
The interval is decided by the chosen spinner.
*/
get interval(): number;
/**
Start the spinner.
@param text - Set the current text.
@returns The spinner instance.
*/
start(text?: string): this;
/**
Stop and clear the spinner.
@returns The spinner instance.
*/
stop(): this;
/**
Stop the spinner, change it to a green `✔` and persist the current text, or `text` if provided.
@param text - Will persist text if provided.
@returns The spinner instance.
*/
succeed(text?: string): this;
/**
Stop the spinner, change it to a red `✖` and persist the current text, or `text` if provided.
@param text - Will persist text if provided.
@returns The spinner instance.
*/
fail(text?: string): this;
/**
Stop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided.
@param text - Will persist text if provided.
@returns The spinner instance.
*/
warn(text?: string): this;
/**
Stop the spinner, change it to a blue `` and persist the current text, or `text` if provided.
@param text - Will persist text if provided.
@returns The spinner instance.
*/
info(text?: string): this;
/**
Stop the spinner and change the symbol or text.
@returns The spinner instance.
*/
stopAndPersist(options?: PersistOptions): this;
/**
Clear the spinner.
@returns The spinner instance.
*/
clear(): this;
/**
Manually render a new frame.
@returns The spinner instance.
*/
render(): this;
/**
Get a new frame.
@returns The spinner instance text.
*/
frame(): string;
}
/**
Elegant terminal spinner.
@param options - If a string is provided, it is treated as a shortcut for `options.text`.
@example
```
import ora from 'ora';
const spinner = ora('Loading unicorns').start();
setTimeout(() => {
spinner.color = 'yellow';
spinner.text = 'Loading rainbows';
}, 1000);
```
*/
export default function ora(options?: string | Options): Ora;
/**
Starts a spinner for a promise or promise-returning function. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects.
@param action - The promise to start the spinner for or a promise-returning function.
@param options - If a string is provided, it is treated as a shortcut for `options.text`.
@returns The given promise.
@example
```
import {oraPromise} from 'ora';
await oraPromise(somePromise);
```
*/
export function oraPromise<T>(
action: PromiseLike<T> | ((spinner: Ora) => PromiseLike<T>),
options?: string | PromiseOptions<T>
): Promise<T>;
export {default as spinners} from 'cli-spinners';

424
node_modules/ora/index.js generated vendored Normal file
View File

@@ -0,0 +1,424 @@
import process from 'node:process';
import chalk from 'chalk';
import cliCursor from 'cli-cursor';
import cliSpinners from 'cli-spinners';
import logSymbols from 'log-symbols';
import stripAnsi from 'strip-ansi';
import stringWidth from 'string-width';
import isInteractive from 'is-interactive';
import isUnicodeSupported from 'is-unicode-supported';
import stdinDiscarder from 'stdin-discarder';
class Ora {
#linesToClear = 0;
#isDiscardingStdin = false;
#lineCount = 0;
#frameIndex = -1;
#lastSpinnerFrameTime = 0;
#options;
#spinner;
#stream;
#id;
#initialInterval;
#isEnabled;
#isSilent;
#indent;
#text;
#prefixText;
#suffixText;
color;
constructor(options) {
if (typeof options === 'string') {
options = {
text: options,
};
}
this.#options = {
color: 'cyan',
stream: process.stderr,
discardStdin: true,
hideCursor: true,
...options,
};
// Public
this.color = this.#options.color;
// It's important that these use the public setters.
this.spinner = this.#options.spinner;
this.#initialInterval = this.#options.interval;
this.#stream = this.#options.stream;
this.#isEnabled = typeof this.#options.isEnabled === 'boolean' ? this.#options.isEnabled : isInteractive({stream: this.#stream});
this.#isSilent = typeof this.#options.isSilent === 'boolean' ? this.#options.isSilent : false;
// Set *after* `this.#stream`.
// It's important that these use the public setters.
this.text = this.#options.text;
this.prefixText = this.#options.prefixText;
this.suffixText = this.#options.suffixText;
this.indent = this.#options.indent;
if (process.env.NODE_ENV === 'test') {
this._stream = this.#stream;
this._isEnabled = this.#isEnabled;
Object.defineProperty(this, '_linesToClear', {
get() {
return this.#linesToClear;
},
set(newValue) {
this.#linesToClear = newValue;
},
});
Object.defineProperty(this, '_frameIndex', {
get() {
return this.#frameIndex;
},
});
Object.defineProperty(this, '_lineCount', {
get() {
return this.#lineCount;
},
});
}
}
get indent() {
return this.#indent;
}
set indent(indent = 0) {
if (!(indent >= 0 && Number.isInteger(indent))) {
throw new Error('The `indent` option must be an integer from 0 and up');
}
this.#indent = indent;
this.#updateLineCount();
}
get interval() {
return this.#initialInterval ?? this.#spinner.interval ?? 100;
}
get spinner() {
return this.#spinner;
}
set spinner(spinner) {
this.#frameIndex = -1;
this.#initialInterval = undefined;
if (typeof spinner === 'object') {
if (spinner.frames === undefined) {
throw new Error('The given spinner must have a `frames` property');
}
this.#spinner = spinner;
} else if (!isUnicodeSupported()) {
this.#spinner = cliSpinners.line;
} else if (spinner === undefined) {
// Set default spinner
this.#spinner = cliSpinners.dots;
} else if (spinner !== 'default' && cliSpinners[spinner]) {
this.#spinner = cliSpinners[spinner];
} else {
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
}
}
get text() {
return this.#text;
}
set text(value = '') {
this.#text = value;
this.#updateLineCount();
}
get prefixText() {
return this.#prefixText;
}
set prefixText(value = '') {
this.#prefixText = value;
this.#updateLineCount();
}
get suffixText() {
return this.#suffixText;
}
set suffixText(value = '') {
this.#suffixText = value;
this.#updateLineCount();
}
get isSpinning() {
return this.#id !== undefined;
}
#getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {
if (typeof prefixText === 'string' && prefixText !== '') {
return prefixText + postfix;
}
if (typeof prefixText === 'function') {
return prefixText() + postfix;
}
return '';
}
#getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {
if (typeof suffixText === 'string' && suffixText !== '') {
return prefix + suffixText;
}
if (typeof suffixText === 'function') {
return prefix + suffixText();
}
return '';
}
#updateLineCount() {
const columns = this.#stream.columns ?? 80;
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');
const fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;
this.#lineCount = 0;
for (const line of stripAnsi(fullText).split('\n')) {
this.#lineCount += Math.max(1, Math.ceil(stringWidth(line, {countAnsiEscapeCodes: true}) / columns));
}
}
get isEnabled() {
return this.#isEnabled && !this.#isSilent;
}
set isEnabled(value) {
if (typeof value !== 'boolean') {
throw new TypeError('The `isEnabled` option must be a boolean');
}
this.#isEnabled = value;
}
get isSilent() {
return this.#isSilent;
}
set isSilent(value) {
if (typeof value !== 'boolean') {
throw new TypeError('The `isSilent` option must be a boolean');
}
this.#isSilent = value;
}
frame() {
// Ensure we only update the spinner frame at the wanted interval,
// even if the render method is called more often.
const now = Date.now();
if (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {
this.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;
this.#lastSpinnerFrameTime = now;
}
const {frames} = this.#spinner;
let frame = frames[this.#frameIndex];
if (this.color) {
frame = chalk[this.color](frame);
}
const fullPrefixText = (typeof this.#prefixText === 'string' && this.#prefixText !== '') ? this.#prefixText + ' ' : '';
const fullText = typeof this.text === 'string' ? ' ' + this.text : '';
const fullSuffixText = (typeof this.#suffixText === 'string' && this.#suffixText !== '') ? ' ' + this.#suffixText : '';
return fullPrefixText + frame + fullText + fullSuffixText;
}
clear() {
if (!this.#isEnabled || !this.#stream.isTTY) {
return this;
}
this.#stream.cursorTo(0);
for (let index = 0; index < this.#linesToClear; index++) {
if (index > 0) {
this.#stream.moveCursor(0, -1);
}
this.#stream.clearLine(1);
}
if (this.#indent || this.lastIndent !== this.#indent) {
this.#stream.cursorTo(this.#indent);
}
this.lastIndent = this.#indent;
this.#linesToClear = 0;
return this;
}
render() {
if (this.#isSilent) {
return this;
}
this.clear();
this.#stream.write(this.frame());
this.#linesToClear = this.#lineCount;
return this;
}
start(text) {
if (text) {
this.text = text;
}
if (this.#isSilent) {
return this;
}
if (!this.#isEnabled) {
if (this.text) {
this.#stream.write(`- ${this.text}\n`);
}
return this;
}
if (this.isSpinning) {
return this;
}
if (this.#options.hideCursor) {
cliCursor.hide(this.#stream);
}
if (this.#options.discardStdin && process.stdin.isTTY) {
this.#isDiscardingStdin = true;
stdinDiscarder.start();
}
this.render();
this.#id = setInterval(this.render.bind(this), this.interval);
return this;
}
stop() {
if (!this.#isEnabled) {
return this;
}
clearInterval(this.#id);
this.#id = undefined;
this.#frameIndex = 0;
this.clear();
if (this.#options.hideCursor) {
cliCursor.show(this.#stream);
}
if (this.#options.discardStdin && process.stdin.isTTY && this.#isDiscardingStdin) {
stdinDiscarder.stop();
this.#isDiscardingStdin = false;
}
return this;
}
succeed(text) {
return this.stopAndPersist({symbol: logSymbols.success, text});
}
fail(text) {
return this.stopAndPersist({symbol: logSymbols.error, text});
}
warn(text) {
return this.stopAndPersist({symbol: logSymbols.warning, text});
}
info(text) {
return this.stopAndPersist({symbol: logSymbols.info, text});
}
stopAndPersist(options = {}) {
if (this.#isSilent) {
return this;
}
const prefixText = options.prefixText ?? this.#prefixText;
const fullPrefixText = this.#getFullPrefixText(prefixText, ' ');
const symbolText = options.symbol ?? ' ';
const text = options.text ?? this.text;
const separatorText = symbolText ? ' ' : '';
const fullText = (typeof text === 'string') ? separatorText + text : '';
const suffixText = options.suffixText ?? this.#suffixText;
const fullSuffixText = this.#getFullSuffixText(suffixText, ' ');
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\n';
this.stop();
this.#stream.write(textToWrite);
return this;
}
}
export default function ora(options) {
return new Ora(options);
}
export async function oraPromise(action, options) {
const actionIsFunction = typeof action === 'function';
const actionIsPromise = typeof action.then === 'function';
if (!actionIsFunction && !actionIsPromise) {
throw new TypeError('Parameter `action` must be a Function or a Promise');
}
const {successText, failText} = typeof options === 'object'
? options
: {successText: undefined, failText: undefined};
const spinner = ora(options).start();
try {
const promise = actionIsFunction ? action(spinner) : action;
const result = await promise;
spinner.succeed(
successText === undefined
? undefined
: (typeof successText === 'string' ? successText : successText(result)),
);
return result;
} catch (error) {
spinner.fail(
failText === undefined
? undefined
: (typeof failText === 'string' ? failText : failText(error)),
);
throw error;
}
}
export {default as spinners} from 'cli-spinners';

9
node_modules/ora/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,20 @@
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

107
node_modules/ora/node_modules/emoji-regex/README.md generated vendored Normal file
View File

@@ -0,0 +1,107 @@
# emoji-regex [![Build status](https://github.com/mathiasbynens/emoji-regex/actions/workflows/main.yml/badge.svg)](https://github.com/mathiasbynens/emoji-regex/actions/workflows/main.yml) [![emoji-regex on npm](https://img.shields.io/npm/v/emoji-regex)](https://www.npmjs.com/package/emoji-regex)
_emoji-regex_ offers a regular expression to match all emoji symbols and sequences (including textual representations of emoji) as per the Unicode Standard. Its based on [_emoji-test-regex-pattern_](https://github.com/mathiasbynens/emoji-test-regex-pattern), which generates (at build time) the regular expression pattern based on the Unicode Standard. As a result, _emoji-regex_ can easily be updated whenever new emoji are added to Unicode.
Since each version of _emoji-regex_ is tied to the latest Unicode version at the time of release, results are deterministic. This is important for use cases like image replacement, where you want to guarantee that an image asset is available for every possibly matched emoji. If you dont need a deterministic regex, a lighter-weight, general emoji pattern is available via the [_emoji-regex-xs_](https://github.com/slevithan/emoji-regex-xs) package that follows the same API.
## Installation
Via [npm](https://www.npmjs.com/):
```bash
npm install emoji-regex
```
In [Node.js](https://nodejs.org/):
```js
const emojiRegex = require('emoji-regex');
// Note: because the regular expression has the global flag set, this module
// exports a function that returns the regex rather than exporting the regular
// expression itself, to make it impossible to (accidentally) mutate the
// original regular expression.
const text = `
\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
`;
const regex = emojiRegex();
for (const match of text.matchAll(regex)) {
const emoji = match[0];
console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
}
```
Console output:
```
Matched sequence ⌚ — code points: 1
Matched sequence ⌚ — code points: 1
Matched sequence ↔️ — code points: 2
Matched sequence ↔️ — code points: 2
Matched sequence 👩 — code points: 1
Matched sequence 👩 — code points: 1
Matched sequence 👩🏿 — code points: 2
Matched sequence 👩🏿 — code points: 2
```
## For maintainers
### How to update emoji-regex after new Unicode Standard releases
1. [Update _emoji-test-regex-pattern_ as described in its repository](https://github.com/mathiasbynens/emoji-test-regex-pattern#how-to-update-emoji-test-regex-pattern-after-new-uts51-releases).
1. Bump the _emoji-test-regex-pattern_ dependency to the latest version.
1. Update the Unicode data dependency in `package.json` by running the following commands:
```sh
# Example: updating from Unicode v13 to Unicode v14.
npm uninstall @unicode/unicode-13.0.0
npm install @unicode/unicode-14.0.0 --save-dev
````
1. Generate the new output:
```sh
npm run build
```
1. Verify that tests still pass:
```sh
npm test
```
### How to publish a new release
1. On the `main` branch, bump the emoji-regex version number in `package.json`:
```sh
npm version patch -m 'Release v%s'
```
Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).
Note that this produces a Git commit + tag.
1. Push the release commit and tag:
```sh
git push && git push --tags
```
Our CI then automatically publishes the new release to npm.
## Author
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
## License
_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.

3
node_modules/ora/node_modules/emoji-regex/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
declare module 'emoji-regex' {
export default function emojiRegex(): RegExp;
}

4
node_modules/ora/node_modules/emoji-regex/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

4
node_modules/ora/node_modules/emoji-regex/index.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

45
node_modules/ora/node_modules/emoji-regex/package.json generated vendored Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "emoji-regex",
"version": "10.6.0",
"description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.",
"homepage": "https://mths.be/emoji-regex",
"main": "index.js",
"module": "index.mjs",
"types": "index.d.ts",
"keywords": [
"unicode",
"regex",
"regexp",
"regular expressions",
"code points",
"symbols",
"characters",
"emoji"
],
"license": "MIT",
"author": {
"name": "Mathias Bynens",
"url": "https://mathiasbynens.be/"
},
"repository": {
"type": "git",
"url": "https://github.com/mathiasbynens/emoji-regex.git"
},
"bugs": "https://github.com/mathiasbynens/emoji-regex/issues",
"files": [
"LICENSE-MIT.txt",
"index.js",
"index.d.ts",
"index.mjs"
],
"scripts": {
"build": "node script/build.js",
"test": "mocha",
"test:watch": "npm run test -- --watch"
},
"devDependencies": {
"@unicode/unicode-17.0.0": "^1.6.10",
"emoji-test-regex-pattern": "^2.4.0",
"mocha": "^11.7.2"
}
}

8
node_modules/ora/node_modules/log-symbols/browser.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
const logSymbols = {
info: '',
success: '✅',
warning: '⚠️',
error: '❌️',
};
export default logSymbols;

22
node_modules/ora/node_modules/log-symbols/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
Colored symbols for various log levels.
Includes fallbacks for Windows CMD which only supports a [limited character set](https://en.wikipedia.org/wiki/Code_page_437).
@example
```
import logSymbols from 'log-symbols';
console.log(logSymbols.success, 'Finished successfully!');
// Terminals with Unicode support: ✔ Finished successfully!
// Terminals without Unicode support: √ Finished successfully!
```
*/
declare const logSymbols: {
readonly info: string;
readonly success: string;
readonly warning: string;
readonly error: string;
};
export default logSymbols;

20
node_modules/ora/node_modules/log-symbols/index.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import chalk from 'chalk';
import isUnicodeSupported from 'is-unicode-supported';
const main = {
info: chalk.blue(''),
success: chalk.green('✔'),
warning: chalk.yellow('⚠'),
error: chalk.red('✖'),
};
const fallback = {
info: chalk.blue('i'),
success: chalk.green('√'),
warning: chalk.yellow('‼'),
error: chalk.red('×'),
};
const logSymbols = isUnicodeSupported() ? main : fallback;
export default logSymbols;

9
node_modules/ora/node_modules/log-symbols/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,12 @@
/**
Detect whether the terminal supports Unicode.
@example
```
import isUnicodeSupported from 'is-unicode-supported';
isUnicodeSupported();
//=> true
```
*/
export default function isUnicodeSupported(): boolean;

View File

@@ -0,0 +1,17 @@
import process from 'node:process';
export default function isUnicodeSupported() {
if (process.platform !== 'win32') {
return process.env.TERM !== 'linux'; // Linux console (kernel)
}
return Boolean(process.env.CI)
|| Boolean(process.env.WT_SESSION) // Windows Terminal
|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|| process.env.TERM_PROGRAM === 'Terminus-Sublime'
|| process.env.TERM_PROGRAM === 'vscode'
|| process.env.TERM === 'xterm-256color'
|| process.env.TERM === 'alacritty'
|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
}

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,43 @@
{
"name": "is-unicode-supported",
"version": "1.3.0",
"description": "Detect whether the terminal supports Unicode",
"license": "MIT",
"repository": "sindresorhus/is-unicode-supported",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"terminal",
"unicode",
"detect",
"utf8",
"console",
"shell",
"support",
"supports",
"supported",
"check",
"detection"
],
"devDependencies": {
"ava": "^4.0.1",
"tsd": "^0.19.1",
"xo": "^0.47.0"
}
}

View File

@@ -0,0 +1,35 @@
# is-unicode-supported
> Detect whether the terminal supports Unicode
This can be useful to decide whether to use Unicode characters or fallback ASCII characters in command-line output.
Note that the check is quite naive. It just assumes all non-Windows terminals support Unicode and hard-codes which Windows terminals that do support Unicode. However, I have been using this logic in some popular packages for years without problems.
## Install
```sh
npm install is-unicode-supported
```
## Usage
```js
import isUnicodeSupported from 'is-unicode-supported';
isUnicodeSupported();
//=> true
```
## API
### isUnicodeSupported()
Returns a `boolean` for whether the terminal supports Unicode.
## Related
- [is-interactive](https://github.com/sindresorhus/is-interactive) - Check if stdout or stderr is interactive
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [figures](https://github.com/sindresorhus/figures) - Unicode symbols with Windows fallbacks
- [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels

57
node_modules/ora/node_modules/log-symbols/package.json generated vendored Normal file
View File

@@ -0,0 +1,57 @@
{
"name": "log-symbols",
"version": "6.0.0",
"description": "Colored symbols for various log levels. Example: `✔︎ Success`",
"license": "MIT",
"repository": "sindresorhus/log-symbols",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
"types": "./index.d.ts",
"node": "./index.js",
"default": "./browser.js"
},
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts",
"browser.js"
],
"keywords": [
"unicode",
"cli",
"cmd",
"command-line",
"characters",
"symbol",
"symbols",
"figure",
"figures",
"fallback",
"windows",
"log",
"logging",
"terminal",
"stdout"
],
"dependencies": {
"chalk": "^5.3.0",
"is-unicode-supported": "^1.3.0"
},
"devDependencies": {
"ava": "^5.3.1",
"strip-ansi": "^7.1.0",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}

39
node_modules/ora/node_modules/log-symbols/readme.md generated vendored Normal file
View File

@@ -0,0 +1,39 @@
# log-symbols
<img src="screenshot.png" width="226" height="192" align="right">
> Colored symbols for various log levels
Includes fallbacks for Windows CMD which only supports a [limited character set](https://en.wikipedia.org/wiki/Code_page_437).
## Install
```sh
npm install log-symbols
```
## Usage
```js
import logSymbols from 'log-symbols';
console.log(logSymbols.success, 'Finished successfully!');
// Terminals with Unicode support: ✔ Finished successfully!
// Terminals without Unicode support: √ Finished successfully!
```
## API
### logSymbols
#### info
#### success
#### warning
#### error
## Related
- [figures](https://github.com/sindresorhus/figures) - Unicode symbols with Windows CMD fallbacks
- [py-log-symbols](https://github.com/ManrajGrover/py-log-symbols) - Python port
- [log-symbols](https://github.com/palash25/log-symbols) - Ruby port
- [guumaster/logsymbols](https://github.com/guumaster/logsymbols) - Golang port

39
node_modules/ora/node_modules/string-width/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,39 @@
export type Options = {
/**
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
@default true
> Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). __If the context cannot be established reliably, they should be treated as narrow characters by default.__
> - http://www.unicode.org/reports/tr11/
*/
readonly ambiguousIsNarrow?: boolean;
/**
Whether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted.
@default false
*/
readonly countAnsiEscapeCodes?: boolean;
};
/**
Get the visual width of a string - the number of columns required to display it.
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
@example
```
import stringWidth from 'string-width';
stringWidth('a');
//=> 1
stringWidth('古');
//=> 2
stringWidth('\u001B[1m古\u001B[22m');
//=> 2
```
*/
export default function stringWidth(string: string, options?: Options): number;

82
node_modules/ora/node_modules/string-width/index.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
import stripAnsi from 'strip-ansi';
import {eastAsianWidth} from 'get-east-asian-width';
import emojiRegex from 'emoji-regex';
const segmenter = new Intl.Segmenter();
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
export default function stringWidth(string, options = {}) {
if (typeof string !== 'string' || string.length === 0) {
return 0;
}
const {
ambiguousIsNarrow = true,
countAnsiEscapeCodes = false,
} = options;
if (!countAnsiEscapeCodes) {
string = stripAnsi(string);
}
if (string.length === 0) {
return 0;
}
let width = 0;
const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
for (const {segment: character} of segmenter.segment(string)) {
const codePoint = character.codePointAt(0);
// Ignore control characters
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
continue;
}
// Ignore zero-width characters
if (
(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
|| codePoint === 0xFE_FF // Zero-width no-break space
) {
continue;
}
// Ignore combining characters
if (
(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
) {
continue;
}
// Ignore surrogate pairs
if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
continue;
}
// Ignore variation selectors
if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
continue;
}
// This covers some of the above cases, but we still keep them for performance reasons.
if (defaultIgnorableCodePointRegex.test(character)) {
continue;
}
// TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
if (emojiRegex().test(character)) {
width += 2;
continue;
}
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
}
return width;
}

9
node_modules/ora/node_modules/string-width/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,64 @@
{
"name": "string-width",
"version": "7.2.0",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": "sindresorhus/string-width",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"string",
"character",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width",
"east-asian-width"
],
"dependencies": {
"emoji-regex": "^10.3.0",
"get-east-asian-width": "^1.0.0",
"strip-ansi": "^7.1.0"
},
"devDependencies": {
"ava": "^5.3.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}

66
node_modules/ora/node_modules/string-width/readme.md generated vendored Normal file
View File

@@ -0,0 +1,66 @@
# string-width
> Get the visual width of a string - the number of columns required to display it
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
Useful to be able to measure the actual width of command-line output.
## Install
```sh
npm install string-width
```
## Usage
```js
import stringWidth from 'string-width';
stringWidth('a');
//=> 1
stringWidth('古');
//=> 2
stringWidth('\u001B[1m古\u001B[22m');
//=> 2
```
## API
### stringWidth(string, options?)
#### string
Type: `string`
The string to be counted.
#### options
Type: `object`
##### ambiguousIsNarrow
Type: `boolean`\
Default: `true`
Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).
> Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). **If the context cannot be established reliably, they should be treated as narrow characters by default.**
> - http://www.unicode.org/reports/tr11/
##### countAnsiEscapeCodes
Type: `boolean`\
Default: `false`
Whether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted.
## Related
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
- [get-east-asian-width](https://github.com/sindresorhus/get-east-asian-width) - Determine the East Asian Width of a Unicode character

64
node_modules/ora/package.json generated vendored Normal file
View File

@@ -0,0 +1,64 @@
{
"name": "ora",
"version": "8.2.0",
"description": "Elegant terminal spinner",
"license": "MIT",
"repository": "sindresorhus/ora",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"cli",
"spinner",
"spinners",
"terminal",
"term",
"console",
"ascii",
"unicode",
"loading",
"indicator",
"progress",
"busy",
"wait",
"idle"
],
"dependencies": {
"chalk": "^5.3.0",
"cli-cursor": "^5.0.0",
"cli-spinners": "^2.9.2",
"is-interactive": "^2.0.0",
"is-unicode-supported": "^2.0.0",
"log-symbols": "^6.0.0",
"stdin-discarder": "^0.2.2",
"string-width": "^7.2.0",
"strip-ansi": "^7.1.0"
},
"devDependencies": {
"@types/node": "^22.5.0",
"ava": "^5.3.1",
"get-stream": "^9.0.1",
"transform-tty": "^1.0.11",
"tsd": "^0.31.1",
"xo": "^0.59.3"
}
}

329
node_modules/ora/readme.md generated vendored Normal file
View File

@@ -0,0 +1,329 @@
# ora
> Elegant terminal spinner
<p align="center">
<br>
<img src="screenshot.svg" width="500">
<br>
</p>
## Install
```sh
npm install ora
```
*Check out [`yocto-spinner`](https://github.com/sindresorhus/yocto-spinner) for a smaller alternative.*
## Usage
```js
import ora from 'ora';
const spinner = ora('Loading unicorns').start();
setTimeout(() => {
spinner.color = 'yellow';
spinner.text = 'Loading rainbows';
}, 1000);
```
## API
### ora(text)
### ora(options)
If a string is provided, it is treated as a shortcut for [`options.text`](#text).
#### options
Type: `object`
##### text
Type: `string`
The text to display next to the spinner.
##### prefixText
Type: `string | () => string`
Text or a function that returns text to display before the spinner. No prefix text will be displayed if set to an empty string.
##### suffixText
Type: `string | () => string`
Text or a function that returns text to display after the spinner text. No suffix text will be displayed if set to an empty string.
##### spinner
Type: `string | object`\
Default: `'dots'` <img src="screenshot-spinner.gif" width="14">
The name of one of the [provided spinners](#spinners). See `example.js` in this repo if you want to test out different spinners. On Windows (except for Windows Terminal), it will always use the `line` spinner as the Windows command-line doesn't have proper Unicode support.
Or an object like:
```js
{
frames: ['-', '+', '-'],
interval: 80 // Optional
}
```
##### color
Type: `string | boolean`\
Default: `'cyan'`\
Values: `'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | boolean`
The color of the spinner.
##### hideCursor
Type: `boolean`\
Default: `true`
Set to `false` to stop Ora from hiding the cursor.
##### indent
Type: `number`\
Default: `0`
Indent the spinner with the given number of spaces.
##### interval
Type: `number`\
Default: Provided by the spinner or `100`
Interval between each frame.
Spinners provide their own recommended interval, so you don't really need to specify this.
##### stream
Type: `stream.Writable`\
Default: `process.stderr`
Stream to write the output.
You could for example set this to `process.stdout` instead.
##### isEnabled
Type: `boolean`
Force enable/disable the spinner. If not specified, the spinner will be enabled if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.
Note that `{isEnabled: false}` doesn't mean it won't output anything. It just means it won't output the spinner, colors, and other ansi escape codes. It will still log text.
##### isSilent
Type: `boolean`\
Default: `false`
Disable the spinner and all log text. All output is suppressed and `isEnabled` will be considered `false`.
##### discardStdin
Type: `boolean`\
Default: `true`
Discard stdin input (except Ctrl+C) while running if it's TTY. This prevents the spinner from twitching on input, outputting broken lines on <kbd>Enter</kbd> key presses, and prevents buffering of input while the spinner is running.
This has no effect on Windows as there is no good way to implement discarding stdin properly there.
### Instance
#### .text <sup>get/set</sup>
Change the text displayed after the spinner.
#### .prefixText <sup>get/set</sup>
Change the text before the spinner.
No prefix text will be displayed if set to an empty string.
#### .suffixText <sup>get/set</sup>
Change the text after the spinner text.
No suffix text will be displayed if set to an empty string.
#### .color <sup>get/set</sup>
Change the spinner color.
#### .spinner <sup>get/set</sup>
Change the spinner.
#### .indent <sup>get/set</sup>
Change the spinner indent.
#### .isSpinning <sup>get</sup>
A boolean indicating whether the instance is currently spinning.
#### .interval <sup>get</sup>
The interval between each frame.
The interval is decided by the chosen spinner.
#### .start(text?)
Start the spinner. Returns the instance. Set the current text if `text` is provided.
#### .stop()
Stop and clear the spinner. Returns the instance.
#### .succeed(text?)
Stop the spinner, change it to a green `✔` and persist the current text, or `text` if provided. Returns the instance. See the GIF below.
#### .fail(text?)
Stop the spinner, change it to a red `✖` and persist the current text, or `text` if provided. Returns the instance. See the GIF below.
#### .warn(text?)
Stop the spinner, change it to a yellow `⚠` and persist the current text, or `text` if provided. Returns the instance.
#### .info(text?)
Stop the spinner, change it to a blue `` and persist the current text, or `text` if provided. Returns the instance.
#### .stopAndPersist(options?)
Stop the spinner and change the symbol or text. Returns the instance. See the GIF below.
##### options
Type: `object`
###### symbol
Type: `string`\
Default: `' '`
Symbol to replace the spinner with.
###### text
Type: `string`\
Default: Current `'text'`
Text to be persisted after the symbol.
###### prefixText
Type: `string | () => string`\
Default: Current `prefixText`
Text or a function that returns text to be persisted before the symbol. No prefix text will be displayed if set to an empty string.
###### suffixText
Type: `string | () => string`\
Default: Current `suffixText`
Text or a function that returns text to be persisted after the text after the symbol. No suffix text will be displayed if set to an empty string.
<img src="screenshot-2.gif" width="480">
#### .clear()
Clear the spinner. Returns the instance.
#### .render()
Manually render a new frame. Returns the instance.
#### .frame()
Get a new frame.
### oraPromise(action, text)
### oraPromise(action, options)
Starts a spinner for a promise or promise-returning function. The spinner is stopped with `.succeed()` if the promise fulfills or with `.fail()` if it rejects. Returns the promise.
```js
import {oraPromise} from 'ora';
await oraPromise(somePromise);
```
#### action
Type: `Promise | ((spinner: ora.Ora) => Promise)`
#### options
Type: `object`
All of the [options](#options) plus the following:
##### successText
Type: `string | ((result: T) => string) | undefined`
The new text of the spinner when the promise is resolved.
Keeps the existing text if `undefined`.
##### failText
Type: `string | ((error: Error) => string) | undefined`
The new text of the spinner when the promise is rejected.
Keeps the existing text if `undefined`.
### spinners
Type: `Record<string, Spinner>`
All [provided spinners](https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json).
## FAQ
### How do I change the color of the text?
Use [`chalk`](https://github.com/chalk/chalk) or [`yoctocolors`](https://github.com/sindresorhus/yoctocolors):
```js
import ora from 'ora';
import chalk from 'chalk';
const spinner = ora(`Loading ${chalk.red('unicorns')}`).start();
```
### Why does the spinner freeze?
JavaScript is single-threaded, so any synchronous operations will block the spinner's animation. To avoid this, prefer using asynchronous operations.
## Related
- [yocto-spinner](https://github.com/sindresorhus/yocto-spinner) - Tiny terminal spinner
- [cli-spinners](https://github.com/sindresorhus/cli-spinners) - Spinners for use in the terminal
**Ports**
- [CLISpinner](https://github.com/kiliankoe/CLISpinner) - Terminal spinner library for Swift
- [halo](https://github.com/ManrajGrover/halo) - Python port
- [spinners](https://github.com/FGRibreau/spinners) - Terminal spinners for Rust
- [marquee-ora](https://github.com/joeycozza/marquee-ora) - Scrolling marquee spinner for Ora
- [briandowns/spinner](https://github.com/briandowns/spinner) - Terminal spinner/progress indicator for Go
- [tj/go-spin](https://github.com/tj/go-spin) - Terminal spinner package for Go
- [observablehq.com/@victordidenko/ora](https://observablehq.com/@victordidenko/ora) - Ora port to Observable notebooks
- [kia](https://github.com/HarryPeach/kia) - Simple terminal spinners for Deno 🦕