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

belt-cli

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

belt-cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

27

cli.js

@@ -37,7 +37,32 @@ #!/usr/bin/env node

function printList() {
const groupBy = require('lodash.groupby');
const sortBy = require('lodash.sortby');
const commands = getCommands();
const groups = Object.entries(groupBy(Object.entries(commands), ([command]) => {
const parts = command.split(':');
return parts.length === 1 ? '_' : parts[0];
}));
const noPrefix = groups.find(_ => _[0] === '_') || ['_', []];
const prefixed = sortBy(groups.filter(_ => _[0] !== '_'), '[0]');
console.log();
Object.entries(commands).forEach(([command, info]) => {
sortBy(noPrefix[1], '[0]').forEach(([command, info]) => {
console.log(`- ${command} (${info.description})`);
});
let prevLength = noPrefix[1].length;
prefixed.forEach(([, commands]) => {
if (prevLength > 1) {
console.log();
}
sortBy(commands, '[0]').forEach(([command, info]) => {
console.log(`- ${command} (${info.description})`);
});
prevLength = commands.length;
});
}

@@ -44,0 +69,0 @@

4

package.json
{
"name": "belt-cli",
"version": "0.0.2",
"version": "0.0.3",
"description": "Minimalistic extendable CLI script runner",

@@ -15,4 +15,6 @@ "main": "cli.js",

"configstore": "^3.1.2",
"lodash.groupby": "^4.6.0",
"lodash.sortby": "^4.7.0",
"minimist": "^1.2.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