Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arve0/system-install
Get the install command for the system package manager
https://github.com/arve0/system-install
Last synced: 27 days ago
JSON representation
Get the install command for the system package manager
- Host: GitHub
- URL: https://github.com/arve0/system-install
- Owner: arve0
- Created: 2016-05-29T20:24:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-03T01:21:24.000Z (about 4 years ago)
- Last Synced: 2024-10-04T21:44:23.732Z (about 2 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/system-install.svg)](https://badge.fury.io/js/system-install) [![Build Status](https://travis-ci.org/arve0/system-install.svg?branch=master)](https://travis-ci.org/arve0/system-install)
# system-install
Get the install command for the system packaging manager, e.g. `sudo apt-get install` for Debian-based systems.
`system-install` 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-install
```## Usage
### Node
```js
const mngr = require('system-install')();
/* - 'brew install' on OS X if homebrew is installed.
* - 'sudo apt-get install' on debian 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: ${mngr} pandoc`);
```### CLI
```sh
$ npm i -g system-install
$ system-install
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