Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedi4ever/sudofy.js
contructs the sudo command for a given command and options
https://github.com/jedi4ever/sudofy.js
Last synced: about 2 months ago
JSON representation
contructs the sudo command for a given command and options
- Host: GitHub
- URL: https://github.com/jedi4ever/sudofy.js
- Owner: jedi4ever
- License: mit
- Created: 2013-08-13T09:38:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-13T09:48:15.000Z (over 11 years ago)
- Last Synced: 2024-11-09T10:42:00.477Z (2 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# Description
This library allows you to generate you a sudo command with all the correct escapes and flags.
# Usage
## Simple usage
> var sudofy = require('sudofy');
> sudofy.command('who am i');
'sudo \'who am i\''## With more options
> var sudofy = require('sudofy');
> var options= { group: 'wheel', user: 'root', interactive: false };
> sudofy.command('who am i', options);
'sudo -g wheel -n \'who am i\''## Run a sudo command as root
> var sudofy = require('sudofy');
> var options= { root: true };
> sudofy.command('who am i', options);
'who ami i'# Available options
- `user`: **string** user to sudo to (defaults to root)
- `group`: **string** group to sudo to (defaults to null)
- `password`: **string** specify password to pass to sudo (default to null)
- `preserveEnv`: **boolean** preserves the Environment (defaults to false)
- `preserveGroup`: **boolean** preserves the Group of the sudo invoker (defaults to false)
- `interactive`: **boolean** run interactively (default to false)
- `root`: **boolean** indicate we are already root (defaults to false)
- `login`: **bolean** simulate initial login (defaults to false)
- `shell`: **string** specify shell when login is specified (defaults to null)
- `args`: **array** of flags/options to pass to the sudo command (default to [])# License
MIT