@package-registry-npm-test/package-registry-npm-test (6.6.6)
Installation
@package-registry-npm-test:registry=npm install @package-registry-npm-test/package-registry-npm-test@6.6.6"@package-registry-npm-test/package-registry-npm-test": "6.6.6"About this package
package-registry-npm-test
A minimal example of how to publish and use npm packages with the gitea npm package registry.
Use the gitea npm registry
Get a personal access token (or https://git.rkcsd.com/user/settings/applications):
curl -XPOST -H "Content-Type: application/json" -k -d '{"name":"npm"}' \
-u {username}:{password} https://gitea.your.host/api/v1/users/{username}/tokens
Setup the private registry:
# Tell npm which registry to use for the scope
npm config set @package-registry-npm-test:registry https://git.rkcsd.com/api/packages/{owner}/npm/
# Tell npm how to authenticate for the registry
npm config set -- '//git.rkcsd.com/api/packages/{owner}/npm/:_authToken' "{token}"
Note that the visibility of the package is tied to the visibility of the owner, which is always a user or organization.
See https://github.com/go-gitea/gitea/issues/20596
Publish to the package registry
Publish from the root of the package:
npm publish
Note that files that are listed in .npmignore are not published. If a
.npmignore does NOT exist .gitignore is used like .npmignore.
Install from the package registry
Install the package:
npm install -g @package-registry-npm-test/package-registry-npm-test@6.6.6
Verify this README did not lie to you (npm is a confusing mess and npm link
does not link the binary automatically for me; look for the package in
$NPM_CONFIG_PREFIX/libs):
$ package-registry-npm-test
hello world
Drone CI
Refer to the .drone.yml for additional information.