Adds logs to javascript code
npm install @alu0100953275/espree-loggingPromise.<void>Transpiles the code in inputFile and writes the result in outputFile
stringAdds logging to the code
Adds logging to the code
Promise.<void>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
``js`
transpile('test1.js', 'logged1.js')
stringKind: global function
Returns: string - The code with logging added
| Param | Type | Description |
| --- | --- | --- |
| code | string | The code to add logging to |
Example
`jsEntering f(${x}) at line 1
addLogging('function f(x) { return x + 1; }')
returns 'function f(x) { console.log(); return x + 1; }'`
Kind: global function
| Param | Type | Description |
| --- | --- | --- |
| node | string | The node to add logging to |
Example
`jsEntering f(${x}) at line 1
addBeforeCode('function f(x) { return x + 1; }')
returns 'function f(x) { console.log(); return x + 1; }'``
For more information check this link