
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
safely-try
Advanced tools
safelyTry() is a type-safe elegant try-catch replacement for JavaScript / TypeScript inspired by Go error handling.
npm i --save safely-try
Instead of using ugly native try-catch like this
let result;
try {
result = somethingMightThrowException();
} catch(e) {
handleTheError(e);
}
you can use safelyTry to do something like this
import safelyTry from 'safely-try';
const { data: result, error } = safelyTry(somethingMightThrowException);
if (error) {
handleTheError(error);
return;
}
or you can use safelyTryTuple to do something like this
import { safelyTryTuple as st } from 'safely-try';
const [result, error] = st(somethingMightThrowException);
if (error) {
handleTheError(error);
return;
}
Type inference works with Language Server Protocol (LSP) in your favorite IDE

Two screenshots were taken from Visual Studio Code and combined with Nano Banana Pro
FAQs
An elegant try-catch replacement for JavaScript / TypeScript
The npm package safely-try receives a total of 6,197 weekly downloads. As such, safely-try popularity was classified as popular.
We found that safely-try demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.