package
0.0.0-20240930212407-d384f87bdcd5
Repository: https://github.com/listendev/pkg.git
Documentation: pkg.go.dev

# README

npm

This package allows to get some information about a npm package from the npm registry.

Installation

go get github.com/listendev/pkg/npm

Usage

npm.GetPackageList

pkg, err := npm.GetPackageList(context.Background(), "react")
if err != nil {
    panic(err)
}

fmt.Println(pkg.Name)
fmt.Println(pkg.Versions["0.0.1"].Dist.Shasum)

npm.GetPackageVersion

pkg, err := npm.GetPackageVersion(context.Background(), "react", "0.0.1")
if err != nil {
    panic(err)
}

fmt.Println(pkg.Name)
fmt.Println(pkg.Dist.Shasum)