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

# sugarshin/npm

npm utilities. Source:
https://github.com/sugarshin/circleci-orbs


## Commands

### install

Install npm modules


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-dir` | string | ~/.node-packages-cache | cache directory |
| `cache-key` | string | cache-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }} | custom cache key |
| `production` | boolean | false | with --production |
| `restore-cache` | boolean | true | restore_cache |
| `save-cache` | boolean | true | save_cache |
| `yarn` | boolean | false | Use yarn instead of npm |

## Jobs

### release

Release a npm module. Publish to npm registry, tagging and create release on GitHub, if version bumped up.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `attach-workspace` | boolean | false | Boolean for whether or not to attach to an existing workspace. Default is false.
 |
| `checkout` | boolean | true | Boolean for whether or not to checkout as a first step. Default is true.
 |
| `executor` | executor | default | executor to use for this job |
| `flags` | string |  | Flags for `npm publish` |
| `npm-token` | env_var_name | NPM_AUTH_TOKEN | Your npm auth token, defaults to $NPM_AUTH_TOKEN
 |
| `persist-to-workspace` | boolean | false | Boolean for whether or not to persist to a workspace. Default is false.
 |
| `ssh-fingerprints` | string |  | Fingerprints for SSH deploy key (add the public key as a read/write key on GitHub; add the private key in CircleCI via SSH Permissions, with github.com as Hostname). Used to push a git tag back to the project's repository.
 |
| `tagging` | boolean | false | Boolean for whether or not to tagging and push to GitHub. Default is false.
 |
| `workspace-root` | string | ~/repo | Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '~/repo'
 |

## Executors

### default

Default executor, with Docker circleci/node:latest


## Examples

### release-example

Example using for release


```yaml
executors:
  nodejs:
    docker:
      - image: circleci/node:12.4.0
orbs:
  npm: sugarshin/npm@x.y.z
version: 2.1
workflows:
  test_build_publish:
    jobs:
      - test
      - build
      - npm/release:
          attach-workspace: true
          executor: nodejs
          flags: '--access=public'
          requires:
            - test
            - build
          ssh-fingerprints: ff:22:gs:v6:gg:2g:22:7j:73:gf:ja:36:ff:y2:22:89
          tagging: true
```