@ecltest/ecl-utils (0.0.4)
Published 2025-08-21 19:57:51 +00:00 by Eric
Installation
@ecltest:registry=npm install @ecltest/ecl-utils@0.0.4"@ecltest/ecl-utils": "0.0.4"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)
IMPORTANT: The project's package.json should have its name value set to the @{scope}/{package} so the path can be properly resolved when running npm install @{scope}/{package}.
e.g.
{
...
"name": "@ecltest/ecl-utils"
}
To then publish the package according to the package.json name and version, run:
npm publish --scope="@{scope}" --registry="http://code.juton.llc/api/packages/{owner}/npm/"
4. Consume a package (consumer)
npm i @{scope}/{package}
e.g
npm i @ecltest/ecl-utils