Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bugsnag-sourcemaps

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugsnag-sourcemaps

[![Latest version](https://img.shields.io/npm/v/bugsnag-sourcemaps.svg)](https://www.npmjs.com/package/bugsnag-sourcemaps) [![Next version](https://img.shields.io/npm/v/bugsnag-sourcemaps/next.svg)](https://www.npmjs.com/package/bugsnag-sourcemaps) [![Dep

  • 1.0.0-rc.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7K
decreased by-52.9%
Maintainers
1
Weekly downloads
 
Created
Source

bugsnag-sourcemaps

Latest version Next version Dependencies Monthly downloads License

A Node.js module to programmatically upload your sourcemap files to Bugsnag.

Installation

$ npm install --save-dev bugsnag-sourcemaps

Command-line Usage

bugsnag-sourcemaps provides a command-line interface for uploading source maps directly. Run bugsnag-sourcemaps --help for a list of all options.

$ npm run bugsnag-sourcemaps -- --api-key YOUR_API_KEY_HERE \
    --app-version 1.2.3 \
    --minified-url 'http://example.com/assets/example.min.js' \
    --source-map path/to/example.js.map \
    --minified-file path/to/example.min.js \
    --overwrite \
    --upload-sources

Options

-h, --help                 Prints this message
-k, --api-key KEY          Your project API key
-v, --app-version VERSION  The version number of your app
-c, --code-bundle-id ID    The code bundle id (react native only)
-e, --endpoint URL         The URL of the upload server
-m, --minified-url URL     The URL your users will request your bundle
-s, --source-map PATH      The path of the source map file (local)
-p, --minified-file PATH   The path of the bundle (local)
-u, --upload-sources       Upload source files referenced by the source map
-r, --project-root PATH    The root path to remove from absolute file paths
-t, --strip-project-root   Strip the root path from file paths in the source map
-w, --add-wildcard-prefix  Insert a wildcard prefix when stripping root path
-o, --overwrite            Overwite previously uploaded source maps

API Usage

import path from 'path';
import { upload } from 'bugsnag-sourcemaps';

upload({
  apiKey: 'YOUR_API_KEY_HERE',
  appVersion: '1.2.3', // optional
  codeBundleId: '1.0-123', // optional (react-native only)
  minifiedUrl: 'http://example.com/assets/example.min.js', // supports wildcards
  sourceMap: path.resolve(__dirname, 'path/to/example.js.map'),
  minifiedFile: path.resolve(__dirname, 'path/to/example.min.js'), // optional
  overwrite: true, // optional
  sources: {
    'http://example.com/assets/main.js': path.resolve(__dirname, 'path/to/main.js'),
    'http://example.com/assets/utils.js': path.resolve(__dirname, 'path/to/utils.js'),
  },
}, function(err) {
  if (err) {
    throw new Error('Something went wrong! ' + err.message);
  }
  console.log('Sourcemap was uploaded successfully.');
});

Bugsnag Enterprise

If you are using Bugsnag Enterprise (on premise installation) with a custom domain, you can pass an optional endpoint option to define a custom upload url.

Example with endpoint option:

import path from 'path';
import { upload } from 'bugsnag-sourcemaps';

upload({
  // apiKey, appVersion, etc...
  endpoint: 'https://bugsnag.my-company.com',
}, function(err) {
  // ...
});

License

MIT License ❤️

Keywords

FAQs

Package last updated on 18 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc