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

esm

Package Overview
Dependencies
Maintainers
2
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esm - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

lib/arg.js

101

index.js

@@ -1,98 +0,21 @@

//var program = require('commander');
var util = require('util');
var prompt = require('prompt');
var program= require('./lib/arg');
var help= require('./lib/help');
var program=(function(){
var x={params:{},command:[]};
var stopCmd=false;
var last='';
function update(k,v) {
if (typeof(v)=='undefined') {
v=true;
}
if (typeof(x.params[k])=='undefined' || x.params[k]===true) {
x.params[k]=v;
} else {
if (!util.isArray(x.params[k])) {
x.params[k]=[x.params[k]]
}
if (v!==true) {
x.params[k].push(v);
}
}
};
function cmd(c){
x.command.push(c);
}
process.argv.forEach(function(val, i, array) {
if (i>1) {
var smin=val.match(/^\-(\w+)/);
var sminmin=val.match(/^\-\-(\w+)/);
var scmd=val.match(/^(\w+)/);
if (scmd && scmd.length && scmd[1] && !stopCmd) {
cmd(scmd[1]);
} else {
stopCmd=true;
if (smin && smin.length && smin[1]) {
if(smin[1].length > 1){
last='';
for(var j=0;j<smin[1].length;j++){
update(smin[1][j]);
}
} else {
last=smin[1];
update(smin[1])
}
} else if (sminmin && sminmin.length && sminmin[1]) {
last=sminmin[1];
update(sminmin[1])
} else {
update(last,val);
}
}
}
});
return x;
}());
//console.log(program);
console.log(program);
if(program.options['h'] || program.options['help'] || program.options['V'] || program.options['version']){
help(program);
process.exit();
}
//function range(val) {
// return val.split('..').map(Number);
//}
//
//function list(val) {
// return val.split(',');
//}
//
//function collect(val, memo) {
// memo.push(val);
// return memo;
//}
//
//function increaseVerbosity(v, total) {
// return total + 1;
//}
//var _init=false;
//
//program
// .version('1.0.1')
// .usage('esm <command>')
// .command('init', 'init esm packages').action(function () {
// console.log('tanya-tanya...');
// _init=true;
// });
////program.parse(process.argv);
//
//process.argv.forEach(function(val, index, array) {
// console.log(index + ': ' + val);
//});
//
if (program.command && program.command.length && program.command.indexOf('init')>-1) {
if (program.command=='init') {
prompt.message = '> ';
prompt.delimiter=' ';
prompt.start();
prompt.get(['name'], function (err, result) {
prompt.get(['name','email'], function (err, result) {
console.log('Command-line input received:');
console.log(' name: ' + result.name);
console.log(' email: ' + result.email);
});
}
{
"name": "esm",
"version": "1.0.2",
"version": "1.0.3",
"description": "emobiq service manager",

@@ -5,0 +5,0 @@ "main": "index.js",

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