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

node-peco

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-peco

Peco (Simplistic interactive filtering tool) NodeJS Binding

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115
decreased by-4.96%
Maintainers
1
Weekly downloads
 
Created
Source

Node Peco

peco nodejs binding library

NOTE: external command peco is required. see peco installation

NPM github ci npm npm bundle size

example

Installation

yarn add node-peco

Usage

This package exports only one function named peco.

import { peco } from 'node-peco'; // or require('node-peco');

peco(['foo', 'bar', 'baz']).then(selected => console.log(selected));

You can pass option as a second argument

import { peco, PecoOption } from 'node-peco';

const pecoOption: PecoOption = {
  onCancel: 'reject',
  layout: 'bottom-up',
  selectionPrefix: '*',
  prompt: "Choose ->",
};

peco(['foo', 'bar', 'baz'], pecoOption).then(selected => console.log(selected));

for more examples, see examples

Option

There are two categories of option. One is js dependent:

keytypedescriptiondefault
binstringpeco binary command(or location path)"peco"
onCancel"reject" | "skip"specify behavior when received SIGINT"skip"
onError"reject" | "exit"specify behavior when peco exited with non-zero code"exit"

The other is peco command line option. See peco#command-line-options

Keywords

FAQs

Package last updated on 04 Apr 2021

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

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