
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Inspired by and adapted from the example code in this article by Kent C. Dodds
Since TypeScript 4.4, catch clause variables default to the unknown
type. This library provides a
zero-dependency utility function which allows you to extract the error message in a type-safe manner
when the variable is of type Error
.
Install the package in your project:
# NPM
npm install catch-safe
# Yarn
yarn add catch-safe
# PNPM
pnpm add catch-safe
Import the getErrorMessage
function from the catch-safe
module and use it to get the error
message (if it exists) from a catch block variable :
import { getErrorMessage } from 'catch-safe'
async function someAsyncFunction() {
try {
await runAsyncTask()
} catch (err) {
throw new Error(getErrorMessage(err))
}
}
FAQs
Zero-dependency type-safe error handling utility
The npm package catch-safe receives a total of 2 weekly downloads. As such, catch-safe popularity was classified as not popular.
We found that catch-safe demonstrated a not healthy version release cadence and project activity because the last version was released 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.