4.4.2 • Published 10 months ago
@pmnps/tools v4.4.2
@pmnps/tools
This package provides some tools for writing plugins for pmnps.
API
message
You can use this api to log what happens in your plugin.
declare type Message = {
error(message: string): void;
info(message: string): void;
log(message: string): void;
success(message: string): void;
desc(message: string): void;
warn(message: string): void;
};
export declare const message: Message;
execution
This API helps to manage the executions.
import type execa from 'execa';
export declare const execution: {
exec(
file: string,
params?: string[] | execa.Options,
options?: execa.Options
): execa.ExecaChildProcess;
command(params: string, options?: execa.Options): execa.ExecaChildProcess;
execute: typeof execa;
killChildProcess([pid, process]: [number, execa.ExecaChildProcess]): void;
};
createPluginCommand
This API helps to create a plugin command.
declare type PluginSlot = {
name: string;
option(
optionName: string,
shortcut: string,
optional?: { description?: string; inputType?: 'string' | 'boolean' }
): PluginSlot;
describe(description: string): PluginSlot;
require(requireFn: RequireFn): PluginSlot;
action(action: Action): Command;
};
export declare function createPluginCommand(name: string): PluginSlot;
inquirer
This API helps to create a prompt for the user.
import type { Answers, QuestionCollection, ui, Separator } from 'inquirer';
declare function prompt<T extends Answers = Answers>(
questions: QuestionCollection<T>,
initialAnswers?: Partial<T>
): Promise<T> & { ui: ui.Prompt<T> };
export declare const inquirer: {
prompt: typeof prompt;
Separator: typeof Separator;
};
4.4.2
10 months ago
4.4.1
10 months ago
4.3.2
11 months ago
4.0.5
1 year ago
4.4.0
11 months ago
4.3.1
11 months ago
4.1.0
12 months ago
4.0.1
1 year ago
4.0.0
1 year ago
4.3.0
11 months ago
4.2.1
11 months ago
4.0.3
1 year ago
4.2.0
12 months ago
4.1.1
12 months ago
4.0.2
1 year ago
3.1.12
3 years ago
3.1.11
3 years ago
3.1.10
3 years ago
3.1.9
3 years ago
3.1.8
3 years ago
3.1.7
3 years ago
3.1.6
3 years ago
3.1.5
3 years ago
3.1.4
3 years ago
3.1.3
3 years ago
3.1.2
3 years ago
3.1.1
3 years ago
3.1.0
3 years ago
3.0.2
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago