https://github.com/thetechstech/system-installer
Get the install command for the system package manager
https://github.com/thetechstech/system-installer
Last synced: 9 months ago
JSON representation
Get the install command for the system package manager
- Host: GitHub
- URL: https://github.com/thetechstech/system-installer
- Owner: TheTechsTech
- Archived: true
- Fork: true (arve0/system-install)
- Created: 2018-02-10T23:53:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T17:54:51.000Z (over 5 years ago)
- Last Synced: 2024-12-15T12:12:04.648Z (over 1 year ago)
- Language: JavaScript
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
system-installer
=======
[](https://nodei.co/npm/system-installer/)
[](https://david-dm.org/techno-express/system-installer) [](https://github.com/techno-express/system-installer/actions) [](https://codecov.io/gh/techno-express/system-installer) [](https://codeclimate.com/github/techno-express/system-install/maintainability) [](https://www.npmjs.org/package/system-installer)
> Get the install command or install a package using the system packaging manager, e.g. `sudo apt-get install` for Debian-based systems.
This package has been replaced with [node-sys](https://www.npmjs.com/package/node-sys).
`system-installer` will try to find which system packaging is installed for the given `process.platform`. If no system package manager is found, `'your_package_manager install'` is returned.
## Install
```sh
npm install system-installer
```
## Usage
### Node
```js
const sysInstaller = require('system-installer').packager();
/* - 'brew install' on OS X if homebrew is installed.
* - 'sudo apt-get install' on debian platforms.
* - 'sudo yum install' on red hat platforms.
* - 'your_package_manager install' if no package manager is found.
*
* Throws if `process.platform` is none of darwin, freebsd, linux, sunos or win32.
*/
console.log(`Please install pandoc: ${sysInstaller.installerCommand} pandoc`);
```
### Install `vim` package onto host, using system's default package manager
* Returns a Promise
```sh
const sysInstaller = require('system-installer').installer;
sysInstaller('vim')
.then(function(data){
// returns installation output
console.log(data);
})
.catch(function(err) {
console.log(err);
});
```
### CLI
```sh
$ npm i -g system-installer
$ system-installer
brew install
```
## Supported package managers
### FreeBSD
- [pkg]
- [pkg_add]
### Linux
- [apt-get] - Debian, Ubuntu
- [dnf] - fedora
- [emerge] - Gentoo
- [nix] - NixOS
- [pacman] - ArchLinux
- [yum] - fedora
- [zypper] - OpenSUSE
- [chromebrew] - Chrome OS
### OS X
- [brew]
- [pkgin]
- [port]
### Solaris
- [pkg](https://docs.oracle.com/cd/E23824_01/html/E21802/gihhp.html)
### Windows
- [chocolatey]
[apt-get]: https://help.ubuntu.com/community/AptGet/Howto
[brew]: http://brew.sh
[pacman]: https://wiki.archlinux.org/index.php/pacman
[yum]: https://fedoraproject.org/wiki/Yum
[dnf]: https://fedoraproject.org/wiki/Dnf
[nix]: https://nixos.org/nix/
[zypper]: https://en.opensuse.org/Portal:Zypper
[emerge]: https://wiki.gentoo.org/wiki/Portage
[port]: https://guide.macports.org/#using.port
[pkgin]: https://github.com/cmacrae/saveosx
[pkg]: https://www.freebsd.org/doc/handbook/pkgng-intro.html
[pkg_add]: https://www.freebsd.org/cgi/man.cgi?query=pkg_add&manpath=FreeBSD+7.2-RELEASE
[chocolatey]: https://chocolatey.org
[chromebrew]: https://github.com/skycocker/chromebrew