npm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MulanPSL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name() string

func PkgType

func PkgType() model.PkgType

Types

type Collector

type Collector struct {
	collector.BaseCollector
}

func NewCollector

func NewCollector() *Collector

func (*Collector) Collect

func (c *Collector) Collect() ([]model.Package, error)

type LockFile

type LockFile struct {
	LockfileVersion string                 `yaml:"lockfileVersion"`
	Dependencies    map[string]any         `yaml:"dependencies,omitempty"`
	DevDependencies map[string]any         `yaml:"devDependencies,omitempty"`
	Packages        map[string]PackageInfo `yaml:"packages,omitempty"`
}

type PackageInfo

type PackageInfo struct {
	Resolution      PackageResolution `yaml:"resolution"`
	Dependencies    map[string]string `yaml:"dependencies,omitempty"`
	DevDependencies map[string]string `yaml:"devDependencies,omitempty"`
	IsDev           bool              `yaml:"dev,omitempty"`
	Name            string            `yaml:"name,omitempty"`
	Version         string            `yaml:"version,omitempty"`
}

type PackageJSONParser

type PackageJSONParser struct{}

PackageJSONParser is a parser for package.json file see: https://docs.npmjs.com/cli/v10/configuring-npm/package-json

func NewPackageJSONParser

func NewPackageJSONParser() *PackageJSONParser

func (PackageJSONParser) Matcher

func (PackageJSONParser) Parse

func (PackageJSONParser) Parse(path string) ([]model.Package, error)

func (PackageJSONParser) ParseMain

func (PackageJSONParser) ParseMain(path string) (pkg *model.Package, err error)

type PackageLockJSONParser

type PackageLockJSONParser struct{}

PackageLockJSONParser is a parser for package-lock.json file see: https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json

func NewPackageLockJSONParser

func NewPackageLockJSONParser() *PackageLockJSONParser

func (PackageLockJSONParser) Matcher

func (PackageLockJSONParser) Parse

func (PackageLockJSONParser) Parse(path string) ([]model.Package, error)

type PackageResolution

type PackageResolution struct {
	Tarball string `yaml:"tarball,omitempty"`
}

type PnpmLockParser

type PnpmLockParser struct{}

func NewPnpmLockParser

func NewPnpmLockParser() *PnpmLockParser

NewPnpmLockParser returns a new PnpmLockParser

func (PnpmLockParser) Matcher

func (PnpmLockParser) Parse

func (PnpmLockParser) Parse(path string) ([]model.Package, error)

type YarnLockParser

type YarnLockParser struct{}

YarnLockParser is a parser for yarn.lock file see: https://classic.yarnpkg.com/lang/en/docs/yarn-lock/

func NewYarnLockParser

func NewYarnLockParser() *YarnLockParser

func (YarnLockParser) Matcher

func (YarnLockParser) Parse

func (YarnLockParser) Parse(path string) ([]model.Package, error)

type YarnPackageContent

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

type YarnPackageKey

type YarnPackageKey string

format: name@version

Jump to

Keyboard shortcuts

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