@ecltest/ecl-utils (0.0.3)
Published 2025-08-21 19:23:24 +00:00 by Eric
Installation
@ecltest:registry=npm install @ecltest/ecl-utils@0.0.3"@ecltest/ecl-utils": "0.0.3"About this package
Setting up and using NPM package registry:
1. Generate token (publisher)
Generate a token that will be used for publishing packages.
curl -H "Content-Type: application/json" \
-d '{"name":"{name}","scopes":["write:package"]}' \
-u "{owner}:{password}" \
"https://code.juton.llc/api/v1/users/{owner}/tokens
IMPORTANT: This will return a response with a secret token that you will only ever see once! Don't lose it.
The response will look something like this:
{
"id": 1,
"name": "{name}",
"sha1": "{token}",
"token_last_eight": "...",
"scopes": ["write:package"]
}
NOTE: "write:package" scope is effectively full access currently.
2. Export the token as an environment variable (publisher and consumer)
export NPM_TOKEN={token}
Exporting the token as an environment variable alows it to be used by a shared .npmrc file as follows:
@{scope}:registry=https://code.juton.llc/api/packages/{owner}/npm/
//code.juton.llc/api/packages/{owner}/npm/:_authToken=${NPM_TOKEN}
This effectively runs the commands:
npm config set "@{scope}:registry" "https://code.juton.llc/api/packages/{owner}/npm/"
npm config set -- "//code.juton.llc/api/packages/{owner}/npm/:_authToken" $NPM_TOKEN
3. Publish a package (publisher)
npm publish --scope="@{scope}" --registry="http://code.juton.llc/api/packages/{owner}/npm/"
This will publish the package according to the package.json package name and version.
4. Consume a package (consumer)
npm i @{scope}/{package}
e.g
npm i @ecltest/ecl-utils