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

@jinboker/self-use

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jinboker/self-use - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

src/action.js

5

package.json
{
"name": "@jinboker/self-use",
"version": "0.0.4",
"version": "0.0.5",
"description": "some tools use by myself",

@@ -26,3 +26,4 @@ "scripts": {

"dependencies": {
"commander": "^3.0.2"
"commander": "^3.0.2",
"inquirer": "^7.0.0"
},

@@ -29,0 +30,0 @@ "devDependencies": {

43

src/index.js
#!/usr/bin/env node
import program from 'commander';
import { VERSION } from '../version';
const program = require('commander');
const inquirer = require('inquirer');
const { VERSION } = require('../version');
const { addAction } = require('./action');
program
.version(VERSION, '-v, --version')
.command('init <name>')
.action(name => {
console.log(name);
.version(VERSION, '-v, --version');
console.log(process.cwd(), 'xxx');
// 添加内容
program
.command('add [type]')
.action(type => {
console.log(type, process.argv, 'xxx');
if (type === undefined) {
inquirer
.prompt([
{
type: 'list',
name: 'action',
message: '请选择操作',
choices: Object.keys(addAction),
},
])
.then(({ action }) => {
if (action in addAction) {
console.log(`add ${action}`);
}
});
return;
}
if (type in addAction) {
console.log(`add ${type}`);
return;
}
throw Error('请输入正确的type');
});
program.parse(process.argv);

@@ -9,5 +9,4 @@ // eslint-disable-next-line import/no-extraneous-dependencies

console.log(file, VERSION, packageJsonPath, 'xxx');
file.set('version', VERSION);
file.save();

@@ -1,1 +0,1 @@

module.exports.VERSION = '0.0.4';
module.exports.VERSION = '0.0.5';
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