Socket
Socket
Sign inDemoInstall

makeerror

Package Overview
Dependencies
0
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

lib-cov/makeerror.js

6

package.json
{
"name": "makeerror",
"description": "A library to make errors.",
"version": "1.0.0",
"version": "1.0.1",
"author": "Naitik Shah <n@daaku.org>",
"main": "index",
"main": "lib/makeerror",
"repository": {

@@ -11,3 +11,3 @@ "type": "git",

},
"scripts": { "test": "./node_modules/.bin/expresso" },
"scripts": { "test": "./node_modules/.bin/expresso -c" },
"devDependencies": {

@@ -14,0 +14,0 @@ "expresso": ">= 0.8.1"

makeerror
=========
A library to make errors.
A library to make errors. Makes an Error constructor function with the signature:
function(message, data)
You'll typically do something like:
var makeError = require('makeerror')
var UnknownFileTypeError = makeError(
'UnknownFileTypeError',
'The specified type is not known.'
)
var er = UnknownFileTypeError()
`er` will have a prototype chain that ensures:
er instanceof Error
er instanceof UnknownFileTypeError
You can also do `var er = new UnknownFileTypeError()` if you really like the
`new` keyword.
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc