From b4a51f32710529bb3d888d311d62471900c2dc79 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 15:36:43 -0500 Subject: [PATCH 1/8] Add `package.json` `files` field. --- CHANGELOG.md | 5 +++++ package.json | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0f2dc..7ef0124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # async-node-events ChangeLog +## 3.0.1 - 2026-xx-xx + +### Fixed +- Add `package.json` `files` field. + ## 3.0.0 - 2022-04-13 ### Changed diff --git a/package.json b/package.json index b830212..ac53828 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,9 @@ "url": "https://github.com/digitalbazaar/async-node-events" }, "main": "./lib/index.js", + "files": [ + "lib/**/*.js" + ], "dependencies": { "is-promise": "^4.0.0" }, From 6b73b8a565faeae934577dff23c256fb635a82d0 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 15:48:41 -0500 Subject: [PATCH 2/8] Remove travis-ci support. --- .travis.yml | 8 -------- README.md | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ac4e85..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "14" - -notifications: - email: - on_success: change - on_failure: change diff --git a/README.md b/README.md index 9b12f91..048e883 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # async-node-events [![NPM Version](https://img.shields.io/npm/v/async-node-events.svg?style=flat-square)](https://npm.im/async-node-devents) -[![Build Status](https://travis-ci.org/digitalbazaar/async-node-events.png?branch=master)](https://travis-ci.org/digitalbazaar/async-node-events) +[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock/main.yml)](https://github.com/digitalbazaar/bedrock/actions/workflows/main.yml) An EventEmitter replacement that allows both asynchronous and synchronous emissions and handlers. This is entirely based off of and almost entirely From 47c74c96631c579f8bd837629380fa07939106b7 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 15:58:45 -0500 Subject: [PATCH 3/8] Fix and update docs. - Use ESM. - Use scoped package name. --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 048e883..af4d5c8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# async-node-events +# @digitalbazaar/async-node-events [![NPM Version](https://img.shields.io/npm/v/async-node-events.svg?style=flat-square)](https://npm.im/async-node-devents) [![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock/main.yml)](https://github.com/digitalbazaar/bedrock/actions/workflows/main.yml) @@ -33,14 +33,14 @@ use ``emitSync`` to emit ``newListener``, ``removeListener``, and ## Install ```sh -npm install async-node-events +npm install @digitalbazaar/async-node-events ``` ## Usage ```js -var EventEmitter = require('async-node-events').EventEmitter; -var util = require('util'); +import {EventEmitter} from '@digitalbazaar/async-node-events'; +const util = require('node:util'); (async () => { const myEmitter = new EventEmitter(); @@ -61,7 +61,8 @@ util.inherits(MyEmittingObject, EventEmitter); The API is intended to be a mostly-drop-in replacement for Node.js' `EventEmitter` object, except with support for asynchronous listeners. -The primary differences between the `EventEmitter` and `async-node-events` are: +The primary differences between the `EventEmitter` and +`@digitalbazaarasync-node-events` are: 1. Passing the maximum number of listeners allowed will fire off a ``maxListenersPassed`` event with the event name and listener count as From 07d690b5b385fb780cc307622b05c5e3c4a047cf Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 16:04:12 -0500 Subject: [PATCH 4/8] Only support Node.js >=20. - Drop testing for old Node versions. They may still work. - Add testing for new Node versions. - Update engines.node to >=20. - Update actions and workflow jobs. --- .github/workflows/{main.yml => main.yaml} | 30 ++++++++++------------- CHANGELOG.md | 5 +++- README.md | 2 +- package.json | 2 +- 4 files changed, 19 insertions(+), 20 deletions(-) rename .github/workflows/{main.yml => main.yaml} (71%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yaml similarity index 71% rename from .github/workflows/main.yml rename to .github/workflows/main.yaml index 4862d50..d7953c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yaml @@ -8,11 +8,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [14.x] + node-version: [24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -24,11 +24,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [14.x, 16.x] + node-version: [20.x, 22.x, 24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - run: | @@ -45,23 +45,19 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [14.x] + node-version: [24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - - run: | - npm install - cd test - npm install + - run: npm install - name: Generate coverage report - run: | - cd test - npm run coverage-ci + run: npm run coverage-ci - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v5 with: file: ./coverage/lcov.info fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ef0124..140d01b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # async-node-events ChangeLog -## 3.0.1 - 2026-xx-xx +## 4.0.0 - 2026-xx-xx + +### Changed +- **BREAKING**: Only support Node.js >=20. ### Fixed - Add `package.json` `files` field. diff --git a/README.md b/README.md index af4d5c8..81f118e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # @digitalbazaar/async-node-events [![NPM Version](https://img.shields.io/npm/v/async-node-events.svg?style=flat-square)](https://npm.im/async-node-devents) -[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock/main.yml)](https://github.com/digitalbazaar/bedrock/actions/workflows/main.yml) +[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock/main.yaml)](https://github.com/digitalbazaar/bedrock/actions/workflows/main.yaml) An EventEmitter replacement that allows both asynchronous and synchronous emissions and handlers. This is entirely based off of and almost entirely diff --git a/package.json b/package.json index ac53828..4934786 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "mocha-lcov-reporter": "^1.3.0" }, "engines": { - "node": ">=14" + "node": ">=20" }, "c8": { "exclude": [ From 4479c3d0393f4da7bdc143cecb0cffcc4f703ecb Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 16:11:04 -0500 Subject: [PATCH 5/8] Update eslint. - Use `@digitalbazaar/eslint-config`. - Use `eslint@9`. --- .eslintrc.cjs | 12 ------------ eslint.config.js | 5 +++++ package.json | 8 +++----- test/event-emitter.js | 2 +- 4 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index eaf2ed6..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - // this is required for dynamic import() - ecmaVersion: 2020 - }, - env: { - node: true - }, - extends: ['digitalbazaar', 'digitalbazaar/jsdoc'], - ignorePatterns: ['node_modules/'] -}; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..45e2405 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,5 @@ +import config from '@digitalbazaar/eslint-config/universal-recommended'; + +export default [ + ...config +]; diff --git a/package.json b/package.json index 4934786..85fb6a9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "module", "description": "Asynchronous EventEmitter", "scripts": { - "lint": "eslint 'lib/*.js' 'test/*.js'", + "lint": "eslint", "coverage": "cross-env NODE_ENV=test c8 --reporter=lcov --reporter=text-summary npm test", "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly npm test", "coverage-report": "c8 report", @@ -41,13 +41,11 @@ "is-promise": "^4.0.0" }, "devDependencies": { + "@digitalbazaar/eslint-config": "^8.0.1", "c8": "^7.11.0", "chai": "^4.3.6", "cross-env": "^7.0.3", - "eslint": "^7.32.0", - "eslint-config-digitalbazaar": "^2.8.0", - "eslint-plugin-jsdoc": "^39.2.1", - "jsdoc-to-markdown": "^7.1.1", + "eslint": "^9.39.3", "mocha": "^9.2.2", "mocha-lcov-reporter": "^1.3.0" }, diff --git a/test/event-emitter.js b/test/event-emitter.js index 84486ef..658f0e3 100644 --- a/test/event-emitter.js +++ b/test/event-emitter.js @@ -1,5 +1,5 @@ -import {expect} from 'chai'; import {EventEmitter} from '../lib/index.js'; +import {expect} from 'chai'; describe('EventEmitter', function() { describe('#constructor', function() { From e115a610731531cc77cffde775f078948a4e09f2 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 16:15:18 -0500 Subject: [PATCH 6/8] Update dev dependencies. --- CHANGELOG.md | 1 + package.json | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 140d01b..8e9c4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changed - **BREAKING**: Only support Node.js >=20. +- Update dev dependencies. ### Fixed - Add `package.json` `files` field. diff --git a/package.json b/package.json index 85fb6a9..9ec9755 100644 --- a/package.json +++ b/package.json @@ -42,11 +42,11 @@ }, "devDependencies": { "@digitalbazaar/eslint-config": "^8.0.1", - "c8": "^7.11.0", - "chai": "^4.3.6", - "cross-env": "^7.0.3", + "c8": "^11.0.0", + "chai": "^6.2.2", + "cross-env": "^10.1.0", "eslint": "^9.39.3", - "mocha": "^9.2.2", + "mocha": "^11.7.5", "mocha-lcov-reporter": "^1.3.0" }, "engines": { From 559b9bb5060209397d79ea13c155ed907a53cf99 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 16:16:38 -0500 Subject: [PATCH 7/8] Fix codecov action usage. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d7953c6..19660aa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,6 +58,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: - file: ./coverage/lcov.info + files: ./coverage/lcov.info fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} From dfcae010924105ed89e8a436352210722d2e8ca8 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 6 Mar 2026 16:50:07 -0500 Subject: [PATCH 8/8] Remove old eslint config. --- test/.eslintrc.cjs | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 test/.eslintrc.cjs diff --git a/test/.eslintrc.cjs b/test/.eslintrc.cjs deleted file mode 100644 index bf3479f..0000000 --- a/test/.eslintrc.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - env: { - mocha: true - } -};