emotesjs 0.0.2 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -1
  2. package/package.json +25 -25
package/index.js CHANGED
@@ -7,14 +7,20 @@ class EmoteJS {
7
7
  height = "1.65rem"
8
8
  format = "WEBP"
9
9
  allowedOrigins = "https://cdn.7tv.app"
10
+ instance
10
11
 
11
12
  constructor(opts) {
13
+ if (EmoteJS.instance) {
14
+ return EmoteJS.instance
15
+ }
16
+
12
17
  this.channelId = opts.channelId || this.channelId
13
18
  this.requireColon = opts.requireColon || this.requireColon
14
19
  this.height = opts.height || this.height
15
20
  this.format = opts.format || this.format
16
21
 
17
22
  this.isLoading = this.load()
23
+ EmoteJS.instance = this
18
24
  }
19
25
 
20
26
  async load() {
@@ -94,5 +100,5 @@ class EmoteJS {
94
100
 
95
101
  }
96
102
 
97
- module.exports = EmoteJS
103
+ module.exports = { EmoteJS }
98
104
 
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
- "name": "emotesjs",
3
- "description": "",
4
- "version": "0.0.2",
5
- "license": "MIT",
6
- "author": {
7
- "name": "darckfast"
8
- },
9
- "engines": {
10
- "node": ">=22"
11
- },
12
- "files": [
13
- "index.js"
14
- ],
15
- "main": "index.js",
16
- "repository": {
17
- "type": "git",
18
- "url": "git://github.com/darckfast/emotesjs.git"
19
- },
20
- "keywords": [
21
- "twitch",
22
- "7tv",
23
- "emotes"
24
- ],
25
- "scripts": {}
26
- }
2
+ "name": "emotesjs",
3
+ "description": "",
4
+ "version": "0.0.8",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "darckfast"
8
+ },
9
+ "engines": {
10
+ "node": ">=22"
11
+ },
12
+ "files": [
13
+ "index.js"
14
+ ],
15
+ "main": "index.js",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git://github.com/darckfast/emotesjs.git"
19
+ },
20
+ "keywords": [
21
+ "twitch",
22
+ "7tv",
23
+ "emotes"
24
+ ],
25
+ "scripts": {}
26
+ }