Table of Contents

Javascript Package - Registry

About

Code Shipping - Registry in Javascript

A registry is:

Properties

Scope

If a scope is associated with a registry:

npm config set @myco:registry http://reg.example.com

List

See also: cdn to get a link to the library

CDN

A Content delivery network delivers Static resources such as image locally worldwide

Management

Set

Set globally

npm set registry http://localhost:4873

Set for a project

Javascript Package - Package.json has a publishConfig property with:

Example:

{
    .....
    "publishConfig": {
        "registry": "https://your-host:8081/repository/npm-private/"
    }
    ....
}

Set at the command line

// locally for the project
npm install lodash --registry http://localhost:4873
// globally
npm --registry https://your-host:8081/repository/npm-group/ install -g packageName

Command

Publish

To publish

{
   ....
   "private": true, // Prevent every publication
   ....
}
echo -n 'admin:admin123' | openssl base64
YWRtaW46YWRtaW4xMjM=  # verify that you get the same value (this command can run also on windows and will not give the same result)

[email protected]
always-auth=true
_auth=YWRtaW46YWRtaW4xMjM=
cd project
yarn install # to test 
# or
yarn install /path/to/project
npm publish
npm notice === Tarball Details ===
npm notice name:          @bytle/webco
npm notice version:       1.0.0
npm notice package size:  100.8 kB
npm notice unpacked size: 339.0 kB
npm notice shasum:        6faef3c35e3dab67320ab6f09d17752dba9a1fc3
npm notice integrity:     sha512-D/NtNsaN20yRK[...]ULMgIRHjUkyog==
npm notice total files:   41
npm notice

For instance, in Repository Manager - Nexus:

Npm Nexus Publish

Ref: https://help.sonatype.com/repomanager2/node-packaged-modules-and-npm-registries

Install

npm install