jsdependency

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(packageManager Tool, commandScope CommandScope, pkg ...string) (*command.Model, error)

AddCommand returns command model to install js dependencies

func RemoveCommand

func RemoveCommand(packageManager Tool, commandScope CommandScope, pkg ...string) (*command.Model, error)

RemoveCommand returns command model to remove js dependencies

Types

type CommandScope

type CommandScope string

CommandScope describes package manager command scope (global, or not)

const (
	Local  CommandScope = "local"
	Global CommandScope = "global"
)

PackageScope types

type InstallCommand

type InstallCommand struct {
	Slice       *command.Model
	IgnoreError bool
}

InstallCommand contains the command to be executed and wether the resulting error can be ignored. (yarn exits with error if removing a not yet added package)

func InstallGlobalDependencyCommand

func InstallGlobalDependencyCommand(packageManager Tool, dependency string, version string) ([]InstallCommand, error)

InstallGlobalDependencyCommand returns command model to install a global js dependency

type Tool

type Tool string

Tool identifies a package manager tool

const (
	Npm  Tool = "npm"
	Yarn Tool = "yarn"
)

Package manager types

func DetectTool

func DetectTool(absPackageJSONDir string) (Tool, error)

DetectTool returns the Js package manager used, e.g. npm or yarn

Jump to

Keyboard shortcuts

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