@php-wasm/node 0.9.12 → 0.9.14

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/noop.js ADDED
@@ -0,0 +1,2 @@
1
+ import { createRequire as topLevelCreateRequire } from 'module';
2
+ const require = topLevelCreateRequire(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node",
3
- "version": "0.9.12",
3
+ "version": "0.9.14",
4
4
  "description": "PHP.wasm for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,6 +15,17 @@
15
15
  "url": "https://github.com/adamziel"
16
16
  }
17
17
  ],
18
+ "exports": {
19
+ ".": {
20
+ "import": "./index.js",
21
+ "require": "./index.cjs"
22
+ },
23
+ "./package.json": "./package.json",
24
+ "./README.md": "./README.md"
25
+ },
26
+ "type": "module",
27
+ "main": "./index.cjs",
28
+ "module": "./index.js",
18
29
  "typedoc": {
19
30
  "entryPoint": "./src/index.ts",
20
31
  "readmeFile": "./README.md",
@@ -26,9 +37,8 @@
26
37
  "directory": "../../../dist/packages/php-wasm/node"
27
38
  },
28
39
  "license": "GPL-2.0-or-later",
29
- "main": "index.cjs",
30
40
  "types": "index.d.ts",
31
- "gitHead": "d915634c21a5af607a7201395920d0a81f842e96",
41
+ "gitHead": "787eee56fce781d74765e3012786e3f83f58b278",
32
42
  "engines": {
33
43
  "node": ">=18.18.0",
34
44
  "npm": ">=8.11.0"
@@ -39,10 +49,10 @@
39
49
  "ini": "4.1.2",
40
50
  "ws": "8.13.0",
41
51
  "yargs": "17.7.2",
42
- "@php-wasm/node-polyfills": "0.9.12",
43
- "@php-wasm/universal": "0.9.12",
44
- "@php-wasm/logger": "0.9.12",
45
- "@php-wasm/util": "0.9.12",
46
- "@wp-playground/common": "0.9.12"
52
+ "@php-wasm/node-polyfills": "0.9.14",
53
+ "@php-wasm/universal": "0.9.14",
54
+ "@php-wasm/logger": "0.9.14",
55
+ "@php-wasm/util": "0.9.14",
56
+ "@wp-playground/common": "0.9.14"
47
57
  }
48
58
  }
@@ -1,40 +0,0 @@
1
- # WebAssembly PHP for Node.js
2
-
3
- This package ships WebAssembly PHP binaries and the JavaScript API optimized for Node.js. It comes with the following PHP extensions:
4
-
5
- - SQLite
6
- - Libzip
7
- - Libpng
8
- - CLI
9
- - OpenSSL
10
- - MySQL
11
-
12
- It uses the host filesystem directly and can access the network if you plug in a custom
13
- WS proxy.
14
-
15
- Here's how to use it:
16
-
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
- });
24
-
25
- // Create and run a script directly
26
- php.writeFile('./index.php', `<?php echo "Hello " . $_POST['name']; ?>`);
27
- await php.run({ scriptPath: './index.php' });
28
-
29
- // Or use the familiar HTTP concepts:
30
- const response = await php.request({
31
- method: 'POST',
32
- url: '/index.php',
33
- data: { name: 'John' },
34
- });
35
- console.log(response.text);
36
- ```
37
-
38
- ## Attribution
39
-
40
- `@php-wasm/node` started as a fork of the original PHP to WebAssembly build published by Oraoto in https://github.com/oraoto/pib and modified by Sean Morris in https://github.com/seanmorris/php-wasm.