@alu0100953275/espree-logging

1.1.1 • Public • Published

Functions

transpile(inputFile, outputFile)Promise.<void>

Transpiles the code in inputFile and writes the result in outputFile

addLogging(code)string

Adds logging to the code

addBeforeCode(node)

Adds logging to the code

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

For more information check this link

Package Sidebar

Install

npm i @alu0100953275/espree-logging

Weekly Downloads

0

Version

1.1.1

License

none

Unpacked Size

5.51 MB

Total Files

76

Last publish

Collaborators

  • alu0100953275