hammerkit

npm

Install locked Node.js dependencies with npm ci.

Install locked Node.js dependencies with npm ci. The task runs in a node container and keeps node_modules as its output, so it is skipped when package.json and package-lock.json are unchanged.

.hammerkit.yaml
includes:
  npm:
    git: https://github.com/no0dles/hammerkit.git
    ref: v1.16.0
    path: catalog/npm

tasks:
  build:
    image: node:24-alpine
    deps: [npm:install]
    cmds:
      - npm run build

Tasks

TaskWhat it doesReadsProduces
installInstall locked Node.js dependencies with npm ci.package.json, package-lock.jsonnode_modules

Inputs

InputDefaultMeaning
NODE_VERSION24Tag of the node image the install runs in, e.g. 22 or 24. The image is node:<NODE_VERSION>-alpine.

The entry

catalog/npm/build.yaml
# Installs the locked dependencies of a Node.js project with npm.
envs:
  # tag of the node image the install runs in
  NODE_VERSION: 24

tasks:
  install:
    description: install the locked dependencies with npm ci
    image: node:${NODE_VERSION}-alpine
    src: [package.json, package-lock.json]
    generates: [node_modules]
    cmds:
      - npm ci

On this page