0.9.1 • Published 1 year ago
@alu0100953275/espree-logging v0.9.1
Functions
transpile(inputFile, outputFile) ⇒ Promise.<void>
Transpiles the code in inputFile and writes the result in outputFile
Kind: global function
Returns: Promise.<void> - A promise that resolves when the file is written
Param | Type | Description |
---|---|---|
inputFile | string | The file with the original code |
outputFile | string | The file in which to write the output |
Example
transpile('test1.js', 'logged1.js')
addLogging(code) ⇒ string
Adds logging to the code
Kind: global function
Returns: string - The code with logging added
Param | Type | Description |
---|---|---|
code | string | The code to add logging to |
Example
addLogging('function f(x) { return x + 1; }')
returns 'function f(x) { console.log(`Entering f(${x}) at line 1`); return x + 1; }'
addBeforeCode(node)
Adds logging to the code
Kind: global function
Param | Type | Description |
---|---|---|
node | string | The node to add logging to |
Example
addBeforeCode('function f(x) { return x + 1; }')
returns 'function f(x) { console.log(`Entering f(${x}) at line 1`); return x + 1; }'