javascript

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package javascript provides a concrete Cataloger implementation for JavaScript ecosystem files (yarn and npm).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJavascriptLockCataloger

func NewJavascriptLockCataloger() *common.GenericCataloger

NewJavascriptLockCataloger returns a new Javascript cataloger object base on package lock files.

func NewJavascriptPackageCataloger

func NewJavascriptPackageCataloger() *common.GenericCataloger

NewJavascriptPackageCataloger returns a new JavaScript cataloger object based on detection of npm based packages.

Types

type Author

type Author struct {
	Name  string `json:"name" mapstruct:"name"`
	Email string `json:"email" mapstruct:"email"`
	URL   string `json:"url" mapstruct:"url"`
}

func (*Author) AuthorString

func (a *Author) AuthorString() string

func (*Author) UnmarshalJSON

func (a *Author) UnmarshalJSON(b []byte) error

type Dependency

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

Dependency represents a single package dependency listed in the package.lock json file

type PackageJSON

type PackageJSON struct {
	Version      string            `json:"version"`
	Latest       []string          `json:"latest"`
	Author       Author            `json:"author"`
	License      json.RawMessage   `json:"license"`
	Licenses     []license         `json:"licenses"`
	Name         string            `json:"name"`
	Homepage     string            `json:"homepage"`
	Description  string            `json:"description"`
	Dependencies map[string]string `json:"dependencies"`
	Repository   Repository        `json:"repository"`
}

PackageJSON represents a JavaScript package.json file

type PackageLock

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

PackageLock represents a JavaScript package.lock json file

type Repository

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

func (*Repository) UnmarshalJSON

func (r *Repository) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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