
Security News
GitHub Actions Supply Chain Attack Puts Thousands of Projects at Risk
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
nanocustomassert
Advanced tools
assert your code + throw custom errors = 🎰
npm i nanocustomassert
const assert = require('nanocustomassert')
// simple assert => AssertionError
assert('a' === 'a', 'should be equal')
// or custom errors => MyError
class MyError extends Error {}
const key1 = 'a1'
const key2 = 'b2'
assert(key1 === key2, MyError)
// or nanoerrors!!!
const nanoerror = require('nanoerror')
const CoolError = nanoerror('COOL_ERR', '🤖COOL ERROR FOUND: %s')
assert(false, CoolError, "Oops 🙈")
const assert = require('nanocustomassert')
assert(expresion: JS expresion, message: string || function constructor, ...params)
Evaluates the expresion, if falsy throws an AssertionError or a custom error. See nanoerror.
string
used as a message for the AssertionError or a function
constructor. This is useful to throw a custom error. OptionalThis module is heavily inspired by nanoassert from Emil Bayes. :clap:
:bug: If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this guideline.
MIT © A GEUT project
FAQs
more than assert
The npm package nanocustomassert receives a total of 1,136 weekly downloads. As such, nanocustomassert popularity was classified as popular.
We found that nanocustomassert 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
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
Research
Security News
A malicious Maven package typosquatting a popular library is secretly stealing OAuth credentials on the 15th of each month, putting Java developers at risk.
Security News
Socket and Seal Security collaborate to fix a critical npm overrides bug, resolving a three-year security issue in the JavaScript ecosystem's most popular package manager.