### Install Archive_Tar from Scratch
Source: https://github.com/combodo/itop/blob/develop/lib/pear/archive_tar/README.md
Install the Archive_Tar package from a package.xml file. This is useful for initial setup.
```bash
pear install package.xml
```
--------------------------------
### Perform specific iTop installation with custom XML
Source: https://github.com/combodo/itop/blob/develop/setup/unattended-install/README.md
Install a specific iTop version or configuration by providing a custom XML setup file, such as one generated during a previous iTop setup.
```bash
./install-itop.sh ../../log/install-2024-04-03.xml
```
--------------------------------
### Tiny-Emitter Usage Examples
Source: https://github.com/combodo/itop/blob/develop/node_modules/tiny-emitter/README.md
Examples demonstrating how to use the tiny-emitter library.
```APIDOC
## Basic Usage
### Description
Demonstrates the standard way to initialize and use the emitter.
### Request Example
```javascript
var Emitter = require('tiny-emitter');
var emitter = new Emitter();
emitter.on('some-event', function (arg1, arg2, arg3) {
//
});
emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');
```
## Instance Initialization
### Description
Shows how to use a pre-initialized emitter instance.
### Request Example
```javascript
var emitter = require('tiny-emitter/instance');
emitter.on('some-event', function (arg1, arg2, arg3) {
//
});
emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');
```
```
--------------------------------
### Perform non-ITIL iTop fresh installation
Source: https://github.com/combodo/itop/blob/develop/setup/unattended-install/README.md
Execute a non-ITIL iTop fresh installation using the `install-itop.sh` script with the `fresh-install.xml` setup file.
```bash
./install-itop.sh ./xml_setup/fresh-install.xml
```
--------------------------------
### Install Select via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/select/readme.md
Use npm to install the Select library for your project.
```bash
npm install select --save
```
--------------------------------
### Install Select via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/select/readme.md
Use Bower to install the Select library for your project.
```bash
bower install select --save
```
--------------------------------
### Install Showdown via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Install Showdown.js using Bower for front-end projects.
```bash
bower install showdown
```
--------------------------------
### Install Development Dependencies
Source: https://github.com/combodo/itop/blob/develop/node_modules/@popperjs/core/README.md
Install the necessary packages for development, including tools for building and testing the library. Ensure Yarn is installed before running this command.
```bash
yarn install
```
--------------------------------
### Install Development Dependencies
Source: https://github.com/combodo/itop/blob/develop/node_modules/mousetrap/README.md
Install development dependencies for running tests by navigating to the repository directory and running `npm install`.
```sh
cd /path/to/repo
npm install
```
--------------------------------
### Install clipboard.js via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/clipboard/readme.md
Install the library using npm for project integration. Ensure you have Node.js and npm installed.
```bash
npm install clipboard --save
```
--------------------------------
### Install Showdown via NuGet
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Install the Showdown.js NuGet package for .NET projects.
```powershell
PM> Install-Package showdownjs
```
--------------------------------
### Run Project Tests
Source: https://github.com/combodo/itop/blob/develop/node_modules/blueimp-file-upload/README.md
Execute this command to run all project tests after installing dependencies and starting Docker.
```sh
npm test
```
--------------------------------
### Install CKEditor 5 Dependencies
Source: https://github.com/combodo/itop/blob/develop/node_modules/ckeditor5-itop-build/README.md
Run this command in the project directory to install all necessary dependencies for building the editor. Ensure Node.js and npm are installed.
```bash
npm install
```
--------------------------------
### Install Delegate.js via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/delegate/readme.md
Install the delegate.js library using npm. This is the recommended method for package management.
```bash
npm install delegate --save
```
--------------------------------
### Install Symfony Security Core
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/security-core/README.md
Use Composer to install the security-core component.
```bash
$ composer require symfony/security-core
```
--------------------------------
### Install Showdown via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Install Showdown.js on your server-side Node.js project using npm.
```bash
npm install showdown
```
--------------------------------
### Execute unattended installation with parameter file
Source: https://github.com/combodo/itop/blob/develop/setup/unattended-install/README.md
Launch the `unattended-install.php` script with a specified parameter file for fresh installations or upgrades. Ensure the current user has sufficient permissions.
```bash
php unattended_install.php --param-file=fresh-install.xml
```
--------------------------------
### Install Guzzle using Composer
Source: https://github.com/combodo/itop/blob/develop/lib/guzzlehttp/guzzle/README.md
The recommended method for installing Guzzle is via Composer. Ensure you have Composer installed and configured for your project.
```bash
composer require guzzlehttp/guzzle
```
--------------------------------
### Example Usage of Custom Options
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Demonstrates how to invoke the program with various custom options and their expected outputs.
```console
$ custom -f 1e2
float: 100
```
```console
$ custom --integer 2
integer: 2
```
```console
$ custom -v -v -v
verbosity: 3
```
```console
$ custom -c a -c b -c c
[ 'a', 'b', 'c' ]
```
```console
$ custom --list x,y,z
[ 'x', 'y', 'z' ]
```
--------------------------------
### Install Node Dependencies
Source: https://github.com/combodo/itop/blob/develop/node_modules/magnific-popup/README.md
Navigate into the Magnific Popup folder and install Node dependencies using npm.
```bash
cd Magnific-Popup && npm install
```
--------------------------------
### Install getallheaders for PHP < 5.6
Source: https://github.com/combodo/itop/blob/develop/lib/ralouphie/getallheaders/README.md
Use this command to install the getallheaders polyfill for PHP versions older than 5.6.
```bash
composer require ralouphie/getallheaders "^2"
```
--------------------------------
### Install DataTables Responsive via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-responsive/Readme.md
Use npm to install the DataTables Responsive extension. This command fetches the core library.
```bash
npm install datatables.net-responsive
```
--------------------------------
### Build with npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/jquery-migrate/README.md
Clone the repository, install dependencies, and build the project using npm commands.
```sh
git clone git://github.com/jquery/jquery-migrate.git
cd jquery-migrate
npm install
npm run build
```
--------------------------------
### Install getallheaders for PHP >= 5.6
Source: https://github.com/combodo/itop/blob/develop/lib/ralouphie/getallheaders/README.md
Use this command to install the getallheaders polyfill for PHP versions 5.6 and newer.
```bash
composer require ralouphie/getallheaders
```
--------------------------------
### Install good-listener with npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/good-listener/readme.md
Install the good-listener package using npm for use in your project.
```bash
npm install good-listener --save
```
--------------------------------
### Basic Popper.js Example
Source: https://github.com/combodo/itop/blob/develop/node_modules/@popperjs/core/README.md
A complete HTML example demonstrating how to create a tooltip positioned to the right of a button using Popper.js.
```html
Popper example
I'm a tooltip
```
--------------------------------
### Install Symfony Stopwatch
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/stopwatch/README.md
Use Composer to install the Symfony Stopwatch component.
```bash
$ composer require symfony/stopwatch
```
--------------------------------
### Install Google OAuth 2.0 Provider
Source: https://github.com/combodo/itop/blob/develop/lib/league/oauth2-google/README.md
Use Composer to install the league/oauth2-google package.
```sh
composer require league/oauth2-google
```
--------------------------------
### Install good-listener with bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/good-listener/readme.md
Install the good-listener package using bower for use in your project.
```bash
bower install good-listener --save
```
--------------------------------
### Install Commander.js
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Install Commander.js using npm. This is the first step to using the library for your Node.js CLI projects.
```sh
npm install commander
```
--------------------------------
### Install Guzzle Promises
Source: https://github.com/combodo/itop/blob/develop/lib/guzzlehttp/promises/README.md
Use Composer to install the Guzzle Promises library.
```shell
composer require guzzlehttp/promises
```
--------------------------------
### Install sodium_compat for libsodium support
Source: https://github.com/combodo/itop/blob/develop/lib/firebase/php-jwt/README.md
Optionally install the paragonie/sodium_compat package if your PHP environment lacks libsodium.
```bash
composer require paragonie/sodium_compat
```
--------------------------------
### Install tiny-emitter via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/tiny-emitter/README.md
Use this command to install the tiny-emitter library as a project dependency.
```bash
npm install tiny-emitter --save
```
--------------------------------
### Install PHP-Parser using Composer
Source: https://github.com/combodo/itop/blob/develop/lib/nikic/php-parser/README.md
Use composer to install the PHP-Parser library. This is the recommended way to add the library to your project.
```bash
php composer.phar require nikic/php-parser
```
--------------------------------
### Fresh installation parameters for iTop
Source: https://github.com/combodo/itop/blob/develop/setup/unattended-install/README.md
XML structure defining mandatory parameters for a fresh iTop installation. This includes database connection details, application URL, administrator account, and language settings.
```xml
/usr/bin/dot
```
--------------------------------
### Install DataTables via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net/Readme.md
Use this command to install the DataTables library for jQuery using npm.
```bash
npm install datatables.net
```
--------------------------------
### Run Tests
Source: https://github.com/combodo/itop/blob/develop/lib/soundasleep/html2text/README.md
Execute the provided tests after installing dependencies. This requires Composer and PHPUnit.
```bash
composer install && vendor/bin/phpunit
```
--------------------------------
### Install DataTables Responsive via bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-responsive/Readme.md
Use bower to install the DataTables Responsive extension. This command saves the package as a dependency.
```bash
bower install --save datatables.net-responsive
```
--------------------------------
### Install jQuery File Upload via NPM
Source: https://github.com/combodo/itop/blob/develop/node_modules/blueimp-file-upload/README.md
Use npm to install the blueimp-file-upload package. This is the recommended way to include the library in your project.
```sh
npm install blueimp-file-upload
```
--------------------------------
### Install DataTables Select via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-select/Readme.md
Use this command to install the DataTables Select extension using npm. This is the recommended method for Node.js environments.
```bash
npm install datatables.net-select
```
--------------------------------
### Install Tom Select using npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/tom-select/README.md
Install Tom Select as a project dependency using npm. This allows for easier management of project assets and build processes.
```bash
npm i tom-select
```
--------------------------------
### Version Option Example
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Shows how to invoke the version option from the command line to display the program's version number.
```console
$ ./examples/pizza -V
0.0.1
```
--------------------------------
### Table Syntax Example
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Provides an example of markdown table syntax that is enabled by the `tables` option. It includes header alignment and basic cell content.
```html
h1
h2
h3
100
[a][1]
![b][2]
foo
bar
baz
```
--------------------------------
### Setup good-listener in Browser (Standalone)
Source: https://github.com/combodo/itop/blob/develop/node_modules/good-listener/readme.md
Include the good-listener script directly in your HTML for standalone browser usage.
```html
```
--------------------------------
### Get all unattended-install.php options
Source: https://github.com/combodo/itop/blob/develop/setup/unattended-install/README.md
Display all available command-line options for the `unattended-install.php` script by using the --help flag.
```php
unattended-install.php --help
```
--------------------------------
### Environment Variable and Preset Example
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Shows how environment variables and preset values are applied, along with implied options, when parsing command-line arguments.
```console
$ PORT=80 extra --donate --free-drink
Options: { timeout: 60, donate: 20, port: '80', freeDrink: true, drink: 'small' }
```
--------------------------------
### Include ScrollMagic Core Library (Uncompressed)
Source: https://github.com/combodo/itop/blob/develop/node_modules/scrollmagic/README.md
Include the uncompressed core ScrollMagic library in your HTML file to get started. For deployment, use the minified version.
```html
```
--------------------------------
### Install Dependencies and Generate Sass Documentation
Source: https://github.com/combodo/itop/blob/develop/datamodels/2.x/combodo-backoffice-darkmoon-theme/vendors/nord/README.md
Installs project dependencies and generates HTML documentation for Nord's Sass sources using SassDoc. The SassDoc configuration can be customized via the .sassdocrc file.
```sh
npm install
gulp sassdoc
```
--------------------------------
### Create a LimitStream
Source: https://github.com/combodo/itop/blob/develop/lib/guzzlehttp/psr7/README.md
Use LimitStream to read a specific portion of an existing stream. This example limits the stream size to 1024 bytes and starts reading from byte 2048.
```php
use GuzzleHttp\Psr7;
$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+'));
echo $original->getSize();
// >>> 1048576
// Limit the size of the body to 1024 bytes and start reading from byte 2048
$stream = new Psr7\LimitStream($original, 1024, 2048);
echo $stream->getSize();
// >>> 1024
echo $stream->tell();
// >>> 0
```
--------------------------------
### Install Toastify JS via NPM
Source: https://github.com/combodo/itop/blob/develop/node_modules/toastify-js/README.md
Use this command to add toastify-js to your project via NPM.
```bash
npm install --save toastify-js
```
--------------------------------
### Install Popper.js with npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/@popperjs/core/README.md
Use npm to add the Popper.js core library to your project dependencies.
```bash
npm i @popperjs/core
```
--------------------------------
### Run SimpleHTTPServer
Source: https://github.com/combodo/itop/blob/develop/node_modules/c3/README.md
Command to start a simple HTTP server in the htdocs directory to serve C3.js samples.
```bash
cd c3/htdocs
python -m SimpleHTTPServer 8080
```
--------------------------------
### Install ScrollMagic via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/scrollmagic/README.md
Install ScrollMagic using Bower. This method only installs the necessary source code and requires manual addition of frameworks like GSAP or jQuery.
```bash
bower install scrollmagic
```
--------------------------------
### Build and Test Commands
Source: https://github.com/combodo/itop/blob/develop/node_modules/tiny-emitter/README.md
Commands to install dependencies, build the project (including tests, browserification, and minification), and run tests.
```bash
npm install
npm run build
```
```bash
npm install
npm test
```
--------------------------------
### PHP XML Extension Requirement
Source: https://github.com/combodo/itop/blob/develop/lib/soundasleep/html2text/README.md
This error indicates the PHP XML extension is not installed. Install it using your system's package manager, e.g., 'apt-get install php7.4-xml'.
```bash
apt-get install php7.4-xml
```
--------------------------------
### Build with grunt
Source: https://github.com/combodo/itop/blob/develop/node_modules/jquery-migrate/README.md
Clone the repository, install npm and grunt dependencies, and build the project using grunt commands.
```sh
git clone git://github.com/jquery/jquery-migrate.git
cd jquery-migrate
npm install
npm install -g grunt-cli
grunt build
```
--------------------------------
### Install PasswordHasher Component
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/password-hasher/README.md
Use Composer to install the Symfony PasswordHasher component.
```bash
$ composer require symfony/password-hasher
```
--------------------------------
### Install Symfony Mailer
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/mailer/README.md
Use Composer to install the Symfony Mailer component.
```bash
$ composer require symfony/mailer
```
--------------------------------
### Install Symfony Dotenv
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/dotenv/README.md
Use Composer to install the Symfony Dotenv component.
```bash
composer require symfony/dotenv
```
--------------------------------
### Variadic Option Examples
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Demonstrates how variadic options collect multiple arguments from the command line, including cases with mixed option types and explicit argument separators.
```console
$ collect -n 1 2 3 --letter a b c
Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] }
Remaining arguments: []
```
```console
$ collect --letter=A -n80 operand
Options: { number: [ '80' ], letter: [ 'A' ] }
Remaining arguments: [ 'operand' ]
```
```console
$ collect --letter -n 1 -n 2 3 -- operand
Options: { number: [ '1', '2', '3' ], letter: true }
Remaining arguments: [ 'operand' ]
```
--------------------------------
### Install Guzzle HTTP PSR-7
Source: https://github.com/combodo/itop/blob/develop/lib/guzzlehttp/psr7/README.md
Use Composer to install the guzzlehttp/psr7 package.
```shell
composer require guzzlehttp/psr7
```
--------------------------------
### Promise Creation and Basic Usage
Source: https://github.com/combodo/itop/blob/develop/lib/guzzlehttp/promises/README.md
Demonstrates how to create a new Promise object with optional wait and cancel functions, and how to resolve and wait for its completion.
```APIDOC
## Promise Creation and Basic Usage
### Description
Creates a new promise object. Optionally accepts a `$waitFn` to resolve the promise and a `$cancelFn` to handle cancellation.
### Method
`new Promise(callable $onFulfilled = null, callable $onRejected = null)`
### Parameters
#### Constructor Parameters
- **$onFulfilled** (callable) - Optional. A function invoked with no arguments that is expected to resolve the promise.
- **$onRejected** (callable) - Optional. A function invoked with no arguments that is expected to cancel the computation of a promise.
### Request Example
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise(
function () use (&$promise) {
$promise->resolve('waited');
},
function () {
// do something that will cancel the promise computation
}
);
assert('waited' === $promise->wait());
```
```
--------------------------------
### Minimal migration from Emogrifier to CssInliner
Source: https://github.com/combodo/itop/blob/develop/lib/pelago/emogrifier/README.md
This example shows the simplest way to migrate from Emogrifier to CssInliner. Note that default behaviors differ regarding display: none elements.
```php
$html = CssInliner::fromHtml($html)->inlineCss()->render();
```
--------------------------------
### Client-side Showdown Extension Initialization
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Include this script to load the Showdown library and a specific extension for client-side Markdown conversion.
```html
```
--------------------------------
### Run Development Environment
Source: https://github.com/combodo/itop/blob/develop/node_modules/@popperjs/core/README.md
Start the development server to enable live-reloading and automatic compilation of code changes. This command is used for local development and experimentation.
```bash
yarn dev
```
--------------------------------
### Basic Usage of tiny-emitter
Source: https://github.com/combodo/itop/blob/develop/node_modules/tiny-emitter/README.md
Demonstrates how to initialize an emitter instance and use its 'on' and 'emit' methods to subscribe to and trigger events.
```javascript
var Emitter = require('tiny-emitter');
var emitter = new Emitter();
emitter.on('some-event', function (arg1, arg2, arg3) {
//
});
emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');
```
--------------------------------
### Showdown.js Output Example (Markdown)
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Example of the Markdown output generated by Showdown.js from HTML input.
```md
[Please Support us!](https://patreon.com/showdownjs)
```
--------------------------------
### Showdown.js Output Example (HTML)
Source: https://github.com/combodo/itop/blob/develop/node_modules/showdown/README.md
Example of the HTML output generated by Showdown.js from Markdown input.
```html
hello, markdown!
```
--------------------------------
### Install DataTables via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net/Readme.md
Use this command to install the DataTables library for jQuery using Bower.
```bash
bower install --save datatables.net
```
--------------------------------
### Install FixedHeader via npm
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-fixedheader/Readme.md
Use this command to install the FixedHeader package. This is a prerequisite for using the extension.
```bash
npm install datatables.net-fixedheader
```
--------------------------------
### SASS 7-1 File Structure Example
Source: https://github.com/combodo/itop/blob/develop/css/common/README.md
Illustrates the directory structure for SCSS files following the 7-1 pattern, including utility files, vendor imports, base styles, and a main entry point.
```tree
css/common/
|
|– utils/
| |– variables/ # Sass Variables used in Functions, Mixins, Helpers, ...
| | |- colors/
| | | |- _base.scss
| | | |- _base-palette.scss # Base colors used everywhere
| | | |- _lifecycle-palette.scss # Colors used for lifecycle of an object (e.g. representing states such as new, frozen, done, ...), based on the base colors
| | | |- _semantic-palette.scss # Colors used for semantic meaning (e.g. red for errors, green for success, ...), based on the base colors
| | | ...
| | |
| | |- _depression.scss
| | |- _elevation.scss
| | |- _size.scss # Base sizes used everywhere (spacings, ...)
| | |- _spacing.scss
| | |- _typography.scss # Typography sizes, weights, families, ...
| | ...
| |
| |– functions/ # Sass Functions
| | |- _color.scss # Color manipulation functions
| |
| |– mixins/ # Sass Mixins
| |– helpers/ # Class & placeholders helpers
|
|– vendors/ # Third-party libs, should be either:
| # - Overload of the lib SCSS variables (BEST way, but possible only if the lib exposes them. e.g. Bulma)
| # - Overload of the lib necessary CSS classes only (not great as it duplicates some rules in the browser, which add weight and computation. e.g. dataTables)
| # - Duplicate the lib CSS completly to insert SCSS variables (not great as it will be outdated when updating the lib itself. e.g. jQuery UI)
| |– _bulma-variables-overload.scss # Bulma CSS framework
| |– _jquery-ui.scss # jQuery UI
| ... # Etc…
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography fonts imports
| ... # Etc…
|
|- _shame.scss # Shame file, should contain all the ugly hacks (https://sass-guidelin.es/#shame-file)
`– main.scss # Main Sass file
```
--------------------------------
### Composer Installation
Source: https://github.com/combodo/itop/blob/develop/lib/soundasleep/html2text/README.md
Add the html2text package to your project using Composer. Ensure you have Composer installed and configured.
```json
{
"require": {
"soundasleep/html2text": "~1.1"
}
}
```
--------------------------------
### Complex migration from Emogrifier to CssInliner
Source: https://github.com/combodo/itop/blob/develop/lib/pelago/emogrifier/README.md
This example demonstrates a more complex migration, including enabling CSS to HTML mapping and handling display: none elements separately.
```php
$domDocument = CssInliner::fromHtml($html)->inlineCss($css)->getDomDocument();
HtmlPruner::fromDomDocument($domDocument)->removeElementsWithDisplayNone();
$html = CssToAttributeConverter::fromDomDocument($domDocument)
->convertCssToVisualAttributes()->render();
```
--------------------------------
### Setup Delegate.js in Browser (Standalone)
Source: https://github.com/combodo/itop/blob/develop/node_modules/delegate/readme.md
Include the delegate.js script directly in your HTML file for standalone browser usage.
```html
```
--------------------------------
### Install Symfony Routing Component
Source: https://github.com/combodo/itop/blob/develop/lib/symfony/routing/README.md
Install the Symfony Routing component using Composer. This is a prerequisite for using the routing features.
```bash
$ composer require symfony/routing
```
--------------------------------
### Define and Use Subcommands with Descriptions
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Sets up a CLI with a main program description and a subcommand ('split') with its own description, arguments, and options. Useful for multi-command CLIs.
```javascript
const { Command } = require('commander');
const program = new Command();
program
.name('string-util')
.description('CLI to some JavaScript string utilities')
.version('0.8.0');
program.command('split')
.description('Split a string into substrings and display as an array')
.argument('', 'string to split')
.option('--first', 'display just the first substring')
.option('-s, --separator ', 'separator character', ',')
.action((str, options) => {
const limit = options.first ? 1 : undefined;
console.log(str.split(options.separator, limit));
});
program.parse();
```
--------------------------------
### Configure Help Formatting
Source: https://github.com/combodo/itop/blob/develop/node_modules/commander/Readme.md
Configure Help behavior by modifying data properties or subclassing. Options include sorting subcommands/options and showing global options.
```javascript
program.configureHelp({
sortSubcommands: true,
subcommandTerm: (cmd) => cmd.name() // Just show the name, instead of short usage.
});
```
--------------------------------
### Install Scroller via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-scroller/Readme.md
Use this command to install the Scroller package using Bower. Bower is a package manager for the web.
```bash
bower install --save datatables.net-scroller
```
--------------------------------
### Install FixedHeader via Bower
Source: https://github.com/combodo/itop/blob/develop/node_modules/datatables.net-fixedheader/Readme.md
Use this command to install the FixedHeader package using Bower. Note that Bower is largely deprecated.
```bash
bower install --save datatables.net-fixedheader
```
--------------------------------
### Install Build Dependencies
Source: https://github.com/combodo/itop/blob/develop/node_modules/c3/CONTRIBUTING.md
Install Grunt CLI globally and project-specific build dependencies using npm. Node.js is required for this step.
```bash
npm install -g grunt-cli
npm install
```
--------------------------------
### Build and Test Commands
Source: https://github.com/combodo/itop/blob/develop/node_modules/jquery-migrate/README.md
Instructions for building and running tests for the jQuery Migrate plugin using npm and Grunt.
```APIDOC
## Build and Run Tests
### Build with `npm`
```sh
git clone git://github.com/jquery/jquery-migrate.git
cd jquery-migrate
npm install
npm run build
```
### Build with `grunt`
```sh
git clone git://github.com/jquery/jquery-migrate.git
cd jquery-migrate
npm install
npm install -g grunt-cli
grunt build
```
### Run Tests
Using npm:
```sh
npm test
```
Using grunt:
```sh
grunt test
```
```