Documentation ¶
Overview ¶
This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/.
This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadPackageIntoFolder ¶
func DownloadPackageIntoFolder(packageName string, version string, outFolder string) (string, error)
* * DownloadPackageIntoFolder downloads given NPM package into the outfolder, it puts it in a subfolder * called <packageName>@<version>, this function returns that folder name.
Types ¶
type NPMPackageIdentifier ¶
type NPMPackageIdentifier struct { Name string // Name of the package, may be of type myname or @org/myname Version string // Version number (the bit after the last @), e.g. 0.1.3 }
func PackageIdToPackageAndVersion ¶
func PackageIdToPackageAndVersion(pn string) (NPMPackageIdentifier, error)
starboard-notebook@1.2.3 -> starboard-notebook 1.2.3
func PathToNPMPackage ¶
func PathToNPMPackage(path string) (NPMPackageIdentifier, error)
type NPMRegistryEntry ¶
type NPMRegistryEntry struct { ID string `json:"_id"` Rev string `json:"_rev"` Name string `json:"name"` DistTags struct { Latest string `json:"latest"` } `json:"dist-tags"` Versions map[string]struct { Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` Author struct { Name string `json:"name"` Email string `json:"email"` } `json:"author"` Funding struct { Type string `json:"type"` URL string `json:"url"` } `json:"funding"` License string `json:"license"` Repository struct { Type string `json:"type"` URL string `json:"url"` } `json:"repository"` Keywords []string `json:"keywords"` Scripts map[string]string `json:"scripts"` Main string `json:"main"` DevDependencies map[string]string `json:"devDependencies"` Dependencies map[string]string `json:"dependencies"` GitHead string `json:"gitHead"` ID string `json:"_id"` NodeVersion string `json:"_nodeVersion"` NpmVersion string `json:"_npmVersion"` Dist struct { Integrity string `json:"integrity"` Shasum string `json:"shasum"` Tarball string `json:"tarball"` FileCount int `json:"fileCount"` UnpackedSize int `json:"unpackedSize"` NpmSignature string `json:"npm-signature"` } `json:"dist"` Maintainers []struct { Name string `json:"name"` Email string `json:"email"` } `json:"maintainers"` NpmUser struct { Name string `json:"name"` Email string `json:"email"` } `json:"_npmUser"` Directories struct { } `json:"directories"` NpmOperationalInternal struct { Host string `json:"host"` Tmp string `json:"tmp"` } `json:"_npmOperationalInternal"` HasShrinkwrap bool `json:"_hasShrinkwrap"` } `json:"versions"` Time map[string]time.Time `json:"time"` Maintainers []struct { Name string `json:"name"` Email string `json:"email"` } `json:"maintainers"` Description string `json:"description"` Keywords []string `json:"keywords"` Repository struct { Type string `json:"type"` URL string `json:"url"` } `json:"repository"` Author struct { Name string `json:"name"` Email string `json:"email"` } `json:"author"` License string `json:"license"` Readme string `json:"readme"` ReadmeFilename string `json:"readmeFilename"` }
func GetRegistryEntry ¶
func GetRegistryEntry(packageName string) (NPMRegistryEntry, error)
Click to show internal directories.
Click to hide internal directories.