Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@astrojs/cli-kit

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/cli-kit - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

3

dist/spinner/index.d.ts
/// <reference types="node" resolution-mode="require"/>
export declare function spinner({ start, end, while: update, }: {
export declare function spinner({ start, end, onError, while: update, }: {
start: string;
end: string;
onError?: (e: any) => void;
while: (...args: any) => Promise<any>;

@@ -6,0 +7,0 @@ }, { stdin, stdout }?: {

@@ -95,12 +95,19 @@ import readline from "node:readline";

}
export async function spinner({ start, end, while: update = () => sleep(100), }, { stdin = process.stdin, stdout = process.stdout } = {}) {
export async function spinner({ start, end, onError, while: update = () => sleep(100), }, { stdin = process.stdin, stdout = process.stdout } = {}) {
const loading = await gradient(chalk.green(start), { stdin, stdout });
const act = update();
const tooslow = Object.create(null);
const result = await Promise.race([sleep(500).then(() => tooslow), act]);
if (result === tooslow) {
const loading = await gradient(chalk.green(start), { stdin, stdout });
await act;
try {
const result = await Promise.race([sleep(500).then(() => tooslow), act]);
if (result === tooslow) {
await act;
}
stdout.write(`${" ".repeat(5)} ${chalk.green("✔")} ${chalk.green(end)}\n`);
}
catch (e) {
onError?.(e);
}
finally {
loading.stop();
}
stdout.write(`${" ".repeat(5)} ${chalk.green("✔")} ${chalk.green(end)}\n`);
}
{
"name": "@astrojs/cli-kit",
"type": "module",
"version": "0.3.0",
"version": "0.3.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "types": "./dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc