Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/t-ski/source-trace

Reliable source code position tracing.
https://github.com/t-ski/source-trace

source-tracing

Last synced: about 10 hours ago
JSON representation

Reliable source code position tracing.

Awesome Lists containing this project

README

        

# Source Trace

Reliable source code position tracing.

``` cli
npm install t-ski/source-trace
```

### Usage

/app/example.js
``` js
const SourceTrace = require("@t-ski/source-trace");

function example() {
const trace = new SourceTrace();
const filename = require("path").basename(trace.path);

console.log(`Evaluation at ${[
`file: ${filename}`,
`line: ${trace.line}`,
`col: ${trace.column}`,
`scope: ${trace.scope}`
].join("\n)}``;
}
```

#### Output

``` cli
Evaluation at
file: /app/example.js
line: 15
col: 19
scope: example
```

##

© Thassilo Martin Schiepanski