@heyputer/puter.js 2.0.8 → 2.0.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyputer/puter.js",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Puter.js - A JavaScript library for interacting with Puter services.",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
@@ -99,7 +99,7 @@ export class PuterJSFileSystemModule extends AdvancedBase {
99
99
  auth: {
100
100
  auth_token: this.authToken,
101
101
  },
102
- autoUnref: true,
102
+ autoUnref: this.context.env === 'nodejs',
103
103
  });
104
104
 
105
105
  this.bindSocketEvents();
@@ -4,7 +4,7 @@ const { resolve } = require('node:path');
4
4
  /**
5
5
  * Method for loading puter.js in Node.js environment
6
6
  * @param {string} authToken - Optional auth token to initialize puter with
7
- * @returns {Promise<import('../index.d.ts').puter>} The `puter` object from puter.js
7
+ * @returns {import('../index.d.ts').puter} The `puter` object from puter.js
8
8
  */
9
9
  const safeLoadPuterJs = (authToken) => {
10
10
  const goodContext = {};
@@ -78,7 +78,7 @@ export class FilesystemService extends putility.concepts.Service {
78
78
 
79
79
  this.socket = io(api_info.api_origin, {
80
80
  auth: { auth_token: api_info.auth_token },
81
- autoUnref: true,
81
+ autoUnref: this._.context.env === 'nodejs',
82
82
  });
83
83
 
84
84
  this.bindSocketEvents();