npm

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Copyright © 2023 The listen.dev team <engineering@garnet.ai>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFromRegistry

func GetFromRegistry(ctx context.Context, name, version string) (io.ReadCloser, error)

GetFromRegistry asks to the npm registry for the details of a package by name, and optionally, by version.

func Version

func Version(ctx context.Context) (string, error)

Version returns the npm version.

Or it errors out if unable to find the npm executable.

Types

type LockfileVersion

type LockfileVersion struct {
	Value int `json:"lockfileVersion" name:"lockfile version" validate:"gte=1,lte=3"`
}

type Package

type Package struct {
	Version string `json:"version" name:"version" validate:"semver"`
	Shasum  string `json:"shasum" name:"shasum" validate:"shasum"`
}

func (*Package) Ok

func (p *Package) Ok() bool

type PackageLockDependency

type PackageLockDependency struct {
	Version  string `json:"version"`
	Resolved string `json:"resolved"`
}

type PackageLockJSON

type PackageLockJSON interface {
	Deps() map[string]PackageLockDependency
	Encode() string
	Ok() bool
	Version() int
}

func NewPackageLockJSON

func NewPackageLockJSON() PackageLockJSON

NewPackageLockJSON is a factory to create an empty (and invalid) PackageLockJSON.

func NewPackageLockJSONFromBytes

func NewPackageLockJSONFromBytes(b []byte) (PackageLockJSON, error)

func NewPackageLockJSONFromDir

func NewPackageLockJSONFromDir(ctx context.Context, dir string) (PackageLockJSON, error)

NewPackageLockJSONFromDir creates a PackageLockJSON instance from the package.json in the dir directory (if any).

func NewPackageLockJSONFromReader

func NewPackageLockJSONFromReader(reader io.Reader) (PackageLockJSON, error)

NewPackageLockJSONFromReader creates a PackageLockJSON instance from by reading the contents of a package-lock.json file.

type Packages

type Packages map[string]Package

func (Packages) Ok

func (p Packages) Ok() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL