npm

package
v0.50.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() types.Parser

Types

type Dependency

type Dependency struct {
	Version      string                `json:"version"`
	Dev          bool                  `json:"dev"`
	Dependencies map[string]Dependency `json:"dependencies"`
	Requires     map[string]string     `json:"requires"`
	Resolved     string                `json:"resolved"`
	StartLine    int
	EndLine      int
}

func (*Dependency) UnmarshalJSONWithMetadata

func (t *Dependency) UnmarshalJSONWithMetadata(node jfather.Node) error

UnmarshalJSONWithMetadata needed to detect start and end lines of deps for v1

type LockFile

type LockFile struct {
	Dependencies    map[string]Dependency `json:"dependencies"`
	Packages        map[string]Package    `json:"packages"`
	LockfileVersion int                   `json:"lockfileVersion"`
}

type Package

type Package struct {
	Name                 string            `json:"name"`
	Version              string            `json:"version"`
	Dependencies         map[string]string `json:"dependencies"`
	OptionalDependencies map[string]string `json:"optionalDependencies"`
	DevDependencies      map[string]string `json:"devDependencies"`
	Resolved             string            `json:"resolved"`
	Dev                  bool              `json:"dev"`
	Link                 bool              `json:"link"`
	Workspaces           []string          `json:"workspaces"`
	StartLine            int
	EndLine              int
}

func (*Package) UnmarshalJSONWithMetadata

func (t *Package) UnmarshalJSONWithMetadata(node jfather.Node) error

UnmarshalJSONWithMetadata needed to detect start and end lines of deps for v2 or newer

type Parser

type Parser struct{}

func (*Parser) Parse

func (p *Parser) Parse(r xio.ReadSeekerAt) ([]types.Library, []types.Dependency, error)

Jump to

Keyboard shortcuts

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