npm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package npm handles the creation of artefacts required for publishing the oto generate package

Index

Constants

View Source
const (
	// NPMPackageMain is an arbitrary output name for client
	NPMPackageMain = "client.js"
	// NPMRegistry is the default registry url for most JS projects.
	NPMRegistry = "//registry.npmjs.org/"
	// GithubRegistry is the NPM registry url Github uses
	GHRegistry = "//npm.pkg.github.com/"
)

Variables

This section is empty.

Functions

func GeneratePackageInfo

func GeneratePackageInfo(npmPackage Package) ([]byte, error)

GeneratePackageInfo validates that all Package fields are present and returns the marshalled bytes of the package json

func Publish

func Publish(path string, options PublishOptions) error

Types

type Package

type Package struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Main    string `json:"main"`
}

Package contains all the fields required for creating an npm package

type PublishOptions

type PublishOptions struct {
	Token       string
	DryRun      bool
	Private     bool
	RegistryURL string
	// Owner is used only for Github
	Owner string
}

Jump to

Keyboard shortcuts

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