# headquarters

> Issue commands to your program while it is running.

Latest version **0.2.4** (published 2015-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install headquarters
pnpm add headquarters
yarn add headquarters
bun add headquarters
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2015-04-03 |
| First published | 2015-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Justin Tormey |
| Maintainers | justintormey |

## Links

- npm: https://www.npmjs.com/package/headquarters
- npm.io page: https://npm.io/package/headquarters

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.54.0

## Recent versions

- 0.2.4 (latest) — 2015-04-03
- 0.2.3 — 2015-04-02
- 0.2.2 — 2015-04-02
- 0.2.1 — 2015-04-02
- 0.2.0 — 2015-04-02
- 0.1.1 — 2015-03-29
- 0.1.0 — 2015-03-29
- 0.0.0 — 2015-03-27

## README

# Headquarters

Issue commands to your program while it is running.

## Installation

```
$ npm install --save headquarters
```

```
var hq = require('headquarters');
```

## Methods

### command

```
hq.command(name, action);
```

Sets a command.

Parameters

* **name** the name of the command (*string*)
* **action** called whe the command is issued (*function*)

Type your command *name* in the console as your program is running followed by any additional parameters. The *action* function for that command will then be executed, with the additional parameters passed into the first argument of the function as an array.

### raw

```
hq.raw(action);
```

Specify what to do with raw input (i.e. issue a command with no command name).

Parameters

* **action** called when raw input (input with no established command) is entered (*function*)

The input is broken up by spaces, put into an array, and then passed into the *action* callback as a single parameter. Named commands can still be set and executed normally.

## Example

```
var hq = require('headquarters');

hq.command('say', function (params) {
	console.log(params.join(' '));
});
```

In the command line, start your program:

```
$ node my_program.js
```

Then use your custom command:

```
say hello world!
```

Profit:

```
hello world!
```

## Pre-existing Commands

Commands that are already built into headquarters:

* **'quit'** stops your process from running
* **'curl'** retrieves a response from a url argument

---
_Source: https://npm.io/package/headquarters · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
