Module ammcore.pkg.packageJson

Parser for .ammpackage.json.

Index

Function

parse()

Read ammpackage.json from lua table.

parseFromFile()

Read ammpackage.json from file.

parseFromString()

Read ammpackage.json from json string.

Class

PackageJson

Data parsed from .ammpackage.json.

Function

ammcore.pkg.packageJson.parse(metadata: any, path: string) version: ammcore.pkg.version.Version, requirements: table<string, ammcore.pkg.version.VersionSpec>, devRequirements: table<string, ammcore.pkg.version.VersionSpec>, packageJson: ammcore.pkg.packageJson.PackageJson

Read ammpackage.json from lua table.

Parameters:
  • metadata (any) – parsed json data.

  • path (string) – where this data comes from, needed for error messages.

Returns:
ammcore.pkg.packageJson.parseFromFile(path: string) version: ammcore.pkg.version.Version, requirements: table<string, ammcore.pkg.version.VersionSpec>, devRequirements: table<string, ammcore.pkg.version.VersionSpec>, packageJson: ammcore.pkg.packageJson.PackageJson

Read ammpackage.json from file.

Parameters:

path (string) – path to an ammpackage.json file.

Returns:
ammcore.pkg.packageJson.parseFromString(metadataTxt: string, path: string) version: ammcore.pkg.version.Version, requirements: table<string, ammcore.pkg.version.VersionSpec>, devRequirements: table<string, ammcore.pkg.version.VersionSpec>, packageJson: ammcore.pkg.packageJson.PackageJson

Read ammpackage.json from json string.

Parameters:
  • metadataTxt (string) – a json string.

  • path (string) – where this string comes from, needed for error messages.

Returns:

Class

class ammcore.pkg.packageJson.PackageJson

Data parsed from .ammpackage.json.

name: string

package name.

version: string

package version.

description: string?

short package description.

author: string?

author of the package.

authors: string[]?

authors of the package, if there are more than one.

maintainer: string?

maintainer of the package.

maintainers: string[]?

maintainers of the package, if there are more than one.

license: string?

license type.

urls: table<string, string>?

links to pages related to the package.

requirements: table<string, string>?

list of production requirements.

devRequirements: table<string, string>?

list of development requirements.