Standard Library

The standard library is a set of Pkl modules, versioned and distributed together with the language. It is documented in the API Docs.

To import a standard library module, use import "pkl:<identifier>". For example, import "pkl:json" imports the pkl.json module.

The pkl.base module defines the most fundamental properties, methods, and classes for using Pkl. Its members are automatically available in every module and hence, it does not need to be imported.

The default module allowlist (--allowed-modules) grants access to all standard library modules.