MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / init

Function init

example/javascript/main.go:16–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func init() {
17
18 // register npm repository origin
19 javascript.RegisterNpmOrigin(func(name, version string) *javascript.PackageJson {
20 var pkgjson *javascript.PackageJson
21 common.DownloadUrlFromRepos(name, func(repo common.RepoConfig, r io.Reader) { pkgjson = javascript.ReadNpmJson(r, version) },
22 common.RepoConfig{Url: "https://r.cnpmjs.org/"},
23 )
24 return pkgjson
25 })
26}
27
28func main() {
29

Callers

nothing calls this directly

Calls 3

RegisterNpmOriginFunction · 0.92
DownloadUrlFromReposFunction · 0.92
ReadNpmJsonFunction · 0.92

Tested by

no test coverage detected