Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@pmnps/tools

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pmnps/tools

These are tools for developing pmnps and its plugins

latest
Source
npmnpm
Version
4.5.0
Version published
Weekly downloads
20
900%
Maintainers
1
Weekly downloads
 
Created
Source

@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;
};

Keywords

js

FAQs

Package last updated on 26 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts