RoadmapShopEvents
Skip to main content

Home > @microsoft/api-extractor-model > IApiPackageSaveOptions

IApiPackageSaveOptions interface

Options for ApiPackage.saveToJsonFile().

Signature:

export interface IApiPackageSaveOptions extends IJsonFileSaveOptions 

Extends: IJsonFileSaveOptions

Properties

PropertyModifiersTypeDescription
ensureFolderExists?boolean

(Optional) Creates the folder recursively using FileSystem.ensureFolder() Defaults to false.

(Inherited from IJsonFileSaveOptions)

headerComment?string

(Optional) If specified, this header will be prepended to the start of the file. The header must consist of lines prefixed by "//" characters.

(Inherited from IJsonFileStringifyOptions)

ignoreUndefinedValues?boolean

(Optional) If true, conforms to the standard behavior of JSON.stringify() when a property has the value undefined. Specifically, the key will be dropped from the emitted object.

(Inherited from IJsonFileStringifyOptions)

newlineConversion?NewlineKind

(Optional) If provided, the specified newline type will be used instead of the default \r\n.

(Inherited from IJsonFileStringifyOptions)

onlyIfChanged?boolean

(Optional) If there is an existing file, and the contents have not changed, then don't write anything; this preserves the old timestamp.

(Inherited from IJsonFileSaveOptions)

prettyFormatting?boolean

(Optional) If true, then the "jju" library will be used to improve the text formatting. Note that this is slightly slower than the native JSON.stringify() implementation.

(Inherited from IJsonFileStringifyOptions)

testMode?boolean(Optional) Set to true only when invoking API Extractor's test harness.
toolPackage?string(Optional) Optionally specifies a value for the "toolPackage" field in the output .api.json data file; otherwise, the value will be "api-extractor-model".
toolVersion?string(Optional) Optionally specifies a value for the "toolVersion" field in the output .api.json data file; otherwise, the value will be the current version of the api-extractor-model package.
updateExistingFile?boolean

(Optional) If true, use the "jju" library to preserve the existing JSON formatting: The file will be loaded from the target filename, the new content will be merged in (preserving whitespace and comments), and then the file will be overwritten with the merged contents. If the target file does not exist, then the file is saved normally.

(Inherited from IJsonFileSaveOptions)