温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/crypto/Hmac/emit
点击访问原文链接

Hmac.emit method | Node.js crypto module | Bun

Hmac.emit method | Node.js crypto module | BunBuildDocsReferenceGuidesBlogDiscord/node:crypto/Hmac/emitMemit

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:crypto/Hmac/emitMemit

method

crypto.Hmac.emitemitE extends keyof DuplexEventMap>(eventName: E,...args: DuplexEventMap[E]): boolean;

Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

Returns true if the event had listeners, false otherwise.

import { EventEmitter } from 'node:events';
const myEmitter = new EventEmitter();

// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});

console.log(myEmitter.listeners('event'));

myEmitter.emit('event', 1, 2, 3, 4, 5);

// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener
emit(eventName: string | symbol,...args: any[]): boolean;

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Hmac.emit method | Node.js crypto module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method node:crypto.Hmac.emit | Bun