Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nw-context with all npm packages installed. Try it out:

var nwContext = require("nw-context")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nw-context v0.0.1

Helper functions for passing document/window context into node-webkit

nw-context

Store browser document and window objects in a module for later retrieval from node-webkit modules running in the node context.

Set up in the browser:

var context = require('nw-context');
context.set({
    window: window,
    document: document
});

Then from within other modules:

var window = require('nw-context').window,
    document = require('nw-context').document;

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free