@php-wasm/node 1.0.28 → 1.0.29

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/README.md +6 -14
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -15,23 +15,15 @@ WS proxy.
15
15
  Here's how to use it:
16
16
 
17
17
  ```js
18
- import { PHP } from '@php-wasm/node';
19
- const php = PHP.load('8.0', {
20
- requestHandler: {
21
- documentRoot: new URL('./', import.meta.url).pathname,
22
- },
23
- });
18
+ import { PHP } from '@php-wasm/universal';
19
+ import { loadNodeRuntime } from '@php-wasm/node';
24
20
 
25
- // Create and run a script directly
26
- php.writeFile('./index.php', `<?php echo "Hello " . $_POST['name']; ?>`);
27
- await php.run({ scriptPath: './index.php' });
21
+ const php = new PHP(await loadNodeRuntime('8.3'));
28
22
 
29
- // Or use the familiar HTTP concepts:
30
- const response = await php.request({
31
- method: 'POST',
32
- url: '/index.php',
33
- data: { name: 'John' },
23
+ const output = await php.run({
24
+ code: '<?php phpinfo(); ?>',
34
25
  });
26
+
35
27
  console.log(response.text);
36
28
  ```
37
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "PHP.wasm for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "license": "GPL-2.0-or-later",
40
40
  "types": "index.d.ts",
41
- "gitHead": "ed7171a91717c70dd7162e3d93283f66d21c001d",
41
+ "gitHead": "173e69f62e1b43bd7353b875054bb1ef5e394de8",
42
42
  "engines": {
43
43
  "node": ">=18.18.0",
44
44
  "npm": ">=8.11.0"
@@ -51,11 +51,11 @@
51
51
  "wasm-feature-detect": "1.8.0",
52
52
  "ws": "8.18.0",
53
53
  "yargs": "17.7.2",
54
- "@php-wasm/node-polyfills": "1.0.28",
55
- "@php-wasm/universal": "1.0.28",
56
- "@php-wasm/logger": "1.0.28",
57
- "@php-wasm/util": "1.0.28",
58
- "@wp-playground/common": "1.0.28",
59
- "@wp-playground/wordpress": "1.0.28"
54
+ "@php-wasm/node-polyfills": "1.0.29",
55
+ "@php-wasm/universal": "1.0.29",
56
+ "@php-wasm/logger": "1.0.29",
57
+ "@php-wasm/util": "1.0.29",
58
+ "@wp-playground/common": "1.0.29",
59
+ "@wp-playground/wordpress": "1.0.29"
60
60
  }
61
61
  }