Public Repository

Last pushed: 2 years ago
Short Description
jsdom4 on Docker rpi-io.js
Full Description

Dockerfile

FROM ontouchstart/rpi-io.js
MAINTAINER Sam Liu <ontouchstart@gmail.com>

ENV NODE_PATH /usr/local/lib/node_modules
RUN npm install -g jsdom 
ENV HOME /home
WORKDIR /home

/home/example.js

// Count all of the links from the io.js build page
var jsdom = require("jsdom");

jsdom.env(
  "https://iojs.org/dist/",
  ["http://code.jquery.com/jquery.js"],
  function (errors, window) {
    console.log("jquery version:", window.$.fn.jquery);
    console.log("there have been", window.$("a").length - 4, "io.js releases!");
  }
);

Test

$ sudo docker run --rm -v $(pwd)/home:/home -it ontouchstart/rpi-jsdom4 iojs example.js
jquery version: 1.11.1
there have been 8 io.js releases!
Docker Pull Command
Owner
ontouchstart

Comments (0)