# shipit-utils

> ## Install

Latest version **1.4.1** (published 2018-11-08) · 0 weekly downloads

## Install

```sh
npm install shipit-utils
pnpm add shipit-utils
yarn add shipit-utils
bun add shipit-utils
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2018-11-08 |
| First published | 2015-02-20 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/shipit-utils) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | neoziro |

## Links

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

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11

## Recent versions

- 1.4.1 (latest) — 2018-11-08
- 1.4.0 — 2016-11-13
- 1.3.1 — 2016-05-09
- 1.3.0 — 2015-03-24
- 1.2.0 — 2015-03-10
- 1.1.4 — 2015-03-09
- 1.1.3 — 2015-03-09
- 1.1.2 — 2015-03-09
- 1.1.1 — 2015-03-06
- 1.1.0 — 2015-02-27
- 1.0.3 — 2015-02-20
- 1.0.2 — 2015-02-20
- 1.0.1 — 2015-02-20
- 1.0.0 — 2015-02-20

## README

# shipit-utils

## Install

```
npm install --save shipit-utils
```

## Usage

```js
var utils = require('shipit-utils');
```

## Methods

### utils.getShipit(gruntOrShipit)

Returns the Shipit object, regardless of your context (Grunt or Shipit).

```js
var shipit = utils.getShipit(gruntOrShipit);
```

### utils.registerTask(gruntOrShipit, name, [description,] task)
Register a task, regardless of your context (Grunt or Shipit).

The description arguement is optional, and will only try to pass along a task description if you are using Grunt (it will be ignored if you are using Shipit).

##### task `Fn`|`Array<String>`
Task function or array of task names to run in order. *Note: If in a Grunt context and passing an array of task names, task will always be synchronous/blocking.*

#### Examples

```js
var task = function() {
    return shipit.local('sleep 10s');
};

// Register a (blocking) task
utils.registerTask(gruntOrShipit, 'myTask', task);

// Run a series of tasks in order
utils.registerTask(gruntOrShipit, 'myTask', ['some', 'other', 'tasks']);
```

### utils.runTask(gruntOrShipit, task)
Run a task or array of tasks, regardless of your context (Grunt or Shipit).

##### task `String`|`Array<String>`

### utils.equalValues(values)
Test to see if all the values in an array are equal. Useful for determining if multiple remote servers are out of sync.

##### values `Array`

## License

MIT

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