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 ¶ added in v0.4.0
func NewJavascriptLockCataloger() *common.GenericCataloger
NewJavascriptLockCataloger returns a new Javascript cataloger object base on package lock files.
func NewJavascriptPackageCataloger ¶ added in v0.4.0
func NewJavascriptPackageCataloger() *common.GenericCataloger
NewJavascriptPackageCataloger returns a new JavaScript cataloger object based on detection of npm based packages.
Types ¶
type Author ¶ added in v0.4.1
type Author struct {
Name string `json:"name" mapstruct:"name"`
Email string `json:"email" mapstruct:"email"`
URL string `json:"url" mapstruct:"url"`
}
func (*Author) AuthorString ¶ added in v0.4.1
func (*Author) UnmarshalJSON ¶ added in v0.4.1
Exports Author.UnmarshalJSON interface to help normalize the json structure.
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 ¶ added in v0.4.0
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 ¶ added in v0.4.1
type Repository struct {
Type string `json:"type" mapstructure:"type"`
URL string `json:"url" mapstructure:"url"`
}
func (*Repository) UnmarshalJSON ¶ added in v0.4.1
func (r *Repository) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.