
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@origin-yaropolk/debug-assert
Advanced tools
Small lib that helps your app meet fail-fast and fail-save principles.
import { assert } from 'debug-assert';
assert(myCondition, 'Print this if failed');
You can setup your own fail-fast function:
import { assert, setupFailFast } from 'debug-assert';
setupFailFast((err: Error) => {
console.error(err);
collectSomeData();
process.abort();
});
assert(myCondition, 'Print this if failed');
Change the principle by calling setupMode function:
import { assert, setupMode } from 'debug-assert';
// calls fail-fast function
// it's default behaviour
assert(myCondition, 'Print this if failed');
setupMode('fail-safe');
// throws an exception
assert(myCondition, 'Print this if failed');
setupMode('ignore');
// replaced with noop
assert(myCondition, 'Print this if failed');
There is an assertNotNull alias:
import { assertNotNull } from 'debug-assert';
assertNotNull(null, 'Print this if failed'); // will fail
assertNotNull(undefined, 'Print this if failed'); // not fail
assertNotNull(0, 'Print this if failed'); // not fail
FAQs
Helps your app meet fail-fast/fail-safe principles
We found that @origin-yaropolk/debug-assert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.