JSPM

react-app-server-runtime

0.5.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q40517F
  • License MIT

Minimal Node-based runtime to eval React components on server

Package Exports

  • react-app-server-runtime

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-app-server-runtime) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-app-server-runtime

Node.js based runtime to evaluate client side code in. By default provides minimalistic sandboxed runtime via vm Node's module.

Installation

% npm install react-app-server-runtime

Usage

Basic usage:

var evaluate = require('react-app-server-runtime');

evaluate('__callback(null, "hello!");', function(err, message) {
  console.log(message); // outputs "hello!"
});

More complex usage:

var evaluate = require('react-app-server-runtime');

var task = {
  bundle: '...',    // code bundle, built with browserify for example
  code: '...',      // some code to execute after bundle
  debug: true       // should we try to extract source maps from bundle
  sourceMap: ...    // or we can provide SourceMapConsumer directly
}

evaluate(task, function(err, message) {
  console.log(message); // outputs "hello!"
});