Generated reference for the harmont Npm API.
npm
Callable singleton for the npm toolchain — access as hm.npm.
Call directly to construct an NpmProject, or use the bare-form
action methods (npm.test(), npm.run(script), etc.) for a
one-shot leaf.
npm(*, path='.', version='20', image=None, base=None) -> NpmProject| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the npm project root (must contain a |
package-lock.json). | |||
version | str | '20' | Node.js major version to install (e.g. "20" or |
"20.x"). | |||
image | str | None | None | Local-mode Docker base image override. |
base | Step | None | None | Existing Step to attach to instead of emitting a fresh |
| apt-base step. |
Returns NpmProject — An NpmProject whose installed step is npm ci.
npm.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
npm.install()
install(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
npm.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
npm.run()
run(script, **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
script | str | required | — |
kw | Any | {} | — |
Returns Step
npm.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmEntry
Callable singleton for the npm toolchain — access as hm.npm.
Call directly to construct an NpmProject, or use the bare-form
action methods (npm.test(), npm.run(script), etc.) for a
one-shot leaf.
NpmEntry.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmEntry.install()
install(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmEntry.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmEntry.run()
run(script, **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
script | str | required | — |
kw | Any | {} | — |
Returns Step
NpmEntry.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmProject
npm project install chain — constructed via hm.npm().
installed is the npm ci step. Action methods (run,
test, lint, fmt) attach leaves to installed so
dependency installation is shared across CI actions.
Fields
| Field | Type | Default |
|---|---|---|
path | str | required |
installed | Step | required |
NpmProject.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmProject.install()
install() -> StepReturns Step
NpmProject.lint()
lint(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
NpmProject.run()
run(script, **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
script | str | required | — |
kw | Any | {} | — |
Returns Step
NpmProject.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step