Download the PHP package lanre/jsrunner without Composer

On this page you can find all versions of the php package lanre/jsrunner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jsrunner

Server side rendering JavaScript in your PHP application

Latest Version on Packagist Build Status Total Downloads

Who's this package for?

You can install the package via composer:

Usage

Engines

An engine executes a JS script on the server. This library ships with three engines: V8Engine which wraps some V8Js calls, so you'll need to install a PHP extension for this one, BunEngine and NodeEngine which build a bun/node script (respectively) at runtime and executes it in a new process. An engine can run a script, or an array of multiple scripts.

V8Engine is a lightweight wrapper around the V8Js class. You'll need to install the v8js extension to use this engine.

BunEngine and NodeEngine write a temporary file with the necessary scripts to render your app, and executes it

in the appropriate environment. You'll need to have node.js (for NodeEngine) or bun (for BunEngine) installed to use this engine.

Rendering options

You can chain any amount of options before rendering the app to control how everything's going to be displayed.

enable(): $this

Enables server side rendering. This is the default state.

disable(): $this

Disables server side rendering. When disabled, the client script and the fallback html will be rendered instead.

enableIf(bool $enabled = true): $this

Conditionally enables server side rendering.

debug(bool $debug = true): $this

When debug is enabled, JavaScript errors will cause a php exception to throw. Without debug mode, the client script and the fallback html will be rendered instead so the app can be rendered from a clean slate.

entry(string $entry): $this

The path to your server script. The contents of this script will be run in the engine.

context($context, $value = null): $this

Context is passed to the server script in the context variable. This is useful for hydrating your application's state. Context can contain anything that json-serializable.

Context can be passed as key & value parameters, or as an array.

env($env, $value = null): $this

Env variables are placed in process.env when the server script is executed. Env variables must be primitive values like numbers, strings or booleans.

fallback(string $fallback): $this

Sets the fallback html for when server side rendering fails or is disabled. You can use this to render a container for the client script to render the fresh app in.

resolveEntryWith(callable $resolver): $this

Add a callback to transform the entry when it gets resolved. It's useful to do this when creating the renderer so you don't have to deal with complex paths in your views.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of jsrunner with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/process Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lanre/jsrunner contains the following files

Loading the files please wait ....