@caruuto/caruuto-js 0.4.0 → 0.4.1

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/lib/extensions.js +10 -13
  2. package/package.json +1 -1
package/lib/extensions.js CHANGED
@@ -1,6 +1,3 @@
1
- const fs = require('fs')
2
- const path = require('path')
3
-
4
1
  /*
5
2
  Each extension should be added to the CaruutoClient prototype, so that
6
3
  for example, the email extension can be used as:
@@ -36,18 +33,18 @@ module.exports = function (CaruutoClient, clientInstance) {
36
33
  ```
37
34
  */
38
35
 
36
+ const emailExtension = require('./extensions/email')
37
+ const tokensExtension = require('./extensions/tokens')
38
+
39
39
  // Load all extensions from the lib/extensions directory/
40
40
  module.exports = function (CaruutoClient, clientInstance) {
41
- const extensionsDir = path.join(__dirname, 'extensions')
42
- const files = fs.readdirSync(extensionsDir)
41
+ if (typeof emailExtension === 'function') {
42
+ emailExtension(CaruutoClient, clientInstance)
43
+ }
43
44
 
44
- files.forEach(file => {
45
- if (file.endsWith('.js')) {
46
- const extension = require(path.join(extensionsDir, file))
45
+ if (typeof tokensExtension === 'function') {
46
+ tokensExtension(CaruutoClient, clientInstance)
47
+ }
47
48
 
48
- if (typeof extension === 'function') {
49
- extension(CaruutoClient, clientInstance)
50
- }
51
- }
52
- })
49
+ // Add any other extensions here.
53
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caruuto/caruuto-js",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A high-level library for interacting with Caruuto",
5
5
  "exports": "./index.js",
6
6
  "scripts": {