npm

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Versions map[string]versions
	DistTags distTags `json:"dist-tags,omitempty"`
}

type Npm

type Npm struct {
	// contains filtered or unexported fields
}

Npm defines a resource of kind "npm"

func New

func New(spec interface{}) (*Npm, error)

New returns a new valid Npm package object.

func (Npm) Changelog

func (n Npm) Changelog() string

Changelog returns the link to the found npm package version's deprecated info

func (Npm) Condition

func (n Npm) Condition(source string) (bool, error)

Condition checks that an Npm package version exist

func (Npm) ConditionFromSCM

func (n Npm) ConditionFromSCM(source string, scm scm.ScmHandler) (bool, error)

ConditionFromSCM checks if a key exists in a yaml file

func (Npm) Source

func (n Npm) Source(workingDir string) (string, error)

Source returns the latest npm package version

func (Npm) Target

func (n Npm) Target(source string, dryRun bool) (bool, error)

func (Npm) TargetFromSCM

func (n Npm) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (bool, []string, string, error)

type Spec

type Spec struct {
	// Defines the specific npm package name
	Name string `yaml:",omitempty"`
	// Defines a specific package version
	Version string `yaml:",omitempty"`
	// Defines registry url
	URL string `yaml:",omitempty"`
	// VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
	VersionFilter version.Filter `yaml:",omitempty"`
}

Spec defines a specification for an Npm package parsed from an updatecli manifest file

func (*Spec) Validate

func (s *Spec) Validate() (err error)

Validate run some validation on the Npm struct

Jump to

Keyboard shortcuts

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