Module ammcore.pkg.packageJson
¶
Parser for .ammpackage.json
.
Index¶
Function
Read ammpackage.json from lua table. |
|
Read ammpackage.json from file. |
|
Read ammpackage.json from json string. |
Class
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:
version (
ammcore.pkg.version.Version
) – parsed package version.requirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed production requirements.devRequirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed development requirements.packageJson (
ammcore.pkg.packageJson.PackageJson
) – raw package data, verified and prepared.
-
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 anammpackage.json
file.- Returns:
version (
ammcore.pkg.version.Version
) – parsed package version.requirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed production requirements.devRequirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed development requirements.packageJson (
ammcore.pkg.packageJson.PackageJson
) – raw package data, verified and prepared.
-
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:
version (
ammcore.pkg.version.Version
) – parsed package version.requirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed production requirements.devRequirements (
table
<string
,ammcore.pkg.version.VersionSpec
>) – parsed development requirements.packageJson (
ammcore.pkg.packageJson.PackageJson
) – raw package data, verified and prepared.
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.
-
name: