node

package
v0.0.0-...-be0cd49 Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package node provides a modular way of interacting with node commands This primarily is for dealing with nodejs files such as the package.json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(cli *cli.Cli)

AddCommands for the node module

func LinkLocalDeps

func LinkLocalDeps() error

LinkLocalDeps search all node projects found inside the meta repo and update all the package json found. WARNING: This function is distructive and any unstaged changes

made will result in data loss.

func LocalNodeModules

func LocalNodeModules() (map[string]*PackageJSON, error)

LocalNodeModules will search through all the submodules and return all the projects that are valid node projects

func Resolve

func Resolve(project string) ([]string, error)

Resolve will explore search through the given package json of project and all the required projects found locally. Once it is completed, it will return the list of the required pacakages otherwise, return an informative error

func RestoreBackups

func RestoreBackups() error

RestoreBackups will itterate through all the node projects and reset their package.json back to what they were before being modified.

Types

type PackageJSON

type PackageJSON struct {
	Name            string            `json:"name"`
	Version         string            `json:"version"`
	Description     string            `json:"description"`
	Main            string            `json:"main"`
	Bugs            map[string]string `json:"bugs,omitempty"`
	Scripts         map[string]string `json:"scripts,omitempty"`
	Dependencies    map[string]string `json:"dependencies,omitempty"`
	DevDependencies map[string]string `json:"devDependencies,omitempty"`
	Private         bool              `json:"private,omitempty"`
	License         string            `json:"license,omitempty"`
}

PackageJSON structure of package.json

func CreateMetaPackageJson

func CreateMetaPackageJson(skipIgnores bool) (*PackageJSON, error)

func (*PackageJSON) WriteTo

func (pack *PackageJSON) WriteTo(path string) error

WriteTo will write the current contents of the PackageJSON into the given directory

Jump to

Keyboard shortcuts

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