libnodejs

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 23 modules, 23 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

libnodejs

Common code shared between Node.js buildpacks

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 LaunchWithTiniEnvName = "BP_LAUNCH_WITH_TINI"
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 FindNodeApplication(workingDir string) (string, error)

func FindProjectPath

func FindProjectPath(workingDir string) (string, error)

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)

func ShouldLaunchWithTini added in v0.5.0

func ShouldLaunchWithTini() (bool, error)

ShouldLaunchWithTini reports whether BP_LAUNCH_WITH_TINI is set to a true boolean value. Returns false when the variable is unset.

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 .

Jump to

Keyboard shortcuts

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