Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

GenerateOptions

interface GenerateOptions {
comment?: boolean | undefined;
directive?: boolean | undefined;
file?: string | undefined;
format?: FormatOptions | undefined;
moz?: MozillaOptions | undefined;
parse?: Function | undefined;
sourceCode?: string | undefined;
sourceContent?: string | undefined;
sourceMap?: string | undefined;
sourceMapRoot?: string | undefined;
sourceMapWithCode?: boolean | undefined;
verbatim?: string | undefined;
}

§Properties

§
comment?: boolean | undefined
[src]

If comments are attached to AST, escodegen is going to emit comments to output code. Default is false.

§
directive?: boolean | undefined
[src]

Recognize DirectiveStatement and distinguish it from ExpressionStatement. Default: false

§
file?: string | undefined
[src]

If file is provided, it will be used as file property of generated source map.

§
format?: FormatOptions | undefined
[src]

The format options

§
moz?: MozillaOptions | undefined
[src]
§
parse?: Function | undefined
[src]

Mozilla Parser API compatible parse function, e.g., the parse function exported by esprima. If it is provided, generator tries to use the 'raw' representation. See esprima raw information. Default is null.

§
sourceCode?: string | undefined
[src]
§
sourceContent?: string | undefined
[src]

Optionally option.sourceContent string can be passed (which represents original source of the file, for example it could be a source of coffeescript from which JS is being generated), if provided generated source map will have original source embedded in it.

§
sourceMap?: string | undefined
[src]

sourceMap is the source maps's source filename, that's a name that will show up in the browser debugger for the generated source (if source-maps is enabled). If a non-empty string value is provided, generate a source map.

§
sourceMapRoot?: string | undefined
[src]

Optionally option.sourceMapRoot can be provided, in which case option.sourceMap will be treated as relative to it. For more information about source map itself, see source map library document, V3 draft and HTML5Rocks introduction. Default is undefined sourceMapRoot is the source root for the source map (see the Mozilla documentation). If sourceMapWithCode is truthy, an object is returned from generate() of the form: { code: .. , map: .. }. If file is provided, it will be used as file property of generated source map.

§
sourceMapWithCode?: boolean | undefined
[src]

. If sourceMapWithCode is true generator returns output hash, where output.map is a source-map representation, which can be serialized as output.map.toString(). output.code is a string with generated JS code (note that it's not going to have //@ sourceMappingURL comment in it).

§
verbatim?: string | undefined
[src]

Providing verbatim code generation option to Expression nodes. verbatim option is provided by user as string. When generating Expression code, looking up node[option.verbatim] value and dump it instead of normal code generation.

@example