A lightweight node port of websocketd, originally written in go.
node-websocketd --port=8080 ./count.shA lightweight node port of websocketd, originally written in go.
node-websocketd --port=8080 ./count.sh| # simple bundle | |
| $ time browserify --debug lib/boot/index.js | wc -c | |
| 1397809 | |
| real 0m1.726s | |
| user 0m1.540s | |
| sys 0m0.139s | |
| # bundle without node_modules |
| ;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){ | |
| // your code | |
| },{}]},{},[1]) | |
| ; |
| $('body').append([ | |
| "<div class='loading-screen' style='z-index:1005'>", | |
| "<div class='loading-container'>", | |
| "<div class='text'>Loading " + item.name + " (" + item.id + ")", | |
| "<div class='progress progress-striped active' style='width: 100%'>", | |
| <div class='bar' style='width: 100%;'></div>", | |
| "</div>", | |
| "</div>", | |
| "</div>", | |
| "</div>" |
| var shoe = require('shoe') | |
| , fetch = require('git-fetch-pack') | |
| , unpack = require('git-list-pack') | |
| , through = require('through') | |
| , Buffer = require('buffer').Buffer | |
| // make a websocket connection to the | |
| // server. | |
| var conn = shoe('/git') | |
| , client |
| var createGame = require('voxel-engine') | |
| function sphereWorld(x, y,z ) { | |
| // return the number of the material you want to show up | |
| // at the current x, y, z position. | |
| // the numbers refer to the games materials array. | |
| // 0 is air | |
| if (x*x + y*y + z*z > 15*15) return 0 | |
| // 3 is dirt | |
| return 3 |
| var AsyncCache = require('async-cache') | |
| var fs = require('fs') | |
| var stats = new AsyncCache({ | |
| max: 100, | |
| maxAge: 1000, | |
| load: function (filePath, cb) { | |
| fs.stat(filePath, cb); | |
| } | |
| }) |
| var Readable = require('stream').Readable; | |
| var r = new Readable({ | |
| lowWaterMark: 3, | |
| highWaterMark: 10 | |
| }); | |
| var calls = 0; | |
| r._read = function (n, cb) { | |
| console.log("_read", this._readableState.length, | |
| this._readableState.lowWaterMark, | |
| this._readableState.highWaterMark) |