sourcetrace

0.1.1 • Public • Published

sourcetrace

Generate a "stacktrace" into JavaScript source code, finding the lines that start blocks and statements containing a given source pattern.

Returns an array of arrays of line numbers.

Usage

Source file:

1: function tau() {
2:     return 6.283
3: }
4:
5: function color() {
6:     return "orange"
7: }
var sourcetrace = require( 'sourcetrace' )
 
sourcetrace( '"orange"', source ) => [ [ 5, 6 ] ]

Package Sidebar

Install

npm i sourcetrace

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • jrajav