create-blockly makes it easy to create Blockly instances in both node and the browser (using browserify).
In the browser, Blockly will always be installed in the most flexible and isolated way, using the Blockly's resizable iframe method.
First, make sure you have
on your machine.
Create a new directory with create-blockly installed:
mkdir MyProjectcd MyProjectnpm install create-blockly
Create "browser.js" that instantiates Blockly:
var createBlockly = ;var Blockly =;// Whenever this Blockly editor changes, log the generated Javscript code.// More Blockly documentation atBlockly;
<!-- This is where the iframed resizable Blockly will be embedded. --><!-- This is the toolbox that defines which blocks are visible. --><!-- -->
Install helpers for the server:
npm install express enchilada
Create the "server.js" to serve the demo:
var express = ;var enchilada = ;var app = ;app;app;app;app;console
Run the server and open localhost:1337 in your browser:
$ node server.jsRunning demo on localhost:1337
Just make a pull request :)