> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# simplecoin-orbs/simplecoin-utils

And orb with a collection of utilities for automating releases

## Commands

### install-packages

Install your Node packages with automated caching and best practices applied. Requires lock file.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `app-dir` | string | . | Path to the directory containing your package.json file. Not needed if package.json lives in the root. |
| `cache-path` | string |  | By default, this orb will utilize 'npm ci' and cache the '~/.npm' directory. Override which path to cache with this parameter.
 |
| `cache-version` | string | v1 | Change the default cache version if you need to clear the cache for any reason. |
| `include-branch-in-cache-key` | boolean | true | If true, this cache bucket will only apply to jobs within the same branch.
 |
| `override-ci-command` | string |  | By default, packages will be installed with "npm ci", "yarn install --frozen-lockfile" or "yarn install --immutable".
Optionally supply a custom package installation command, with any additional flags needed.
 |
| `pkg-manager` | enum | npm | Select the default node package manager to use. NPM v5+ Required. |
| `slack-mention` | string | @devops | A Slack group or user to mention
 |
| `slack-notify` | boolean | true | If true, it will send notifications to slack. Make sure a context `slack-secrets` exists
 |
| `with-cache` | boolean | true | Cache your node packages automatically for faster install times. |

## Jobs

### semantic-release

runs a semantic-release on the defined release branch


| Parameter | Type | Default | Description |
|---|---|---|---|
| `release-branch` | string | master | Branch to trigger semantic-release on |
| `slack-mention` | string | @devops | A Slack group or user to mention
 |
| `slack-notify` | boolean | true | If true, it will send notifications to slack. Make sure a context `slack-secrets` exists
 |

### test

Simple drop-in job to test your Node.js application automatically.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `app-dir` | string | ~/project | Path to the directory containing your package.json file. Not needed if package.json lives in the root. |
| `cache-version` | string | v1 | Change the default cache version if you need to clear the cache for any reason. |
| `override-ci-command` | string |  | By default, packages will be installed with "npm ci" or "yarn install --frozen-lockfile".
Optionally supply a custom package installation command, with any additional flags needed.
 |
| `pkg-manager` | enum | npm | Select the default node package manager to use. |
| `run-command` | string | test | The name of the script within your package.json which will run your tests. |
| `setup` | steps |  | Provide any optional steps you would like to run prior to installing the node dependencies. This is a good place to install global modules. |
| `slack-mention` | string | @devops | A Slack group or user to mention
 |
| `slack-notify` | boolean | true | If true, it will send notifications to slack. Make sure a context `slack-secrets` exists
 |
| `version` | string | 16.3.0 | A full version tag must be specified. Example: "16.3.0" For a full list of releases, see the following: https://nodejs.org/en/download/releases
 |

## Executors

### default

Select the version of Node.js to use. Uses CircleCI's highly cached convenience images built for CI.
Any available tag from this list can be used: https://hub.docker.com/r/cimg/node/tags


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 16.3.0 | Pick a specific cimg/node image version tag: https://hub.docker.com/r/cimg/node
 |

## Examples

### npm-install

By default, the "install-packages" command will attempt to utilize "npm ci". The command can however be overwriten to support an alternative package install command such as "npm install".


```yaml
version: '2.1'
orbs:
  simplecoin-utils: simplecoin-orbs/simplecoin-utils@1
workflows:
  test_my_app:
    jobs:
      - simplecoin-utls/install-packages
```

### npm-test

By default, the "install-packages" command will attempt to utilize "npm ci". The command can however be overwriten to support an alternative package install command such as "npm install".


```yaml
version: '2.1'
orbs:
  simplecoin-utils: simplecoin-orbs/simplecoin-utils@1
workflows:
  test_my_app:
    jobs:
      - simplecoin-utls/test
```

### semantic-release

Example of using the simplecoin-utils/semantic-release orb.


```yaml
version: '2.1'
orbs:
  simplecoin-utils: simplecoin-orbs/simplecoin-utils@1
workflows:
  run-semantic-release:
    jobs:
      - simplecoin-utils/semantic-release:
          release-branch: prod
          slack-mention: '@my-group'
          slack-notify: true
```