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.1 to 1.0.2

99

index.js

@@ -1,3 +0,98 @@

exports.printMsg=function(){
console.log('this message is from esm');
//var program = require('commander');
var util = require('util');
var prompt = require('prompt');
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);
//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) {
prompt.start();
prompt.get(['name'], function (err, result) {
console.log('Command-line input received:');
console.log(' name: ' + result.name);
});
}
{
"name": "esm",
"version": "1.0.1",
"version": "1.0.2",
"description": "emobiq service manager",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node ./node_modules/tad/bin/tad"
},

@@ -12,4 +12,11 @@ "keywords": [

],
"dependencies": {
"cli-color": "^1.0.0",
"prompt": "^0.2.14"
},
"devDependencies": {
"tad": "^0.2.2"
},
"author": "Agus Made <krisnaparta@gmail.com>",
"license": "ISC"
}
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