New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oclif/plugin-search

Package Overview
Dependencies
Maintainers
0
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/plugin-search - npm Package Compare versions

Comparing version 1.1.5-dev.0 to 1.1.5-dev.1

20

dist/commands/search.js

@@ -8,2 +8,3 @@ /*

import { Command, loadHelpClass, toConfiguredId, toStandardizedId, ux } from '@oclif/core';
import ansiEscapes from 'ansi-escapes';
import autocomplete from 'inquirer-autocomplete-standalone';

@@ -15,5 +16,3 @@ import readline from 'node:readline';

async run() {
this.log(`Interactively search the catalog of ${this.config.bin} commands.
Use ${ux.colorize('bold', '↑')} and ${ux.colorize('bold', '↓')} keys or type to search. Press ${ux.colorize('bold', 'ESC')} to exit.
`);
this.log(`Use ${ux.colorize('bold', '↑')} and ${ux.colorize('bold', '↓')} keys or type to search. Press ${ux.colorize('bold', 'ESC')} to exit.\n`);
const commandChoices = this.config.commands

@@ -30,6 +29,7 @@ .filter((c) => !c.hidden && !c.aliases.includes(c.id))

});
const pageSize = Math.floor(process.stdout.rows < 20 ? process.stdout.rows / 2 : 10);
const commandPromise = autocomplete({
emptyText: 'Nothing found!',
message: 'Search for a command',
pageSize: Math.floor(process.stdout.rows < 20 ? process.stdout.rows / 2 : 10),
pageSize,
async source(input) {

@@ -39,8 +39,14 @@ return input ? commandChoices.filter((c) => c.name.includes(input)) : commandChoices;

});
function cancel() {
commandPromise.cancel();
// erase the list of commands
process.stdout.write(ansiEscapes.eraseLines(pageSize + 3));
}
readline.emitKeypressEvents(process.stdin);
process.stdin.setRawMode(true);
process.stdin.on('keypress', (_, key) => {
if (key.name === 'escape') {
commandPromise.cancel();
}
if (key.name === 'escape')
cancel();
if (key.name === 'c' && key.ctrl)
cancel();
});

@@ -47,0 +53,0 @@ const command = await commandPromise

@@ -29,3 +29,3 @@ {

},
"version": "1.1.5-dev.0"
"version": "1.1.5-dev.1"
}
{
"name": "@oclif/plugin-search",
"version": "1.1.5-dev.0",
"version": "1.1.5-dev.1",
"description": "A command for searching commands",

@@ -9,2 +9,3 @@ "author": "Salesforce",

"@oclif/core": "^4",
"ansi-escapes": "^7.0.0",
"inquirer-autocomplete-standalone": "^0.8.1"

@@ -11,0 +12,0 @@ },

@@ -25,3 +25,3 @@ # @oclif/plugin-search

$ @oclif/plugin-search (--version)
@oclif/plugin-search/1.1.5-dev.0 linux-x64 node-v20.14.0
@oclif/plugin-search/1.1.5-dev.1 linux-x64 node-v20.14.0
$ @oclif/plugin-search --help [COMMAND]

@@ -53,3 +53,3 @@ USAGE

_See code: [src/commands/search.ts](https://github.com/oclif/plugin-search/blob/v1.1.5-dev.0/src/commands/search.ts)_
_See code: [src/commands/search.ts](https://github.com/oclif/plugin-search/blob/v1.1.5-dev.1/src/commands/search.ts)_
<!-- commandsstop -->

@@ -56,0 +56,0 @@

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