noderuntimepack

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package noderuntimepack stores the embedded Node runtime as a few solid zstd blocks. The runtime's package copies repeat one another (an SDK bundle contains the modules it was built from), and a block compresses those repeats away, which a per-file archive cannot. Blocks decode independently, so extraction runs them in parallel.

Index

Constants

This section is empty.

Variables

View Source
var ErrTruncated = errors.New("noderuntimepack: truncated archive")

ErrTruncated reports an archive whose block lengths run past its end.

Functions

func Extract

func Extract(archive string, visit func(name string, data []byte) error) error

Extract decodes every block of archive and calls visit for each file. Blocks run in parallel, so visit must be safe for concurrent use; data is valid only during the call. The first error stops further blocks.

func Pack

func Pack(files []File) ([]byte, error)

Pack returns the blocks for files, in an order that keeps each package directory's files adjacent (a directory walk does). The output depends only on the names and contents.

Types

type File

type File struct {
	Name string
	Data []byte
}

File is one runtime file; Name is a slash-separated path.

Jump to

Keyboard shortcuts

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