diff --git a/.eslintrc b/.eslintrc
index 2e80833bc..ea0d691b4 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,11 +1,6 @@
{
"parser": "@typescript-eslint/parser",
- "plugins": [
- "@typescript-eslint",
- "sonarjs",
- "security",
- "github"
- ],
+ "plugins": ["@typescript-eslint", "sonarjs", "security", "github"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
@@ -14,15 +9,9 @@
"plugin:security/recommended"
],
"rules": {
- "curly": [
- "error",
- "multi-line"
- ],
+ "curly": ["error", "multi-line"],
"@typescript-eslint/no-explicit-any": "off",
- "semi": [
- "warn",
- "never"
- ],
+ "semi": ["warn", "never"],
"sonarjs/cognitive-complexity": "warn"
},
"globals": {
@@ -30,11 +19,7 @@
},
"overrides": [
{
- "files": [
- "*.spec.ts",
- "*.spec.tsx",
- "src/help/command.ts"
- ],
+ "files": ["*.spec.ts", "*.spec.tsx", "src/help/command.ts"],
"rules": {
"no-undef": "off",
"security/detect-non-literal-fs-filename": "off",
@@ -49,4 +34,4 @@
}
}
]
-}
\ No newline at end of file
+}
diff --git a/.github/workflows/automerge-for-humans-merging.yml b/.github/workflows/automerge-for-humans-merging.yml
index 4bce61da2..defbd11af 100644
--- a/.github/workflows/automerge-for-humans-merging.yml
+++ b/.github/workflows/automerge-for-humans-merging.yml
@@ -33,7 +33,7 @@ jobs:
# 5. Removes repeated authors (authors can have more than one commit in the PR).
# 6. Builds the `Co-authored-by: ...` lines with actual info.
# 7. Transforms the array into plain text. Thanks to this, the actual stdout of this step can be used by the next Workflow step (wich is basically the automerge).
- cmd: |
+ cmd: |
curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" "${{github.event.pull_request._links.commits.href}}?per_page=100" |
jq -r '[.[]
| {name: .commit.author.name, email: .commit.author.email, login: .author.login}]
@@ -45,11 +45,11 @@ jobs:
- name: Automerge PR
uses: pascalgn/automerge-action@v0.14.3
env:
- GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
- MERGE_LABELS: "!do-not-merge,ready-to-merge"
- MERGE_METHOD: "squash"
+ GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}'
+ MERGE_LABELS: '!do-not-merge,ready-to-merge'
+ MERGE_METHOD: 'squash'
# Using the output of the previous step (`Co-authored-by: ...` lines) as commit description.
# Important to keep 2 empty lines as https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line mentions
- MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ steps.authors.outputs.value }}"
- MERGE_RETRIES: "20"
- MERGE_RETRY_SLEEP: "30000"
+ MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ steps.authors.outputs.value }}"
+ MERGE_RETRIES: '20'
+ MERGE_RETRY_SLEEP: '30000'
diff --git a/.github/workflows/automerge-orphans.yml b/.github/workflows/automerge-orphans.yml
index 20322ecb7..db8416e00 100644
--- a/.github/workflows/automerge-orphans.yml
+++ b/.github/workflows/automerge-orphans.yml
@@ -5,7 +5,7 @@ name: 'Notify on failing automerge'
on:
schedule:
- - cron: "0 0 * * *"
+ - cron: '0 0 * * *'
jobs:
identify-orphans:
@@ -53,7 +53,7 @@ jobs:
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: issuemarkdown
with:
- text: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
+ text: '-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})'
- if: steps.orphans.outputs.found == 'true'
name: Send info about orphan to slack
uses: rtCamp/action-slack-notify@v2
@@ -61,4 +61,4 @@ jobs:
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
SLACK_TITLE: π¨ Not merged PR that should be automerged π¨
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
- MSG_MINIMAL: true
\ No newline at end of file
+ MSG_MINIMAL: true
diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml
index 052a19c32..35cc1fbd6 100644
--- a/.github/workflows/automerge.yml
+++ b/.github/workflows/automerge.yml
@@ -21,7 +21,7 @@ jobs:
- name: Autoapproving
uses: hmarr/auto-approve-action@v2
with:
- github-token: "${{ secrets.GH_TOKEN_BOT_EVE }}"
+ github-token: '${{ secrets.GH_TOKEN_BOT_EVE }}'
- name: Label autoapproved
uses: actions/github-script@v5
@@ -43,10 +43,10 @@ jobs:
- name: Automerging
uses: pascalgn/automerge-action@v0.13.0
env:
- GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
+ GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}'
GITHUB_LOGIN: asyncapi-bot
- MERGE_LABELS: ""
- MERGE_METHOD: "squash"
- MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
- MERGE_RETRIES: "20"
- MERGE_RETRY_SLEEP: "30000"
+ MERGE_LABELS: ''
+ MERGE_METHOD: 'squash'
+ MERGE_COMMIT_MESSAGE: '{pullRequest.title} (#{pullRequest.number})'
+ MERGE_RETRIES: '20'
+ MERGE_RETRY_SLEEP: '30000'
diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml
index ad8e0198f..dc39e6b92 100644
--- a/.github/workflows/autoupdate.yml
+++ b/.github/workflows/autoupdate.yml
@@ -1,34 +1,34 @@
-# This action is centrally managed in https://github.com/asyncapi/.github/
-# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
-
-# This workflow is designed to work with:
-# - autoapprove and automerge workflows for dependabot and asyncapibot.
-# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against
-
-# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch.
-# Autoupdating to latest destination branch works only in the context of upstream repo and not forks
-
-name: autoupdate
-
-on:
- push:
- branches-ignore:
- - 'version-bump/**'
- - 'dependabot/**'
- - 'bot/**'
- - 'all-contributors/**'
-
-jobs:
- autoupdate-for-bot:
- if: startsWith(github.repository, 'asyncapi/')
- name: Autoupdate autoapproved PR created in the upstream
- runs-on: ubuntu-latest
- steps:
- - name: Autoupdating
- uses: docker://chinthakagodawita/autoupdate-action:v1
- env:
- GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}'
- PR_FILTER: "labelled"
- PR_LABELS: "autoupdate"
- PR_READY_STATE: "ready_for_review"
- MERGE_CONFLICT_ACTION: "ignore"
+# This action is centrally managed in https://github.com/asyncapi/.github/
+# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
+
+# This workflow is designed to work with:
+# - autoapprove and automerge workflows for dependabot and asyncapibot.
+# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against
+
+# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch.
+# Autoupdating to latest destination branch works only in the context of upstream repo and not forks
+
+name: autoupdate
+
+on:
+ push:
+ branches-ignore:
+ - 'version-bump/**'
+ - 'dependabot/**'
+ - 'bot/**'
+ - 'all-contributors/**'
+
+jobs:
+ autoupdate-for-bot:
+ if: startsWith(github.repository, 'asyncapi/')
+ name: Autoupdate autoapproved PR created in the upstream
+ runs-on: ubuntu-latest
+ steps:
+ - name: Autoupdating
+ uses: docker://chinthakagodawita/autoupdate-action:v1
+ env:
+ GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}'
+ PR_FILTER: 'labelled'
+ PR_LABELS: 'autoupdate'
+ PR_READY_STATE: 'ready_for_review'
+ MERGE_CONFLICT_ACTION: 'ignore'
diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml
index 68daa7c0c..ca160d138 100644
--- a/.github/workflows/bump.yml
+++ b/.github/workflows/bump.yml
@@ -1,7 +1,7 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
-# Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only.
+# Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only.
# It runs in a repo after merge of release commit and searches for other packages that use released package. Every found package gets updated with lates version
name: Bump package version in dependent repos - if Node project
diff --git a/.github/workflows/coverall.yml b/.github/workflows/coverall.yml
index 1f7e18168..698abb4eb 100644
--- a/.github/workflows/coverall.yml
+++ b/.github/workflows/coverall.yml
@@ -1,25 +1,25 @@
-on:
+on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
-name: Check test coverage
+name: Check test coverage
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: Setup Node.js
- uses: actions/setup-node@v1
- with:
- node-version: 14
- - name: npm install, run test
- run: |
- npm install
- npm run test
- - name: Coveralls
- uses: coverallsapp/github-action@master
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
+ - uses: actions/checkout@v2
+ - name: Setup Node.js
+ uses: actions/setup-node@v1
+ with:
+ node-version: 14
+ - name: npm install, run test
+ run: |
+ npm install
+ npm run test
+ - name: Coveralls
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml
index 03f891eba..872a01290 100644
--- a/.github/workflows/help-command.yml
+++ b/.github/workflows/help-command.yml
@@ -3,10 +3,10 @@
name: Create help comment
-on:
- issue_comment:
- types:
- - created
+on:
+ issue_comment:
+ types:
+ - created
jobs:
create_help_comment_pr:
diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml
index e9c2e3e21..e393238c0 100644
--- a/.github/workflows/if-nodejs-pr-testing.yml
+++ b/.github/workflows/if-nodejs-pr-testing.yml
@@ -37,15 +37,15 @@ jobs:
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- - if: steps.should_run.outputs.shouldrun == 'true'
+ - if: steps.should_run.outputs.shouldrun == 'true'
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- - if: steps.should_run.outputs.shouldrun == 'true'
+ - if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- - if: steps.should_run.outputs.shouldrun == 'true'
+ - if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
@@ -64,7 +64,7 @@ jobs:
continue-on-error: true
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
name: Clear NPM cache and install deps again
- run: |
+ run: |
npm cache clean --force
npm install --loglevel verbose
- if: steps.packagejson.outputs.exists == 'true'
diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml
index b1a516935..8c686f9ff 100644
--- a/.github/workflows/if-nodejs-release.yml
+++ b/.github/workflows/if-nodejs-release.yml
@@ -17,7 +17,6 @@ on:
- alpha
jobs:
-
test-nodejs:
# We just check the message of first commit as there is always just one commit because we squash into one before merging
# "commits" contains array of objects where one of the properties is commit "message"
@@ -113,4 +112,4 @@ jobs:
fields: repo,action,workflow
text: 'Release workflow failed in release job'
env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
\ No newline at end of file
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml
index fbf682249..88fcb4354 100644
--- a/.github/workflows/if-nodejs-version-bump.yml
+++ b/.github/workflows/if-nodejs-version-bump.yml
@@ -4,9 +4,9 @@
# It does magic only if there is package.json file in the root of the project
name: Version bump - if Node.js project
-on:
+on:
release:
- types:
+ types:
- published
jobs:
@@ -37,7 +37,7 @@ jobs:
- if: steps.packagejson.outputs.exists == 'true'
name: Assets generation
run: npm run generate:assets --if-present
- - if: steps.packagejson.outputs.exists == 'true'
+ - if: steps.packagejson.outputs.exists == 'true'
name: Bump version in package.json
# There is no need to substract "v" from the tag as version script handles it
# When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow
@@ -62,4 +62,4 @@ jobs:
fields: repo,action,workflow
text: 'Unable to bump the version in package.json after the release'
env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
\ No newline at end of file
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml
index b2f3ba76d..65d0bdfdc 100644
--- a/.github/workflows/release-announcements.yml
+++ b/.github/workflows/release-announcements.yml
@@ -3,13 +3,12 @@
name: 'Announce releases in different channels'
-on:
+on:
release:
- types:
+ types:
- published
jobs:
-
slack-announce:
name: Slack - notify on every release
runs-on: ubuntu-latest
@@ -18,14 +17,14 @@ jobs:
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: markdown
with:
- text: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}"
+ text: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}"
- name: Send info about release to Slack
uses: rtCamp/action-slack-notify@v2
env:
- SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }}
- SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild π±πͺπΎπ
- SLACK_MESSAGE: ${{steps.markdown.outputs.text}}
- MSG_MINIMAL: true
+ SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }}
+ SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild π±πͺπΎπ
+ SLACK_MESSAGE: ${{steps.markdown.outputs.text}}
+ MSG_MINIMAL: true
twitter-announce:
name: Twitter - notify on minor and major releases
@@ -71,7 +70,7 @@ jobs:
uses: m1ner79/Github-Twittction@v1.0.1
with:
twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild π±πͺπΎπ\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}"
- twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
- twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
- twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
- twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
\ No newline at end of file
+ twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
+ twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
+ twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
+ twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
diff --git a/.github/workflows/scripts/README.md b/.github/workflows/scripts/README.md
index ba97dca07..b63e88201 100644
--- a/.github/workflows/scripts/README.md
+++ b/.github/workflows/scripts/README.md
@@ -1 +1 @@
-The entire `scripts` directory is centrally managed in [.github](https://github.com/asyncapi/.github/) repository. Any changes in this folder should be done in central repository.
\ No newline at end of file
+The entire `scripts` directory is centrally managed in [.github](https://github.com/asyncapi/.github/) repository. Any changes in this folder should be done in central repository.
diff --git a/.github/workflows/scripts/mailchimp/htmlContent.js b/.github/workflows/scripts/mailchimp/htmlContent.js
index d132c72f1..09f3ffffb 100644
--- a/.github/workflows/scripts/mailchimp/htmlContent.js
+++ b/.github/workflows/scripts/mailchimp/htmlContent.js
@@ -3,8 +3,7 @@
* Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
*/
module.exports = (link, title) => {
-
- return `
+ return `
@@ -386,7 +385,7 @@ There is a new topic at AsyncAPI Initiative that requires Technical Steering Com
Please have a look if it is just something you need to be aware of, or maybe your vote is needed.
-Topic: ${ title }.
+Topic: ${title}.
@@ -492,4 +491,4 @@ You can Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
- const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
- if (!issueMessage && !prMessage) {
- throw new Error('Action must have at least one of issue-message or pr-message set');
- }
- const isIssue = !!context.payload.issue;
- let isFirstContribution;
- if (isIssue) {
- const query = `query($owner:String!, $name:String!, $contributer:String!) {
- repository(owner:$owner, name:$name){
- issues(first: 1, filterBy: {createdBy:$contributer}){
- totalCount
+ - uses: actions/github-script@v3
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/git-workflow.md) useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
+ const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
+ if (!issueMessage && !prMessage) {
+ throw new Error('Action must have at least one of issue-message or pr-message set');
+ }
+ const isIssue = !!context.payload.issue;
+ let isFirstContribution;
+ if (isIssue) {
+ const query = `query($owner:String!, $name:String!, $contributer:String!) {
+ repository(owner:$owner, name:$name){
+ issues(first: 1, filterBy: {createdBy:$contributer}){
+ totalCount
+ }
}
- }
- }`;
- const variables = {
- owner: context.repo.owner,
- name: context.repo.repo,
- contributer: context.payload.sender.login
- };
- const { repository: { issues: { totalCount } } } = await github.graphql(query, variables);
- isFirstContribution = totalCount === 1;
- } else {
- const query = `query($qstr: String!) {
- search(query: $qstr, type: ISSUE, first: 1) {
- issueCount
- }
}`;
- const variables = {
- "qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`,
- };
- const { search: { issueCount } } = await github.graphql(query, variables);
- isFirstContribution = issueCount === 1;
- }
-
- if (!isFirstContribution) {
- console.log(`Not the users first contribution.`);
- return;
- }
- const message = isIssue ? issueMessage : prMessage;
- // Add a comment to the appropriate place
- if (isIssue) {
- const issueNumber = context.payload.issue.number;
- console.log(`Adding message: ${message} to issue #${issueNumber}`);
- await github.issues.createComment({
- owner: context.payload.repository.owner.login,
- repo: context.payload.repository.name,
- issue_number: issueNumber,
- body: message
- });
- }
- else {
- const pullNumber = context.payload.pull_request.number;
- console.log(`Adding message: ${message} to pull request #${pullNumber}`);
- await github.pulls.createReview({
- owner: context.payload.repository.owner.login,
- repo: context.payload.repository.name,
- pull_number: pullNumber,
- body: message,
- event: 'COMMENT'
- });
- }
+ const variables = {
+ owner: context.repo.owner,
+ name: context.repo.repo,
+ contributer: context.payload.sender.login
+ };
+ const { repository: { issues: { totalCount } } } = await github.graphql(query, variables);
+ isFirstContribution = totalCount === 1;
+ } else {
+ const query = `query($qstr: String!) {
+ search(query: $qstr, type: ISSUE, first: 1) {
+ issueCount
+ }
+ }`;
+ const variables = {
+ "qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`,
+ };
+ const { search: { issueCount } } = await github.graphql(query, variables);
+ isFirstContribution = issueCount === 1;
+ }
+
+ if (!isFirstContribution) {
+ console.log(`Not the users first contribution.`);
+ return;
+ }
+ const message = isIssue ? issueMessage : prMessage;
+ // Add a comment to the appropriate place
+ if (isIssue) {
+ const issueNumber = context.payload.issue.number;
+ console.log(`Adding message: ${message} to issue #${issueNumber}`);
+ await github.issues.createComment({
+ owner: context.payload.repository.owner.login,
+ repo: context.payload.repository.name,
+ issue_number: issueNumber,
+ body: message
+ });
+ }
+ else {
+ const pullNumber = context.payload.pull_request.number;
+ console.log(`Adding message: ${message} to pull request #${pullNumber}`);
+ await github.pulls.createReview({
+ owner: context.payload.repository.owner.login,
+ repo: context.payload.repository.name,
+ pull_number: pullNumber,
+ body: message,
+ event: 'COMMENT'
+ });
+ }
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 000000000..ffda45a0a
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,20 @@
+{
+ "printWidth": 120,
+ "tabWidth": 2,
+ "useTabs": false,
+ "semi": false,
+ "singleQuote": true,
+ "jsxSingleQuote": false,
+ "trailingComma": "all",
+ "bracketSpacing": true,
+ "arrowParens": "always",
+ "endOfLine": "lf",
+ "overrides": [
+ {
+ "files": "*.json",
+ "options": {
+ "parser": "json"
+ }
+ }
+ ]
+}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1334921c2..ed3008e59 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,5 @@
# Contributing to AsyncAPI
+
We love your input! We want to make contributing to this project as easy and transparent as possible.
## Contribution recogniton
@@ -37,12 +38,15 @@ The following is a summary of the ideal contribution flow. Please, note that Pul
```
## Code of Conduct
+
AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected.
## Our Development Process
+
We use Github to host code, to track issues and feature requests, as well as accept pull requests.
## Issues
+
[Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster!
## Bug Reports and Feature Requests
@@ -73,7 +77,9 @@ Prefix that follows specification is not enough though. Remember that the title
Happy contributing :heart:
## License
+
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern.
## References
-This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).
\ No newline at end of file
+
+This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).
diff --git a/README.md b/README.md
index 8c90ab7c4..88ef0f570 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,9 @@
![Glee β The AsyncAPI framework that will make you smile again.](assets/readme-banner.png)
+
+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
+
[![Coverage Status](https://coveralls.io/repos/github/asyncapi/glee/badge.svg?branch=master)](https://coveralls.io/github/asyncapi/glee?branch=master)
@@ -13,8 +16,8 @@
Glee is a spec-first framework that helps you build server-side applications. It leverages the AsyncAPI specification to make you more productive:
-* It makes sure your code and AsyncAPI definition are on par. No more outdated documentation. Glee takes care of it for you, automatically.
-* Glee lets you focus on what matters and handles the rest for you. You only write the code for your business use-case. Glee takes care of performance, scalability, resilience, and everything you need to make your application production-ready.
+- It makes sure your code and AsyncAPI definition are on par. No more outdated documentation. Glee takes care of it for you, automatically.
+- Glee lets you focus on what matters and handles the rest for you. You only write the code for your business use-case. Glee takes care of performance, scalability, resilience, and everything you need to make your application production-ready.
## Setup
@@ -30,9 +33,9 @@ For more information on how to use `create-glee-app`, you can review [the `creat
## Getting started
-* :file_folder: [Application structure](docs/app-structure.md): know how to structure your application with Glee.
-* :gear: [Configuring your application](docs/config-file.md): tweak Glee's default configuration.
-* :rocket: [Examples](./examples): see Glee in action.
+- :file_folder: [Application structure](docs/app-structure.md): know how to structure your application with Glee.
+- :gear: [Configuring your application](docs/config-file.md): tweak Glee's default configuration.
+- :rocket: [Examples](./examples): see Glee in action.
## Generating documentation
@@ -44,6 +47,7 @@ glee docs
```
You can also tweak Glee's default configuration for generating documentation here [Configuring your application](docs/config-file.md)
+
## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -62,4 +66,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
-This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
\ No newline at end of file
+This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
diff --git a/docs/app-structure.md b/docs/app-structure.md
index eeb54e5db..a4e59c189 100644
--- a/docs/app-structure.md
+++ b/docs/app-structure.md
@@ -15,12 +15,11 @@ Glee expects your project to have some files and folders with special names. The
ββ package.json (required)
```
-|File/Directory|Description|
-|---|---|
-|functions|**Required.** This directory contains all the functions that Glee must execute when it receives a message from the server. Each file must export a default async function. [Read more about the functions signature](./functions.md).
-|lifecycle|This directory contains application lifecycle functions. These functions will be executed when certain events happen in the application. E.g., `onConnect`, `onServerReady`, `onDisconnect`, etc. [Read the full list of lifecycle events](./lifecycle-events.md).
-|.env|The environment variables of your application. Read more about the Glee [environment variables](./env-vars.md). **DO NOT PUT SECRETS HERE**.
-|asyncapi.(yaml | json | yml)|**Required.** The [AsyncAPI](https://www.asyncapi.com/docs/specifications/latest) file defining your API. Make sure all the `publish` operations have an assigned `operationId` that matches a file name (excluding the extension) in the `functions` directory.
-|glee.config.js|The Glee configuration file. [Read more about how to use this file](./config-file.md).
-|package.json|**Required.** The Node.js package definition file. Make sure you include `@asyncapi/glee` as a dependency and add two scripts: `dev` and `start`. They should be running `glee dev` and `glee start` respectively.
-
+| File/Directory | Description |
+| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| functions | **Required.** This directory contains all the functions that Glee must execute when it receives a message from the server. Each file must export a default async function. [Read more about the functions signature](./functions.md). |
+| lifecycle | This directory contains application lifecycle functions. These functions will be executed when certain events happen in the application. E.g., `onConnect`, `onServerReady`, `onDisconnect`, etc. [Read the full list of lifecycle events](./lifecycle-events.md). |
+| .env | The environment variables of your application. Read more about the Glee [environment variables](./env-vars.md). **DO NOT PUT SECRETS HERE**. |
+| asyncapi.(yaml | json | yml) | **Required.** The [AsyncAPI](https://www.asyncapi.com/docs/specifications/latest) file defining your API. Make sure all the `publish` operations have an assigned `operationId` that matches a file name (excluding the extension) in the `functions` directory. |
+| glee.config.js | The Glee configuration file. [Read more about how to use this file](./config-file.md). |
+| package.json | **Required.** The Node.js package definition file. Make sure you include `@asyncapi/glee` as a dependency and add two scripts: `dev` and `start`. They should be running `glee dev` and `glee start` respectively. |
diff --git a/docs/config-file.md b/docs/config-file.md
index 1e56e8abd..52e660f76 100644
--- a/docs/config-file.md
+++ b/docs/config-file.md
@@ -21,10 +21,9 @@ export default async function () {
kafka: {},
websocket: {},
mqtt: {},
- cluster: {}
+ cluster: {},
}
}
-
```
Here is an example of a `glee.config.js` file for reference:
@@ -80,69 +79,67 @@ Inside the return statement, you can specify the following options:
These configurations apply to Glee itself, rather than any specific protocol.
-|Field|Default|Description|
-|--|--|--|
-|glee.gleeDir|`.glee`|Sets the Glee directory. Your sources will be compiled here.|
-|glee.lifecycleDir|`lifecycle`|Path to the directory that stores your [lifecycle events](./lifecycle-events.md).|
-|glee.functionsDir|`functions`| Path to the directory that stores your [functions](./functions.md).|
-|glee.asyncapiFilePath|`asyncapi.(yaml \| yml \| json)`| Path to your AsyncAPI file. |
+| Field | Default | Description |
+| --------------------- | -------------------------------- | --------------------------------------------------------------------------------- |
+| glee.gleeDir | `.glee` | Sets the Glee directory. Your sources will be compiled here. |
+| glee.lifecycleDir | `lifecycle` | Path to the directory that stores your [lifecycle events](./lifecycle-events.md). |
+| glee.functionsDir | `functions` | Path to the directory that stores your [functions](./functions.md). |
+| glee.asyncapiFilePath | `asyncapi.(yaml \| yml \| json)` | Path to your AsyncAPI file. |
### Generating Documentation
-|Field|Description|
-|--|--|
-|docs.enabled|This flag enables/disables the docs generation functionality.
-|docs.folder|The dedicated folder you want your generated docs to reside.
-|docs.template|The AsyncAPI template you wanna use for generating your documentation.
+| Field | Description |
+| ------------- | ---------------------------------------------------------------------- |
+| docs.enabled | This flag enables/disables the docs generation functionality. |
+| docs.folder | The dedicated folder you want your generated docs to reside. |
+| docs.template | The AsyncAPI template you wanna use for generating your documentation. |
### Websocket Server
-|Field|Description|
-|--|--|
-|ws.server|Websocket server-specific configurations|
-|ws.client|Websocket client-specific configurations|
-|ws.server.adapter| The Glee adapter to use for the WebSocket server. Defaults to a "native" WebSocket implementation. Other allowed values are `socket.io` (to use the [Socket.IO](https://socket.io/) Glee adapter) or a reference to a custom adapter.|
-|ws.server.httpServer| A custom HTTP server of your own. E.g., an [Express](https://expressjs.com/en/4x/api.html) server or any object that implements the [http.Server](https://nodejs.org/api/http.html#http_class_http_server) interface. |
-|ws.server.port| The port to use when binding the WebSocket server. This is useful when your server is behind a proxy and the port exposed for consumption is not the same as the port your application should be bound to. Defaults to the port specified in the selected AsyncAPI server.|
-|ws.client.auth| Authentication variables for client|
-|ws.client.auth.token| HTTP Authentication header|
+| Field | Description |
+| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| ws.server | Websocket server-specific configurations |
+| ws.client | Websocket client-specific configurations |
+| ws.server.adapter | The Glee adapter to use for the WebSocket server. Defaults to a "native" WebSocket implementation. Other allowed values are `socket.io` (to use the [Socket.IO](https://socket.io/) Glee adapter) or a reference to a custom adapter. |
+| ws.server.httpServer | A custom HTTP server of your own. E.g., an [Express](https://expressjs.com/en/4x/api.html) server or any object that implements the [http.Server](https://nodejs.org/api/http.html#http_class_http_server) interface. |
+| ws.server.port | The port to use when binding the WebSocket server. This is useful when your server is behind a proxy and the port exposed for consumption is not the same as the port your application should be bound to. Defaults to the port specified in the selected AsyncAPI server. |
+| ws.client.auth | Authentication variables for client |
+| ws.client.auth.token | HTTP Authentication header |
### Cluster
-|Field|Description|
-|--|--|
-|cluster.adapter| The Glee cluster adapter to use for communication between instances. Defaults to Redis Pub/Sub ("redis"). Can be a reference to a custom adapter.|
-|cluster.name|The name of the cluster. Defaults to "cluster".|
-|cluster.url|The url of the server to be used by the adapter. In case of "redis" adapter, it's the url of the Redis server.|
+| Field | Description |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
+| cluster.adapter | The Glee cluster adapter to use for communication between instances. Defaults to Redis Pub/Sub ("redis"). Can be a reference to a custom adapter. |
+| cluster.name | The name of the cluster. Defaults to "cluster". |
+| cluster.url | The url of the server to be used by the adapter. In case of "redis" adapter, it's the url of the Redis server. |
### MQTT
-|Field|Description|
-|---|---|
-|mqtt.auth| MQTT authentication configuration|
-|mqtt.auth.cert| Client certificate
-|mqtt.auth.clientId| MQTT client Id for authentication
-|mqtt.auth.username| username parameter
-|mqtt.auth.password| password parameter
+| Field | Description |
+| ------------------ | --------------------------------- |
+| mqtt.auth | MQTT authentication configuration |
+| mqtt.auth.cert | Client certificate |
+| mqtt.auth.clientId | MQTT client Id for authentication |
+| mqtt.auth.username | username parameter |
+| mqtt.auth.password | password parameter |
### Kafka
-|Field|Description|
-|---|---|
-|kafka.auth| Kafka authentication configuration|
-|kafka.auth.key | Kafka Broker Key
-|kafka.auth.cert| Client certificate
-|kafka.auth.clientId| Kafka client Id for authentication
-|kafka.auth.rejectUnauthorized | Boolean flag for accepting the valid SSL certificates
-|kafka.auth.username| The username to use during authentication.
-|kafka.auth.password| The password to use during authentication.
-
+| Field | Description |
+| ----------------------------- | ----------------------------------------------------- |
+| kafka.auth | Kafka authentication configuration |
+| kafka.auth.key | Kafka Broker Key |
+| kafka.auth.cert | Client certificate |
+| kafka.auth.clientId | Kafka client Id for authentication |
+| kafka.auth.rejectUnauthorized | Boolean flag for accepting the valid SSL certificates |
+| kafka.auth.username | The username to use during authentication. |
+| kafka.auth.password | The password to use during authentication. |
### Auth Config
Most clients like `ws`,`kafka`, and `mqtt` have auth fields that are used for passing auth parameters. All these configurations can be an object or a function that returns the specific object defined by each protocol.
-
```js
export default async function() {
ws: {
diff --git a/docs/env-vars.md b/docs/env-vars.md
index 590d9e5fa..d62724da8 100644
--- a/docs/env-vars.md
+++ b/docs/env-vars.md
@@ -2,8 +2,8 @@
Glee provides a few environment variables for you to customize the experience:
-|Variable|Description|Example|
-|---|---|---|
-|GLEE_SERVER_NAMES|A comma-separated list of the servers to load on startup.|`GLEE_SERVER_NAMES=websockets,mosquitto`
-|GLEE_SERVER_CERTS|A comma-separated list of `${serverName}:${pathToCertificateFile}`. These are the certificates to use when establishing the connection to the given server.|`GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt`
-|GLEE_SERVER_VARIABLES|A comma-separated list of `${serverName}:${serverVariable}:${value}`. These are the values to use for each server variable.|`GLEE_SERVER_VARIABLES=websockets:namespace:public`
+| Variable | Description | Example |
+| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
+| GLEE_SERVER_NAMES | A comma-separated list of the servers to load on startup. | `GLEE_SERVER_NAMES=websockets,mosquitto` |
+| GLEE_SERVER_CERTS | A comma-separated list of `${serverName}:${pathToCertificateFile}`. These are the certificates to use when establishing the connection to the given server. | `GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt` |
+| GLEE_SERVER_VARIABLES | A comma-separated list of `${serverName}:${serverVariable}:${value}`. These are the values to use for each server variable. | `GLEE_SERVER_VARIABLES=websockets:namespace:public` |
diff --git a/docs/functions.md b/docs/functions.md
index 69b86dd23..6ab09f23e 100644
--- a/docs/functions.md
+++ b/docs/functions.md
@@ -12,12 +12,12 @@ export default async function (event) {
Functions take a single argument, which is the event received from a broker or a client, depending which kind of API you're building. The `event` argument has the following shape:
-|Attribute|Description|
-|----|----|
-|payload|The payload/body of the received event.
-|headers|The headers/metadata of the received event.
-|channel|The name of the channel/topic from which the event was read.
-|serverName|The name of the server/broker from which the event was received.
+| Attribute | Description |
+| ---------- | ---------------------------------------------------------------- |
+| payload | The payload/body of the received event. |
+| headers | The headers/metadata of the received event. |
+| channel | The name of the channel/topic from which the event was read. |
+| serverName | The name of the server/broker from which the event was received. |
Functions may return an object to tell Glee what to do next. For instance, the following example greets the user back:
@@ -26,27 +26,28 @@ Functions may return an object to tell Glee what to do next. For instance, the f
export default async function (event) {
return {
- reply: [{
- payload: 'Greetings! How is your day going?'
- }]
+ reply: [
+ {
+ payload: 'Greetings! How is your day going?',
+ },
+ ],
}
}
```
-|Attribute|Type|Description|
-|---|---|---|
-|send|array<[OutboundMessage](#anatomy-of-an-outbound-message)>|A list of outbound messages to send when the processing of the inbound event has finished. All clients subscribed to the given channel/topic will receive the message.
-|reply|array<[OutboundMessage](#anatomy-of-an-outbound-message)>|A list of outbound messages to send as a reply when the processing of the inbound event has finished. This is useful when the target of your message is the sender of the inbound event. Note, however, that this only works when you're running Glee as a server. For example, using `reply` when receiving a WebSocket message is fine and the reply will exclusively go to the client that sent the message. However, if you're receiving a message from an MQTT broker, `reply` will work exactly the same way as `send` above, and will send the message to all the clients subscribed to the given channel/topic.
-
+| Attribute | Type | Description |
+| --------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| send | array<[OutboundMessage](#anatomy-of-an-outbound-message)> | A list of outbound messages to send when the processing of the inbound event has finished. All clients subscribed to the given channel/topic will receive the message. |
+| reply | array<[OutboundMessage](#anatomy-of-an-outbound-message)> | A list of outbound messages to send as a reply when the processing of the inbound event has finished. This is useful when the target of your message is the sender of the inbound event. Note, however, that this only works when you're running Glee as a server. For example, using `reply` when receiving a WebSocket message is fine and the reply will exclusively go to the client that sent the message. However, if you're receiving a message from an MQTT broker, `reply` will work exactly the same way as `send` above, and will send the message to all the clients subscribed to the given channel/topic. |
##### Anatomy of an outbound message
-|Attribute|Type|Description|
-|---|---|---|
-|payload|string|The payload/body of the message you want to send.
-|headers|object<string,string>|The headers/metadata of the message you want to send.
-|channel|string|The channel/topic you want to send the message to. Defaults to `event.channel`, i.e., the same channel as the received event.
-|server|string|The server/broker you want to send the message to. Defaults to `event.serverName`, i.e., the same server as the received event.
+| Attribute | Type | Description |
+| --------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
+| payload | string | The payload/body of the message you want to send. |
+| headers | object<string,string> | The headers/metadata of the message you want to send. |
+| channel | string | The channel/topic you want to send the message to. Defaults to `event.channel`, i.e., the same channel as the received event. |
+| server | string | The server/broker you want to send the message to. Defaults to `event.serverName`, i.e., the same server as the received event. |
## How does Glee know which function it should execute?
@@ -61,4 +62,4 @@ channels:
...
```
-Glee maps the `onHello` operation to the `functions/onHello.js` file.
\ No newline at end of file
+Glee maps the `onHello` operation to the `functions/onHello.js` file.
diff --git a/docs/lifecycle-events.md b/docs/lifecycle-events.md
index 2192bb8e3..7ce01976e 100644
--- a/docs/lifecycle-events.md
+++ b/docs/lifecycle-events.md
@@ -5,12 +5,7 @@ Glee lets you bind incoming messages to [functions](./functions.md). However, so
To subscribe to a lifecycle event, create a file under the `lifecycle` directory. It must have the following shape:
```js
-export default async function ({
- glee,
- serverName,
- server,
- connection,
-}) {
+export default async function ({ glee, serverName, server, connection }) {
// Your business logic here...
}
@@ -21,23 +16,23 @@ Each file in the `lifecycle` directory must export a default async function and
## List of events
-|Event|Description|
-|---|---|
-|onConnect|A connection with a broker has been established.
-|onReconnect|Glee reconnected to a broker.
-|onDisconnect|A connection with a broker has been closed.
-|onServerReady|Your Glee server is now ready to accept connections.
-|onServerConnectionOpen|A client has opened a connection with your Glee server.
-|onServerConnectionClose|A client has closed the connection with your Glee server.
+| Event | Description |
+| ----------------------- | --------------------------------------------------------- |
+| onConnect | A connection with a broker has been established. |
+| onReconnect | Glee reconnected to a broker. |
+| onDisconnect | A connection with a broker has been closed. |
+| onServerReady | Your Glee server is now ready to accept connections. |
+| onServerConnectionOpen | A client has opened a connection with your Glee server. |
+| onServerConnectionClose | A client has closed the connection with your Glee server. |
All of them take a single argument which contains information about the event:
-|Attribute|Description
-|---|---|
-|glee|A reference to the Glee app.
-|serverName|The name of the server where the event happened.
-|server|The AsyncAPI definition of the server where the event happened.
-|connection|The connection where the event happened.
+| Attribute | Description |
+| ---------- | --------------------------------------------------------------- |
+| glee | A reference to the Glee app. |
+| serverName | The name of the server where the event happened. |
+| server | The AsyncAPI definition of the server where the event happened. |
+| connection | The connection where the event happened. |
## Restricting the lifecycle event
diff --git a/docs/reference/classes/adapters_cluster_redis.default.md b/docs/reference/classes/adapters_cluster_redis.default.md
index 17d729902..2769cc371 100644
--- a/docs/reference/classes/adapters_cluster_redis.default.md
+++ b/docs/reference/classes/adapters_cluster_redis.default.md
@@ -72,8 +72,8 @@ Instantiates a Glee Cluster adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----- | :------------------------------- | :--------------------------- |
| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
#### Inherited from
@@ -94,17 +94,17 @@ Instantiates a Glee Cluster adapter.
[src/adapters/cluster/redis/index.ts:9](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L9)
-___
+---
### \_publisher
-β’ `Private` **\_publisher**: `RedisClientType`<{ `bf`: { `ADD`: `__module` ; `EXISTS`: `__module` ; `INFO`: `__module` ; `INSERT`: `__module` ; `LOADCHUNK`: `__module` ; `MADD`: `__module` ; `MEXISTS`: `__module` ; `RESERVE`: `__module` ; `SCANDUMP`: `__module` ; `add`: `__module` ; `exists`: `__module` ; `info`: `__module` ; `insert`: `__module` ; `loadChunk`: `__module` ; `mAdd`: `__module` ; `mExists`: `__module` ; `reserve`: `__module` ; `scanDump`: `__module` } ; `cf`: { `ADD`: `__module` ; `ADDNX`: `__module` ; `COUNT`: `__module` ; `DEL`: `__module` ; `EXISTS`: `__module` ; `INFO`: `__module` ; `INSERT`: `__module` ; `INSERTNX`: `__module` ; `LOADCHUNK`: `__module` ; `RESERVE`: `__module` ; `SCANDUMP`: `__module` ; `add`: `__module` ; `addNX`: `__module` ; `count`: `__module` ; `del`: `__module` ; `exists`: `__module` ; `info`: `__module` ; `insert`: `__module` ; `insertNX`: `__module` ; `loadChunk`: `__module` ; `reserve`: `__module` ; `scanDump`: `__module` } ; `cms`: { `INCRBY`: `__module` ; `INFO`: `__module` ; `INITBYDIM`: `__module` ; `INITBYPROB`: `__module` ; `MERGE`: `__module` ; `QUERY`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `initByDim`: `__module` ; `initByProb`: `__module` ; `merge`: `__module` ; `query`: `__module` } ; `ft`: { `AGGREGATE`: `__module` ; `ALIASADD`: `__module` ; `ALIASDEL`: `__module` ; `ALIASUPDATE`: `__module` ; `ALTER`: `__module` ; `CONFIG_GET`: `__module` ; `CONFIG_SET`: `__module` ; `CREATE`: `__module` ; `DICTADD`: `__module` ; `DICTDEL`: `__module` ; `DICTDUMP`: `__module` ; `DROPINDEX`: `__module` ; `EXPLAIN`: `__module` ; `EXPLAINCLI`: `__module` ; `INFO`: `__module` ; `PROFILEAGGREGATE`: `__module` ; `PROFILESEARCH`: `__module` ; `SEARCH`: `__module` ; `SPELLCHECK`: `__module` ; `SUGADD`: `__module` ; `SUGDEL`: `__module` ; `SUGGET`: `__module` ; `SUGGET_WITHPAYLOADS`: `__module` ; `SUGGET_WITHSCORES`: `__module` ; `SUGGET_WITHSCORES_WITHPAYLOADS`: `__module` ; `SUGLEN`: `__module` ; `SYNDUMP`: `__module` ; `SYNUPDATE`: `__module` ; `TAGVALS`: `__module` ; `_LIST`: `__module` ; `_list`: `__module` ; `aggregate`: `__module` ; `aliasAdd`: `__module` ; `aliasDel`: `__module` ; `aliasUpdate`: `__module` ; `alter`: `__module` ; `configGet`: `__module` ; `configSet`: `__module` ; `create`: `__module` ; `dictAdd`: `__module` ; `dictDel`: `__module` ; `dictDump`: `__module` ; `dropIndex`: `__module` ; `explain`: `__module` ; `explainCli`: `__module` ; `info`: `__module` ; `profileAggregate`: `__module` ; `profileSearch`: `__module` ; `search`: `__module` ; `spellCheck`: `__module` ; `sugAdd`: `__module` ; `sugDel`: `__module` ; `sugGet`: `__module` ; `sugGetWithPayloads`: `__module` ; `sugGetWithScores`: `__module` ; `sugGetWithScoresWithPayloads`: `__module` ; `sugLen`: `__module` ; `synDump`: `__module` ; `synUpdate`: `__module` ; `tagVals`: `__module` } ; `graph`: { `CONFIG_GET`: `__module` ; `CONFIG_SET`: `__module` ; `DELETE`: `__module` ; `EXPLAIN`: `__module` ; `LIST`: `__module` ; `PROFILE`: `__module` ; `QUERY`: `__module` ; `QUERY_RO`: `__module` ; `SLOWLOG`: `__module` ; `configGet`: `__module` ; `configSet`: `__module` ; `delete`: `__module` ; `explain`: `__module` ; `list`: `__module` ; `profile`: `__module` ; `query`: `__module` ; `queryRo`: `__module` ; `slowLog`: `__module` } ; `json`: { `ARRAPPEND`: `__module` ; `ARRINDEX`: `__module` ; `ARRINSERT`: `__module` ; `ARRLEN`: `__module` ; `ARRPOP`: `__module` ; `ARRTRIM`: `__module` ; `DEBUG_MEMORY`: `__module` ; `DEL`: `__module` ; `FORGET`: `__module` ; `GET`: `__module` ; `MGET`: `__module` ; `NUMINCRBY`: `__module` ; `NUMMULTBY`: `__module` ; `OBJKEYS`: `__module` ; `OBJLEN`: `__module` ; `RESP`: `__module` ; `SET`: `__module` ; `STRAPPEND`: `__module` ; `STRLEN`: `__module` ; `TYPE`: `__module` ; `arrAppend`: `__module` ; `arrIndex`: `__module` ; `arrInsert`: `__module` ; `arrLen`: `__module` ; `arrPop`: `__module` ; `arrTrim`: `__module` ; `debugMemory`: `__module` ; `del`: `__module` ; `forget`: `__module` ; `get`: `__module` ; `mGet`: `__module` ; `numIncrBy`: `__module` ; `numMultBy`: `__module` ; `objKeys`: `__module` ; `objLen`: `__module` ; `resp`: `__module` ; `set`: `__module` ; `strAppend`: `__module` ; `strLen`: `__module` ; `type`: `__module` } ; `topK`: { `ADD`: `__module` ; `COUNT`: `__module` ; `INCRBY`: `__module` ; `INFO`: `__module` ; `LIST`: `__module` ; `QUERY`: `__module` ; `RESERVE`: `__module` ; `add`: `__module` ; `count`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `list`: `__module` ; `query`: `__module` ; `reserve`: `__module` } ; `ts`: { `ADD`: `__module` ; `ALTER`: `__module` ; `CREATE`: `__module` ; `CREATERULE`: `__module` ; `DECRBY`: `__module` ; `DEL`: `__module` ; `DELETERULE`: `__module` ; `GET`: `__module` ; `INCRBY`: `__module` ; `INFO`: `__module` ; `INFO_DEBUG`: `__module` ; `MADD`: `__module` ; `MGET`: `__module` ; `MGET_WITHLABELS`: `__module` ; `MRANGE`: `__module` ; `MRANGE_WITHLABELS`: `__module` ; `MREVRANGE`: `__module` ; `MREVRANGE_WITHLABELS`: `__module` ; `QUERYINDEX`: `__module` ; `RANGE`: `__module` ; `REVRANGE`: `__module` ; `add`: `__module` ; `alter`: `__module` ; `create`: `__module` ; `createRule`: `__module` ; `decrBy`: `__module` ; `del`: `__module` ; `deleteRule`: `__module` ; `get`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `infoDebug`: `__module` ; `mAdd`: `__module` ; `mGet`: `__module` ; `mGetWithLabels`: `__module` ; `mRange`: `__module` ; `mRangeWithLabels`: `__module` ; `mRevRange`: `__module` ; `mRevRangeWithLabels`: `__module` ; `queryIndex`: `__module` ; `range`: `__module` ; `revRange`: `__module` } }, `RedisScripts`\>
+β’ `Private` **\_publisher**: `RedisClientType`<{ `bf`: { `ADD`: `__module` ; `EXISTS`: `__module` ; `INFO`: `__module` ; `INSERT`: `__module` ; `LOADCHUNK`: `__module` ; `MADD`: `__module` ; `MEXISTS`: `__module` ; `RESERVE`: `__module` ; `SCANDUMP`: `__module` ; `add`: `__module` ; `exists`: `__module` ; `info`: `__module` ; `insert`: `__module` ; `loadChunk`: `__module` ; `mAdd`: `__module` ; `mExists`: `__module` ; `reserve`: `__module` ; `scanDump`: `__module` } ; `cf`: { `ADD`: `__module` ; `ADDNX`: `__module` ; `COUNT`: `__module` ; `DEL`: `__module` ; `EXISTS`: `__module` ; `INFO`: `__module` ; `INSERT`: `__module` ; `INSERTNX`: `__module` ; `LOADCHUNK`: `__module` ; `RESERVE`: `__module` ; `SCANDUMP`: `__module` ; `add`: `__module` ; `addNX`: `__module` ; `count`: `__module` ; `del`: `__module` ; `exists`: `__module` ; `info`: `__module` ; `insert`: `__module` ; `insertNX`: `__module` ; `loadChunk`: `__module` ; `reserve`: `__module` ; `scanDump`: `__module` } ; `cms`: { `INCRBY`: `__module` ; `INFO`: `__module` ; `INITBYDIM`: `__module` ; `INITBYPROB`: `__module` ; `MERGE`: `__module` ; `QUERY`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `initByDim`: `__module` ; `initByProb`: `__module` ; `merge`: `__module` ; `query`: `__module` } ; `ft`: { `AGGREGATE`: `__module` ; `ALIASADD`: `__module` ; `ALIASDEL`: `__module` ; `ALIASUPDATE`: `__module` ; `ALTER`: `__module` ; `CONFIG_GET`: `__module` ; `CONFIG_SET`: `__module` ; `CREATE`: `__module` ; `DICTADD`: `__module` ; `DICTDEL`: `__module` ; `DICTDUMP`: `__module` ; `DROPINDEX`: `__module` ; `EXPLAIN`: `__module` ; `EXPLAINCLI`: `__module` ; `INFO`: `__module` ; `PROFILEAGGREGATE`: `__module` ; `PROFILESEARCH`: `__module` ; `SEARCH`: `__module` ; `SPELLCHECK`: `__module` ; `SUGADD`: `__module` ; `SUGDEL`: `__module` ; `SUGGET`: `__module` ; `SUGGET_WITHPAYLOADS`: `__module` ; `SUGGET_WITHSCORES`: `__module` ; `SUGGET_WITHSCORES_WITHPAYLOADS`: `__module` ; `SUGLEN`: `__module` ; `SYNDUMP`: `__module` ; `SYNUPDATE`: `__module` ; `TAGVALS`: `__module` ; `_LIST`: `__module` ; `_list`: `__module` ; `aggregate`: `__module` ; `aliasAdd`: `__module` ; `aliasDel`: `__module` ; `aliasUpdate`: `__module` ; `alter`: `__module` ; `configGet`: `__module` ; `configSet`: `__module` ; `create`: `__module` ; `dictAdd`: `__module` ; `dictDel`: `__module` ; `dictDump`: `__module` ; `dropIndex`: `__module` ; `explain`: `__module` ; `explainCli`: `__module` ; `info`: `__module` ; `profileAggregate`: `__module` ; `profileSearch`: `__module` ; `search`: `__module` ; `spellCheck`: `__module` ; `sugAdd`: `__module` ; `sugDel`: `__module` ; `sugGet`: `__module` ; `sugGetWithPayloads`: `__module` ; `sugGetWithScores`: `__module` ; `sugGetWithScoresWithPayloads`: `__module` ; `sugLen`: `__module` ; `synDump`: `__module` ; `synUpdate`: `__module` ; `tagVals`: `__module` } ; `graph`: { `CONFIG_GET`: `__module` ; `CONFIG_SET`: `__module` ; `DELETE`: `__module` ; `EXPLAIN`: `__module` ; `LIST`: `__module` ; `PROFILE`: `__module` ; `QUERY`: `__module` ; `QUERY_RO`: `__module` ; `SLOWLOG`: `__module` ; `configGet`: `__module` ; `configSet`: `__module` ; `delete`: `__module` ; `explain`: `__module` ; `list`: `__module` ; `profile`: `__module` ; `query`: `__module` ; `queryRo`: `__module` ; `slowLog`: `__module` } ; `json`: { `ARRAPPEND`: `__module` ; `ARRINDEX`: `__module` ; `ARRINSERT`: `__module` ; `ARRLEN`: `__module` ; `ARRPOP`: `__module` ; `ARRTRIM`: `__module` ; `DEBUG_MEMORY`: `__module` ; `DEL`: `__module` ; `FORGET`: `__module` ; `GET`: `__module` ; `MGET`: `__module` ; `NUMINCRBY`: `__module` ; `NUMMULTBY`: `__module` ; `OBJKEYS`: `__module` ; `OBJLEN`: `__module` ; `RESP`: `__module` ; `SET`: `__module` ; `STRAPPEND`: `__module` ; `STRLEN`: `__module` ; `TYPE`: `__module` ; `arrAppend`: `__module` ; `arrIndex`: `__module` ; `arrInsert`: `__module` ; `arrLen`: `__module` ; `arrPop`: `__module` ; `arrTrim`: `__module` ; `debugMemory`: `__module` ; `del`: `__module` ; `forget`: `__module` ; `get`: `__module` ; `mGet`: `__module` ; `numIncrBy`: `__module` ; `numMultBy`: `__module` ; `objKeys`: `__module` ; `objLen`: `__module` ; `resp`: `__module` ; `set`: `__module` ; `strAppend`: `__module` ; `strLen`: `__module` ; `type`: `__module` } ; `topK`: { `ADD`: `__module` ; `COUNT`: `__module` ; `INCRBY`: `__module` ; `INFO`: `__module` ; `LIST`: `__module` ; `QUERY`: `__module` ; `RESERVE`: `__module` ; `add`: `__module` ; `count`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `list`: `__module` ; `query`: `__module` ; `reserve`: `__module` } ; `ts`: { `ADD`: `__module` ; `ALTER`: `__module` ; `CREATE`: `__module` ; `CREATERULE`: `__module` ; `DECRBY`: `__module` ; `DEL`: `__module` ; `DELETERULE`: `__module` ; `GET`: `__module` ; `INCRBY`: `__module` ; `INFO`: `__module` ; `INFO_DEBUG`: `__module` ; `MADD`: `__module` ; `MGET`: `__module` ; `MGET_WITHLABELS`: `__module` ; `MRANGE`: `__module` ; `MRANGE_WITHLABELS`: `__module` ; `MREVRANGE`: `__module` ; `MREVRANGE_WITHLABELS`: `__module` ; `QUERYINDEX`: `__module` ; `RANGE`: `__module` ; `REVRANGE`: `__module` ; `add`: `__module` ; `alter`: `__module` ; `create`: `__module` ; `createRule`: `__module` ; `decrBy`: `__module` ; `del`: `__module` ; `deleteRule`: `__module` ; `get`: `__module` ; `incrBy`: `__module` ; `info`: `__module` ; `infoDebug`: `__module` ; `mAdd`: `__module` ; `mGet`: `__module` ; `mGetWithLabels`: `__module` ; `mRange`: `__module` ; `mRangeWithLabels`: `__module` ; `mRevRange`: `__module` ; `mRevRangeWithLabels`: `__module` ; `queryIndex`: `__module` ; `range`: `__module` ; `revRange`: `__module` } }, `RedisScripts`\>
#### Defined in
[src/adapters/cluster/redis/index.ts:10](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L10)
-___
+---
### captureRejectionSymbol
@@ -118,7 +118,7 @@ ___
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -134,7 +134,7 @@ Sets or gets the default captureRejection value for all emitters.
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -148,7 +148,7 @@ ___
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -188,7 +188,7 @@ ClusterAdapter.glee
[src/lib/cluster.ts:93](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L93)
-___
+---
### instanceId
@@ -206,7 +206,7 @@ ClusterAdapter.instanceId
[src/lib/cluster.ts:105](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L105)
-___
+---
### serverName
@@ -224,7 +224,7 @@ ClusterAdapter.serverName
[src/lib/cluster.ts:97](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L97)
-___
+---
### serverUrlExpanded
@@ -246,7 +246,7 @@ ClusterAdapter.serverUrlExpanded
### \_connect
-βΈ **_connect**(): `Promise`<[`default`](adapters_cluster_redis.default.md)\>
+βΈ **\_connect**(): `Promise`<[`default`](adapters_cluster_redis.default.md)\>
#### Returns
@@ -256,16 +256,16 @@ ClusterAdapter.serverUrlExpanded
[src/adapters/cluster/redis/index.ts:24](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L24)
-___
+---
### \_send
-βΈ **_send**(`message`): `Promise`<`void`\>
+βΈ **\_send**(`message`): `Promise`<`void`\>
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -276,7 +276,7 @@ ___
[src/adapters/cluster/redis/index.ts:67](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L67)
-___
+---
### addListener
@@ -288,10 +288,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -305,7 +305,7 @@ Alias for `emitter.on(eventName, listener)`.
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -325,7 +325,7 @@ Connects to the remote server.
[src/adapters/cluster/redis/index.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L16)
-___
+---
### deserializeMessage
@@ -335,8 +335,8 @@ Deserializes the serialized message.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----------- | :------- | :--------------------- |
| `serialized` | `string` | The serialized message |
#### Returns
@@ -353,7 +353,7 @@ The deserialized message.
[src/lib/cluster.ts:151](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L151)
-___
+---
### emit
@@ -365,26 +365,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -401,10 +401,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -418,7 +418,7 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -428,15 +428,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -454,7 +454,7 @@ console.log(myEE.eventNames());
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -477,7 +477,7 @@ set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](adapter
node_modules/@types/node/events.d.ts:499
-___
+---
### listenerCount
@@ -489,8 +489,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -505,7 +505,7 @@ Returns the number of listeners listening to the event named `eventName`.
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -515,9 +515,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -525,8 +525,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -541,7 +541,7 @@ console.log(util.inspect(server.listeners('connection')));
node_modules/@types/node/events.d.ts:512
-___
+---
### name
@@ -555,7 +555,7 @@ ___
[src/adapters/cluster/redis/index.ts:12](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L12)
-___
+---
### off
@@ -567,10 +567,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -584,7 +584,7 @@ Alias for `emitter.removeListener()`.
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -597,8 +597,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -607,10 +607,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -620,10 +620,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -637,7 +637,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -648,8 +648,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -658,10 +658,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -671,10 +671,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -688,7 +688,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -701,8 +701,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -711,10 +711,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -728,19 +728,19 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](adapters_cluster_redis.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -749,10 +749,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -766,7 +766,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -776,35 +776,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -819,7 +819,7 @@ emitter.emit('log');
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -837,8 +837,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -853,7 +853,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -863,11 +863,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -876,35 +876,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -920,18 +920,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -940,10 +940,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -957,7 +957,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -967,8 +967,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -983,7 +983,7 @@ Sends a message to the remote server.
[src/adapters/cluster/redis/index.ts:20](https://github.com/asyncapi/glee/blob/388e335/src/adapters/cluster/redis/index.ts#L20)
-___
+---
### serializeMessage
@@ -993,8 +993,8 @@ Serialize a message into JSON.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :---------------------------------- | :------------------------ |
| `message` | [`default`](lib_message.default.md) | The message to serialize. |
#### Returns
@@ -1011,7 +1011,7 @@ The serialized message,
[src/lib/cluster.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L131)
-___
+---
### setMaxListeners
@@ -1028,9 +1028,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1044,7 +1044,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1059,19 +1059,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1079,10 +1079,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1096,7 +1096,7 @@ const { getEventListeners, EventEmitter } = require('events');
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1105,11 +1105,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1119,10 +1119,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1136,32 +1136,32 @@ console.log(listenerCount(myEmitter, 'event'));
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1172,39 +1172,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1220,7 +1220,7 @@ that iterates `eventName` events emitted by the `emitter`
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1235,31 +1235,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1267,15 +1267,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1283,38 +1283,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1332,11 +1332,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1350,7 +1350,7 @@ node_modules/@types/node/events.d.ts:157
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1363,23 +1363,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/adapters_mqtt.default.md b/docs/reference/classes/adapters_mqtt.default.md
index 9ac530ad3..67bdb2005 100644
--- a/docs/reference/classes/adapters_mqtt.default.md
+++ b/docs/reference/classes/adapters_mqtt.default.md
@@ -75,12 +75,12 @@ Instantiates a Glee adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
-| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
-| `server` | `Server` | The AsyncAPI server to use for the connection. |
-| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
+| Name | Type | Description |
+| :--------------- | :------------------------------- | :--------------------------------------------------------- |
+| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
+| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
+| `server` | `Server` | The AsyncAPI server to use for the connection. |
+| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
#### Inherited from
@@ -100,7 +100,7 @@ Instantiates a Glee adapter.
[src/adapters/mqtt/index.ts:15](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L15)
-___
+---
### firstConnect
@@ -110,7 +110,7 @@ ___
[src/adapters/mqtt/index.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L16)
-___
+---
### captureRejectionSymbol
@@ -124,7 +124,7 @@ ___
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -140,7 +140,7 @@ Sets or gets the default captureRejection value for all emitters.
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -154,7 +154,7 @@ ___
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -194,7 +194,7 @@ Adapter.AsyncAPIServer
[src/lib/adapter.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L131)
-___
+---
### channelNames
@@ -212,7 +212,7 @@ Adapter.channelNames
[src/lib/adapter.ts:139](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L139)
-___
+---
### connections
@@ -230,7 +230,7 @@ Adapter.connections
[src/lib/adapter.ts:143](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L143)
-___
+---
### glee
@@ -248,7 +248,7 @@ Adapter.glee
[src/lib/adapter.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L123)
-___
+---
### parsedAsyncAPI
@@ -266,7 +266,7 @@ Adapter.parsedAsyncAPI
[src/lib/adapter.ts:135](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L135)
-___
+---
### serverName
@@ -284,7 +284,7 @@ Adapter.serverName
[src/lib/adapter.ts:127](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L127)
-___
+---
### serverUrlExpanded
@@ -306,7 +306,7 @@ Adapter.serverUrlExpanded
### \_connect
-βΈ **_connect**(): `Promise`<[`default`](adapters_mqtt.default.md)\>
+βΈ **\_connect**(): `Promise`<[`default`](adapters_mqtt.default.md)\>
#### Returns
@@ -316,16 +316,16 @@ Adapter.serverUrlExpanded
[src/adapters/mqtt/index.ts:30](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L30)
-___
+---
### \_createMessage
-βΈ **_createMessage**(`packet`): [`default`](lib_message.default.md)
+βΈ **\_createMessage**(`packet`): [`default`](lib_message.default.md)
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :--------------- |
| `packet` | `IPublishPacket` |
#### Returns
@@ -336,16 +336,16 @@ ___
[src/adapters/mqtt/index.ts:125](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L125)
-___
+---
### \_send
-βΈ **_send**(`message`): `Promise`<`void`\>
+βΈ **\_send**(`message`): `Promise`<`void`\>
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -356,7 +356,7 @@ ___
[src/adapters/mqtt/index.ts:107](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L107)
-___
+---
### addListener
@@ -368,10 +368,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -385,7 +385,7 @@ Alias for `emitter.on(eventName, listener)`.
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -405,7 +405,7 @@ Connects to the remote server.
[src/adapters/mqtt/index.ts:22](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L22)
-___
+---
### emit
@@ -417,26 +417,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -453,10 +453,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -470,7 +470,7 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -480,15 +480,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -506,7 +506,7 @@ console.log(myEE.eventNames());
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -529,7 +529,7 @@ set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](adapter
node_modules/@types/node/events.d.ts:499
-___
+---
### getSubscribedChannels
@@ -549,7 +549,7 @@ Returns a list of the channels a given adapter has to subscribe to.
[src/lib/adapter.ts:154](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L154)
-___
+---
### listenerCount
@@ -561,8 +561,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -577,7 +577,7 @@ Returns the number of listeners listening to the event named `eventName`.
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -587,9 +587,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -597,8 +597,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -613,7 +613,7 @@ console.log(util.inspect(server.listeners('connection')));
node_modules/@types/node/events.d.ts:512
-___
+---
### name
@@ -627,7 +627,7 @@ ___
[src/adapters/mqtt/index.ts:18](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L18)
-___
+---
### off
@@ -639,10 +639,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -656,7 +656,7 @@ Alias for `emitter.removeListener()`.
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -669,8 +669,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -679,10 +679,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -692,10 +692,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -709,7 +709,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -720,8 +720,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -730,10 +730,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -743,10 +743,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -760,7 +760,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -773,8 +773,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -783,10 +783,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -800,19 +800,19 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](adapters_mqtt.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -821,10 +821,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -838,7 +838,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -848,35 +848,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -891,7 +891,7 @@ emitter.emit('log');
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -909,8 +909,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -925,7 +925,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -935,11 +935,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -948,35 +948,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -992,18 +992,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -1012,10 +1012,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -1029,7 +1029,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -1039,8 +1039,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -1055,7 +1055,7 @@ Sends a message to the remote server.
[src/adapters/mqtt/index.ts:26](https://github.com/asyncapi/glee/blob/388e335/src/adapters/mqtt/index.ts#L26)
-___
+---
### setMaxListeners
@@ -1072,9 +1072,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1088,7 +1088,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1103,19 +1103,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1123,10 +1123,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1140,7 +1140,7 @@ const { getEventListeners, EventEmitter } = require('events');
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1149,11 +1149,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1163,10 +1163,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1180,32 +1180,32 @@ console.log(listenerCount(myEmitter, 'event'));
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1216,39 +1216,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1264,7 +1264,7 @@ that iterates `eventName` events emitted by the `emitter`
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1279,31 +1279,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1311,15 +1311,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1327,38 +1327,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1376,11 +1376,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1394,7 +1394,7 @@ node_modules/@types/node/events.d.ts:157
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1407,23 +1407,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/adapters_socket_io.default.md b/docs/reference/classes/adapters_socket_io.default.md
index 92fc9d4f9..2f4d65838 100644
--- a/docs/reference/classes/adapters_socket_io.default.md
+++ b/docs/reference/classes/adapters_socket_io.default.md
@@ -74,12 +74,12 @@ Instantiates a Glee adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
-| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
-| `server` | `Server` | The AsyncAPI server to use for the connection. |
-| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
+| Name | Type | Description |
+| :--------------- | :------------------------------- | :--------------------------------------------------------- |
+| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
+| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
+| `server` | `Server` | The AsyncAPI server to use for the connection. |
+| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
#### Inherited from
@@ -99,7 +99,7 @@ Instantiates a Glee adapter.
[src/adapters/socket.io/index.ts:6](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L6)
-___
+---
### captureRejectionSymbol
@@ -113,7 +113,7 @@ ___
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -129,7 +129,7 @@ Sets or gets the default captureRejection value for all emitters.
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -143,7 +143,7 @@ ___
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -183,7 +183,7 @@ Adapter.AsyncAPIServer
[src/lib/adapter.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L131)
-___
+---
### channelNames
@@ -201,7 +201,7 @@ Adapter.channelNames
[src/lib/adapter.ts:139](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L139)
-___
+---
### connections
@@ -219,7 +219,7 @@ Adapter.connections
[src/lib/adapter.ts:143](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L143)
-___
+---
### glee
@@ -237,7 +237,7 @@ Adapter.glee
[src/lib/adapter.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L123)
-___
+---
### parsedAsyncAPI
@@ -255,7 +255,7 @@ Adapter.parsedAsyncAPI
[src/lib/adapter.ts:135](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L135)
-___
+---
### serverName
@@ -273,7 +273,7 @@ Adapter.serverName
[src/lib/adapter.ts:127](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L127)
-___
+---
### serverUrlExpanded
@@ -295,7 +295,7 @@ Adapter.serverUrlExpanded
### \_connect
-βΈ **_connect**(): `Promise`<[`default`](adapters_socket_io.default.md)\>
+βΈ **\_connect**(): `Promise`<[`default`](adapters_socket_io.default.md)\>
#### Returns
@@ -305,18 +305,18 @@ Adapter.serverUrlExpanded
[src/adapters/socket.io/index.ts:20](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L20)
-___
+---
### \_createMessage
-βΈ **_createMessage**(`eventName`, `payload`): [`default`](lib_message.default.md)
+βΈ **\_createMessage**(`eventName`, `payload`): [`default`](lib_message.default.md)
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------- |
| `eventName` | `string` |
-| `payload` | `any` |
+| `payload` | `any` |
#### Returns
@@ -326,16 +326,16 @@ ___
[src/adapters/socket.io/index.ts:83](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L83)
-___
+---
### \_send
-βΈ **_send**(`message`): `Promise`<`void`\>
+βΈ **\_send**(`message`): `Promise`<`void`\>
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -346,7 +346,7 @@ ___
[src/adapters/socket.io/index.ts:67](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L67)
-___
+---
### addListener
@@ -358,10 +358,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -375,7 +375,7 @@ Alias for `emitter.on(eventName, listener)`.
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -395,7 +395,7 @@ Connects to the remote server.
[src/adapters/socket.io/index.ts:12](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L12)
-___
+---
### emit
@@ -407,26 +407,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -443,10 +443,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -460,7 +460,7 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -470,15 +470,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -496,7 +496,7 @@ console.log(myEE.eventNames());
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -519,7 +519,7 @@ set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](adapter
node_modules/@types/node/events.d.ts:499
-___
+---
### getSubscribedChannels
@@ -539,7 +539,7 @@ Returns a list of the channels a given adapter has to subscribe to.
[src/lib/adapter.ts:154](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L154)
-___
+---
### listenerCount
@@ -551,8 +551,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -567,7 +567,7 @@ Returns the number of listeners listening to the event named `eventName`.
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -577,9 +577,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -587,8 +587,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -603,7 +603,7 @@ console.log(util.inspect(server.listeners('connection')));
node_modules/@types/node/events.d.ts:512
-___
+---
### name
@@ -617,7 +617,7 @@ ___
[src/adapters/socket.io/index.ts:8](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L8)
-___
+---
### off
@@ -629,10 +629,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -646,7 +646,7 @@ Alias for `emitter.removeListener()`.
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -659,8 +659,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -669,10 +669,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -682,10 +682,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -699,7 +699,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -710,8 +710,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -720,10 +720,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -733,10 +733,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -750,7 +750,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -763,8 +763,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -773,10 +773,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -790,19 +790,19 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](adapters_socket_io.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -811,10 +811,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -828,7 +828,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -838,35 +838,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -881,7 +881,7 @@ emitter.emit('log');
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -899,8 +899,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -915,7 +915,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -925,11 +925,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -938,35 +938,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -982,18 +982,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -1002,10 +1002,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -1019,7 +1019,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -1029,8 +1029,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -1045,7 +1045,7 @@ Sends a message to the remote server.
[src/adapters/socket.io/index.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/adapters/socket.io/index.ts#L16)
-___
+---
### setMaxListeners
@@ -1062,9 +1062,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1078,7 +1078,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1093,19 +1093,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1113,10 +1113,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1130,7 +1130,7 @@ const { getEventListeners, EventEmitter } = require('events');
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1139,11 +1139,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1153,10 +1153,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1170,32 +1170,32 @@ console.log(listenerCount(myEmitter, 'event'));
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1206,39 +1206,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1254,7 +1254,7 @@ that iterates `eventName` events emitted by the `emitter`
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1269,31 +1269,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1301,15 +1301,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1317,38 +1317,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1366,11 +1366,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1384,7 +1384,7 @@ node_modules/@types/node/events.d.ts:157
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1397,23 +1397,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/adapters_ws.default.md b/docs/reference/classes/adapters_ws.default.md
index 5edd8c944..cf850aa3a 100644
--- a/docs/reference/classes/adapters_ws.default.md
+++ b/docs/reference/classes/adapters_ws.default.md
@@ -73,12 +73,12 @@ Instantiates a Glee adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
-| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
-| `server` | `Server` | The AsyncAPI server to use for the connection. |
-| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
+| Name | Type | Description |
+| :--------------- | :------------------------------- | :--------------------------------------------------------- |
+| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
+| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
+| `server` | `Server` | The AsyncAPI server to use for the connection. |
+| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
#### Inherited from
@@ -102,7 +102,7 @@ Instantiates a Glee adapter.
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -118,7 +118,7 @@ Sets or gets the default captureRejection value for all emitters.
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -132,7 +132,7 @@ ___
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -172,7 +172,7 @@ Adapter.AsyncAPIServer
[src/lib/adapter.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L131)
-___
+---
### channelNames
@@ -190,7 +190,7 @@ Adapter.channelNames
[src/lib/adapter.ts:139](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L139)
-___
+---
### connections
@@ -208,7 +208,7 @@ Adapter.connections
[src/lib/adapter.ts:143](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L143)
-___
+---
### glee
@@ -226,7 +226,7 @@ Adapter.glee
[src/lib/adapter.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L123)
-___
+---
### parsedAsyncAPI
@@ -244,7 +244,7 @@ Adapter.parsedAsyncAPI
[src/lib/adapter.ts:135](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L135)
-___
+---
### serverName
@@ -262,7 +262,7 @@ Adapter.serverName
[src/lib/adapter.ts:127](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L127)
-___
+---
### serverUrlExpanded
@@ -284,7 +284,7 @@ Adapter.serverUrlExpanded
### \_connect
-βΈ **_connect**(): `Promise`<[`default`](adapters_ws.default.md)\>
+βΈ **\_connect**(): `Promise`<[`default`](adapters_ws.default.md)\>
#### Returns
@@ -294,18 +294,18 @@ Adapter.serverUrlExpanded
[src/adapters/ws/index.ts:22](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L22)
-___
+---
### \_createMessage
-βΈ **_createMessage**(`eventName`, `payload`): [`default`](lib_message.default.md)
+βΈ **\_createMessage**(`eventName`, `payload`): [`default`](lib_message.default.md)
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------- |
| `eventName` | `string` |
-| `payload` | `any` |
+| `payload` | `any` |
#### Returns
@@ -315,16 +315,16 @@ ___
[src/adapters/ws/index.ts:140](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L140)
-___
+---
### \_send
-βΈ **_send**(`message`): `Promise`<`void`\>
+βΈ **\_send**(`message`): `Promise`<`void`\>
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -335,7 +335,7 @@ ___
[src/adapters/ws/index.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L123)
-___
+---
### addListener
@@ -347,10 +347,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -364,7 +364,7 @@ Alias for `emitter.on(eventName, listener)`.
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -384,7 +384,7 @@ Connects to the remote server.
[src/adapters/ws/index.ts:14](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L14)
-___
+---
### emit
@@ -396,26 +396,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -432,10 +432,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -449,7 +449,7 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -459,15 +459,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -485,7 +485,7 @@ console.log(myEE.eventNames());
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -508,7 +508,7 @@ set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](adapter
node_modules/@types/node/events.d.ts:499
-___
+---
### getSubscribedChannels
@@ -528,7 +528,7 @@ Returns a list of the channels a given adapter has to subscribe to.
[src/lib/adapter.ts:154](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L154)
-___
+---
### listenerCount
@@ -540,8 +540,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -556,7 +556,7 @@ Returns the number of listeners listening to the event named `eventName`.
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -566,9 +566,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -576,8 +576,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -592,7 +592,7 @@ console.log(util.inspect(server.listeners('connection')));
node_modules/@types/node/events.d.ts:512
-___
+---
### name
@@ -606,7 +606,7 @@ ___
[src/adapters/ws/index.ts:10](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L10)
-___
+---
### off
@@ -618,10 +618,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -635,7 +635,7 @@ Alias for `emitter.removeListener()`.
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -648,8 +648,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -658,10 +658,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -671,10 +671,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -688,7 +688,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -699,8 +699,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -709,10 +709,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -722,10 +722,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -739,7 +739,7 @@ myEE.emit('foo');
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -752,8 +752,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -762,10 +762,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -779,19 +779,19 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](adapters_ws.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -800,10 +800,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -817,7 +817,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -827,35 +827,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -870,7 +870,7 @@ emitter.emit('log');
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -888,8 +888,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -904,7 +904,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -914,11 +914,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -927,35 +927,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -971,18 +971,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -991,10 +991,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -1008,7 +1008,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -1018,8 +1018,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -1034,7 +1034,7 @@ Sends a message to the remote server.
[src/adapters/ws/index.ts:18](https://github.com/asyncapi/glee/blob/388e335/src/adapters/ws/index.ts#L18)
-___
+---
### setMaxListeners
@@ -1051,9 +1051,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1067,7 +1067,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1082,19 +1082,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1102,10 +1102,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1119,7 +1119,7 @@ const { getEventListeners, EventEmitter } = require('events');
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1128,11 +1128,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1142,10 +1142,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1159,32 +1159,32 @@ console.log(listenerCount(myEmitter, 'event'));
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1195,39 +1195,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1243,7 +1243,7 @@ that iterates `eventName` events emitted by the `emitter`
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1258,31 +1258,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1290,15 +1290,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1306,38 +1306,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1355,11 +1355,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1373,7 +1373,7 @@ node_modules/@types/node/events.d.ts:157
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1386,23 +1386,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/errors_glee_error.default.md b/docs/reference/classes/errors_glee_error.default.md
index 54981a97c..b4b381351 100644
--- a/docs/reference/classes/errors_glee_error.default.md
+++ b/docs/reference/classes/errors_glee_error.default.md
@@ -43,8 +43,8 @@
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------------------ | :------- |
| `__namedParameters` | `Object` |
#### Overrides
@@ -65,7 +65,7 @@ Error.constructor
[src/errors/glee-error.ts:3](https://github.com/asyncapi/glee/blob/388e335/src/errors/glee-error.ts#L3)
-___
+---
### \_errors
@@ -75,7 +75,7 @@ ___
[src/errors/glee-error.ts:2](https://github.com/asyncapi/glee/blob/388e335/src/errors/glee-error.ts#L2)
-___
+---
### message
@@ -89,7 +89,7 @@ Error.message
node_modules/typescript/lib/lib.es5.d.ts:1023
-___
+---
### name
@@ -103,7 +103,7 @@ Error.name
node_modules/typescript/lib/lib.es5.d.ts:1022
-___
+---
### stack
@@ -117,7 +117,7 @@ Error.stack
node_modules/typescript/lib/lib.es5.d.ts:1024
-___
+---
### prepareStackTrace
@@ -133,9 +133,9 @@ Optional override for formatting stack traces
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `err` | `Error` |
+| Name | Type |
+| :------------ | :----------- |
+| `err` | `Error` |
| `stackTraces` | `CallSite`[] |
##### Returns
@@ -150,7 +150,7 @@ Error.prepareStackTrace
node_modules/@types/node/globals.d.ts:11
-___
+---
### stackTraceLimit
@@ -178,7 +178,7 @@ node_modules/@types/node/globals.d.ts:13
[src/errors/glee-error.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/errors/glee-error.ts#L16)
-___
+---
### errors
@@ -202,9 +202,9 @@ Create .stack property on a target object
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `targetObject` | `object` |
+| Name | Type |
+| :---------------- | :--------- |
+| `targetObject` | `object` |
| `constructorOpt?` | `Function` |
#### Returns
diff --git a/docs/reference/classes/lib_adapter.default.md b/docs/reference/classes/lib_adapter.default.md
index ac659a385..28b75722e 100644
--- a/docs/reference/classes/lib_adapter.default.md
+++ b/docs/reference/classes/lib_adapter.default.md
@@ -82,12 +82,12 @@ Instantiates a Glee adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
-| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
-| `server` | `Server` | The AsyncAPI server to use for the connection. |
-| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
+| Name | Type | Description |
+| :--------------- | :------------------------------- | :--------------------------------------------------------- |
+| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
+| `serverName` | `string` | The name of the AsyncAPI server to use for the connection. |
+| `server` | `Server` | The AsyncAPI server to use for the connection. |
+| `parsedAsyncAPI` | `AsyncAPIDocument` | The AsyncAPI document. |
#### Overrides
@@ -107,7 +107,7 @@ EventEmitter.constructor
[src/lib/adapter.ts:17](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L17)
-___
+---
### \_channelNames
@@ -117,7 +117,7 @@ ___
[src/lib/adapter.ts:19](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L19)
-___
+---
### \_connections
@@ -127,7 +127,7 @@ ___
[src/lib/adapter.ts:20](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L20)
-___
+---
### \_glee
@@ -137,7 +137,7 @@ ___
[src/lib/adapter.ts:15](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L15)
-___
+---
### \_parsedAsyncAPI
@@ -147,7 +147,7 @@ ___
[src/lib/adapter.ts:18](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L18)
-___
+---
### \_serverName
@@ -157,7 +157,7 @@ ___
[src/lib/adapter.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L16)
-___
+---
### \_serverUrlExpanded
@@ -167,7 +167,7 @@ ___
[src/lib/adapter.ts:21](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L21)
-___
+---
### captureRejectionSymbol
@@ -181,7 +181,7 @@ EventEmitter.captureRejectionSymbol
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -197,7 +197,7 @@ EventEmitter.captureRejections
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -211,7 +211,7 @@ EventEmitter.defaultMaxListeners
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -247,7 +247,7 @@ node_modules/@types/node/events.d.ts:300
[src/lib/adapter.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L131)
-___
+---
### channelNames
@@ -261,7 +261,7 @@ ___
[src/lib/adapter.ts:139](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L139)
-___
+---
### connections
@@ -275,7 +275,7 @@ ___
[src/lib/adapter.ts:143](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L143)
-___
+---
### glee
@@ -289,7 +289,7 @@ ___
[src/lib/adapter.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L123)
-___
+---
### parsedAsyncAPI
@@ -303,7 +303,7 @@ ___
[src/lib/adapter.ts:135](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L135)
-___
+---
### serverName
@@ -317,7 +317,7 @@ ___
[src/lib/adapter.ts:127](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L127)
-___
+---
### serverUrlExpanded
@@ -343,10 +343,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -360,7 +360,7 @@ EventEmitter.addListener
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -376,7 +376,7 @@ Connects to the remote server.
[src/lib/adapter.ts:168](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L168)
-___
+---
### emit
@@ -388,26 +388,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -424,10 +424,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -441,7 +441,7 @@ EventEmitter.emit
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -451,15 +451,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -477,7 +477,7 @@ EventEmitter.eventNames
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -500,7 +500,7 @@ EventEmitter.getMaxListeners
node_modules/@types/node/events.d.ts:499
-___
+---
### getSubscribedChannels
@@ -516,7 +516,7 @@ Returns a list of the channels a given adapter has to subscribe to.
[src/lib/adapter.ts:154](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L154)
-___
+---
### listenerCount
@@ -528,8 +528,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -544,7 +544,7 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -554,9 +554,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -564,8 +564,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -580,7 +580,7 @@ EventEmitter.listeners
node_modules/@types/node/events.d.ts:512
-___
+---
### off
@@ -592,10 +592,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -609,7 +609,7 @@ EventEmitter.off
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -622,8 +622,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -632,10 +632,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -645,10 +645,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -662,7 +662,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -673,8 +673,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -683,10 +683,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -696,10 +696,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -713,7 +713,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -726,8 +726,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -736,10 +736,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -753,19 +753,19 @@ EventEmitter.prependListener
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](lib_adapter.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -774,10 +774,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -791,7 +791,7 @@ EventEmitter.prependOnceListener
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -801,35 +801,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -844,7 +844,7 @@ EventEmitter.rawListeners
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -862,8 +862,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -878,7 +878,7 @@ EventEmitter.removeAllListeners
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -888,11 +888,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -901,35 +901,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -945,18 +945,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -965,10 +965,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -982,7 +982,7 @@ EventEmitter.removeListener
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -992,8 +992,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :---------------------------------- | :------------------- |
| `message` | [`default`](lib_message.default.md) | The message to send. |
#### Returns
@@ -1004,7 +1004,7 @@ Sends a message to the remote server.
[src/lib/adapter.ts:177](https://github.com/asyncapi/glee/blob/388e335/src/lib/adapter.ts#L177)
-___
+---
### setMaxListeners
@@ -1021,9 +1021,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1037,7 +1037,7 @@ EventEmitter.setMaxListeners
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1052,19 +1052,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1072,10 +1072,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1089,7 +1089,7 @@ EventEmitter.getEventListeners
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1098,11 +1098,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1112,10 +1112,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1129,32 +1129,32 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1165,39 +1165,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1213,7 +1213,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1228,31 +1228,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1260,15 +1260,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1276,38 +1276,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1325,11 +1325,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1343,7 +1343,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1356,23 +1356,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/lib_cluster.default.md b/docs/reference/classes/lib_cluster.default.md
index 51345a99c..d378d1ad8 100644
--- a/docs/reference/classes/lib_cluster.default.md
+++ b/docs/reference/classes/lib_cluster.default.md
@@ -73,8 +73,8 @@ Instantiates a Glee Cluster adapter.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----- | :------------------------------- | :--------------------------- |
| `glee` | [`default`](lib_glee.default.md) | A reference to the Glee app. |
#### Overrides
@@ -95,7 +95,7 @@ EventEmitter.constructor
[src/lib/cluster.ts:36](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L36)
-___
+---
### \_instanceId
@@ -105,7 +105,7 @@ ___
[src/lib/cluster.ts:39](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L39)
-___
+---
### \_serverName
@@ -115,7 +115,7 @@ ___
[src/lib/cluster.ts:37](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L37)
-___
+---
### \_serverUrlExpanded
@@ -125,7 +125,7 @@ ___
[src/lib/cluster.ts:38](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L38)
-___
+---
### captureRejectionSymbol
@@ -139,7 +139,7 @@ EventEmitter.captureRejectionSymbol
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -155,7 +155,7 @@ EventEmitter.captureRejections
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -169,7 +169,7 @@ EventEmitter.defaultMaxListeners
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -205,7 +205,7 @@ node_modules/@types/node/events.d.ts:300
[src/lib/cluster.ts:93](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L93)
-___
+---
### instanceId
@@ -219,7 +219,7 @@ ___
[src/lib/cluster.ts:105](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L105)
-___
+---
### serverName
@@ -233,7 +233,7 @@ ___
[src/lib/cluster.ts:97](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L97)
-___
+---
### serverUrlExpanded
@@ -259,10 +259,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -276,7 +276,7 @@ EventEmitter.addListener
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -292,7 +292,7 @@ Connects to the remote server.
[src/lib/cluster.ts:112](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L112)
-___
+---
### deserializeMessage
@@ -302,8 +302,8 @@ Deserializes the serialized message.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----------- | :------- | :--------------------- |
| `serialized` | `string` | The serialized message |
#### Returns
@@ -316,7 +316,7 @@ The deserialized message.
[src/lib/cluster.ts:151](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L151)
-___
+---
### emit
@@ -328,26 +328,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -364,10 +364,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -381,7 +381,7 @@ EventEmitter.emit
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -391,15 +391,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -417,7 +417,7 @@ EventEmitter.eventNames
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -440,7 +440,7 @@ EventEmitter.getMaxListeners
node_modules/@types/node/events.d.ts:499
-___
+---
### listenerCount
@@ -452,8 +452,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -468,7 +468,7 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -478,9 +478,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -488,8 +488,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -504,7 +504,7 @@ EventEmitter.listeners
node_modules/@types/node/events.d.ts:512
-___
+---
### off
@@ -516,10 +516,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -533,7 +533,7 @@ EventEmitter.off
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -546,8 +546,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -556,10 +556,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -569,10 +569,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -586,7 +586,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -597,8 +597,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -607,10 +607,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -620,10 +620,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -637,7 +637,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -650,8 +650,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -660,10 +660,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -677,19 +677,19 @@ EventEmitter.prependListener
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](lib_cluster.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -698,10 +698,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -715,7 +715,7 @@ EventEmitter.prependOnceListener
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -725,35 +725,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -768,7 +768,7 @@ EventEmitter.rawListeners
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -786,8 +786,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -802,7 +802,7 @@ EventEmitter.removeAllListeners
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -812,11 +812,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -825,35 +825,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -869,18 +869,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -889,10 +889,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -906,7 +906,7 @@ EventEmitter.removeListener
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -916,8 +916,8 @@ Sends a message to the remote server.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :---------------------------------- | :------------------- |
| `message` | [`default`](lib_message.default.md) | The message to send. |
#### Returns
@@ -928,7 +928,7 @@ Sends a message to the remote server.
[src/lib/cluster.ts:121](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L121)
-___
+---
### serializeMessage
@@ -938,8 +938,8 @@ Serialize a message into JSON.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :---------------------------------- | :------------------------ |
| `message` | [`default`](lib_message.default.md) | The message to serialize. |
#### Returns
@@ -952,7 +952,7 @@ The serialized message,
[src/lib/cluster.ts:131](https://github.com/asyncapi/glee/blob/388e335/src/lib/cluster.ts#L131)
-___
+---
### setMaxListeners
@@ -969,9 +969,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -985,7 +985,7 @@ EventEmitter.setMaxListeners
node_modules/@types/node/events.d.ts:493
-___
+---
### getEventListeners
@@ -1000,19 +1000,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1020,10 +1020,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1037,7 +1037,7 @@ EventEmitter.getEventListeners
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1046,11 +1046,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1060,10 +1060,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1077,32 +1077,32 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1113,39 +1113,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1161,7 +1161,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1176,31 +1176,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1208,15 +1208,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1224,38 +1224,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1273,11 +1273,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1291,7 +1291,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1304,23 +1304,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/lib_connection.default.md b/docs/reference/classes/lib_connection.default.md
index f6f15dbde..de9a2d6e8 100644
--- a/docs/reference/classes/lib_connection.default.md
+++ b/docs/reference/classes/lib_connection.default.md
@@ -41,8 +41,8 @@ Instantiates a Glee connection.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------- |
| `options` | `IGleeConnectionConstructor` |
#### Defined in
@@ -59,7 +59,7 @@ Instantiates a Glee connection.
[src/lib/connection.ts:15](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L15)
-___
+---
### \_channels
@@ -69,7 +69,7 @@ ___
[src/lib/connection.ts:13](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L13)
-___
+---
### \_parsedAsyncAPI
@@ -79,7 +79,7 @@ ___
[src/lib/connection.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L16)
-___
+---
### \_rawConnection
@@ -89,7 +89,7 @@ ___
[src/lib/connection.ts:12](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L12)
-___
+---
### \_serverName
@@ -113,7 +113,7 @@ ___
[src/lib/connection.ts:48](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L48)
-___
+---
### channels
@@ -127,7 +127,7 @@ ___
[src/lib/connection.ts:40](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L40)
-___
+---
### parsedAsyncAPI
@@ -141,7 +141,7 @@ ___
[src/lib/connection.ts:52](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L52)
-___
+---
### rawConnection
@@ -155,7 +155,7 @@ ___
[src/lib/connection.ts:36](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L36)
-___
+---
### serverName
@@ -185,7 +185,7 @@ Returns the real connection object.
[src/lib/connection.ts:71](https://github.com/asyncapi/glee/blob/388e335/src/lib/connection.ts#L71)
-___
+---
### hasChannel
@@ -195,8 +195,8 @@ Checks whether a channel is associated with this connection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------------ | :------- | :----------------------- |
| `channelName` | `string` | The name of the channel. |
#### Returns
diff --git a/docs/reference/classes/lib_glee.default.md b/docs/reference/classes/lib_glee.default.md
index 7d0c36408..b3e002fe1 100644
--- a/docs/reference/classes/lib_glee.default.md
+++ b/docs/reference/classes/lib_glee.default.md
@@ -79,8 +79,8 @@ Instantiates Glee.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :------------------------------------------- |
| `options` | [`GleeConfig`](../modules/lib.md#gleeconfig) |
#### Overrides
@@ -101,7 +101,7 @@ EventEmitter.constructor
[src/lib/glee.ts:32](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L32)
-___
+---
### \_clusterAdapter
@@ -111,7 +111,7 @@ ___
[src/lib/glee.ts:33](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L33)
-___
+---
### \_options
@@ -121,7 +121,7 @@ ___
[src/lib/glee.ts:30](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L30)
-___
+---
### \_router
@@ -131,7 +131,7 @@ ___
[src/lib/glee.ts:31](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L31)
-___
+---
### captureRejectionSymbol
@@ -145,7 +145,7 @@ EventEmitter.captureRejectionSymbol
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -161,7 +161,7 @@ EventEmitter.captureRejections
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -175,7 +175,7 @@ EventEmitter.defaultMaxListeners
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -211,7 +211,7 @@ node_modules/@types/node/events.d.ts:300
[src/lib/glee.ts:52](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L52)
-___
+---
### clusterAdapter
@@ -225,7 +225,7 @@ ___
[src/lib/glee.ts:56](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L56)
-___
+---
### options
@@ -243,16 +243,16 @@ ___
### \_execErrorMiddleware
-βΈ `Private` **_execErrorMiddleware**(`emws`, `index`, `error`, `message`): `void`
+βΈ `Private` **\_execErrorMiddleware**(`emws`, `index`, `error`, `message`): `void`
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emws` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] |
-| `index` | `number` |
-| `error` | `Error` |
-| `message` | [`default`](lib_message.default.md) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------------------------------------- |
+| `emws` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] |
+| `index` | `number` |
+| `error` | `Error` |
+| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -262,21 +262,21 @@ ___
[src/lib/glee.ts:261](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L261)
-___
+---
### \_processError
-βΈ `Private` **_processError**(`errorMiddlewares`, `error`, `message`): `void`
+βΈ `Private` **\_processError**(`errorMiddlewares`, `error`, `message`): `void`
Starts executing the middlewares for the given error and message.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----------------- | :-------------------------------------------------------------------------------------- | :-------------------------------------- |
| `errorMiddlewares` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] | The error middlewares chain to execute. |
-| `error` | `Error` | The error to pass to the middleware. |
-| `message` | [`default`](lib_message.default.md) | The message to pass to the middlewares. |
+| `error` | `Error` | The error to pass to the middleware. |
+| `message` | [`default`](lib_message.default.md) | The message to pass to the middlewares. |
#### Returns
@@ -286,21 +286,21 @@ Starts executing the middlewares for the given error and message.
[src/lib/glee.ts:254](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L254)
-___
+---
### \_processMessage
-βΈ `Private` **_processMessage**(`middlewares`, `errorMiddlewares`, `message`): `void`
+βΈ `Private` **\_processMessage**(`middlewares`, `errorMiddlewares`, `message`): `void`
Starts executing the middlewares for the given message.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `middlewares` | [`ChannelMiddlewareTuple`](../modules/lib_router.md#channelmiddlewaretuple)[] | The middleware chain to execute. |
+| Name | Type | Description |
+| :----------------- | :-------------------------------------------------------------------------------------- | :------------------------------------------------- |
+| `middlewares` | [`ChannelMiddlewareTuple`](../modules/lib_router.md#channelmiddlewaretuple)[] | The middleware chain to execute. |
| `errorMiddlewares` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] | The middlewares chain to execute in case of error. |
-| `message` | [`default`](lib_message.default.md) | The message to pass to the middlewares. |
+| `message` | [`default`](lib_message.default.md) | The message to pass to the middlewares. |
#### Returns
@@ -310,7 +310,7 @@ Starts executing the middlewares for the given message.
[src/lib/glee.ts:200](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L200)
-___
+---
### addAdapter
@@ -320,13 +320,13 @@ Adds a connection adapter.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `Adapter` | typeof [`default`](lib_adapter.default.md) |
-| `__namedParameters` | `Object` |
-| `__namedParameters.parsedAsyncAPI` | `AsyncAPIDocument` |
-| `__namedParameters.server` | `Server` |
-| `__namedParameters.serverName` | `string` |
+| Name | Type |
+| :--------------------------------- | :----------------------------------------- |
+| `Adapter` | typeof [`default`](lib_adapter.default.md) |
+| `__namedParameters` | `Object` |
+| `__namedParameters.parsedAsyncAPI` | `AsyncAPIDocument` |
+| `__namedParameters.server` | `Server` |
+| `__namedParameters.serverName` | `string` |
#### Returns
@@ -336,7 +336,7 @@ Adds a connection adapter.
[src/lib/glee.ts:68](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L68)
-___
+---
### addListener
@@ -348,10 +348,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -365,7 +365,7 @@ EventEmitter.addListener
node_modules/@types/node/events.d.ts:327
-___
+---
### connect
@@ -381,7 +381,7 @@ Tells the adapters to connect.
[src/lib/glee.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L123)
-___
+---
### emit
@@ -393,26 +393,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -429,10 +429,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -446,7 +446,7 @@ EventEmitter.emit
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -456,15 +456,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -482,7 +482,7 @@ EventEmitter.eventNames
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -505,7 +505,7 @@ EventEmitter.getMaxListeners
node_modules/@types/node/events.d.ts:499
-___
+---
### injectError
@@ -515,10 +515,10 @@ Injects an error into the Glee inbound error middleware chain.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `error` | `Error` | The error. |
-| `channel?` | `string` | - |
+| Name | Type | Description |
+| :--------- | :------- | :---------- |
+| `error` | `Error` | The error. |
+| `channel?` | `string` | - |
#### Returns
@@ -528,7 +528,7 @@ Injects an error into the Glee inbound error middleware chain.
[src/lib/glee.ts:171](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L171)
-___
+---
### injectMessage
@@ -538,11 +538,11 @@ Injects a message into the Glee inbound middleware chain.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `message` | [`default`](lib_message.default.md) | The message you want to send. |
-| `serverName` | `string` | The name of the server this message is coming from. |
-| `connection` | [`default`](lib_connection.default.md) | - |
+| Name | Type | Description |
+| :----------- | :------------------------------------- | :-------------------------------------------------- |
+| `message` | [`default`](lib_message.default.md) | The message you want to send. |
+| `serverName` | `string` | The name of the server this message is coming from. |
+| `connection` | [`default`](lib_connection.default.md) | - |
#### Returns
@@ -552,7 +552,7 @@ Injects a message into the Glee inbound middleware chain.
[src/lib/glee.ts:153](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L153)
-___
+---
### listen
@@ -568,7 +568,7 @@ Alias for `connect`.
[src/lib/glee.ts:142](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L142)
-___
+---
### listenerCount
@@ -580,8 +580,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -596,7 +596,7 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -606,9 +606,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -616,8 +616,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -632,7 +632,7 @@ EventEmitter.listeners
node_modules/@types/node/events.d.ts:512
-___
+---
### off
@@ -644,10 +644,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -661,7 +661,7 @@ EventEmitter.off
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -674,8 +674,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -684,10 +684,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -697,10 +697,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -714,7 +714,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -725,8 +725,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -735,10 +735,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -748,10 +748,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -765,7 +765,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -778,8 +778,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -788,10 +788,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -805,19 +805,19 @@ EventEmitter.prependListener
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](lib_glee.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -826,10 +826,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -843,7 +843,7 @@ EventEmitter.prependOnceListener
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -853,35 +853,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -896,7 +896,7 @@ EventEmitter.rawListeners
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -914,8 +914,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -930,7 +930,7 @@ EventEmitter.removeAllListeners
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -940,11 +940,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -953,35 +953,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -997,18 +997,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -1017,10 +1017,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -1034,7 +1034,7 @@ EventEmitter.removeListener
node_modules/@types/node/events.d.ts:467
-___
+---
### send
@@ -1044,8 +1044,8 @@ Send a message to the adapters.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :---------------------------------- | :------------------------------------------- |
| `message` | [`default`](lib_message.default.md) | The payload of the message you want to send. |
#### Returns
@@ -1056,7 +1056,7 @@ Send a message to the adapters.
[src/lib/glee.ts:110](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L110)
-___
+---
### setClusterAdapter
@@ -1066,8 +1066,8 @@ Sets the cluster adapter to use.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :----------------------------------------- |
| `Adapter` | typeof [`default`](lib_cluster.default.md) |
#### Returns
@@ -1078,7 +1078,7 @@ Sets the cluster adapter to use.
[src/lib/glee.ts:77](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L77)
-___
+---
### setMaxListeners
@@ -1095,9 +1095,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1111,7 +1111,7 @@ EventEmitter.setMaxListeners
node_modules/@types/node/events.d.ts:493
-___
+---
### syncCluster
@@ -1121,8 +1121,8 @@ Synchronizes the other instances in the cluster with the message.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------------------------------- |
| `message` | [`default`](lib_message.default.md) |
#### Returns
@@ -1133,7 +1133,7 @@ Synchronizes the other instances in the cluster with the message.
[src/lib/glee.ts:184](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L184)
-___
+---
### use
@@ -1143,8 +1143,8 @@ Use a middleware for inbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -1159,9 +1159,9 @@ Use a middleware for inbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
+| `channel` | `string` |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -1172,7 +1172,7 @@ Use a middleware for inbound messages.
[src/lib/glee.ts:89](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L89)
-___
+---
### useOutbound
@@ -1182,8 +1182,8 @@ Use a middleware for outbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -1198,9 +1198,9 @@ Use a middleware for outbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
+| `channel` | `string` |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -1211,7 +1211,7 @@ Use a middleware for outbound messages.
[src/lib/glee.ts:100](https://github.com/asyncapi/glee/blob/388e335/src/lib/glee.ts#L100)
-___
+---
### getEventListeners
@@ -1226,19 +1226,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1246,10 +1246,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1263,7 +1263,7 @@ EventEmitter.getEventListeners
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1272,11 +1272,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1286,10 +1286,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1303,32 +1303,32 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1339,39 +1339,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1387,7 +1387,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1402,31 +1402,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1434,15 +1434,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1450,38 +1450,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1499,11 +1499,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1517,7 +1517,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1530,23 +1530,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/lib_message.default.md b/docs/reference/classes/lib_message.default.md
index 4a8088c5f..ae2556302 100644
--- a/docs/reference/classes/lib_message.default.md
+++ b/docs/reference/classes/lib_message.default.md
@@ -83,8 +83,8 @@ Instantiates a new GleeMessage.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :------------------------ |
| `options` | `IGleeMessageConstructor` |
#### Overrides
@@ -105,7 +105,7 @@ EventEmitter.constructor
[src/lib/message.ts:28](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L28)
-___
+---
### \_channel
@@ -115,7 +115,7 @@ ___
[src/lib/message.ts:25](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L25)
-___
+---
### \_cluster
@@ -125,7 +125,7 @@ ___
[src/lib/message.ts:31](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L31)
-___
+---
### \_connection
@@ -135,7 +135,7 @@ ___
[src/lib/message.ts:27](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L27)
-___
+---
### \_headers
@@ -149,7 +149,7 @@ ___
[src/lib/message.ts:24](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L24)
-___
+---
### \_inbound
@@ -159,7 +159,7 @@ ___
[src/lib/message.ts:29](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L29)
-___
+---
### \_outbound
@@ -169,7 +169,7 @@ ___
[src/lib/message.ts:30](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L30)
-___
+---
### \_params
@@ -183,7 +183,7 @@ ___
[src/lib/message.ts:32](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L32)
-___
+---
### \_payload
@@ -193,7 +193,7 @@ ___
[src/lib/message.ts:23](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L23)
-___
+---
### \_serverName
@@ -203,7 +203,7 @@ ___
[src/lib/message.ts:26](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L26)
-___
+---
### captureRejectionSymbol
@@ -217,7 +217,7 @@ EventEmitter.captureRejectionSymbol
node_modules/@types/node/events.d.ts:301
-___
+---
### captureRejections
@@ -233,7 +233,7 @@ EventEmitter.captureRejections
node_modules/@types/node/events.d.ts:306
-___
+---
### defaultMaxListeners
@@ -247,7 +247,7 @@ EventEmitter.defaultMaxListeners
node_modules/@types/node/events.d.ts:307
-___
+---
### errorMonitor
@@ -283,7 +283,7 @@ node_modules/@types/node/events.d.ts:300
[src/lib/message.ts:106](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L106)
-___
+---
### channel
@@ -301,8 +301,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `value` | `string` |
#### Returns
@@ -313,7 +313,7 @@ ___
[src/lib/message.ts:86](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L86)
-___
+---
### cluster
@@ -331,8 +331,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :-------- |
| `value` | `boolean` |
#### Returns
@@ -343,7 +343,7 @@ ___
[src/lib/message.ts:122](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L122)
-___
+---
### connection
@@ -361,8 +361,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------------------------------------- |
| `value` | [`default`](lib_connection.default.md) |
#### Returns
@@ -373,7 +373,7 @@ ___
[src/lib/message.ts:102](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L102)
-___
+---
### headers
@@ -391,8 +391,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `value` | `Object` |
#### Returns
@@ -403,7 +403,7 @@ ___
[src/lib/message.ts:78](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L78)
-___
+---
### params
@@ -421,8 +421,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `value` | `Object` |
#### Returns
@@ -433,7 +433,7 @@ ___
[src/lib/message.ts:114](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L114)
-___
+---
### payload
@@ -451,8 +451,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :---- |
| `value` | `any` |
#### Returns
@@ -463,7 +463,7 @@ ___
[src/lib/message.ts:70](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L70)
-___
+---
### serverName
@@ -481,8 +481,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `value` | `string` |
#### Returns
@@ -505,10 +505,10 @@ Alias for `emitter.on(eventName, listener)`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -522,7 +522,7 @@ EventEmitter.addListener
node_modules/@types/node/events.d.ts:327
-___
+---
### emit
@@ -534,26 +534,26 @@ to each.
Returns `true` if the event had listeners, `false` otherwise.
```js
-const EventEmitter = require('events');
-const myEmitter = new EventEmitter();
+const EventEmitter = require('events')
+const myEmitter = new EventEmitter()
// First listener
myEmitter.on('event', function firstListener() {
- console.log('Helloooo! first listener');
-});
+ console.log('Helloooo! first listener')
+})
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
-});
+ 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`);
-});
+ const parameters = args.join(', ')
+ console.log(`event with parameters ${parameters} in third listener`)
+})
-console.log(myEmitter.listeners('event'));
+console.log(myEmitter.listeners('event'))
-myEmitter.emit('event', 1, 2, 3, 4, 5);
+myEmitter.emit('event', 1, 2, 3, 4, 5)
// Prints:
// [
@@ -570,10 +570,10 @@ myEmitter.emit('event', 1, 2, 3, 4, 5);
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
-| `...args` | `any`[] |
+| `...args` | `any`[] |
#### Returns
@@ -587,7 +587,7 @@ EventEmitter.emit
node_modules/@types/node/events.d.ts:583
-___
+---
### eventNames
@@ -597,15 +597,15 @@ Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or `Symbol`s.
```js
-const EventEmitter = require('events');
-const myEE = new EventEmitter();
-myEE.on('foo', () => {});
-myEE.on('bar', () => {});
+const EventEmitter = require('events')
+const myEE = new EventEmitter()
+myEE.on('foo', () => {})
+myEE.on('bar', () => {})
-const sym = Symbol('symbol');
-myEE.on(sym, () => {});
+const sym = Symbol('symbol')
+myEE.on(sym, () => {})
-console.log(myEE.eventNames());
+console.log(myEE.eventNames())
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
```
@@ -623,7 +623,7 @@ EventEmitter.eventNames
node_modules/@types/node/events.d.ts:642
-___
+---
### getMaxListeners
@@ -646,7 +646,7 @@ EventEmitter.getMaxListeners
node_modules/@types/node/events.d.ts:499
-___
+---
### isInbound
@@ -662,7 +662,7 @@ Checks if it's an inbound message.
[src/lib/message.ts:175](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L175)
-___
+---
### isOutbound
@@ -678,7 +678,7 @@ Checks if it's an outbound message.
[src/lib/message.ts:182](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L182)
-___
+---
### listenerCount
@@ -690,8 +690,8 @@ Returns the number of listeners listening to the event named `eventName`.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :---------- | :------------------- | :--------------------------------------- |
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
#### Returns
@@ -706,7 +706,7 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:589
-___
+---
### listeners
@@ -716,9 +716,9 @@ Returns a copy of the array of listeners for the event named `eventName`.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
-console.log(util.inspect(server.listeners('connection')));
+ console.log('someone connected!')
+})
+console.log(util.inspect(server.listeners('connection')))
// Prints: [ [Function] ]
```
@@ -726,8 +726,8 @@ console.log(util.inspect(server.listeners('connection')));
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -742,7 +742,7 @@ EventEmitter.listeners
node_modules/@types/node/events.d.ts:512
-___
+---
### off
@@ -754,10 +754,10 @@ Alias for `emitter.removeListener()`.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -771,7 +771,7 @@ EventEmitter.off
node_modules/@types/node/events.d.ts:472
-___
+---
### on
@@ -784,8 +784,8 @@ times.
```js
server.on('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -794,10 +794,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.on('foo', () => console.log('a'));
-myEE.prependListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.on('foo', () => console.log('a'))
+myEE.prependListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -807,10 +807,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -824,7 +824,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:358
-___
+---
### once
@@ -835,8 +835,8 @@ next time `eventName` is triggered, this listener is removed and then invoked.
```js
server.once('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -845,10 +845,10 @@ By default, event listeners are invoked in the order they are added. The`emitter
event listener to the beginning of the listeners array.
```js
-const myEE = new EventEmitter();
-myEE.once('foo', () => console.log('a'));
-myEE.prependOnceListener('foo', () => console.log('b'));
-myEE.emit('foo');
+const myEE = new EventEmitter()
+myEE.once('foo', () => console.log('a'))
+myEE.prependOnceListener('foo', () => console.log('b'))
+myEE.emit('foo')
// Prints:
// b
// a
@@ -858,10 +858,10 @@ myEE.emit('foo');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -875,7 +875,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:387
-___
+---
### prependListener
@@ -888,8 +888,8 @@ times.
```js
server.prependListener('connection', (stream) => {
- console.log('someone connected!');
-});
+ console.log('someone connected!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -898,10 +898,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -915,19 +915,19 @@ EventEmitter.prependListener
node_modules/@types/node/events.d.ts:607
-___
+---
### prependOnceListener
βΈ **prependOnceListener**(`eventName`, `listener`): [`default`](lib_message.default.md)
-Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
+Adds a **one-time**`listener` function for the event named `eventName` to the*beginning* of the listeners array. The next time `eventName` is triggered, this
listener is removed, and then invoked.
```js
server.prependOnceListener('connection', (stream) => {
- console.log('Ah, we have our first user!');
-});
+ console.log('Ah, we have our first user!')
+})
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -936,10 +936,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `eventName` | `string` \| `symbol` | The name of the event. |
-| `listener` | (...`args`: `any`[]) => `void` | The callback function |
+| Name | Type | Description |
+| :---------- | :----------------------------- | :--------------------- |
+| `eventName` | `string` \| `symbol` | The name of the event. |
+| `listener` | (...`args`: `any`[]) => `void` | The callback function |
#### Returns
@@ -953,7 +953,7 @@ EventEmitter.prependOnceListener
node_modules/@types/node/events.d.ts:623
-___
+---
### rawListeners
@@ -963,35 +963,35 @@ Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`).
```js
-const emitter = new EventEmitter();
-emitter.once('log', () => console.log('log once'));
+const emitter = new EventEmitter()
+emitter.once('log', () => console.log('log once'))
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
-const listeners = emitter.rawListeners('log');
-const logFnWrapper = listeners[0];
+const listeners = emitter.rawListeners('log')
+const logFnWrapper = listeners[0]
// Logs "log once" to the console and does not unbind the `once` event
-logFnWrapper.listener();
+logFnWrapper.listener()
// Logs "log once" to the console and removes the listener
-logFnWrapper();
+logFnWrapper()
-emitter.on('log', () => console.log('log persistently'));
+emitter.on('log', () => console.log('log persistently'))
// Will return a new Array with a single function bound by `.on()` above
-const newListeners = emitter.rawListeners('log');
+const newListeners = emitter.rawListeners('log')
// Logs "log persistently" twice
-newListeners[0]();
-emitter.emit('log');
+newListeners[0]()
+emitter.emit('log')
```
**`since`** v9.4.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---------- | :------------------- |
| `eventName` | `string` \| `symbol` |
#### Returns
@@ -1006,7 +1006,7 @@ EventEmitter.rawListeners
node_modules/@types/node/events.d.ts:542
-___
+---
### removeAllListeners
@@ -1024,8 +1024,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------------------- |
| `event?` | `string` \| `symbol` |
#### Returns
@@ -1040,7 +1040,7 @@ EventEmitter.removeAllListeners
node_modules/@types/node/events.d.ts:483
-___
+---
### removeListener
@@ -1050,11 +1050,11 @@ Removes the specified `listener` from the listener array for the event named`eve
```js
const callback = (stream) => {
- console.log('someone connected!');
-};
-server.on('connection', callback);
+ console.log('someone connected!')
+}
+server.on('connection', callback)
// ...
-server.removeListener('connection', callback);
+server.removeListener('connection', callback)
```
`removeListener()` will remove, at most, one instance of a listener from the
@@ -1063,35 +1063,35 @@ listener array for the specified `eventName`, then `removeListener()` must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
-time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
+time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and*before* the last listener finishes execution will
not remove them from`emit()` in progress. Subsequent events behave as expected.
```js
-const myEmitter = new MyEmitter();
+const myEmitter = new MyEmitter()
const callbackA = () => {
- console.log('A');
- myEmitter.removeListener('event', callbackB);
-};
+ console.log('A')
+ myEmitter.removeListener('event', callbackB)
+}
const callbackB = () => {
- console.log('B');
-};
+ console.log('B')
+}
-myEmitter.on('event', callbackA);
+myEmitter.on('event', callbackA)
-myEmitter.on('event', callbackB);
+myEmitter.on('event', callbackB)
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
-myEmitter.emit('event');
+myEmitter.emit('event')
// Prints:
// A
```
@@ -1107,18 +1107,18 @@ event (as in the example below), `removeListener()` will remove the most
recently added instance. In the example the `once('ping')`listener is removed:
```js
-const ee = new EventEmitter();
+const ee = new EventEmitter()
function pong() {
- console.log('pong');
+ console.log('pong')
}
-ee.on('ping', pong);
-ee.once('ping', pong);
-ee.removeListener('ping', pong);
+ee.on('ping', pong)
+ee.once('ping', pong)
+ee.removeListener('ping', pong)
-ee.emit('ping');
-ee.emit('ping');
+ee.emit('ping')
+ee.emit('ping')
```
Returns a reference to the `EventEmitter`, so that calls can be chained.
@@ -1127,10 +1127,10 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `eventName` | `string` \| `symbol` |
-| `listener` | (...`args`: `any`[]) => `void` |
+| Name | Type |
+| :---------- | :----------------------------- |
+| `eventName` | `string` \| `symbol` |
+| `listener` | (...`args`: `any`[]) => `void` |
#### Returns
@@ -1144,7 +1144,7 @@ EventEmitter.removeListener
node_modules/@types/node/events.d.ts:467
-___
+---
### reply
@@ -1154,8 +1154,8 @@ Sends the message back to the server/broker.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :------- |
| `options` | `IReply` |
#### Returns
@@ -1166,7 +1166,7 @@ Sends the message back to the server/broker.
[src/lib/message.ts:134](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L134)
-___
+---
### send
@@ -1182,7 +1182,7 @@ Tells Glee to send the message.
[src/lib/message.ts:189](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L189)
-___
+---
### setInbound
@@ -1198,7 +1198,7 @@ Makes the message suitable only for the inbound pipeline.
[src/lib/message.ts:159](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L159)
-___
+---
### setMaxListeners
@@ -1215,9 +1215,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n` | `number` |
+| Name | Type |
+| :--- | :------- |
+| `n` | `number` |
#### Returns
@@ -1231,7 +1231,7 @@ EventEmitter.setMaxListeners
node_modules/@types/node/events.d.ts:493
-___
+---
### setOutbound
@@ -1247,7 +1247,7 @@ Makes the message suitable only for the outbound pipeline.
[src/lib/message.ts:167](https://github.com/asyncapi/glee/blob/388e335/src/lib/message.ts#L167)
-___
+---
### getEventListeners
@@ -1262,19 +1262,19 @@ For `EventTarget`s this is the only way to get the event listeners for the
event target. This is useful for debugging and diagnostic purposes.
```js
-const { getEventListeners, EventEmitter } = require('events');
+const { getEventListeners, EventEmitter } = require('events')
{
- const ee = new EventEmitter();
- const listener = () => console.log('Events are fun');
- ee.on('foo', listener);
- getEventListeners(ee, 'foo'); // [listener]
+ const ee = new EventEmitter()
+ const listener = () => console.log('Events are fun')
+ ee.on('foo', listener)
+ getEventListeners(ee, 'foo') // [listener]
}
{
- const et = new EventTarget();
- const listener = () => console.log('Events are fun');
- et.addEventListener('foo', listener);
- getEventListeners(et, 'foo'); // [listener]
+ const et = new EventTarget()
+ const listener = () => console.log('Events are fun')
+ et.addEventListener('foo', listener)
+ getEventListeners(et, 'foo') // [listener]
}
```
@@ -1282,10 +1282,10 @@ const { getEventListeners, EventEmitter } = require('events');
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------- |
| `emitter` | `DOMEventTarget` \| `EventEmitter` |
-| `name` | `string` \| `symbol` |
+| `name` | `string` \| `symbol` |
#### Returns
@@ -1299,7 +1299,7 @@ EventEmitter.getEventListeners
node_modules/@types/node/events.d.ts:270
-___
+---
### listenerCount
@@ -1308,11 +1308,11 @@ ___
A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
```js
-const { EventEmitter, listenerCount } = require('events');
-const myEmitter = new EventEmitter();
-myEmitter.on('event', () => {});
-myEmitter.on('event', () => {});
-console.log(listenerCount(myEmitter, 'event'));
+const { EventEmitter, listenerCount } = require('events')
+const myEmitter = new EventEmitter()
+myEmitter.on('event', () => {})
+myEmitter.on('event', () => {})
+console.log(listenerCount(myEmitter, 'event'))
// Prints: 2
```
@@ -1322,10 +1322,10 @@ console.log(listenerCount(myEmitter, 'event'));
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | The emitter to query |
-| `eventName` | `string` \| `symbol` | The event name |
+| Name | Type | Description |
+| :---------- | :------------------- | :------------------- |
+| `emitter` | `EventEmitter` | The emitter to query |
+| `eventName` | `string` \| `symbol` | The event name |
#### Returns
@@ -1339,32 +1339,32 @@ EventEmitter.listenerCount
node_modules/@types/node/events.d.ts:242
-___
+---
### on
βΈ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
```js
-const { on, EventEmitter } = require('events');
+const { on, EventEmitter } = require('events')
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo')) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
```
Returns an `AsyncIterator` that iterates `eventName` events. It will throw
@@ -1375,39 +1375,39 @@ composed of the emitted event arguments.
An `AbortSignal` can be used to cancel waiting on events:
```js
-const { on, EventEmitter } = require('events');
-const ac = new AbortController();
+const { on, EventEmitter } = require('events')
+const ac = new AbortController()
-(async () => {
- const ee = new EventEmitter();
+;(async () => {
+ const ee = new EventEmitter()
// Emit later on
process.nextTick(() => {
- ee.emit('foo', 'bar');
- ee.emit('foo', 42);
- });
+ ee.emit('foo', 'bar')
+ ee.emit('foo', 42)
+ })
for await (const event of on(ee, 'foo', { signal: ac.signal })) {
// The execution of this inner block is synchronous and it
// processes one event at a time (even with await). Do not use
// if concurrent execution is required.
- console.log(event); // prints ['bar'] [42]
+ console.log(event) // prints ['bar'] [42]
}
// Unreachable here
-})();
+})()
-process.nextTick(() => ac.abort());
+process.nextTick(() => ac.abort())
```
**`since`** v13.6.0, v12.16.0
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `emitter` | `EventEmitter` | - |
-| `eventName` | `string` | The name of the event being listened for |
-| `options?` | `StaticEventEmitterOptions` | - |
+| Name | Type | Description |
+| :---------- | :-------------------------- | :--------------------------------------- |
+| `emitter` | `EventEmitter` | - |
+| `eventName` | `string` | The name of the event being listened for |
+| `options?` | `StaticEventEmitterOptions` | - |
#### Returns
@@ -1423,7 +1423,7 @@ EventEmitter.on
node_modules/@types/node/events.d.ts:221
-___
+---
### once
@@ -1438,31 +1438,31 @@ This method is intentionally generic and works with the web platform [EventTarge
semantics and does not listen to the `'error'` event.
```js
-const { once, EventEmitter } = require('events');
+const { once, EventEmitter } = require('events')
async function run() {
- const ee = new EventEmitter();
+ const ee = new EventEmitter()
process.nextTick(() => {
- ee.emit('myevent', 42);
- });
+ ee.emit('myevent', 42)
+ })
- const [value] = await once(ee, 'myevent');
- console.log(value);
+ const [value] = await once(ee, 'myevent')
+ console.log(value)
- const err = new Error('kaboom');
+ const err = new Error('kaboom')
process.nextTick(() => {
- ee.emit('error', err);
- });
+ ee.emit('error', err)
+ })
try {
- await once(ee, 'myevent');
+ await once(ee, 'myevent')
} catch (err) {
- console.log('error happened', err);
+ console.log('error happened', err)
}
}
-run();
+run()
```
The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
@@ -1470,15 +1470,15 @@ The special handling of the `'error'` event is only used when `events.once()`is
special handling:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
+const ee = new EventEmitter()
once(ee, 'error')
.then(([err]) => console.log('ok', err.message))
- .catch((err) => console.log('error', err.message));
+ .catch((err) => console.log('error', err.message))
-ee.emit('error', new Error('boom'));
+ee.emit('error', new Error('boom'))
// Prints: ok boom
```
@@ -1486,38 +1486,38 @@ ee.emit('error', new Error('boom'));
An `AbortSignal` can be used to cancel waiting for the event:
```js
-const { EventEmitter, once } = require('events');
+const { EventEmitter, once } = require('events')
-const ee = new EventEmitter();
-const ac = new AbortController();
+const ee = new EventEmitter()
+const ac = new AbortController()
async function foo(emitter, event, signal) {
try {
- await once(emitter, event, { signal });
- console.log('event emitted!');
+ await once(emitter, event, { signal })
+ console.log('event emitted!')
} catch (error) {
if (error.name === 'AbortError') {
- console.error('Waiting for the event was canceled!');
+ console.error('Waiting for the event was canceled!')
} else {
- console.error('There was an error', error.message);
+ console.error('There was an error', error.message)
}
}
}
-foo(ee, 'foo', ac.signal);
-ac.abort(); // Abort waiting for the event
-ee.emit('foo'); // Prints: Waiting for the event was canceled!
+foo(ee, 'foo', ac.signal)
+ac.abort() // Abort waiting for the event
+ee.emit('foo') // Prints: Waiting for the event was canceled!
```
**`since`** v11.13.0, v10.16.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `NodeEventTarget` |
-| `eventName` | `string` \| `symbol` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `NodeEventTarget` |
+| `eventName` | `string` \| `symbol` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1535,11 +1535,11 @@ node_modules/@types/node/events.d.ts:157
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `emitter` | `DOMEventTarget` |
-| `eventName` | `string` |
-| `options?` | `StaticEventEmitterOptions` |
+| Name | Type |
+| :---------- | :-------------------------- |
+| `emitter` | `DOMEventTarget` |
+| `eventName` | `string` |
+| `options?` | `StaticEventEmitterOptions` |
#### Returns
@@ -1553,7 +1553,7 @@ EventEmitter.once
node_modules/@types/node/events.d.ts:162
-___
+---
### setMaxListeners
@@ -1566,23 +1566,23 @@ modified (if eventTargets is empty) or modify the limit specified in every `Even
The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
```js
-EventEmitter.setMaxListeners(20);
+EventEmitter.setMaxListeners(20)
// Equivalent to
-EventEmitter.defaultMaxListeners = 20;
+EventEmitter.defaultMaxListeners = 20
-const eventTarget = new EventTarget();
+const eventTarget = new EventTarget()
// Only way to increase limit for `EventTarget` instances
// as these doesn't expose its own `setMaxListeners` method
-EventEmitter.setMaxListeners(20, eventTarget);
+EventEmitter.setMaxListeners(20, eventTarget)
```
**`since`** v15.3.0, v14.17.0
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `n?` | `number` |
+| Name | Type |
+| :---------------- | :------------------------------------- |
+| `n?` | `number` |
| `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
#### Returns
diff --git a/docs/reference/classes/lib_router.default.md b/docs/reference/classes/lib_router.default.md
index 6c01af4e5..ef2364f85 100644
--- a/docs/reference/classes/lib_router.default.md
+++ b/docs/reference/classes/lib_router.default.md
@@ -54,7 +54,7 @@ Instantiates a GleeRouter.
[src/lib/router.ts:19](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L19)
-___
+---
### middlewares
@@ -64,7 +64,7 @@ ___
[src/lib/router.ts:17](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L17)
-___
+---
### outboundErrorMiddlewares
@@ -74,7 +74,7 @@ ___
[src/lib/router.ts:20](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L20)
-___
+---
### outboundMiddlewares
@@ -88,17 +88,17 @@ ___
### \_addMiddlewares
-βΈ `Private` **_addMiddlewares**(`target`, `middlewares`, `channel`): `void`
+βΈ `Private` **\_addMiddlewares**(`target`, `middlewares`, `channel`): `void`
Adds a normalized middleware to a target collection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `target` | [`GenericChannelMiddlewareTuple`](../modules/lib_router.md#genericchannelmiddlewaretuple)[] | The target collection. |
+| Name | Type | Description |
+| :------------ | :------------------------------------------------------------------------------------------ | :---------------------------------------- |
+| `target` | [`GenericChannelMiddlewareTuple`](../modules/lib_router.md#genericchannelmiddlewaretuple)[] | The target collection. |
| `middlewares` | [`GenericChannelMiddlewareTuple`](../modules/lib_router.md#genericchannelmiddlewaretuple)[] | The middlewares to add to the collection. |
-| `channel` | `string` | - |
+| `channel` | `string` | - |
#### Returns
@@ -108,7 +108,7 @@ Adds a normalized middleware to a target collection.
[src/lib/router.ts:122](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L122)
-___
+---
### addErrorMiddlewares
@@ -118,10 +118,10 @@ Adds a normalized middleware to the inbound error middlewares collection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----------------- | :-------------------------------------------------------------------------------------- | :---------------------------------------- |
| `errorMiddlewares` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] | The middlewares to add to the collection. |
-| `channel?` | `string` | - |
+| `channel?` | `string` | - |
#### Returns
@@ -131,7 +131,7 @@ Adds a normalized middleware to the inbound error middlewares collection.
[src/lib/router.ts:159](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L159)
-___
+---
### addMiddlewares
@@ -141,10 +141,10 @@ Adds a normalized middleware to the inbound middlewares collection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------------ | :---------------------------------------------------------------------------- | :---------------------------------------- |
| `middlewares` | [`ChannelMiddlewareTuple`](../modules/lib_router.md#channelmiddlewaretuple)[] | The middlewares to add to the collection. |
-| `channel?` | `string` | - |
+| `channel?` | `string` | - |
#### Returns
@@ -154,7 +154,7 @@ Adds a normalized middleware to the inbound middlewares collection.
[src/lib/router.ts:139](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L139)
-___
+---
### addOutboundErrorMiddlewares
@@ -164,10 +164,10 @@ Adds a normalized middleware to the outbound error middlewares collection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :----------------- | :-------------------------------------------------------------------------------------- | :---------------------------------------- |
| `errorMiddlewares` | [`ChannelErrorMiddlewareTuple`](../modules/lib_router.md#channelerrormiddlewaretuple)[] | The middlewares to add to the collection. |
-| `channel?` | `string` | - |
+| `channel?` | `string` | - |
#### Returns
@@ -177,7 +177,7 @@ Adds a normalized middleware to the outbound error middlewares collection.
[src/lib/router.ts:169](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L169)
-___
+---
### addOutboundMiddlewares
@@ -187,10 +187,10 @@ Adds a normalized middleware to the outbound middlewares collection.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------------ | :---------------------------------------------------------------------------- | :---------------------------------------- |
| `middlewares` | [`ChannelMiddlewareTuple`](../modules/lib_router.md#channelmiddlewaretuple)[] | The middlewares to add to the collection. |
-| `channel?` | `string` | - |
+| `channel?` | `string` | - |
#### Returns
@@ -200,7 +200,7 @@ Adds a normalized middleware to the outbound middlewares collection.
[src/lib/router.ts:149](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L149)
-___
+---
### getErrorMiddlewares
@@ -216,7 +216,7 @@ Returns all the inbound error middlewares.
[src/lib/router.ts:102](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L102)
-___
+---
### getMiddlewares
@@ -232,7 +232,7 @@ Returns all the inbound middlewares.
[src/lib/router.ts:86](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L86)
-___
+---
### getOutboundErrorMiddlewares
@@ -248,7 +248,7 @@ Returns all the outbound error middlewares.
[src/lib/router.ts:110](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L110)
-___
+---
### getOutboundMiddlewares
@@ -264,7 +264,7 @@ Returns all the outbound middlewares.
[src/lib/router.ts:94](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L94)
-___
+---
### middlewaresToChannelMiddlewaresTuples
@@ -272,10 +272,10 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` \| [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware) |
-| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
+| Name | Type |
+| :--------------- | :---------------------------------------------------------------------------- |
+| `channel` | `string` \| [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware) |
+| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -285,7 +285,7 @@ ___
[src/lib/router.ts:73](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L73)
-___
+---
### use
@@ -296,8 +296,8 @@ this function will make use of inbound and outbound middlewares.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -312,9 +312,9 @@ this function will make use of inbound and outbound middlewares.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
+| `channel` | `string` |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -325,7 +325,7 @@ this function will make use of inbound and outbound middlewares.
[src/lib/router.ts:40](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L40)
-___
+---
### useOutbound
@@ -335,8 +335,8 @@ Use a middleware for outbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
@@ -351,9 +351,9 @@ Use a middleware for outbound messages.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
+| Name | Type |
+| :--------------- | :------------------------------------------------------------------ |
+| `channel` | `string` |
| `...middlewares` | [`GenericMiddleware`](../modules/lib_router.md#genericmiddleware)[] |
#### Returns
diff --git a/docs/reference/interfaces/lib_logger.chalk.Chalk.md b/docs/reference/interfaces/lib_logger.chalk.Chalk.md
index a924b1b85..f7e61680f 100644
--- a/docs/reference/interfaces/lib_logger.chalk.Chalk.md
+++ b/docs/reference/interfaces/lib_logger.chalk.Chalk.md
@@ -21,6 +21,7 @@ Use a template string.
**`remarks`** Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
**`example`**
+
```
import chalk = require('chalk');
@@ -32,6 +33,7 @@ DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
```
**`example`**
+
```
import chalk = require('chalk');
@@ -40,10 +42,10 @@ log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`)
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `text` | `TemplateStringsArray` |
-| `...placeholders` | `unknown`[] |
+| Name | Type |
+| :---------------- | :--------------------- |
+| `text` | `TemplateStringsArray` |
+| `...placeholders` | `unknown`[] |
#### Returns
@@ -59,8 +61,8 @@ node_modules/chalk/index.d.ts:148
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------- |
| `...text` | `unknown`[] |
#### Returns
@@ -154,7 +156,7 @@ Return a new Chalk instance.
node_modules/chalk/index.d.ts:157
-___
+---
### bgBlack
@@ -164,7 +166,7 @@ ___
node_modules/chalk/index.d.ts:369
-___
+---
### bgBlackBright
@@ -174,7 +176,7 @@ ___
node_modules/chalk/index.d.ts:388
-___
+---
### bgBlue
@@ -184,7 +186,7 @@ ___
node_modules/chalk/index.d.ts:373
-___
+---
### bgBlueBright
@@ -194,7 +196,7 @@ ___
node_modules/chalk/index.d.ts:392
-___
+---
### bgCyan
@@ -204,7 +206,7 @@ ___
node_modules/chalk/index.d.ts:375
-___
+---
### bgCyanBright
@@ -214,7 +216,7 @@ ___
node_modules/chalk/index.d.ts:394
-___
+---
### bgGray
@@ -224,7 +226,7 @@ ___
node_modules/chalk/index.d.ts:381
-___
+---
### bgGreen
@@ -234,7 +236,7 @@ ___
node_modules/chalk/index.d.ts:371
-___
+---
### bgGreenBright
@@ -244,7 +246,7 @@ ___
node_modules/chalk/index.d.ts:390
-___
+---
### bgGrey
@@ -254,7 +256,7 @@ ___
node_modules/chalk/index.d.ts:386
-___
+---
### bgMagenta
@@ -264,7 +266,7 @@ ___
node_modules/chalk/index.d.ts:374
-___
+---
### bgMagentaBright
@@ -274,7 +276,7 @@ ___
node_modules/chalk/index.d.ts:393
-___
+---
### bgRed
@@ -284,7 +286,7 @@ ___
node_modules/chalk/index.d.ts:370
-___
+---
### bgRedBright
@@ -294,7 +296,7 @@ ___
node_modules/chalk/index.d.ts:389
-___
+---
### bgWhite
@@ -304,7 +306,7 @@ ___
node_modules/chalk/index.d.ts:376
-___
+---
### bgWhiteBright
@@ -314,7 +316,7 @@ ___
node_modules/chalk/index.d.ts:395
-___
+---
### bgYellow
@@ -324,7 +326,7 @@ ___
node_modules/chalk/index.d.ts:372
-___
+---
### bgYellowBright
@@ -334,7 +336,7 @@ ___
node_modules/chalk/index.d.ts:391
-___
+---
### black
@@ -344,7 +346,7 @@ ___
node_modules/chalk/index.d.ts:341
-___
+---
### blackBright
@@ -354,7 +356,7 @@ ___
node_modules/chalk/index.d.ts:360
-___
+---
### blue
@@ -364,7 +366,7 @@ ___
node_modules/chalk/index.d.ts:345
-___
+---
### blueBright
@@ -374,7 +376,7 @@ ___
node_modules/chalk/index.d.ts:364
-___
+---
### bold
@@ -386,7 +388,7 @@ Modifier: Make text bold.
node_modules/chalk/index.d.ts:303
-___
+---
### cyan
@@ -396,7 +398,7 @@ ___
node_modules/chalk/index.d.ts:347
-___
+---
### cyanBright
@@ -406,7 +408,7 @@ ___
node_modules/chalk/index.d.ts:366
-___
+---
### dim
@@ -418,7 +420,7 @@ Modifier: Emitting only a small amount of light.
node_modules/chalk/index.d.ts:308
-___
+---
### gray
@@ -428,7 +430,7 @@ ___
node_modules/chalk/index.d.ts:353
-___
+---
### green
@@ -438,7 +440,7 @@ ___
node_modules/chalk/index.d.ts:343
-___
+---
### greenBright
@@ -448,7 +450,7 @@ ___
node_modules/chalk/index.d.ts:362
-___
+---
### grey
@@ -458,7 +460,7 @@ ___
node_modules/chalk/index.d.ts:358
-___
+---
### hidden
@@ -470,7 +472,7 @@ Modifier: Prints the text, but makes it invisible.
node_modules/chalk/index.d.ts:328
-___
+---
### inverse
@@ -482,7 +484,7 @@ Modifier: Inverse background and foreground colors.
node_modules/chalk/index.d.ts:323
-___
+---
### italic
@@ -494,7 +496,7 @@ Modifier: Make text italic. (Not widely supported)
node_modules/chalk/index.d.ts:313
-___
+---
### level
@@ -505,6 +507,7 @@ The color support for Chalk.
By default, color support is automatically detected based on the environment.
Levels:
+
- `0` - All colors disabled.
- `1` - Basic 16 colors support.
- `2` - ANSI 256 colors support.
@@ -514,7 +517,7 @@ Levels:
node_modules/chalk/index.d.ts:170
-___
+---
### magenta
@@ -524,7 +527,7 @@ ___
node_modules/chalk/index.d.ts:346
-___
+---
### magentaBright
@@ -534,7 +537,7 @@ ___
node_modules/chalk/index.d.ts:365
-___
+---
### red
@@ -544,7 +547,7 @@ ___
node_modules/chalk/index.d.ts:342
-___
+---
### redBright
@@ -554,7 +557,7 @@ ___
node_modules/chalk/index.d.ts:361
-___
+---
### reset
@@ -566,7 +569,7 @@ Modifier: Resets the current color chain.
node_modules/chalk/index.d.ts:298
-___
+---
### strikethrough
@@ -578,7 +581,7 @@ Modifier: Puts a horizontal line through the center of the text. (Not widely sup
node_modules/chalk/index.d.ts:333
-___
+---
### underline
@@ -590,7 +593,7 @@ Modifier: Make text underline. (Not widely supported)
node_modules/chalk/index.d.ts:318
-___
+---
### visible
@@ -603,7 +606,7 @@ Can be useful for things that are purely cosmetic.
node_modules/chalk/index.d.ts:339
-___
+---
### white
@@ -613,7 +616,7 @@ ___
node_modules/chalk/index.d.ts:348
-___
+---
### whiteBright
@@ -623,7 +626,7 @@ ___
node_modules/chalk/index.d.ts:367
-___
+---
### yellow
@@ -633,7 +636,7 @@ ___
node_modules/chalk/index.d.ts:344
-___
+---
### yellowBright
@@ -656,8 +659,8 @@ For example, 31 for red, 91 for redBright.
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :----- | :------- |
| `code` | `number` |
#### Returns
@@ -668,7 +671,7 @@ For example, 31 for red, 91 for redBright.
node_modules/chalk/index.d.ts:226
-___
+---
### ansi256
@@ -678,8 +681,8 @@ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-b
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `index` | `number` |
#### Returns
@@ -690,7 +693,7 @@ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-b
node_modules/chalk/index.d.ts:231
-___
+---
### bgAnsi
@@ -704,8 +707,8 @@ Use the foreground code, not the background code (for example, not 41, nor 101).
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :----- | :------- |
| `code` | `number` |
#### Returns
@@ -716,7 +719,7 @@ Use the foreground code, not the background code (for example, not 41, nor 101).
node_modules/chalk/index.d.ts:288
-___
+---
### bgAnsi256
@@ -726,8 +729,8 @@ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-b
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :------- |
| `index` | `number` |
#### Returns
@@ -738,7 +741,7 @@ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-b
node_modules/chalk/index.d.ts:293
-___
+---
### bgHex
@@ -747,6 +750,7 @@ ___
Use HEX value to set background color.
**`example`**
+
```
import chalk = require('chalk');
@@ -755,8 +759,8 @@ chalk.bgHex('#DEADED');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------ | :------- | :------------------------------------------------ |
| `color` | `string` | Hexadecimal value representing the desired color. |
#### Returns
@@ -767,7 +771,7 @@ chalk.bgHex('#DEADED');
node_modules/chalk/index.d.ts:245
-___
+---
### bgHsl
@@ -777,11 +781,11 @@ Use HSL values to set background color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :----------- | :------- |
+| `hue` | `number` |
| `saturation` | `number` |
-| `lightness` | `number` |
+| `lightness` | `number` |
#### Returns
@@ -791,7 +795,7 @@ Use HSL values to set background color.
node_modules/chalk/index.d.ts:269
-___
+---
### bgHsv
@@ -801,11 +805,11 @@ Use HSV values to set background color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :----------- | :------- |
+| `hue` | `number` |
| `saturation` | `number` |
-| `value` | `number` |
+| `value` | `number` |
#### Returns
@@ -815,7 +819,7 @@ Use HSV values to set background color.
node_modules/chalk/index.d.ts:274
-___
+---
### bgHwb
@@ -825,9 +829,9 @@ Use HWB values to set background color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :---------- | :------- |
+| `hue` | `number` |
| `whiteness` | `number` |
| `blackness` | `number` |
@@ -839,7 +843,7 @@ Use HWB values to set background color.
node_modules/chalk/index.d.ts:279
-___
+---
### bgKeyword
@@ -848,6 +852,7 @@ ___
Use keyword color value to set background color.
**`example`**
+
```
import chalk = require('chalk');
@@ -856,8 +861,8 @@ chalk.bgKeyword('orange');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------ | :------- | :-------------------------------------------- |
| `color` | `string` | Keyword value representing the desired color. |
#### Returns
@@ -868,7 +873,7 @@ chalk.bgKeyword('orange');
node_modules/chalk/index.d.ts:259
-___
+---
### bgRgb
@@ -878,11 +883,11 @@ Use RGB values to set background color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `red` | `number` |
+| Name | Type |
+| :------ | :------- |
+| `red` | `number` |
| `green` | `number` |
-| `blue` | `number` |
+| `blue` | `number` |
#### Returns
@@ -892,7 +897,7 @@ Use RGB values to set background color.
node_modules/chalk/index.d.ts:264
-___
+---
### hex
@@ -901,6 +906,7 @@ ___
Use HEX value to set text color.
**`example`**
+
```
import chalk = require('chalk');
@@ -909,8 +915,8 @@ chalk.hex('#DEADED');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------ | :------- | :------------------------------------------------ |
| `color` | `string` | Hexadecimal value representing the desired color. |
#### Returns
@@ -921,7 +927,7 @@ chalk.hex('#DEADED');
node_modules/chalk/index.d.ts:184
-___
+---
### hsl
@@ -931,11 +937,11 @@ Use HSL values to set text color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :----------- | :------- |
+| `hue` | `number` |
| `saturation` | `number` |
-| `lightness` | `number` |
+| `lightness` | `number` |
#### Returns
@@ -945,7 +951,7 @@ Use HSL values to set text color.
node_modules/chalk/index.d.ts:208
-___
+---
### hsv
@@ -955,11 +961,11 @@ Use HSV values to set text color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :----------- | :------- |
+| `hue` | `number` |
| `saturation` | `number` |
-| `value` | `number` |
+| `value` | `number` |
#### Returns
@@ -969,7 +975,7 @@ Use HSV values to set text color.
node_modules/chalk/index.d.ts:213
-___
+---
### hwb
@@ -979,9 +985,9 @@ Use HWB values to set text color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `hue` | `number` |
+| Name | Type |
+| :---------- | :------- |
+| `hue` | `number` |
| `whiteness` | `number` |
| `blackness` | `number` |
@@ -993,7 +999,7 @@ Use HWB values to set text color.
node_modules/chalk/index.d.ts:218
-___
+---
### keyword
@@ -1002,6 +1008,7 @@ ___
Use keyword color value to set text color.
**`example`**
+
```
import chalk = require('chalk');
@@ -1010,8 +1017,8 @@ chalk.keyword('orange');
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :------ | :------- | :-------------------------------------------- |
| `color` | `string` | Keyword value representing the desired color. |
#### Returns
@@ -1022,7 +1029,7 @@ chalk.keyword('orange');
node_modules/chalk/index.d.ts:198
-___
+---
### rgb
@@ -1032,11 +1039,11 @@ Use RGB values to set text color.
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `red` | `number` |
+| Name | Type |
+| :------ | :------- |
+| `red` | `number` |
| `green` | `number` |
-| `blue` | `number` |
+| `blue` | `number` |
#### Returns
diff --git a/docs/reference/interfaces/lib_logger.chalk.ChalkFunction.md b/docs/reference/interfaces/lib_logger.chalk.ChalkFunction.md
index f415fb6bc..a7cbfd570 100644
--- a/docs/reference/interfaces/lib_logger.chalk.ChalkFunction.md
+++ b/docs/reference/interfaces/lib_logger.chalk.ChalkFunction.md
@@ -21,6 +21,7 @@ Use a template string.
**`remarks`** Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
**`example`**
+
```
import chalk = require('chalk');
@@ -32,6 +33,7 @@ DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
```
**`example`**
+
```
import chalk = require('chalk');
@@ -40,10 +42,10 @@ log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`)
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `text` | `TemplateStringsArray` |
-| `...placeholders` | `unknown`[] |
+| Name | Type |
+| :---------------- | :--------------------- |
+| `text` | `TemplateStringsArray` |
+| `...placeholders` | `unknown`[] |
#### Returns
@@ -59,8 +61,8 @@ node_modules/chalk/index.d.ts:148
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :---------- |
| `...text` | `unknown`[] |
#### Returns
diff --git a/docs/reference/interfaces/lib_logger.chalk.ColorSupport.md b/docs/reference/interfaces/lib_logger.chalk.ColorSupport.md
index bccf4acd3..d53f2a1bd 100644
--- a/docs/reference/interfaces/lib_logger.chalk.ColorSupport.md
+++ b/docs/reference/interfaces/lib_logger.chalk.ColorSupport.md
@@ -27,7 +27,7 @@ Return whether Chalk supports Truecolor 16 million colors.
node_modules/chalk/index.d.ts:121
-___
+---
### has256
@@ -39,7 +39,7 @@ Return whether Chalk supports ANSI 256 colors.
node_modules/chalk/index.d.ts:116
-___
+---
### hasBasic
@@ -51,7 +51,7 @@ Return whether Chalk supports basic 16 colors.
node_modules/chalk/index.d.ts:111
-___
+---
### level
diff --git a/docs/reference/interfaces/lib_logger.chalk.Options.md b/docs/reference/interfaces/lib_logger.chalk.Options.md
index 3b3680da3..606ca96a2 100644
--- a/docs/reference/interfaces/lib_logger.chalk.Options.md
+++ b/docs/reference/interfaces/lib_logger.chalk.Options.md
@@ -21,6 +21,7 @@ Specify the color support for Chalk.
By default, color support is automatically detected based on the environment.
Levels:
+
- `0` - All colors disabled.
- `1` - Basic 16 colors support.
- `2` - ANSI 256 colors support.
diff --git a/docs/reference/modules/lib.md b/docs/reference/modules/lib.md
index 5f0905554..6b8362591 100644
--- a/docs/reference/modules/lib.md
+++ b/docs/reference/modules/lib.md
@@ -24,17 +24,17 @@
#### Type declaration
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------- | :---------------------------------------------------------------- |
| `adapter?` | `string` \| typeof [`default`](../classes/lib_cluster.default.md) |
-| `name?` | `string` |
-| `url` | `string` |
+| `name?` | `string` |
+| `url` | `string` |
#### Defined in
[src/lib/index.d.ts:8](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L8)
-___
+---
### GleeConfig
@@ -42,19 +42,19 @@ ___
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `cluster?` | [`GleeClusterAdapterConfig`](lib.md#gleeclusteradapterconfig) |
-| `websocket?` | { `adapter?`: [`WebSocketServerType`](lib.md#websocketservertype) \| typeof [`default`](../classes/lib_adapter.default.md) ; `httpServer?`: `any` ; `port?`: `number` } |
-| `websocket.adapter?` | [`WebSocketServerType`](lib.md#websocketservertype) \| typeof [`default`](../classes/lib_adapter.default.md) |
-| `websocket.httpServer?` | `any` |
-| `websocket.port?` | `number` |
+| Name | Type |
+| :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `cluster?` | [`GleeClusterAdapterConfig`](lib.md#gleeclusteradapterconfig) |
+| `websocket?` | { `adapter?`: [`WebSocketServerType`](lib.md#websocketservertype) \| typeof [`default`](../classes/lib_adapter.default.md) ; `httpServer?`: `any` ; `port?`: `number` } |
+| `websocket.adapter?` | [`WebSocketServerType`](lib.md#websocketservertype) \| typeof [`default`](../classes/lib_adapter.default.md) |
+| `websocket.httpServer?` | `any` |
+| `websocket.port?` | `number` |
#### Defined in
[src/lib/index.d.ts:14](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L14)
-___
+---
### GleeFunction
@@ -66,8 +66,8 @@ ___
##### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------ | :---------------------------------------------- |
| `event` | [`GleeFunctionEvent`](lib.md#gleefunctionevent) |
##### Returns
@@ -78,7 +78,7 @@ ___
[src/lib/index.d.ts:48](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L48)
-___
+---
### GleeFunctionEvent
@@ -86,20 +86,20 @@ ___
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `channel?` | `string` |
+| Name | Type |
+| :------------ | :------------------------------------------------ |
+| `channel?` | `string` |
| `connection?` | [`default`](../classes/lib_connection.default.md) |
-| `glee` | [`default`](../classes/lib_glee.default.md) |
-| `headers?` | { [key: string]: `string`; } |
-| `payload?` | `any` |
-| `serverName` | `string` |
+| `glee` | [`default`](../classes/lib_glee.default.md) |
+| `headers?` | { [key: string]: `string`; } |
+| `payload?` | `any` |
+| `serverName` | `string` |
#### Defined in
[src/lib/index.d.ts:29](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L29)
-___
+---
### GleeFunctionReturn
@@ -107,17 +107,17 @@ ___
#### Type declaration
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :----------- | :-------------------------------------------------------------------- |
| `broadcast?` | [`GleeFunctionReturnBroadcast`](lib.md#gleefunctionreturnbroadcast)[] |
-| `reply?` | [`GleeFunctionReturnReply`](lib.md#gleefunctionreturnreply)[] |
-| `send?` | [`GleeFunctionReturnSend`](lib.md#gleefunctionreturnsend)[] |
+| `reply?` | [`GleeFunctionReturnReply`](lib.md#gleefunctionreturnreply)[] |
+| `send?` | [`GleeFunctionReturnSend`](lib.md#gleefunctionreturnsend)[] |
#### Defined in
[src/lib/index.d.ts:23](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L23)
-___
+---
### GleeFunctionReturnBroadcast
@@ -127,7 +127,7 @@ ___
[src/lib/index.d.ts:46](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L46)
-___
+---
### GleeFunctionReturnReply
@@ -137,7 +137,7 @@ ___
[src/lib/index.d.ts:45](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L45)
-___
+---
### GleeFunctionReturnSend
@@ -145,22 +145,22 @@ ___
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `channel?` | `string` |
-| `headers?` | { [key: string]: `string`; } |
-| `payload?` | `any` |
-| `server?` | `string` |
+| Name | Type |
+| :--------- | :--------------------------- |
+| `channel?` | `string` |
+| `headers?` | { [key: string]: `string`; } |
+| `payload?` | `any` |
+| `server?` | `string` |
#### Defined in
[src/lib/index.d.ts:38](https://github.com/asyncapi/glee/blob/388e335/src/lib/index.d.ts#L38)
-___
+---
### WebSocketServerType
-Ζ¬ **WebSocketServerType**: ``"native"`` \| ``"socket.io"``
+Ζ¬ **WebSocketServerType**: `"native"` \| `"socket.io"`
#### Defined in
diff --git a/docs/reference/modules/lib_adapter.md b/docs/reference/modules/lib_adapter.md
index ee0f02601..4558806b7 100644
--- a/docs/reference/modules/lib_adapter.md
+++ b/docs/reference/modules/lib_adapter.md
@@ -20,11 +20,11 @@
#### Type declaration
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------------ | :------------------------------------------------ |
| `connection?` | [`default`](../classes/lib_connection.default.md) |
-| `server` | `Server` |
-| `serverName` | `string` |
+| `server` | `Server` |
+| `serverName` | `string` |
#### Defined in
diff --git a/docs/reference/modules/lib_cluster.md b/docs/reference/modules/lib_cluster.md
index ca1ea69a9..9dc1793b9 100644
--- a/docs/reference/modules/lib_cluster.md
+++ b/docs/reference/modules/lib_cluster.md
@@ -20,10 +20,10 @@
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `adapter` | [`default`](../classes/lib_cluster.default.md) |
-| `serverName` | `string` |
+| Name | Type |
+| :----------- | :--------------------------------------------- |
+| `adapter` | [`default`](../classes/lib_cluster.default.md) |
+| `serverName` | `string` |
#### Defined in
diff --git a/docs/reference/modules/lib_compiler.md b/docs/reference/modules/lib_compiler.md
index 9bdb5a5d7..9d659d0b3 100644
--- a/docs/reference/modules/lib_compiler.md
+++ b/docs/reference/modules/lib_compiler.md
@@ -16,8 +16,8 @@
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------------------ | :----------------- |
| `__namedParameters` | `ICompileAndWatch` |
#### Returns
diff --git a/docs/reference/modules/lib_configs.md b/docs/reference/modules/lib_configs.md
index ed8094fac..835b77173 100644
--- a/docs/reference/modules/lib_configs.md
+++ b/docs/reference/modules/lib_configs.md
@@ -23,21 +23,21 @@
[src/lib/configs.ts:53](https://github.com/asyncapi/glee/blob/388e335/src/lib/configs.ts#L53)
-___
+---
### initializeConfigs
-βΈ **initializeConfigs**(`config?`): `Promise`<{ [key: string]: `string`; }\>
+βΈ **initializeConfigs**(`config?`): `Promise`<{ [key: string]: `string`; }\>
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------- |
| `config` | `Config` |
#### Returns
-`Promise`<{ [key: string]: `string`; }\>
+`Promise`<{ [key: string]: `string`; }\>
#### Defined in
diff --git a/docs/reference/modules/lib_functions.md b/docs/reference/modules/lib_functions.md
index c075ad449..f915366bf 100644
--- a/docs/reference/modules/lib_functions.md
+++ b/docs/reference/modules/lib_functions.md
@@ -31,8 +31,8 @@
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---- | :------- |
| `dir` | `string` |
#### Returns
@@ -43,7 +43,7 @@
[src/lib/functions.ts:53](https://github.com/asyncapi/glee/blob/388e335/src/lib/functions.ts#L53)
-___
+---
### trigger
@@ -51,12 +51,12 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `__namedParameters` | `Object` |
-| `__namedParameters.app` | [`default`](../classes/lib_glee.default.md) |
-| `__namedParameters.message` | [`default`](../classes/lib_message.default.md) |
-| `__namedParameters.operationId` | `string` |
+| Name | Type |
+| :------------------------------ | :--------------------------------------------- |
+| `__namedParameters` | `Object` |
+| `__namedParameters.app` | [`default`](../classes/lib_glee.default.md) |
+| `__namedParameters.message` | [`default`](../classes/lib_message.default.md) |
+| `__namedParameters.operationId` | `string` |
#### Returns
diff --git a/docs/reference/modules/lib_lifecycleEvents.md b/docs/reference/modules/lib_lifecycleEvents.md
index 1577f1494..f709e1a77 100644
--- a/docs/reference/modules/lib_lifecycleEvents.md
+++ b/docs/reference/modules/lib_lifecycleEvents.md
@@ -31,8 +31,8 @@
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :---- | :------- |
| `dir` | `string` |
#### Returns
@@ -43,7 +43,7 @@
[src/lib/lifecycleEvents.ts:16](https://github.com/asyncapi/glee/blob/388e335/src/lib/lifecycleEvents.ts#L16)
-___
+---
### run
@@ -51,10 +51,10 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `lifecycleEvent` | `string` |
-| `params` | [`GleeFunctionEvent`](lib.md#gleefunctionevent) |
+| Name | Type |
+| :--------------- | :---------------------------------------------- |
+| `lifecycleEvent` | `string` |
+| `params` | [`GleeFunctionEvent`](lib.md#gleefunctionevent) |
#### Returns
diff --git a/docs/reference/modules/lib_logger.chalk.md b/docs/reference/modules/lib_logger.chalk.md
index d8d16ab30..8f6b80df6 100644
--- a/docs/reference/modules/lib_logger.chalk.md
+++ b/docs/reference/modules/lib_logger.chalk.md
@@ -32,21 +32,22 @@ Return a new Chalk instance.
##### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------- | :----------------------------------------------------- |
| `options?` | [`Options`](../interfaces/lib_logger.chalk.Options.md) |
#### Defined in
node_modules/chalk/index.d.ts:97
-___
+---
### Level
-Ζ¬ **Level**: ``0`` \| ``1`` \| ``2`` \| ``3``
+Ζ¬ **Level**: `0` \| `1` \| `2` \| `3`
Levels:
+
- `0` - All colors disabled.
- `1` - Basic 16 colors support.
- `2` - ANSI 256 colors support.
diff --git a/docs/reference/modules/lib_logger.md b/docs/reference/modules/lib_logger.md
index afb7107b7..e3a240a9b 100644
--- a/docs/reference/modules/lib_logger.md
+++ b/docs/reference/modules/lib_logger.md
@@ -31,7 +31,7 @@
### chalk
-β’ **chalk**: [`Chalk`](../interfaces/lib_logger.chalk.Chalk.md) & [`ChalkFunction`](../interfaces/lib_logger.chalk.ChalkFunction.md) & { `BackgroundColor`: `BackgroundColor` ; `Color`: `Color` ; `ForegroundColor`: `ForegroundColor` ; `Level`: [`Level`](lib_logger.chalk.md#level) ; `Modifiers`: `Modifiers` ; `stderr`: [`Chalk`](../interfaces/lib_logger.chalk.Chalk.md) & { `supportsColor`: ``false`` \| [`ColorSupport`](../interfaces/lib_logger.chalk.ColorSupport.md) } ; `supportsColor`: ``false`` \| [`ColorSupport`](../interfaces/lib_logger.chalk.ColorSupport.md) }
+β’ **chalk**: [`Chalk`](../interfaces/lib_logger.chalk.Chalk.md) & [`ChalkFunction`](../interfaces/lib_logger.chalk.ChalkFunction.md) & { `BackgroundColor`: `BackgroundColor` ; `Color`: `Color` ; `ForegroundColor`: `ForegroundColor` ; `Level`: [`Level`](lib_logger.chalk.md#level) ; `Modifiers`: `Modifiers` ; `stderr`: [`Chalk`](../interfaces/lib_logger.chalk.Chalk.md) & { `supportsColor`: `false` \| [`ColorSupport`](../interfaces/lib_logger.chalk.ColorSupport.md) } ; `supportsColor`: `false` \| [`ColorSupport`](../interfaces/lib_logger.chalk.ColorSupport.md) }
Main Chalk object that allows to chain styles together.
Call the last one as a method with a string argument.
@@ -50,8 +50,8 @@ node_modules/chalk/index.d.ts:405
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------- |
| `amount` | `number` |
#### Returns
@@ -62,7 +62,7 @@ node_modules/chalk/index.d.ts:405
[src/lib/logger.ts:43](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L43)
-___
+---
### logError
@@ -70,10 +70,10 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `error` | [`default`](../classes/errors_glee_error.default.md) \| `Error` |
-| `options` | `ILogErrorOptions` |
+| Name | Type |
+| :-------- | :-------------------------------------------------------------- |
+| `error` | [`default`](../classes/errors_glee_error.default.md) \| `Error` |
+| `options` | `ILogErrorOptions` |
#### Returns
@@ -83,7 +83,7 @@ ___
[src/lib/logger.ts:129](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L129)
-___
+---
### logErrorLine
@@ -91,9 +91,9 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | `string` |
+| Name | Type |
+| :------------------ | :------------ |
+| `message` | `string` |
| `__namedParameters` | `ILogOptions` |
#### Returns
@@ -104,7 +104,7 @@ ___
[src/lib/logger.ts:123](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L123)
-___
+---
### logInboundMessage
@@ -112,8 +112,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------------------- |
| `message` | [`default`](../classes/lib_message.default.md) |
#### Returns
@@ -124,7 +124,7 @@ ___
[src/lib/logger.ts:110](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L110)
-___
+---
### logInfoMessage
@@ -132,9 +132,9 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `text` | `string` |
+| Name | Type |
+| :------------------ | :------------ |
+| `text` | `string` |
| `__namedParameters` | `ILogOptions` |
#### Returns
@@ -145,7 +145,7 @@ ___
[src/lib/logger.ts:92](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L92)
-___
+---
### logJSON
@@ -153,11 +153,11 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `json` | `object` \| `any`[] |
-| `__namedParameters` | `Object` |
-| `__namedParameters.error` | `boolean` |
+| Name | Type |
+| :------------------------ | :------------------ |
+| `json` | `object` \| `any`[] |
+| `__namedParameters` | `Object` |
+| `__namedParameters.error` | `boolean` |
#### Returns
@@ -167,7 +167,7 @@ ___
[src/lib/logger.ts:105](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L105)
-___
+---
### logLineWithIcon
@@ -175,10 +175,10 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `icon` | `string` |
-| `text` | `string` |
+| Name | Type |
+| :------------------ | :------------------------ |
+| `icon` | `string` |
+| `text` | `string` |
| `__namedParameters` | `ILogLineWithIconOptions` |
#### Returns
@@ -189,7 +189,7 @@ ___
[src/lib/logger.ts:83](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L83)
-___
+---
### logOutboundMessage
@@ -197,8 +197,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------------------- |
| `message` | [`default`](../classes/lib_message.default.md) |
#### Returns
@@ -209,7 +209,7 @@ ___
[src/lib/logger.ts:115](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L115)
-___
+---
### logTypeScriptError
@@ -217,12 +217,12 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `code` | `number` |
-| `message` | `string` |
-| `fileName` | `string` |
-| `line` | `number` |
+| Name | Type |
+| :---------- | :------- |
+| `code` | `number` |
+| `message` | `string` |
+| `fileName` | `string` |
+| `line` | `number` |
| `character` | `number` |
#### Returns
@@ -233,7 +233,7 @@ ___
[src/lib/logger.ts:150](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L150)
-___
+---
### logTypeScriptMessage
@@ -241,8 +241,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :------- |
| `message` | `string` |
#### Returns
@@ -253,7 +253,7 @@ ___
[src/lib/logger.ts:146](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L146)
-___
+---
### logWarningMessage
@@ -261,9 +261,9 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
-| `text` | `string` |
+| Name | Type |
+| :------------------ | :------------ |
+| `text` | `string` |
| `__namedParameters` | `ILogOptions` |
#### Returns
@@ -274,7 +274,7 @@ ___
[src/lib/logger.ts:98](https://github.com/asyncapi/glee/blob/388e335/src/lib/logger.ts#L98)
-___
+---
### logWelcome
@@ -282,8 +282,8 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------------------ | :------- |
| `__namedParameters` | `Object` |
#### Returns
diff --git a/docs/reference/modules/lib_router.md b/docs/reference/modules/lib_router.md
index 6648c2313..6618f711a 100644
--- a/docs/reference/modules/lib_router.md
+++ b/docs/reference/modules/lib_router.md
@@ -23,16 +23,16 @@
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
-| `fn` | [`ErrorMiddleware`](middlewares.md#errormiddleware) |
+| Name | Type |
+| :-------- | :-------------------------------------------------- |
+| `channel` | `string` |
+| `fn` | [`ErrorMiddleware`](middlewares.md#errormiddleware) |
#### Defined in
[src/lib/router.ts:8](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L8)
-___
+---
### ChannelMiddlewareTuple
@@ -40,16 +40,16 @@ ___
#### Type declaration
-| Name | Type |
-| :------ | :------ |
-| `channel` | `string` |
-| `fn` | [`Middleware`](middlewares.md#middleware) |
+| Name | Type |
+| :-------- | :---------------------------------------- |
+| `channel` | `string` |
+| `fn` | [`Middleware`](middlewares.md#middleware) |
#### Defined in
[src/lib/router.ts:3](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L3)
-___
+---
### GenericChannelMiddlewareTuple
@@ -59,7 +59,7 @@ ___
[src/lib/router.ts:14](https://github.com/asyncapi/glee/blob/388e335/src/lib/router.ts#L14)
-___
+---
### GenericMiddleware
diff --git a/docs/reference/modules/lib_util.md b/docs/reference/modules/lib_util.md
index 3637789b2..8b25515b4 100644
--- a/docs/reference/modules/lib_util.md
+++ b/docs/reference/modules/lib_util.md
@@ -21,7 +21,7 @@
#### Parameters
-| Name | Type |
+| Name | Type |
| :------ | :------ |
| `array` | `any`[] |
@@ -33,7 +33,7 @@
[src/lib/util.ts:106](https://github.com/asyncapi/glee/blob/388e335/src/lib/util.ts#L106)
-___
+---
### duplicateMessage
@@ -43,8 +43,8 @@ Duplicates a GleeMessage.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
+| Name | Type | Description |
+| :-------- | :--------------------------------------------- | :------------------------ |
| `message` | [`default`](../classes/lib_message.default.md) | The message to duplicate. |
#### Returns
@@ -55,7 +55,7 @@ Duplicates a GleeMessage.
[src/lib/util.ts:44](https://github.com/asyncapi/glee/blob/388e335/src/lib/util.ts#L44)
-___
+---
### getParams
@@ -65,9 +65,9 @@ Determines if a path matches a channel, and returns the matching params and its
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `path` | `string` | The path. |
+| Name | Type | Description |
+| :-------- | :------- | :----------- |
+| `path` | `string` | The path. |
| `channel` | `string` | The channel. |
#### Returns
@@ -78,7 +78,7 @@ Determines if a path matches a channel, and returns the matching params and its
[src/lib/util.ts:22](https://github.com/asyncapi/glee/blob/388e335/src/lib/util.ts#L22)
-___
+---
### gleeMessageToFunctionEvent
@@ -86,10 +86,10 @@ ___
#### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :-------- | :--------------------------------------------- |
| `message` | [`default`](../classes/lib_message.default.md) |
-| `glee` | [`default`](../classes/lib_glee.default.md) |
+| `glee` | [`default`](../classes/lib_glee.default.md) |
#### Returns
@@ -99,7 +99,7 @@ ___
[src/lib/util.ts:110](https://github.com/asyncapi/glee/blob/388e335/src/lib/util.ts#L110)
-___
+---
### matchChannel
@@ -109,9 +109,9 @@ Determines if a path matches a channel.
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `path` | `string` | The path. |
+| Name | Type | Description |
+| :-------- | :------- | :----------- |
+| `path` | `string` | The path. |
| `channel` | `string` | The channel. |
#### Returns
@@ -122,7 +122,7 @@ Determines if a path matches a channel.
[src/lib/util.ts:72](https://github.com/asyncapi/glee/blob/388e335/src/lib/util.ts#L72)
-___
+---
### validateData
@@ -132,9 +132,9 @@ Validates data against a given JSON Schema definition
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `data` | `any` | The data to validate |
+| Name | Type | Description |
+| :------- | :------- | :----------------------- |
+| `data` | `any` | The data to validate |
| `schema` | `object` | A JSON Schema definition |
#### Returns
diff --git a/docs/reference/modules/middlewares.md b/docs/reference/modules/middlewares.md
index d8c36f16f..0c38ba16b 100644
--- a/docs/reference/modules/middlewares.md
+++ b/docs/reference/modules/middlewares.md
@@ -22,11 +22,11 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `error` | `Error` |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `error` | `Error` |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
@@ -36,7 +36,7 @@
[src/middlewares/index.d.ts:4](https://github.com/asyncapi/glee/blob/388e335/src/middlewares/index.d.ts#L4)
-___
+---
### Middleware
@@ -48,10 +48,10 @@ ___
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
@@ -61,7 +61,7 @@ ___
[src/middlewares/index.d.ts:3](https://github.com/asyncapi/glee/blob/388e335/src/middlewares/index.d.ts#L3)
-___
+---
### MiddlewareCallback
@@ -73,9 +73,9 @@ ___
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `error?` | `Error` |
+| Name | Type |
+| :--------- | :--------------------------------------------- |
+| `error?` | `Error` |
| `message?` | [`default`](../classes/lib_message.default.md) |
##### Returns
diff --git a/docs/reference/modules/middlewares_buffer2string.md b/docs/reference/modules/middlewares_buffer2string.md
index cec1da8c4..7f6dd3b34 100644
--- a/docs/reference/modules/middlewares_buffer2string.md
+++ b/docs/reference/modules/middlewares_buffer2string.md
@@ -20,10 +20,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_errorLogger.md b/docs/reference/modules/middlewares_errorLogger.md
index d0ad725f4..649ec3695 100644
--- a/docs/reference/modules/middlewares_errorLogger.md
+++ b/docs/reference/modules/middlewares_errorLogger.md
@@ -20,11 +20,11 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `err` | `Error` |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `err` | `Error` |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_existsInAsyncAPI.md b/docs/reference/modules/middlewares_existsInAsyncAPI.md
index d2587554f..b090eca8f 100644
--- a/docs/reference/modules/middlewares_existsInAsyncAPI.md
+++ b/docs/reference/modules/middlewares_existsInAsyncAPI.md
@@ -20,8 +20,8 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :--------- | :----------------- |
| `asyncapi` | `AsyncAPIDocument` |
##### Returns
@@ -32,10 +32,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `event` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :------ | :-------------------------------------------------------- |
+| `event` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_json2string.md b/docs/reference/modules/middlewares_json2string.md
index fac2f2eb5..f66260950 100644
--- a/docs/reference/modules/middlewares_json2string.md
+++ b/docs/reference/modules/middlewares_json2string.md
@@ -20,10 +20,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_logger.md b/docs/reference/modules/middlewares_logger.md
index 9baeabbb1..958ae923f 100644
--- a/docs/reference/modules/middlewares_logger.md
+++ b/docs/reference/modules/middlewares_logger.md
@@ -20,10 +20,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_string2json.md b/docs/reference/modules/middlewares_string2json.md
index 897b7e6e0..277981d82 100644
--- a/docs/reference/modules/middlewares_string2json.md
+++ b/docs/reference/modules/middlewares_string2json.md
@@ -20,10 +20,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `message` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :-------- | :-------------------------------------------------------- |
+| `message` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_validate.md b/docs/reference/modules/middlewares_validate.md
index 2a3482987..bd31c6311 100644
--- a/docs/reference/modules/middlewares_validate.md
+++ b/docs/reference/modules/middlewares_validate.md
@@ -20,8 +20,8 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
+| Name | Type |
+| :------- | :------- |
| `schema` | `Schema` |
##### Returns
@@ -32,10 +32,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `event` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :------ | :-------------------------------------------------------- |
+| `event` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/middlewares_validateConnection.md b/docs/reference/modules/middlewares_validateConnection.md
index 177a254ca..0ea8fd7b7 100644
--- a/docs/reference/modules/middlewares_validateConnection.md
+++ b/docs/reference/modules/middlewares_validateConnection.md
@@ -20,10 +20,10 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `event` | [`default`](../classes/lib_message.default.md) |
-| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
+| Name | Type |
+| :------ | :-------------------------------------------------------- |
+| `event` | [`default`](../classes/lib_message.default.md) |
+| `next` | [`MiddlewareCallback`](middlewares.md#middlewarecallback) |
##### Returns
diff --git a/docs/reference/modules/moduleIndex.md b/docs/reference/modules/moduleIndex.md
index 85513c11d..ac7014854 100644
--- a/docs/reference/modules/moduleIndex.md
+++ b/docs/reference/modules/moduleIndex.md
@@ -15,7 +15,7 @@
Renames and re-exports [default](../classes/lib_glee.default.md)
-___
+---
### Message
diff --git a/docs/reference/modules/registerAdapters.md b/docs/reference/modules/registerAdapters.md
index 9787fe22c..2aaab1bc9 100644
--- a/docs/reference/modules/registerAdapters.md
+++ b/docs/reference/modules/registerAdapters.md
@@ -20,11 +20,11 @@
##### Parameters
-| Name | Type |
-| :------ | :------ |
-| `app` | [`default`](../classes/lib_glee.default.md) |
-| `parsedAsyncAPI` | `AsyncAPIDocument` |
-| `config` | [`GleeConfig`](lib.md#gleeconfig) |
+| Name | Type |
+| :--------------- | :------------------------------------------ |
+| `app` | [`default`](../classes/lib_glee.default.md) |
+| `parsedAsyncAPI` | `AsyncAPIDocument` |
+| `config` | [`GleeConfig`](lib.md#gleeconfig) |
##### Returns
diff --git a/examples/crypto-websockets/README.md b/examples/crypto-websockets/README.md
index ae2c73c8a..6d80b4a6f 100644
--- a/examples/crypto-websockets/README.md
+++ b/examples/crypto-websockets/README.md
@@ -1,4 +1,5 @@
-## Crypto Websockets
-This example tries to showcase how Glee could be used as a WebSocket client. There is a server that streams the price change of a fake cryptocurrency (we can call it asyncapicoin) and the client subscribes to this stream and draws a graph in the terminal.
+## Crypto Websockets
-
\ No newline at end of file
+This example tries to showcase how Glee could be used as a WebSocket client. There is a server that streams the price change of a fake cryptocurrency (we can call it asyncapicoin) and the client subscribes to this stream and draws a graph in the terminal.
+
+
diff --git a/examples/crypto-websockets/client/asyncapi.yaml b/examples/crypto-websockets/client/asyncapi.yaml
index 6aea97599..c4767bfd9 100644
--- a/examples/crypto-websockets/client/asyncapi.yaml
+++ b/examples/crypto-websockets/client/asyncapi.yaml
@@ -1,5 +1,5 @@
asyncapi: 2.4.0
-info:
+info:
title: asyncapicoin client
version: 1.0.0
description: |
@@ -31,4 +31,3 @@ components:
type: number
price:
type: number
-
\ No newline at end of file
diff --git a/examples/crypto-websockets/client/db.json b/examples/crypto-websockets/client/db.json
index 578124390..0e431d769 100644
--- a/examples/crypto-websockets/client/db.json
+++ b/examples/crypto-websockets/client/db.json
@@ -1 +1,11 @@
-[{"time":1663935946665,"price":130,"status":"started"},{"time":1663935947684,"price":140,"status":"intransit"},{"time":1663935948690,"price":130,"status":"intransit"},{"time":1663935949698,"price":140,"status":"intransit"},{"time":1663935950710,"price":150,"status":"intransit"},{"time":1663935951716,"price":130,"status":"intransit"},{"time":1663935952724,"price":100,"status":"intransit"},{"time":1663935953737,"price":110,"status":"intransit"},{"time":1663935954742,"price":140,"status":"intransit"}]
\ No newline at end of file
+[
+ { "time": 1663935946665, "price": 130, "status": "started" },
+ { "time": 1663935947684, "price": 140, "status": "intransit" },
+ { "time": 1663935948690, "price": 130, "status": "intransit" },
+ { "time": 1663935949698, "price": 140, "status": "intransit" },
+ { "time": 1663935950710, "price": 150, "status": "intransit" },
+ { "time": 1663935951716, "price": 130, "status": "intransit" },
+ { "time": 1663935952724, "price": 100, "status": "intransit" },
+ { "time": 1663935953737, "price": 110, "status": "intransit" },
+ { "time": 1663935954742, "price": 140, "status": "intransit" }
+]
diff --git a/examples/crypto-websockets/client/functions/index.ts b/examples/crypto-websockets/client/functions/index.ts
index 8e3bfcc63..4ad7b0d07 100644
--- a/examples/crypto-websockets/client/functions/index.ts
+++ b/examples/crypto-websockets/client/functions/index.ts
@@ -3,25 +3,32 @@ import fs from 'fs'
import asciichart from 'asciichart'
export default async function (event) {
- const payload = event.payload
- const dbPath = path.resolve('./db.json')
- const read = () => JSON.parse(fs.readFileSync(dbPath, 'utf-8'))
- const write = (data) => { fs.writeFileSync(dbPath, data, { encoding: 'utf-8' }) }
- let db
- switch (payload.status) {
- case 'started':
- write(JSON.stringify([payload]))
- break
- case 'intransit':
- db = read()
- write(JSON.stringify([...db, payload]))
- break
- case 'finished':
- db = read()
- const values = [...db, payload]
- console.log(asciichart.plot(values.map(v => v.price), {height: 8}))
- }
- return {
- send: []
- }
-}
\ No newline at end of file
+ const payload = event.payload
+ const dbPath = path.resolve('./db.json')
+ const read = () => JSON.parse(fs.readFileSync(dbPath, 'utf-8'))
+ const write = (data) => {
+ fs.writeFileSync(dbPath, data, { encoding: 'utf-8' })
+ }
+ let db
+ switch (payload.status) {
+ case 'started':
+ write(JSON.stringify([payload]))
+ break
+ case 'intransit':
+ db = read()
+ write(JSON.stringify([...db, payload]))
+ break
+ case 'finished':
+ db = read()
+ const values = [...db, payload]
+ console.log(
+ asciichart.plot(
+ values.map((v) => v.price),
+ { height: 8 },
+ ),
+ )
+ }
+ return {
+ send: [],
+ }
+}
diff --git a/examples/crypto-websockets/client/glee.config.js b/examples/crypto-websockets/client/glee.config.js
index b6732bec7..4f5c3263b 100644
--- a/examples/crypto-websockets/client/glee.config.js
+++ b/examples/crypto-websockets/client/glee.config.js
@@ -2,14 +2,14 @@ export default async function () {
return {
ws: {
client: {
- auth: async ({serverName}) => {
- if(serverName === 'websockets') {
+ auth: async ({ serverName }) => {
+ if (serverName === 'websockets') {
return {
- token: process.env.TOKEN
+ token: process.env.TOKEN,
}
}
- }
- }
- }
- };
+ },
+ },
+ },
+ }
}
diff --git a/examples/crypto-websockets/client/tsconfig.json b/examples/crypto-websockets/client/tsconfig.json
index 23b7ed419..727704864 100644
--- a/examples/crypto-websockets/client/tsconfig.json
+++ b/examples/crypto-websockets/client/tsconfig.json
@@ -5,6 +5,6 @@
"esModuleInterop": true,
"moduleResolution": "node",
"module": "commonjs",
- "resolveJsonModule": true,
+ "resolveJsonModule": true
}
-}
\ No newline at end of file
+}
diff --git a/examples/crypto-websockets/server/asyncapi.yaml b/examples/crypto-websockets/server/asyncapi.yaml
index f500b6503..444ca0acb 100644
--- a/examples/crypto-websockets/server/asyncapi.yaml
+++ b/examples/crypto-websockets/server/asyncapi.yaml
@@ -33,4 +33,4 @@ components:
time:
type: number
price:
- type: number
\ No newline at end of file
+ type: number
diff --git a/examples/crypto-websockets/server/lifecycle/updateCryptoPrice.ts b/examples/crypto-websockets/server/lifecycle/updateCryptoPrice.ts
index ed02a7113..c1c015b67 100644
--- a/examples/crypto-websockets/server/lifecycle/updateCryptoPrice.ts
+++ b/examples/crypto-websockets/server/lifecycle/updateCryptoPrice.ts
@@ -4,44 +4,43 @@
import { Message } from '@asyncapi/glee'
export default async function ({ glee, connection }) {
- let status = 'transit'
- let currentPrice = 100
- const count = 10
- ;(function priceChange(i) {
- if (i === count) {
- status = 'started'
- }else if (i === 1) {
- status = 'finished'
- }else {
- status = 'intransit'
- }
- const date = new Date()
- setTimeout(() => {
- glee.send(new Message({
- channel: '/price',
- connection,
- payload: {time: date.getTime(), price: getPrice(), status}
- }))
- if (--i) priceChange(i)
- }, 1000)
- }(count))
-
- const between = (min, max) => {
- return Math.floor(
- Math.random() * (max - min) + min
- )
+ let status = 'transit'
+ let currentPrice = 100
+ const count = 10
+ ;(function priceChange(i) {
+ if (i === count) {
+ status = 'started'
+ } else if (i === 1) {
+ status = 'finished'
+ } else {
+ status = 'intransit'
}
+ const date = new Date()
+ setTimeout(() => {
+ glee.send(
+ new Message({
+ channel: '/price',
+ connection,
+ payload: { time: date.getTime(), price: getPrice(), status },
+ }),
+ )
+ if (--i) priceChange(i)
+ }, 1000)
+ })(count)
+
+ const between = (min, max) => {
+ return Math.floor(Math.random() * (max - min) + min)
+ }
- const getPrice = () => {
- const HighOrLow = between(1,10)
- if (HighOrLow >= 4) {
- currentPrice = currentPrice + (between(0,5) * 10)
- }else {
- currentPrice = currentPrice - (between(0,5) * 10)
- }
- return currentPrice
+ const getPrice = () => {
+ const HighOrLow = between(1, 10)
+ if (HighOrLow >= 4) {
+ currentPrice = currentPrice + between(0, 5) * 10
+ } else {
+ currentPrice = currentPrice - between(0, 5) * 10
}
+ return currentPrice
+ }
}
-
-export const lifecycleEvent = 'onServerConnectionOpen'
\ No newline at end of file
+export const lifecycleEvent = 'onServerConnectionOpen'
diff --git a/examples/crypto-websockets/server/tsconfig.json b/examples/crypto-websockets/server/tsconfig.json
index 394855c77..3aa6fb9a2 100644
--- a/examples/crypto-websockets/server/tsconfig.json
+++ b/examples/crypto-websockets/server/tsconfig.json
@@ -6,4 +6,4 @@
"moduleResolution": "node",
"module": "commonjs"
}
-}
\ No newline at end of file
+}
diff --git a/examples/dummy/README.md b/examples/dummy/README.md
index 33d864865..9cc6805b7 100644
--- a/examples/dummy/README.md
+++ b/examples/dummy/README.md
@@ -1,3 +1,3 @@
# Dummy
-This is a dummy example mainly used to test functionalities.
\ No newline at end of file
+This is a dummy example mainly used to test functionalities.
diff --git a/examples/dummy/asyncapi.yaml b/examples/dummy/asyncapi.yaml
index 30c6f9752..55817ff2a 100644
--- a/examples/dummy/asyncapi.yaml
+++ b/examples/dummy/asyncapi.yaml
@@ -48,7 +48,7 @@ channels:
bindingVersion: 0.1.0
subscribe:
message:
- $ref: '#/components/messages/UserSignedUp'
+ $ref: '#/components/messages/UserSignedUp'
server/announce:
subscribe:
message:
@@ -98,4 +98,4 @@ components:
- id
properties:
id:
- type: string
\ No newline at end of file
+ type: string
diff --git a/examples/dummy/functions/onUserSignedUp.ts b/examples/dummy/functions/onUserSignedUp.ts
index 867040cf6..7ff015d0c 100644
--- a/examples/dummy/functions/onUserSignedUp.ts
+++ b/examples/dummy/functions/onUserSignedUp.ts
@@ -2,9 +2,11 @@ export default async function (event) {
const user: any = event.payload
console.log(`${user.displayName} has recently signed up. Sending an email to ${user.email}.`)
return {
- send: [{
- server: 'websockets',
- payload: event.payload,
- }]
+ send: [
+ {
+ server: 'websockets',
+ payload: event.payload,
+ },
+ ],
}
}
diff --git a/examples/dummy/glee.config.js b/examples/dummy/glee.config.js
index 2fbe2645e..4d2390052 100644
--- a/examples/dummy/glee.config.js
+++ b/examples/dummy/glee.config.js
@@ -4,14 +4,14 @@ import fs from 'fs'
export default async function () {
return {
mqtt: {
- auth: async ({serverName}) => {
- if(serverName === 'mosquitto') {
+ auth: async ({ serverName }) => {
+ if (serverName === 'mosquitto') {
return {
- cert: fs.readFileSync('./mosquitto.org.crt', 'utf-8')
+ cert: fs.readFileSync('./mosquitto.org.crt', 'utf-8'),
}
}
- }
- }
+ },
+ },
// websocket: {
// httpServer: customServer,
// adapter: 'native', // Default. Can also be 'socket.io' or a reference to a custom adapter.
diff --git a/examples/dummy/index.html b/examples/dummy/index.html
index 156a458ae..eed2ecebf 100644
--- a/examples/dummy/index.html
+++ b/examples/dummy/index.html
@@ -2,14 +2,14 @@
const serverAnnounceSocket = new WebSocket('ws://localhost:3005/ws/server/announce')
const userSignedUpSocket = new WebSocket('ws://localhost:3005/ws/user/signedup?salutation=Hola')
- function logMessage (event) {
+ function logMessage(event) {
console.log(JSON.parse(event.data))
}
serverAnnounceSocket.addEventListener('message', logMessage)
userSignedUpSocket.addEventListener('message', logMessage)
-
+
userSignedUpSocket.addEventListener('open', () => {
// userSignedUpSocket.send('{"displayName": "Fran Mendez", "email": "fmvilas@gmail.com"}')
})
-
\ No newline at end of file
+
diff --git a/examples/dummy/lifecycle/announceServer.ts b/examples/dummy/lifecycle/announceServer.ts
index d758fcac3..6e32ac0e7 100644
--- a/examples/dummy/lifecycle/announceServer.ts
+++ b/examples/dummy/lifecycle/announceServer.ts
@@ -1,12 +1,14 @@
export default async function () {
return {
- send: [{
- server: 'mosquitto',
- channel: 'server/announce',
- payload: {
- id: process.env.SERVER_ID || String(Date.now()),
- }
- }]
+ send: [
+ {
+ server: 'mosquitto',
+ channel: 'server/announce',
+ payload: {
+ id: process.env.SERVER_ID || String(Date.now()),
+ },
+ },
+ ],
}
}
diff --git a/examples/dummy/package-lock.json b/examples/dummy/package-lock.json
index 536b90450..112fb943a 100644
--- a/examples/dummy/package-lock.json
+++ b/examples/dummy/package-lock.json
@@ -5174,9 +5174,7 @@
},
"../../node_modules/concat-stream": {
"version": "2.0.0",
- "engines": [
- "node >= 6.0"
- ],
+ "engines": ["node >= 6.0"],
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
@@ -6806,9 +6804,7 @@
},
"../../node_modules/extsprintf": {
"version": "1.3.0",
- "engines": [
- "node >=0.6.0"
- ],
+ "engines": ["node >=0.6.0"],
"license": "MIT"
},
"../../node_modules/fast-deep-equal": {
@@ -7114,9 +7110,7 @@
"version": "2.3.2",
"license": "MIT",
"optional": true,
- "os": [
- "darwin"
- ],
+ "os": ["darwin"],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
@@ -9450,9 +9444,7 @@
},
"../../node_modules/jsonparse": {
"version": "1.3.1",
- "engines": [
- "node >= 0.2.0"
- ],
+ "engines": ["node >= 0.2.0"],
"license": "MIT"
},
"../../node_modules/jsonpointer": {
@@ -10033,9 +10025,7 @@
"../../node_modules/markdown-toc/node_modules/concat-stream": {
"version": "1.6.2",
"dev": true,
- "engines": [
- "node >= 0.8"
- ],
+ "engines": ["node >= 0.8"],
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
@@ -10654,10 +10644,7 @@
],
"dev": true,
"license": "Artistic-2.0",
- "workspaces": [
- "docs",
- "packages/*"
- ],
+ "workspaces": ["docs", "packages/*"],
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/arborist": "^2.9.0",
@@ -11683,9 +11670,7 @@
"../../node_modules/npm/node_modules/extsprintf": {
"version": "1.3.0",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ],
+ "engines": ["node >=0.6.0"],
"inBundle": true,
"license": "MIT"
},
@@ -12115,18 +12100,14 @@
"../../node_modules/npm/node_modules/jsonparse": {
"version": "1.3.1",
"dev": true,
- "engines": [
- "node >= 0.2.0"
- ],
+ "engines": ["node >= 0.2.0"],
"inBundle": true,
"license": "MIT"
},
"../../node_modules/npm/node_modules/jsprim": {
"version": "1.4.1",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ],
+ "engines": ["node >=0.6.0"],
"inBundle": true,
"license": "MIT",
"dependencies": {
@@ -13499,9 +13480,7 @@
"../../node_modules/npm/node_modules/verror": {
"version": "1.10.0",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ],
+ "engines": ["node >=0.6.0"],
"inBundle": true,
"license": "MIT",
"dependencies": {
@@ -14009,10 +13988,7 @@
"../../node_modules/pause-stream": {
"version": "0.0.11",
"dev": true,
- "license": [
- "MIT",
- "Apache2"
- ],
+ "license": ["MIT", "Apache2"],
"dependencies": {
"through": "~2.3"
}
@@ -14678,9 +14654,7 @@
"../../node_modules/redis": {
"version": "4.0.3",
"license": "MIT",
- "workspaces": [
- "./packages/*"
- ],
+ "workspaces": ["./packages/*"],
"dependencies": {
"@node-redis/bloom": "1.0.1",
"@node-redis/client": "1.0.3",
@@ -17157,9 +17131,7 @@
},
"../../node_modules/verror": {
"version": "1.10.0",
- "engines": [
- "node >=0.6.0"
- ],
+ "engines": ["node >=0.6.0"],
"license": "MIT",
"dependencies": {
"assert-plus": "^1.0.0",
@@ -29186,4 +29158,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/dummy/socket.io.html b/examples/dummy/socket.io.html
index ca1f23a6b..e4c2bc2d5 100644
--- a/examples/dummy/socket.io.html
+++ b/examples/dummy/socket.io.html
@@ -1,10 +1,13 @@
-
+
\ No newline at end of file
+
diff --git a/examples/dummy/tsconfig.json b/examples/dummy/tsconfig.json
index b17930b3e..16bd12ebd 100644
--- a/examples/dummy/tsconfig.json
+++ b/examples/dummy/tsconfig.json
@@ -4,6 +4,6 @@
"target": "es6",
"esModuleInterop": true,
"moduleResolution": "node",
- "module":"es2020"
+ "module": "es2020"
}
-}
\ No newline at end of file
+}
diff --git a/examples/flight-management/README.md b/examples/flight-management/README.md
index 3be8e37a7..a82bd4744 100644
--- a/examples/flight-management/README.md
+++ b/examples/flight-management/README.md
@@ -5,31 +5,38 @@ This example was created to demonstrate the usage of Glee with WebSockets and Ne
# Architecture
This project consists of three parts: backend, board, and admin front-end.
+
## Backend
+
The backend is developed with Glee and uses a JSON server to store data. If you want to add more flights you can add them to the `db.json` file in `backend` folder.
## Board
+
This will show a list of flights for a specific airport. See the flights for a specific airport by using this URL format `http://localhost:{PORT}/{AIRPORT_CODE}`.
+
## Admin Front-End
+
You can edit flight info here to see them change in your board project in real time. Browse `http://localhost:{PORT}/{AIRPORT_CODE}` to see and edit flight info.
## Run it
-1) Run the backend:
+1. Run the backend:
```
cd ./backend
npm run dev
```
-2) Run the board project:
+
+2. Run the board project:
```
cd ./front-end-board
npm run dev
```
-3) Run the admin dashboard project:
+
+3. Run the admin dashboard project:
```
cd ./front-end-admin
npm run dev
-```
\ No newline at end of file
+```
diff --git a/examples/flight-management/backend/Events/allFlights.ts b/examples/flight-management/backend/Events/allFlights.ts
index 5a82a29d0..b773cc9df 100644
--- a/examples/flight-management/backend/Events/allFlights.ts
+++ b/examples/flight-management/backend/Events/allFlights.ts
@@ -1,13 +1,16 @@
import DatabaseManager from '../helpters/DatabaseManager.js'
-import type {GleeFunctionReturn} from '@asyncapi/glee/src/lib'
+import type { GleeFunctionReturn } from '@asyncapi/glee/src/lib'
export default async function getFlights(airportCode: string): Promise {
const flights = await DatabaseManager.getInstance().getFlights(airportCode)
return {
- reply: [{
- payload: JSON.stringify({
- name: 'allFlights',
- flights: flights,})
- }]
+ reply: [
+ {
+ payload: JSON.stringify({
+ name: 'allFlights',
+ flights: flights,
+ }),
+ },
+ ],
}
}
diff --git a/examples/flight-management/backend/Events/updateFlight.ts b/examples/flight-management/backend/Events/updateFlight.ts
index a768015a7..f448e8609 100644
--- a/examples/flight-management/backend/Events/updateFlight.ts
+++ b/examples/flight-management/backend/Events/updateFlight.ts
@@ -1,16 +1,18 @@
import { GleeFunctionReturn } from '@asyncapi/glee/src/lib/index.js'
import DatabaseManager from '../helpters/DatabaseManager.js'
-export default async function updateFlight(flight):Promise {
+export default async function updateFlight(flight): Promise {
const isSuccessful = await DatabaseManager.getInstance().updateFlight(flight)
- if(isSuccessful){
+ if (isSuccessful) {
return {
- send: [{
- server: 'websockets',
- payload: JSON.stringify({
- name: 'updateFlight',
- flight,
- })
- }]
+ send: [
+ {
+ server: 'websockets',
+ payload: JSON.stringify({
+ name: 'updateFlight',
+ flight,
+ }),
+ },
+ ],
}
} else return {}
}
diff --git a/examples/flight-management/backend/db.json b/examples/flight-management/backend/db.json
index 2172096d3..f421cce4d 100644
--- a/examples/flight-management/backend/db.json
+++ b/examples/flight-management/backend/db.json
@@ -79,4 +79,4 @@
"status": "ON TIME"
}
]
-}
\ No newline at end of file
+}
diff --git a/examples/flight-management/backend/functions/sendMessage.ts b/examples/flight-management/backend/functions/sendMessage.ts
index 7cc881417..e98f6c0d9 100644
--- a/examples/flight-management/backend/functions/sendMessage.ts
+++ b/examples/flight-management/backend/functions/sendMessage.ts
@@ -3,6 +3,6 @@ import allFlights from '../Events/allFlights.js'
import updateFlight from '../Events/updateFlight.js'
export default async function (gleeEvent): Promise {
const myEvent = gleeEvent.payload
- if(myEvent.name === 'allFlights') return await allFlights(myEvent.airportCode)
- if(myEvent.name === 'updateFlight') return await updateFlight(myEvent.updatedFlight)
+ if (myEvent.name === 'allFlights') return await allFlights(myEvent.airportCode)
+ if (myEvent.name === 'updateFlight') return await updateFlight(myEvent.updatedFlight)
}
diff --git a/examples/flight-management/backend/helpters/DatabaseManager.ts b/examples/flight-management/backend/helpters/DatabaseManager.ts
index c64fed477..f575ff6b8 100644
--- a/examples/flight-management/backend/helpters/DatabaseManager.ts
+++ b/examples/flight-management/backend/helpters/DatabaseManager.ts
@@ -1,14 +1,14 @@
-import {Low, JSONFile} from 'lowdb'
+import { Low, JSONFile } from 'lowdb'
type Data = {
- flights: any[];
+ flights: any[]
}
export default class DatabaseManager {
db: Low
private static instance: DatabaseManager
- private constructor(){
- const file = new JSONFile("db.json")
- console.log('the file is',file)
+ private constructor() {
+ const file = new JSONFile('db.json')
+ console.log('the file is', file)
this.db = new Low(file)
}
@@ -21,19 +21,20 @@ export default class DatabaseManager {
async getFlights(airportCode: string) {
await this.db.read()
- return this.db.data.flights.filter((flight) => flight.destin_code === airportCode || flight.origin_code === airportCode)
-
+ return this.db.data.flights.filter(
+ (flight) => flight.destin_code === airportCode || flight.origin_code === airportCode,
+ )
}
async updateFlight(updatedFlight: any): Promise {
const id = updatedFlight.id
try {
this.db.data.flights = this.db.data.flights.map((flight) => {
- if(flight.id === id) return {...flight, ...updatedFlight}
+ if (flight.id === id) return { ...flight, ...updatedFlight }
return flight
})
this.db.write()
- } catch(err){
+ } catch (err) {
console.error(err)
return false
}
diff --git a/examples/flight-management/backend/package.json b/examples/flight-management/backend/package.json
index ab93104e3..418882bff 100644
--- a/examples/flight-management/backend/package.json
+++ b/examples/flight-management/backend/package.json
@@ -15,9 +15,7 @@
"type": "git",
"url": "git+https://github.com/asyncapi/glee-hello-world.git"
},
- "keywords": [
- "glee"
- ],
+ "keywords": ["glee"],
"author": "Khudadad Nomani",
"license": "Apache-2.0",
"bugs": {
diff --git a/examples/flight-management/front-end-admin/app/[airport_code]/page.tsx b/examples/flight-management/front-end-admin/app/[airport_code]/page.tsx
index f9bed49a5..f567c619e 100644
--- a/examples/flight-management/front-end-admin/app/[airport_code]/page.tsx
+++ b/examples/flight-management/front-end-admin/app/[airport_code]/page.tsx
@@ -2,11 +2,7 @@ import Flights from '../../components/Flights'
export default async function HomePage({ params }: any) {
return (