Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@bugsnag/source-maps
Advanced tools
@bugsnag/source-maps is an npm package that helps you upload source maps to Bugsnag, a tool for monitoring and reporting errors in applications. Source maps are used to map minified code back to the original source code, making it easier to debug errors in production environments.
Uploading Browser Source Maps
This feature allows you to upload source maps for browser-based applications. The code sample demonstrates how to upload a source map file along with the minified JavaScript file to Bugsnag.
const { upload } = require('@bugsnag/source-maps');
upload({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
minifiedUrl: 'https://example.com/app.min.js',
sourceMap: 'path/to/app.min.js.map',
minifiedFile: 'path/to/app.min.js',
overwrite: true
}).then(() => {
console.log('Source map uploaded successfully');
}).catch(err => {
console.error('Failed to upload source map', err);
});
Uploading Node.js Source Maps
This feature allows you to upload source maps for Node.js applications. The code sample shows how to upload a source map file along with the corresponding minified JavaScript file to Bugsnag.
const { upload } = require('@bugsnag/source-maps');
upload({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
sourceMap: 'path/to/app.js.map',
minifiedFile: 'path/to/app.js',
minifiedUrl: 'app.js',
overwrite: true
}).then(() => {
console.log('Source map uploaded successfully');
}).catch(err => {
console.error('Failed to upload source map', err);
});
Uploading React Native Source Maps
This feature allows you to upload source maps for React Native applications. The code sample demonstrates how to upload a source map file along with the minified JavaScript bundle for an iOS platform to Bugsnag.
const { upload } = require('@bugsnag/source-maps');
upload({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
platform: 'ios',
sourceMap: 'path/to/main.jsbundle.map',
minifiedFile: 'path/to/main.jsbundle',
minifiedUrl: 'main.jsbundle',
overwrite: true
}).then(() => {
console.log('Source map uploaded successfully');
}).catch(err => {
console.error('Failed to upload source map', err);
});
sentry-cli is a command-line tool for Sentry, another error monitoring and reporting tool. It allows you to upload source maps, manage releases, and perform other Sentry-related tasks. Compared to @bugsnag/source-maps, sentry-cli offers a broader range of functionalities beyond just source map uploads.
airbrake-js is an error monitoring library for Airbrake that includes functionalities for uploading source maps. It is similar to @bugsnag/source-maps in that it helps map minified code back to the original source code, but it is part of a broader library for error tracking.
You can install @bugsnag/source-maps locally to your project:
npm install --save-dev @bugsnag/source-maps
yarn add --dev @bugsnag/source-maps
You can then run the CLI using the convenience tools for each package manager:
npx bugsnag-source-maps [...args]
yarn run bugsnag-source-maps [...args]
Or you can install the bugsnag-source-maps
CLI tool globally on your system:
npm install --global @bugsnag/source-maps
yarn global add @bugsnag/source-maps
@bugsnag/source-maps
requires Node.js v10+
See the Bugsnag docs website for full usage documentation.
bugsnag-source-maps --help
bugsnag-source-maps <command>
Available commands
upload-browser
upload-node
upload-react-native
Options
-h, --help show this message
--version output the version of the CLI module
If you are using Bugsnag On-premise, you should use the endpoint option to set the url of your upload server, for example:
bugsnag-source-maps upload-browser \
--endpoint https://bugsnag.my-company.com/
# ... other options
Most updates to this repo will be made by Bugsnag employees. We are unable to accommodate significant external PRs such as features additions or any large refactoring, however minor fixes are welcome.
This package is free software released under the MIT License. See LICENSE.txt for details.
FAQs
CLI and JS library for uploading source maps to Bugsnag
The npm package @bugsnag/source-maps receives a total of 156,223 weekly downloads. As such, @bugsnag/source-maps popularity was classified as popular.
We found that @bugsnag/source-maps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.