stack-frame-utils
Utilities for working with stack frames.
Last updated 8 years ago by timer .
MIT · Repository · Original npm · Tarball · package.json
$ gnpm install stack-frame-utils 
SYNC missed versions from official npm registry.

stack-frame-utils

Utilities for working with stack frames.

API

getLinesAround

Parameters

  • line number The line number to provide context around.
  • count number The number of lines you'd like for context.
  • lines (Array<string> | string) The source code.

Returns Array<ScriptLine>

getSourceMap

Returns an instance of SourceMap for a given fileUri and fileContents.

Parameters

  • fileUri string The URI of the source file.
  • fileContents string The contents of the source file.

Returns Promise<SourceMap>

SourceMap

A wrapped instance of a SourceMapConsumer.

This exposes methods which will be indifferent to changes made in source-map.

getOriginalPosition

Returns the original code position for a generated code position.

Parameters

  • line number The line of the generated code position.
  • column number The column of the generated code position.

Returns {source: string, line: number, column: number}

getGeneratedPosition

Returns the generated code position for an original position.

Parameters

  • source string The source file of the original code position.
  • line number The line of the original code position.
  • column number The column of the original code position.

Returns {line: number, column: number}

getSource

Returns the code for a given source file name.

Parameters

  • sourceName string The name of the source file.

Returns string

Current Tags

  • 0.4.0                                ...           latest (8 years ago)

6 Versions

  • 0.4.0                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |