![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Eventm help you to manage all evenements in your code. The library store the state, data returned and the callback stack for you. Can be used like RabbitMQ in your local project.
Eventm help you to manage all evenements in your code. The library store the state, data returned and the callback stack for you.
Can be used like RabbitMQ in your local project.
$ npm install eventm
// -------------- BEHIND
const Eventm = require('eventm');
const mevent = new Eventm();
const myLib = new function()
{
const eventSucessCb = mevent.create('tryEvenSuccessCallback');
this.tryEvenSuccessCallback = (cb) => eventSucessCb.push(cb);
setTimeout(() => mevent.getEvent('tryEvenSuccessCallback').resolve('tryEvenSuccessCallback function executed'), 1000);
this.tryEventMultiParams = (cb) => mevent.create('tryEventMultiParams', { promise: false }).push(cb);
setTimeout(() => mevent.getEvent('tryEventMultiParams').resolve('tryEventMultiParams function executed'), 2000);
this.tryEventKeepSession = (cb) => mevent.create('tryEventKeepSession').push(cb);
setTimeout(() => mevent.getEvent('tryEventKeepSession').resolve('tryEventKeepSession function executed'), 3000);
this.tryEventDontKeepSession = (cb) => mevent.create('tryEventDontKeepSession', { keepSession: false }).push(cb);
setTimeout(() => mevent.getEvent('tryEventDontKeepSession').resolve('tryEventDontKeepSession function executed'), 4000);
this.tryAnEventInReject = () => mevent.create('tryAnEventInReject').getPromise();
setTimeout(() => mevent.getEvent('tryAnEventInReject').reject('tryAnEventInReject function executed'), 7000);
}
// -------------- AHEAD
myLib.tryEvenSuccessCallback(data => {
console.log(data);
myLib.tryEventMultiParams(async (err, data) => {
console.log(err, data);
data = await myLib.tryEventKeepSession();
console.log(data);
data = await myLib.tryEventKeepSession();
console.log(data);
data = await myLib.tryEventDontKeepSession();
console.log(data);
myLib.tryEventDontKeepSession(() => {
console.log('tryEventDontKeepSession 2');
});
await myLib.tryAnEventInReject();
});
});
Name | Description |
---|---|
create(string: name, object: options = {}): Event Level | create method is used to create a new event |
getEvent(string: name): Event Level | getEvent method is used to retrieve event level |
Name | Description |
---|---|
resolve(any: data = undefined): undefined | resolve method is used to set a success response |
resolveForced(any: data = undefined): undefined | resolveForced method is used to set a success response in forced mode (it means: if there are already a statement then this forces the system to recall all callbacks with the new paramter). Obviously it doesn't works for promise. |
reject(any: data = undefined): undefined | reject method is used to set an error response |
push(function: callback): Promise | push method is used to add new callback |
Name | Default | Description |
---|---|---|
keepSession | true | true = If the callback is alreayd executed, keepSession keep the session open for the futur callback |
promise | true | true = The callback is called with a single paramter - false = The callback is call with (err , data ) => {} parameters |
FAQs
Eventm help you to manage all evenements in your code. The library store the state, data returned and the callback stack for you. Can be used like RabbitMQ in your local project.
The npm package eventm receives a total of 2 weekly downloads. As such, eventm popularity was classified as not popular.
We found that eventm 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.