0.1.1 • Published 10 years ago

sourcetrace v0.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

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 ] ]