Socket
Socket
Sign inDemoInstall

hookified

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hookified - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

19

dist/index.js

@@ -49,10 +49,2 @@ // src/eventified.ts

}
} else if (event === "error") {
if (arguments_[0] instanceof Error) {
throw arguments_[0];
} else {
const error = new CustomEventError(arguments_[0]);
error.context = arguments_[0];
throw error;
}
}

@@ -82,13 +74,2 @@ }

};
var CustomEventError = class _CustomEventError extends Error {
context;
constructor(message, context) {
super(message);
this.context = context;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, _CustomEventError);
}
this.name = this.constructor.name;
}
};

@@ -95,0 +76,0 @@ // src/index.ts

6

package.json
{
"name": "hookified",
"version": "1.1.0",
"version": "1.2.0",
"description": "Event and Middleware Hooks",

@@ -29,3 +29,2 @@ "type": "module",

"hooks",
"emittery",
"eventemitter",

@@ -41,3 +40,2 @@ "eventemitter3",

"hook-handlers",
"async-hooks",
"middleware",

@@ -64,3 +62,3 @@ "emit",

"@vitest/coverage-v8": "^2.1.1",
"docula": "^0.9.0",
"docula": "^0.9.1",
"rimraf": "^6.0.1",

@@ -67,0 +65,0 @@ "tsup": "^8.3.0",

<img src="site/logo.svg" alt="Hookified" height="400" align="center">
# Async Event and Middleware Hooks
# Event Emitting and Async Middleware Hooks

@@ -14,3 +14,3 @@ [![tests](https://github.com/jaredwray/hookified/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/hookified/actions/workflows/tests.yaml)

- Async Middleware Hooks for Your Methods
- ESM / CJS and Nodejs 20+
- ESM / CJS with Types and Nodejs 20+
- Maintained on a regular basis!

@@ -24,3 +24,3 @@

## Usage
This was built because we constantly wanted hooks and events extended on libraires we are building such as [Keyv](https://keyv.org) and [Cacheable](https://cacheable.org). This is a simple way to add hooks and events (via [emittery](https://npmjs.com/package/emittery)) to your libraries.
This was built because we constantly wanted hooks and events extended on libraires we are building such as [Keyv](https://keyv.org) and [Cacheable](https://cacheable.org). This is a simple way to add hooks and events to your classes.

@@ -36,3 +36,3 @@ ```javascript

async myMethodEmittingEvent() {
await this.emit('message', 'Hello World'); //using Emittery
this.emit('message', 'Hello World'); //using Emittery
}

@@ -39,0 +39,0 @@

Sorry, the diff of this file is not supported yet

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