@heyputer/puter.js 2.0.10 → 2.0.12
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/README.md +56 -12
- package/dist/puter.js +1 -4
- package/package.json +1 -1
- package/src/{safeLoadPuter.cjs → init.cjs} +4 -4
package/package.json
CHANGED
|
@@ -2,11 +2,11 @@ const { readFileSync } = require('node:fs');
|
|
|
2
2
|
const vm = require('node:vm');
|
|
3
3
|
const { resolve } = require('node:path');
|
|
4
4
|
/**
|
|
5
|
-
* Method for loading puter.js in Node.js environment
|
|
5
|
+
* Method for loading puter.js in Node.js environment with auth token
|
|
6
6
|
* @param {string} authToken - Optional auth token to initialize puter with
|
|
7
|
-
* @returns {import('../index
|
|
7
|
+
* @returns {import('../index').puter} The `puter` object from puter.js
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const init = (authToken) => {
|
|
10
10
|
const goodContext = {};
|
|
11
11
|
Object.getOwnPropertyNames(globalThis).forEach(name => {
|
|
12
12
|
try {
|
|
@@ -25,4 +25,4 @@ const safeLoadPuterJs = (authToken) => {
|
|
|
25
25
|
return goodContext.puter;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
module.exports = {
|
|
28
|
+
module.exports = { init };
|