{"id":16689616,"url":"https://github.com/mortend/xbash","last_synced_at":"2026-04-15T10:31:25.538Z","repository":{"id":57401023,"uuid":"198708990","full_name":"mortend/xbash","owner":"mortend","description":"Friendly, portable wrapper around bash.","archived":false,"fork":false,"pushed_at":"2021-01-08T18:24:38.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T02:03:28.682Z","etag":null,"topics":["bash","cross-platform","npm-package","shell-script"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mortend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-24T20:59:20.000Z","updated_at":"2021-01-08T18:24:33.000Z","dependencies_parsed_at":"2022-09-05T03:50:27.292Z","dependency_job_id":null,"html_url":"https://github.com/mortend/xbash","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortend%2Fxbash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortend%2Fxbash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortend%2Fxbash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortend%2Fxbash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mortend","download_url":"https://codeload.github.com/mortend/xbash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243467024,"owners_count":20295309,"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":["bash","cross-platform","npm-package","shell-script"],"created_at":"2024-10-12T15:48:51.916Z","updated_at":"2025-12-29T10:38:56.731Z","avatar_url":"https://github.com/mortend.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xbash\n\n[![NPM package](https://img.shields.io/npm/v/xbash.svg?style=flat-square)](https://www.npmjs.com/package/xbash)\n[![NPM downloads](https://img.shields.io/npm/dt/xbash?color=blue\u0026style=flat-square)](https://www.npmjs.com/package/xbash)\n[![License: MIT](https://img.shields.io/github/license/mortend/xbash.svg?style=flat-square)](LICENSE)\n\n\u003e Friendly, portable wrapper around `bash`.\n\nThe wrapper is used to run shell-scripts in various [node-powered applications](https://github.com/fuse-open/uno). The wrapper makes sure that also `curl` and `unzip` are available inside `bash`, as needed by some [cross-platform installers](https://github.com/fuse-open/android-build-tools).\n\n* On Windows, the wrapper finds your [Git for Windows] installation and will prefer to run commands from there.\n\n* If a [Git for Windows] installation isn't found, and the commands aren't otherwise found, the wrapper will provide instructions on how to install [Git for Windows].\n\n[Git for Windows]: https://git-scm.com/downloads\n\n## Install\n\n```\nnpm install xbash\n```\n\nThis will install `bash` (alias `xbash`), a cross-platform wrapper around the real `bash` executable.\n\n## Usage\n\nThis package gives you a reasonably portable way to use `bash` and other tools – in JavaScript or from command-line.\n\n### JavaScript\n\n```js\nconst bash = require('xbash');\n\nbash(['-c', 'echo Hello World!'], process.exit);\n```\n\n### Command-Line\n\n```\n$ bash --version\n\nERROR: 'bash' was not found. This can be solved by installing Git.\n\nPlease get Git from https://git-scm.com/downloads and try again.\n```\n\nThis happens when `bash` was not found. Running again after installing [Git for Windows].\n\n```\n$ bash --version\n\nGNU bash, version 4.4.23(1)-release (x86_64-pc-msys)\nCopyright (C) 2016 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttp://gnu.org/licenses/gpl.html\u003e\n\nThis is free software; you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n```\n\nWe can run scripts or invoke other commands (that aren't otherwise available in PATH).\n\n```\n$ bash script.bash\n\nHello World!\n```\n\n```\n$ bash -c 'curl --version'\n\ncurl 7.65.1 (x86_64-w64-mingw32) libcurl/7.65.1 OpenSSL/1.1.1c (Schannel) zlib/1.2.11 libidn2/2.2.0 nghttp2/1.38.0\nRelease-Date: 2019-06-05\nProtocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp\nFeatures: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP\n```\n\n```\n$ bash -c 'unzip'\n\nUnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send\nbug reports using http://www.info-zip.org/zip-bug.html; see README for details.\n\n[...]\n```\n\n## Contributing\n\nPlease [report an issue](https://github.com/mortend/xbash/issues) if you encounter a problem, or [open a pull request](https://github.com/mortend/xbash/pulls) if you make a patch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortend%2Fxbash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortend%2Fxbash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortend%2Fxbash/lists"}