npm

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageJsonFile string = "package.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchingRule

type MatchingRule struct {
	// Path specifies a package.json path pattern, the pattern requires to match all of name, not just a substring.
	Path string
}

MatchingRule allows to specifies rules to identify manifest

type MatchingRules

type MatchingRules []MatchingRule

type Npm

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

Npm holds all information needed to generate npm manifest.

func New

func New(spec interface{}, rootDir, scmID string) (Npm, error)

New return a new valid object.

func (Npm) DiscoverManifests

func (n Npm) DiscoverManifests() ([][]byte, error)

type Spec

type Spec struct {
	// RootDir defines the root directory used to recursively search for npm packages.json
	RootDir string `yaml:",omitempty"`
	// Ignore allows to specify rule to ignore autodiscovery a specific NPM based on a rule
	Ignore MatchingRules `yaml:",omitempty"`
	// Only allows to specify rule to only autodiscover manifest for a specific NPM based on a rule
	Only MatchingRules `yaml:",omitempty"`
}

Spec defines the parameters which can be provided to the NPM builder.

Jump to

Keyboard shortcuts

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