Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avow

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avow - npm Package Compare versions

Comparing version 4.0.6 to 5.0.0

24

package.json
{
"name": "avow",
"version": "4.0.6",
"description": "Proxy for assert that accepts custom Errors",
"engines": {
"node": ">=6.4.0"
},
"version": "5.0.0",
"description": "DEPRECATED: Use @invisible/assert",
"main": "index.js",
"scripts": {
"test": "ava test",
"test-watch": "ava -w test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/invisible-tech/avow.git"
"url": "git+https://github.com/invisible-tech/assert.git"
},

@@ -24,12 +17,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/invisible-tech/avow/issues"
"url": "https://github.com/invisible-tech/assert/issues"
},
"homepage": "https://github.com/invisible-tech/avow#readme",
"devDependencies": {
"ava": "^0.22.0",
"eslint": "^3.18.0"
},
"dependencies": {
"parse-function": "^5.0.7"
}
"homepage": "https://github.com/invisible-tech/assert#readme"
}
# avow
Assertion library to allow one to throw custom errors.
Proxy for `assert` that throws Custom Errors.
`avow` uses ES2015 Proxies to intercept calls to `assert`.
All methods of `assert` are available, and it is compatible with both
`Node.js`'s standard assertion library and the one on `npm`.
## Motivation
To allow `assert` to throw custom errors.
## Example
### `assert` encapsulates Custom Errors under an AssertionError, which sucks
```js
const assert = require('assert')
assert(false, Error('yohoo')
{ AssertionError: Error: yohoo
at Object.<anonymous> (/tmp/a/index.js:2:1)
name: 'AssertionError',
actual: false,
expected: true,
operator: '==',
message:
Error: yohoo
at Object.<anonymous> (/tmp/a/index.js:2:15)
generatedMessage: false }
```
_Stack-trace trimmed for readability._
### `avow` throws Custom Errors properly, which is nice
```js
const avow = require('avow')
avow(false, Error('yohoo'))
Error: yohoo
at Object.<anonymous> (/tmp/a/index.js:2:16)
```
_Stack-trace trimmed for readability._
## Installation
Make sure `assert` is installed.
The `npm` library `assert` is not a `dependency` in `package.json` in order to
allow one to use `Node.js`'s standard `assert` library.
## DEPRECATED: Use [@invisible/assert](https://www.npmjs.com/package/@invisible/assert)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc