Methods
-
dirname(filename) → {string}
-
Extracts the directory name from a file name.
Parameters:
Name Type Description filenamestring File name
- Source:
Returns:
Directory name
- Type
- string
-
escapestr(s) → {string}
-
Escaoes a string to be used inside of a single or double quote enclosed JavaScript string.
Parameters:
Name Type Description sstring String to escape
- Source:
Returns:
Escaped string
- Type
- string
-
include(filename, absolute)
-
Includes another source file.
Parameters:
Name Type Description filenamestring File to include. May be a glob expression on node.js.
absoluteboolean Whether the path is absolute, defaults to
falsefor a relative path- Source:
-
indent(str, indent) → {string}
-
Indents a block of text.
Parameters:
Name Type Description strstring Text to indent
indentstring | number Whitespace text to use for indentation or the number of whitespaces to use
- Source:
Returns:
Indented text
- Type
- string
-
write(s)
-
Writes some contents to the document (no indentation).
Parameters:
Name Type Description s* Contents to write
- Source:
-
writeln(s)
-
Writes some contents to the document, followed by a new line.
Parameters:
Name Type Description s* Contents to write
- Source: