Methods
-
dirname(filename) → {string}
-
Extracts the directory name from a file name.
Parameters:
Name Type Description filename
string File name
Returns:
Directory name, defaults to
.
- 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 s
string String to escape
Returns:
Escaped string
- Type
- string
-
include(filename, absolute)
-
Includes another source file.
Parameters:
Name Type Description filename
string File to include. May be a glob expression on node.js.
absolute
boolean Whether the path is absolute, defaults to
false
for a relative path -
indent(str, indent) → {string}
-
Indents a block of text.
Parameters:
Name Type Description str
string Text to indent
indent
string | number Whitespace text to use for indentation or the number of whitespaces to use
Returns:
Indented text
- Type
- string
-
write(s)
-
Writes some contents to the document (no indentation).
Parameters:
Name Type Description s
* Contents to write
-
writeln(s)
-
Writes some contents to the document, followed by a new line.
Parameters:
Name Type Description s
* Contents to write