Skip to main content

Using WordPress Playground in Node.js

As a WebAssembly project, WordPress Playground can also be used in Node.js. Here's how you can do it:

Start a zero-setup dev environment via VScode extension

You can use the VScode extension to develop your plugin or theme locally without installing Apache or MySQL.

The extension ships with a portable WebAssembly version of PHP and sets up WordPress to use SQLite. All you have to do is click the "Start WordPress Server" button in VScode:

Work directly with WebAssembly PHP for Node.js

And if you need a low-level control over the underlying WebAssembly PHP build, take a look at the @php-wasm/node package which ships the PHP WebAssembly runtime. This package is at the core of all WordPress Playground tools for Node.js.