npm

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Type string = "npm"

Variables

View Source
var (
	Manifests = []string{"package.json", "package-lock.json", ".package.json", ".package-lock.json", "yarn.lock", "pnpm-lock.yaml"}
)

Functions

func CheckRelatedFile

func CheckRelatedFile(file string) (string, bool, bool)

func Scan

func Scan(data interface{}) interface{}

Types

type Contributors

type Contributors struct {
	Name     string `json:"name" mapstruct:"name"`
	Username string `json:"email" mapstruct:"username"`
	URL      string `json:"url" mapstruct:"url"`
}

Contributors - PackageJSON contributors

type Dependency

type Dependency struct {
	Version      string            `yaml:"version"`
	Resolution   string            `yaml:"resolution"`
	Dependencies map[string]string `yaml:"dependencies"`
	Checksum     string            `yaml:"checksum"`
	LanguageName string            `yaml:"languageName"`
	LinkType     string            `yaml:"linkType"`
}

type LockDependency

type LockDependency struct {
	Version   string `json:"version"`
	Resolved  string `json:"resolved"`
	Integrity string `json:"integrity"`
	Requires  map[string]string
}

LockDependency - PackageLock dependencies

type Metadata

type Metadata struct {
	Name            string                 `json:"name"`
	Version         string                 `json:"version"`
	Latest          []string               `json:"latest"`
	Contributors    interface{}            `json:"contributors"`
	License         interface{}            `json:"license"`
	Homepage        string                 `json:"homepage"`
	Description     string                 `json:"description"`
	Dependencies    map[string]interface{} `json:"dependencies"`
	DevDependencies map[string]interface{} `json:"devDependencies"`
	Repository      interface{}            `json:"repository"`
	Author          interface{}            `json:"author"`
}

PackageJSON - packages.json model

type Package

type Package struct {
	Version      string
	Resolution   string
	Dependencies map[string]string
}

type PackageLock

type PackageLock struct {
	Requires        bool `json:"requires"`
	LockfileVersion int  `json:"lockfileVersion"`
	Dependencies    map[string]LockDependency
}

PackageLock - PackageLock model

type PnpmLockfile

type PnpmLockfile struct {
	LockFileVersion string                 `yaml:"lockfileVersion"`
	Dependencies    map[string]interface{} `yaml:"dependencies"`
	Packages        map[string]interface{} `yaml:"packages"`
}

type Repository

type Repository struct {
	Type string `json:"type" mapstructure:"type"`
	URL  string `json:"url" mapstructure:"url"`
}

Repository - PackageJSON repository

type YarnLockfile added in v1.12.3

type YarnLockfile struct {
	Version      string            `yaml:"version"`
	Resolution   string            `yaml:"resolution"`
	Dependencies map[string]string `yaml:"dependencies"`
	Checksum     string            `yaml:"checksum"`
	LanguageName string            `yaml:"languageName"`
	LinkType     string            `yaml:"linkType"`
}

type YarnPackage

type YarnPackage struct {
	Version      string
	Resolution   string
	Dependencies map[string]string
}

Jump to

Keyboard shortcuts

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