Skip to content

Commit 401f4b6

Browse files
chore: add an ES module wrapper
1 parent 64d5754 commit 401f4b6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"name": "engine.io",
33
"version": "5.2.0",
44
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
5+
"type": "commonjs",
56
"main": "./build/engine.io.js",
67
"types": "./build/engine.io.d.ts",
8+
"exports": {
9+
"import": "./wrapper.mjs",
10+
"require": "./build/engine.io.js"
11+
},
712
"author": "Guillermo Rauch <[email protected]>",
813
"homepage": "https://github.com/socketio/engine.io",
914
"contributors": [
@@ -62,7 +67,8 @@
6267
"url": "[email protected]:socketio/engine.io.git"
6368
},
6469
"files": [
65-
"build/"
70+
"build/",
71+
"wrapper.mjs"
6672
],
6773
"engines": {
6874
"node": ">=10.0.0"

wrapper.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import lib from "./build/engine.io.js";
2+
3+
export const { Server, Socket, Transport, transports, listen, attach, parser, protocol } = lib;

0 commit comments

Comments
 (0)