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

@jbangdev/jbang

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

@jbangdev/jbang - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

17

jbang.js

@@ -5,2 +5,3 @@ const shell = require('shelljs');

argLine = args.join(" ");
let cmdResult = null;
if (shell.which('jbang')

@@ -10,10 +11,10 @@ || (process.platform === 'win32' && shell.which('./jbang.cmd')) // windows

console.log('using jbang:', argLine);
shell.exec('jbang ' + argLine);
cmdResult = shell.exec('jbang ' + argLine);
} else if (shell.which('curl') && shell.which('bash')) {
console.log('using curl + bash:', argLine);
shell.exec('curl -Ls https://sh.jbang.dev | bash -s - ' + argLine);
cmdResult = shell.exec('curl -Ls https://sh.jbang.dev | bash -s - ' + argLine);
} else if (shell.which('powershell')) {
console.log('using powershell:', argLine);
shell.exec('echo iex "& { $(iwr -useb https://ps.jbang.dev) } $args" > %TEMP%/jbang.ps1');
shell.exec('powershell -Command "%TEMP%/jbang.ps1 ' + argLine + '"');
cmdResult = shell.exec('powershell -Command "%TEMP%/jbang.ps1 ' + argLine + '"');
} else {

@@ -23,2 +24,12 @@ shell.echo('unable to pre-install jbang:', argLine);

}
if (cmdResult?.code !== 0) {
const err = new Error(`The command failed: 'jbang ${argLine}'. Code: ${cmdResult?.code}`);
err.code = cmdResult?.code;
err.cause = cmdResult.stderr;
throw err;
}
return cmdResult;
};

@@ -25,0 +36,0 @@

2

package.json
{
"name": "@jbangdev/jbang",
"version": "0.1.4",
"version": "0.2.0",
"description": "NPM for JBang - Java Script in your JavaScript",

@@ -5,0 +5,0 @@ "homepage": "https://jbang.dev",

@@ -20,3 +20,3 @@ # jbang-npm - Java Script in your JavaScript

And in `package.json`:
And in `package.json` (use the latest version from [npm](https://www.npmjs.com/package/@jbangdev/jbang)):

@@ -29,3 +29,3 @@ ```json

"devDependencies": {
"@jbangdev/jbang": "^0.1.0"
"@jbangdev/jbang": "^0.1.4"
}

@@ -32,0 +32,0 @@ }

#! /usr/bin/env node
var jbang = require('./jbang');
jbang.exec('properties@jbangdev');
try {
jbang.exec('badinput');
console.error('jbang error not caught!');
process.exit(1);
} catch (err) {
console.log('jbang error caught successfully');
}
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