func (n *NPMLookup) PackagesNotInPublic() []string {
	notavail := []string{}
	for _, pkg := range n.Packages {
		if n.localReference(pkg.Version) || n.urlReference(pkg.Version) || n.gitReference(pkg.Version) {
			continue
		}
		if n.gitHubReference(pkg.Version) {
			if !n.gitHubOrgExists(pkg.Version) {
				notavail = append(notavail, pkg.Name)
				continue
			} else {
				continue
			}
		}
		if !n.isAvailableInPublic(pkg.Name, 0) {
			notavail = append(notavail, pkg.Name)
		}
	}
	return notavail
}
PackagesNotInPublic determines if an npm package does not exist in the public npm package repository.

Returns a slice of strings with any npm packages not in the public npm package repository
package main
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"time"
)
type PackageJSON struct {
	Dependencies         map[string]string `json:"dependencies,omitempty"`
	DevDependencies      map[string]string `json:"devDependencies,omitempty"`
	PeerDependencies     map[string]string `json:"peerDependencies,omitempty"`
	BundledDependencies  []string          `json:"bundledDependencies,omitempty"`
	BundleDependencies   []string          `json:"bundleDependencies,omitempty"`
	OptionalDependencies map[string]string `json:"optionalDependencies,omitempty"`
}
type NpmResponse struct {
	ID   string `json:"_id"`
	Name string `json:"name"`
	Time struct {
		Unpublished NpmResponseUnpublished `json:"unpublished"`
	} `json:"time"`
}
type NpmResponseUnpublished struct {
		Maintainers []struct {
			Email string `json:"email"`
			Name  string `json:"name"`
		} `json:"maintainers"`
		Name string `json:"name"`
		Tags struct {
			Latest string `json:"latest"`
		} `json:"tags"`
		Time     time.Time `json:"time"`
		Versions []string  `json:"versions"`
}
func (n *NpmResponse) NotAvailable() bool {
	return len(n.Time.Unpublished.Name) > 0
}
type NPMLookup struct {
	Packages []NPMPackage
	Verbose  bool
}
type NPMPackage struct {
	Name string
	Version string
}
func NewNPMLookup(verbose bool) PackageResolver {
	return &NPMLookup{Packages: []NPMPackage{}, Verbose: verbose}
}
func (n *NPMLookup) ReadPackagesFromFile(filename string) error {
	rawfile, err := ioutil.ReadFile(filename)
	if err != nil {
		return err
	}
	data := PackageJSON{}
	err = json.Unmarshal([]byte(rawfile), &data)
	if err != nil {
		fmt.Printf(" [W] Non-fatal issue encountered while reading %s : %s\n", filename, err)
	}
	for pkgname, pkgversion := range data.Dependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, pkgversion})
	}
	for pkgname, pkgversion := range data.DevDependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, pkgversion})
	}
	for pkgname, pkgversion := range data.PeerDependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, pkgversion})
	}
	for pkgname, pkgversion := range data.OptionalDependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, pkgversion})
	}
	for _, pkgname := range data.BundledDependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, ""})
	}
	for _, pkgname := range data.BundleDependencies {
		n.Packages = append(n.Packages, NPMPackage{pkgname, ""})
	}
	return nil
}