Code Monkey home page Code Monkey logo

sourcemap-scout's Introduction

SourceMap Scout

Source map as a HTTP service.

Usage

$ git clone https://github.com/aaronjan/sourcemap-scout.git sourcemap-scout
$ cd sourcemap-scout
$ npm install
$ cp .env.example .env
# If you're using PM2:
$ pm2 start
# Else:
$ npm start

Configure

You can tweak SourceMap-Scout by editing the .env file:

PORT

HTTP service port.

IN_MEMORY_SOURCEMAP_LIMIT

Specify how many source map files should be kept in memory. Older files will be automatically removed.

SOURCEMAP_FOLDER

Specify the folder that has all the source map files.

API

Get original source position for a compiled source position.

POST /original-position

Request payload (application/json):

Name Type Required Description
file string yes Source map's file path, relative to the SOURCEMAP_FOLDER folder (default is: sourcemaps/)
line integer yes The line number in the compiled source
column integer yes The column number in the compiled source

Request example:

{
	"file": "example.js.map",
	"line": 2,
	"column": 4
}

Response - Success (statusCode: 200):

{
	"statusCode": 200,
	"data": {
        "source": "../src/example.ts",
        "line": 2,
        "column": 2,
		"name": "key"
	}
}

Data:

Name Type Description
source string or null The original source file, or null if this information is not available.
line integer or null The line number in the original source, or null if this information is not available. The line number is 1-based.
column integer or null The column number in the original source, or null if this information is not available. The column number is 0-based.
name string or null The original identifier, or null if this information is not available.

License

Licensed under the APACHE LISENCE 2.0.

sourcemap-scout's People

Contributors

aaronjan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.