{"id":19557806,"url":"https://github.com/jbangdev/jbang-npm","last_synced_at":"2025-04-26T23:31:30.959Z","repository":{"id":42456476,"uuid":"475080944","full_name":"jbangdev/jbang-npm","owner":"jbangdev","description":"Install and use jbang from npm based projects","archived":false,"fork":false,"pushed_at":"2025-04-01T15:06:53.000Z","size":740,"stargazers_count":1,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T11:45:58.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbangdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-28T16:12:36.000Z","updated_at":"2025-04-01T15:06:50.000Z","dependencies_parsed_at":"2025-04-19T04:30:30.240Z","dependency_job_id":"b557be2a-19e9-4938-a1e9-7e7f8c1af97b","html_url":"https://github.com/jbangdev/jbang-npm","commit_stats":{"total_commits":19,"total_committers":4,"mean_commits":4.75,"dds":"0.26315789473684215","last_synced_commit":"c54fdd354f037ee4e13df217c2a38df977d1957c"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbangdev%2Fjbang-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbangdev%2Fjbang-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbangdev%2Fjbang-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbangdev%2Fjbang-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbangdev","download_url":"https://codeload.github.com/jbangdev/jbang-npm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250878893,"owners_count":21501742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T04:44:04.139Z","updated_at":"2025-04-26T23:31:30.904Z","avatar_url":"https://github.com/jbangdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jbang-npm - Java Script in your JavaScript \u003c!-- omit in toc --\u003e\n\nInstall and use [JBang](https://www.jbang.dev) from NPM based projects.\n\n![](java_script.png)\n\nLets you use your own local scripts, [JBang AppStore](https://jbang.dev/appstore) alias or any network reachable jar or Maven artifact.\n\n# Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [As a library](#as-a-library)\n    - [exec(string)](#execstring)\n  - [As a CLI](#as-a-cli)\n- [Behind the scenes](#behind-the-scenes)\n- [Using as a dependency](#using-as-a-dependency)\n\n## Installation\n\n`npm i @jbangdev/jbang --save`\n\nPrefer installing the package globally if you want to use it as a CLI wrapper of `JBang`:\n\n`npm i -g @jbangdev/jbang`\n\n## Usage\n\nYou can find the complete documentation about arguments you can pass to the `jbang` executable here: https://www.jbang.dev/documentation/guide/latest/cli/jbang.html.\n\n### As a library\n\n```js\nconst jbang = require('@jbangdev/jbang');\n```\n\n`jbang` is an object exposing the following.\n\n#### exec(string)\n\nThe `jbang.exec()` function accepts a string that will be passed as the command-line arguments to the `jbang` executable.\n\nExample:\n\n```js\njbang.exec('app install --name karate-core com.intuit.karate:karate-core:RELEASE:all');\n```\n\n#### spawnSync(string)\n\nUse `spawnSync` to run the command in the same process/stdin/signals.\n\n```js\nawait jbang.spawnSync('app install --name karate-core com.intuit.karate:karate-core:RELEASE:all');\n```\n\nPrimarily used by the `jbang-npm` CLI.\n\n### As a CLI\n\nPackage preferably installed globally, you can run in a shell the command named `jbang-npm`. `jbang-npm` is a simple wrapper of the installed `jbang` executable which prevents you to manually add the command to your path.\n\nExample:\n\n`jbang-npm app install --name karate-core com.intuit.karate:karate-core:RELEASE:all`\n\nYou can also use `npx`:\n\n`npx jbang quarkus@quarkusio`\n\n## Behind the scenes\n\nThis will look for jbang in path and if not available install it before executing jbang.\n\n## Using as a dependency\n\nIn most cases you should be able to use JBang directly in node scripts.\n\nBut 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.\n\nFor an example, refer to the [`@karatelabs/karate`](https://github.com/karatelabs/karate-npm) NPM package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbangdev%2Fjbang-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbangdev%2Fjbang-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbangdev%2Fjbang-npm/lists"}