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

# continuousauth/npm

Publish NPM packages from CircleCI via Continuous Auth.  This orb automatically acquires a `GITHUB_TOKEN` for use with semantic release.


## Commands

### release

This command fetches requisite tokens and publishes an npm package with Continuous Auth and Semantic Release


## Jobs

### release

Runs the release command, by default will only run build steps defined in prepublishOnly


| Parameter | Type | Default | Description |
|---|---|---|---|
| `package-manager` | enum | yarn | The package manager used to install dependencies, by default "yarn" |
| `prepare` | steps |  | Steps to run between `yarn` and `semantic-release` |

## Executors

### default

This is a sample executor using Docker and Node. If you want to provide a custom environment in your orb, insert your image here. If you do not require an executor, you can simply delete this directory.


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

## Examples

### example

Example testing and release workflow using this orb


```yaml
version: '2.1'
orbs:
  cfa: continuousauth/npm@1.0.0
jobs:
  test:
    docker:
      - image: cimg/node:18.11.0
    steps:
      - checkout
      - restore_cache:
          key: dependency-cache-{{ checksum "yarn.lock" }}
      - run: yarn --frozen-lockfile
      - save_cache:
          key: dependency-cache-{{ checksum "yarn.lock" }}
          paths:
            - ./node_modules
      - run: yarn lint
      - run: yarn test
workflows:
  test_and_release:
    jobs:
      - test
      - cfa/release:
          context: cfa-release
          filters:
            branches:
              only:
                - main
          requires:
            - test
```