0.9.1 • Published 1 year ago

@alu0100953275/espree-logging v0.9.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

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

ParamTypeDescription
inputFilestringThe file with the original code
outputFilestringThe 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

ParamTypeDescription
codestringThe 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

ParamTypeDescription
nodestringThe 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; }'