nodejs

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package nodejs provides Node.js-specific functionality for librarian.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean added in v0.14.0

func Clean(lib *config.Library) error

Clean removes all generated code from beneath the given library's output directory. If the output directory does not currently exist, this function is a no-op.

func DefaultLibraryName added in v0.14.0

func DefaultLibraryName(api string) string

DefaultLibraryName derives a library name from an API path by stripping the version suffix and replacing "/" with "-". For example: "google/cloud/secretmanager/v1" -> "google-cloud-secretmanager".

func DefaultOutput

func DefaultOutput(name, defaultOutput string) string

DefaultOutput returns the output path for a library.

func FindExistingLibraryForNewAPI added in v0.14.0

func FindExistingLibraryForNewAPI(libraries []*config.Library, apiPath string) *config.Library

FindExistingLibraryForNewAPI attempts to find an existing library that should contain the given new API path. The rule is currently for matching against a candidate library is currently as simple as "if any API path within the library matches the given API path, having removed the version from both of them, the API should be added to that library". If no such library is found, nil is returned.

func Generate

func Generate(ctx context.Context, cfg *config.Config, library *config.Library, srcs *sources.Sources) error

Generate generates a Node.js client library.

func Install added in v0.10.0

func Install(ctx context.Context, tools *config.Tools) error

Install installs Node.js tool dependencies.

func InstallDir added in v0.26.0

func InstallDir() (string, error)

InstallDir gets the directory where tools should be installed.

func InstallPNPM added in v0.27.0

func InstallPNPM(ctx context.Context, pnpmTools []*config.PNPMTool) error

InstallPNPM installs PNPM tools.

func IsMixedLibrary added in v0.14.0

func IsMixedLibrary(lib *config.Library) bool

IsMixedLibrary reports whether the library has handwritten code wrapping generated or librarian-managed code.

func Tidy added in v0.16.0

func Tidy(lib *config.Library) (*config.Library, error)

Tidy tidies configuration for a library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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