
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@jbangdev/jbang
Advanced tools
Install and use JBang from npm based projects.
Lets you use your own local scripts, JBang AppStore alias or any network reachable jar or Maven artifact.
The jbang.exec()
function accepts a string that will be passed as the command-line arguments to the jbang
executable.
Given this script test.js
:
#! /usr/bin/env node
const jbang = require('@jbangdev/jbang');
jbang.exec('properties@jbangdev');
And in package.json
(use the latest version from npm):
{
"scripts": {
"test": "node test.js"
},
"devDependencies": {
"@jbangdev/jbang": "^0.1.4"
}
}
Now you can invoke the test
script from the command-line:
npm run test
You can easily pass command-line arguments around:
let args = process.argv.slice(2).join(' ');
jbang.exec('com.myco.mylib:RELEASE ' + args);
So now if you run npm run test arg1 arg2
, arg1 arg2
will be appended to the command executed.
When you run npm install
- JBang and other dependencies will be installed via the npm preinstall
hook. This uses the app setup
command.
Opening a new terminal or shell may be required to be able to use the jbang
command from the system PATH
.
In most cases you should be able to use JBang directly in node scripts.
But if you want to provide more customization you can create your own "wrapper" NPM package. One of the advantages is that you can pre-install the library dependencies needed at the time of npm install
(just by calling --help
or a similar "no op" command) so that the user-experience when running the first command after install is better.
For an example, refer to the @karatelabs/karate
NPM package.
FAQs
NPM for JBang - Java Script in your JavaScript
The npm package @jbangdev/jbang receives a total of 897 weekly downloads. As such, @jbangdev/jbang popularity was classified as not popular.
We found that @jbangdev/jbang demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.