Skip to content

Commit

Permalink
Improved ESM support (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
LJNeon authored and abalabahaha committed Jan 1, 2020
1 parent db95115 commit 3fd70d4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
41 changes: 41 additions & 0 deletions esm.mjs
@@ -0,0 +1,41 @@
import Eris from "./index.js";

export default function(token, options) {
return new Eris.Client(token, options);
}

export const {
Base,
Bucket,
Call,
CategoryChannel,
Channel,
Client,
Collection,
Command,
CommandClient,
Constants,
ExtendedUser,
GroupChannel,
Guild,
GuildChannel,
GuildIntegration,
Invite,
Member,
Message,
NewsChannel,
Permission,
PermissionOverwrite,
PrivateChannel,
Relationship,
Role,
Shard,
SharedStream,
TextChannel,
User,
VERSION,
VoiceChannel,
VoiceConnection,
VoiceConnectionManager,
VoiceState
} = Eris;
10 changes: 10 additions & 0 deletions package.json
Expand Up @@ -3,6 +3,16 @@
"version": "0.11.1",
"description": "A NodeJS Discord library",
"main": "./index.js",
"exports": {
".": [
{
"require": "./index.js",
"import": "./esm.mjs"
},
"./index.js"
],
"./esm": "./esm.mjs"
},
"typings": "./index.d.ts",
"engines": {
"node": ">=8.0.0"
Expand Down

0 comments on commit 3fd70d4

Please sign in to comment.