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.5 to 1.0.6

bin/esm

30

index.js
#!/usr/bin/env node
var prompt = require('prompt');
var program= require('./lib/arg');
var help= require('./lib/help');
var _p = require('./lib/arg');
var help = require('./lib/help');
var func = require('./lib/func')(_p);
//console.log(program);
if(program.options['h'] || program.options['help'] || program.options['V'] || program.options['version']){
help(program);
if((!_p.options.length && !_p.command) || _p.options.h || _p.options.help || _p.options.v || _p.options.version){
help(_p);
process.exit();
}
if (program.command=='init') {
prompt.message = '> ';
prompt.delimiter=' ';
prompt.start();
prompt.get(['name','email'], function (err, result) {
console.log('Command-line input received:');
console.log(' name: ' + result.name);
console.log(' email: ' + result.email);
});
}
func.initCLI(function(){
var cmd = require('./lib/cmd')(func);
if (_p.command && cmd[_p.command]) {
cmd[_p.command]();
} else {
help(_p);
}
});

@@ -15,3 +15,3 @@ var util = require('util');

if (!util.isArray(x.options[k])) {
x.options[k]=[x.options[k]]
x.options[k]=[x.options[k]];
}

@@ -22,3 +22,3 @@ if (v!==true) {

}
};
}
function arg(a,v){

@@ -44,9 +44,9 @@ x.arguments[a]=v;

last=smin[1];
opt(smin[1])
opt(smin[1]);
}
} else if (sminmin && sminmin.length && sminmin[1]) {
last=sminmin[1];
opt(sminmin[1])
opt(sminmin[1]);
} else if(sarg && sarg.length > 2){
arg(sarg[1],sarg[2])
arg(sarg[1],sarg[2]);
} else {

@@ -59,3 +59,7 @@ opt(last,val);

});
if (x.options['']) {
x.subcommand=x.options[''];
delete(x.options['']);
}
return x;
}());

@@ -0,28 +1,64 @@

var util = require('util');
var help=require('./../help.json');
function srepeat(s,n) {
return (new Array(n+1).join(s));
}
function showHelp(h) {
function format1(hs,s) {
if (!util.isArray(hs)) {
hs=[hs];
}
console.log('\n'+s+hs[0]);
for(var i=1;i<hs.length;i++){
console.log(srepeat(' ',s.length)+hs[i]);
}
}
function format2(hs,s,l) {
l=l||3;
if (!util.isArray(hs)) {
hs=[hs];
}
console.log('\n'+s);
for(var i=0;i<hs.length;i++){
console.log((srepeat(' ',3))+hs[i]);
}
}
if (h.usage) {
format1(h.usage,' Usage: ');
}
if (h.description) {
format1(h.description,' ');
}
if (h.options) {
format2(h.options,' Options: ');
}
if (h.notes) {
var hs=h.notes;
if (!util.isArray(hs)) {
hs=[hs];
}
for(var i=0;i<hs.length;i++){
if (!(hs[i].title)) {
console.log('\n '+hs[i]);
} else {
format2(hs[i].content,' '+hs[i].title);
}
}
}
console.log('');
}
module.exports=function(p){
p=p||{options:{},command:'',arguments:[]};
var s='';
if (p.options['V'] || p.options['version']) {
s='esm version:1.0.2';
} else if (p.command=='init') {
s='\n Usage: esm init\n';
if (p.options.v || p.options.version && !p.command) {
console.log('esm version:'+help.version);
} else if(!p.command){
showHelp(help);
} else if (help.commands[p.command]) {
showHelp(help.commands[p.command]);
} else {
s= '\n'+
' Usage: esm [options|<command> [arguments]]\n\n'+
' esm command line interface\n\n'+
' where <command> is one of:\n'+
' add-user, adduser, apihelp, author, bin, bugs, c, cache,\n'+
' completion, config, ddp, dedupe, deprecate, docs, edit,\n'+
' explore, faq, find, find-dupes, get, help, help-search,\n'+
' home, i, info, init, install, issues, la, link, list, ll,\n'+
' ln, login, ls, outdated, owner, pack, prefix, prune,\n'+
' publish, r, rb, rebuild, remove, repo, restart, rm, root,\n'+
' run-script, s, se, search, set, show, shrinkwrap, star,\n'+
' stars, start, stop, t, tag, test, tst, un, uninstall,\n'+
' unlink, unpublish, unstar, up, update, v, version, view,\n'+
' whoami\n\n'+
' Options:\n'+
' -h, --help output usage information\n'+
' -V, --version output the version number\n';
console.log('no command found');
}
console.log(s);
};
{
"name": "esm",
"version": "1.0.5",
"version": "1.0.6",
"description": "emobiq service manager",
"main": "index.js",
"bin": "index.js",
"bin": {
"esm": "./bin/esm"
},
"scripts": {
"test": "node ./node_modules/tad/bin/tad"
"start": "node ./index.js",
"test": "tad"
},

@@ -14,7 +17,18 @@ "keywords": [

"dependencies": {
"cli-color": "^1.0.0",
"prompt": "^0.2.14"
"colors": "~1.1.2",
"fstream": "~1.0.7",
"jshint": "~2.8.0",
"mute-stream": "~0.0.4",
"ncp": "^2.0.0",
"osenv": "~0.1.2",
"request": "~2.57.0",
"tar": "~2.1.1",
"tough-cookie": "~2.0.0",
"tough-cookie-filestore": "~0.0.1",
"uglify-js": "~2.4.23"
},
"devDependencies": {
"tad": "^0.2.2"
"gulp": "~3.9.0",
"gulp-jshint": "~1.11.0",
"tad": "~0.2.2"
},

@@ -21,0 +35,0 @@ "author": "Agus Made <krisnaparta@gmail.com>",

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