npm

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

README

npm - NPM packages in a NPM registry (e.g. npmjs.com)

Synopsis
type: npm/v1

Provided blobs use the following media type: application/x-tgz

Description

This method implements the access of an NPM package from an NPM registry.

Specification Versions

Supported specification version is v1

Version v1

The type specific specification fields are:

  • registry string

    Base URL of the NPM registry.

  • package string

    The name of the NPM package.

  • version string

    The version of the NPM package.

Documentation

Index

Constants

View Source
const (
	Type   = "npm"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Type is the access type of NPM registry.

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

Types

type AccessSpec

type AccessSpec struct {
	runtime.ObjectVersionedType `json:",inline"`

	// Registry is the base URL of the NPM registry
	Registry string `json:"registry"`
	// Package is the name of NPM package
	Package string `json:"package"`
	// Version of the NPM package.
	Version string `json:"version"`
}

AccessSpec describes the access for a NPM registry.

func New

func New(registry, pkg, version string) *AccessSpec

New creates a new NPM registry access spec version v1.

func (*AccessSpec) AccessMethod

func (*AccessSpec) Describe

func (a *AccessSpec) Describe(_ accspeccpi.Context) string

func (*AccessSpec) GetPackageVersion added in v0.11.0

func (a *AccessSpec) GetPackageVersion(ctx accspeccpi.Context) (*npm.Version, error)

func (*AccessSpec) GetReferenceHint

func (a *AccessSpec) GetReferenceHint(_ accspeccpi.ComponentVersionAccess) string

func (*AccessSpec) GetType

func (_ *AccessSpec) GetType() string

func (*AccessSpec) GlobalAccessSpec

func (a *AccessSpec) GlobalAccessSpec(_ accspeccpi.Context) accspeccpi.AccessSpec

func (*AccessSpec) IsLocal

func (_ *AccessSpec) IsLocal(accspeccpi.Context) bool

func (*AccessSpec) PackageUrl added in v0.10.0

func (a *AccessSpec) PackageUrl() string

PackageUrl returns the URL of the NPM package (Registry/Package).

func (*AccessSpec) PackageVersionUrl added in v0.11.0

func (a *AccessSpec) PackageVersionUrl() string

PackageVersionUrl returns the URL of the NPM package-version (Registry/Package/Version).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL