Documentation ¶
Overview ¶
Package libnodejs provides common capabilities for buildpacks interacting with Node.js ecosystem files and configuraton.
Index ¶
Constants ¶
View Source
const LaunchPointEnvName = "BP_LAUNCHPOINT"
View Source
const ProjectPathEnvName = "BP_NODE_PROJECT_PATH"
View Source
const StartScriptNameEnvName = "BP_NPM_START_SCRIPT"
View Source
const VerifyLaunchPointEnvName = "BP_VERIFY_LAUNCHPOINT"
Variables ¶
This section is empty.
Functions ¶
func FindNodeApplication ¶ added in v0.1.0
func FindProjectPath ¶
FindProjectPath will validate that project path exists and is valid relative to the working directory.
func ResolveNodeVersion ¶ added in v0.2.0
func ResolveNodeVersion(resolver nodeResolver, plan packit.BuildpackPlan) (packit.BuildpackPlanEntry, []packit.BuildpackPlanEntry)
Types ¶
type PackageJSON ¶
type PackageJSON struct { Engines struct { Node string `json:"node"` } `json:"engines"` Scripts struct { PostStart string PreStart string Start string } Dependencies map[string]string `json:"dependencies"` DevDependencies map[string]string `json:"devDependencies"` AllScripts map[string]string `json:"scripts"` }
PackageJSON represents the contents of a package.json file.
func ParsePackageJSON ¶
func ParsePackageJSON(path string) (PackageJSON, error)
ParsePackageJSON parses the contents of a package.json file.
func (PackageJSON) GetVersion ¶ added in v0.1.0
func (pj PackageJSON) GetVersion() string
func (PackageJSON) HasStartScript ¶
func (pj PackageJSON) HasStartScript() bool
HasStartScript indicates the presence of a start script in the package.json file or as defined by .
Click to show internal directories.
Click to hide internal directories.