Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove node modules from the repo

  • Loading branch information...
commit 5dd3d80f453fe25d6b52d955338dcec86811286e 1 parent 2e4df6f
@cianclarke authored
View
89 node_modules/walk/node-type-emitter.js
@@ -1,89 +0,0 @@
-/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
-(function () {
- "use strict";
-
- // "FIFO" isn't easy to convert to camelCase and back reliably
- var isFnodeTypes = [
- "isFile", "isDirectory", "isSymbolicLink", "isBlockDevice", "isCharacterDevice", "isFIFO", "isSocket"
- ],
- fnodeTypes = [
- "file", "directory", "symbolicLink", "blockDevice", "characterDevice", "FIFO", "socket"
- ],
- fnodeTypesPlural = [
- "files", "directories", "symbolicLinks", "blockDevices", "characterDevices", "FIFOs", "sockets"
- ];
-
-
- //
- function createNodeGroups() {
- var nodeGroups = {};
- fnodeTypesPlural.concat("nodes", "errors").forEach(function (fnodeTypePlural) {
- nodeGroups[fnodeTypePlural] = [];
- });
- return nodeGroups;
- }
-
-
- // Determine each file node's type
- //
- function sortFnodesByType(stat, fnodes) {
- var i, isType;
-
- for (i = 0; i < isFnodeTypes.length; i += 1) {
- isType = isFnodeTypes[i];
- if (stat[isType]()) {
- stat.type = fnodeTypes[i];
- fnodes[fnodeTypesPlural[i]].push(stat);
- return;
- }
- }
- }
-
-
- // Get the current number of listeners (which may change)
- // Emit events to each listener
- // Wait for all listeners to `next()` before continueing
- // (in theory this may avoid disk thrashing)
- function emitSingleEvents(emitter, path, stats, next, self) {
- var num = 1 + emitter.listeners(stats.type).length + emitter.listeners("node").length;
-
- function nextWhenReady() {
- num -= 1;
- if (0 === num) { next.call(self); }
- }
-
- emitter.emit(stats.type, path, stats, nextWhenReady);
- emitter.emit("node", path, stats, nextWhenReady);
- nextWhenReady();
- }
-
-
- // Since the risk for disk thrashing among anything
- // other than files is relatively low, all types are
- // emitted at once, but all must complete before advancing
- function emitPluralEvents(emitter, path, nodes, next, self) {
- var num = 1;
-
- function nextWhenReady() {
- num -= 1;
- if (0 === num) { next.call(self); }
- }
-
- fnodeTypesPlural.concat(["nodes", "errors"]).forEach(function (fnodeType) {
- if (0 === nodes[fnodeType].length) { return; }
- num += emitter.listeners(fnodeType).length;
- emitter.emit(fnodeType, path, nodes[fnodeType], nextWhenReady);
- });
- nextWhenReady();
- }
-
- module.exports = {
- emitNodeType: emitSingleEvents,
- emitNodeTypeGroups: emitPluralEvents,
- isFnodeTypes: isFnodeTypes,
- fnodeTypes: fnodeTypes,
- fnodeTypesPlural: fnodeTypesPlural,
- sortFnodesByType: sortFnodesByType,
- createNodeGroups: createNodeGroups
- };
-}());
View
46 node_modules/walk/node_modules/forEachAsync/README.md
@@ -1,46 +0,0 @@
-Array.forEachAsync()
-----
-
-Another reincarnation of `sequence` that makes sense for the use case of arrays.
-
-**Example:**
-
- var forEachAsync = require('forEachAsync')
- , count = 0
- , timers = [
- 101,
- 502,
- 203,
- 604,
- 105
- ];
-
- function hello(next, time) {
- this[count] = time;
-
- if (count >= 4) {
- next(forEachAsync.BREAK);
- }
-
- console.log(count += 1, time);
-
- setTimeout(next, time);
- }
-
- function goodbye() {
- console.log("All Done", this);
- }
-
- forEachAsync(timers, hello, {}).then(goodbye);
-
-API
----
-
- * forEachAsync(array, callback*[, thisArg]*)
- * forEachAsync#then(finalCallback)
- * forEachAsync#BREAK
-
-**Warning:** [Poorly written code](https://gist.github.com/941362) may have really strange errors when `Array.prototype` is extended.
-If you run into such problems please contact the author of the code (I'm also willing to help if they are unavailable).
-Libraries such as `jQuery` or `MooTools` will accept bug reports for such failures.
-
View
37 node_modules/walk/node_modules/forEachAsync/forEachAsync.js
@@ -1,37 +0,0 @@
-/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
-(function () {
- "use strict";
-
- var Sequence = require('sequence');
-
- function handleItem(item, i, arr) {
- var seq = this
- ;
-
- function nextItem(next, BREAK) {
- if (forEachAsync.BREAK === BREAK) {
- process.nextTick(function () {
- next(forEachAsync.BREAK);
- });
- return;
- }
-
- seq._contextCallback.call(this, next, item, i, arr);
- }
-
- seq.then(nextItem);
- }
-
- function forEachAsync(arr, callback, _context) {
- var sequence = Sequence.create(_context);
-
- sequence._contextCallback = callback;
-
- arr.forEach(handleItem, sequence);
-
- return sequence;
- }
-
- forEachAsync.BREAK = '__forEachAsync_BREAK__';
- module.exports = forEachAsync;
-}());
View
35 node_modules/walk/node_modules/forEachAsync/node_modules/sequence/README.md
@@ -1,35 +0,0 @@
-sequence()
-----
-
-Creates an Asynchronous Stack which execute each enqueued method after the previous function calls the provided `next(err, data [, ...])`.
-
-**Core**
-
- * `Futures.sequence(globalContext=null)`
- * `then(next, err, data [, ...])` - add a method onto the queue
- * begins or resumes the queue
- * passes the results of the previous function into the next
-
-**Example:**
-
- var sequence = Futures.sequence(),
- err;
-
- sequence
- .then(function (next) {
- setTimeout(function () {
- next(err, "Hi", "World!");
- }, 120);
- })
- .then(function (next, err, a, b) {
- setTimeout(function () {
- next(err, "Hello", b);
- }, 270);
- })
- .then(function (next, err, a, b) {
- setTimeout(function () {
- console.log(a, b);
- next();
- }, 50);
- });
-
View
22 node_modules/walk/node_modules/forEachAsync/node_modules/sequence/package.json
@@ -1,22 +0,0 @@
-{
- "name": "sequence",
- "version": "2.2.1",
- "description": "The sequence module of FuturesJS (Ender.JS and Node.JS)",
- "homepage": "https://github.com/coolaj86/futures",
- "keywords": ["flow-control", "async", "asynchronous", "futures", "sequence", "chain", "step", "util", "browser"],
- "repository": {
- "type": "git",
- "url": "git://github.com/coolaj86/futures.git"
- },
- "author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
- "main": "sequence.js",
- "directories": {
- "lib": "."
- },
- "dependencies": {
- },
- "engines": {
- "node": "*",
- "ender": ">= 0.5.0"
- }
-}
View
66 node_modules/walk/node_modules/forEachAsync/node_modules/sequence/sequence.js
@@ -1,66 +0,0 @@
-(function () {
- "use strict";
-
- function isSequence(obj) {
- return obj instanceof Sequence;
- }
-
- function Sequence(global_context) {
- var self = this,
- waiting = true,
- data,
- stack = [];
-
- if (!isSequence(this)) {
- return new Sequence(global_context);
- }
-
- global_context = global_context || null;
-
- function next() {
- var args = Array.prototype.slice.call(arguments),
- seq = stack.shift(); // BUG this will eventually leak
-
- data = arguments;
-
- if (!seq) {
- // the chain has ended (for now)
- waiting = true;
- return;
- }
-
- args.unshift(next);
- seq.callback.apply(seq.context, args);
- }
-
- function then(callback, context) {
- if ('function' !== typeof callback) {
- throw new Error("`Sequence().then(callback [context])` requires that `callback` be a function and that `context` be `null`, an object, or a function");
- }
- stack.push({
- callback: callback,
- context: (null === context ? null : context || global_context),
- index: stack.length
- });
-
- // if the chain has stopped, start it back up
- if (waiting) {
- waiting = false;
- next.apply(null, data);
- }
-
- return self;
- }
-
- self.next = next;
- self.then = then;
- }
-
- function createSequence(context) {
- // TODO use prototype instead of new
- return (new Sequence(context));
- }
- Sequence.create = createSequence;
- Sequence.isSequence = isSequence;
- module.exports = Sequence;
-}());
View
23 node_modules/walk/node_modules/forEachAsync/package.json
@@ -1,23 +0,0 @@
-{
- "name": "forEachAsync",
- "version": "2.2.0",
- "description": "The forEachAsync module of FuturesJS (Ender.JS and Node.JS)",
- "homepage": "https://github.com/coolaj86/futures",
- "keywords": ["flow-control", "async", "asynchronous", "futures", "forEachAsync", "chain", "step", "util", "browser"],
- "repository": {
- "type": "git",
- "url": "git://github.com/coolaj86/futures.git"
- },
- "author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
- "main": "forEachAsync.js",
- "directories": {
- "lib": "."
- },
- "dependencies": {
- "sequence": ">= 2.2.1"
- },
- "engines": {
- "node": "*",
- "ender": ">= 0.5.0"
- }
-}
View
24 node_modules/walk/package.json
@@ -1,24 +0,0 @@
-{
- "name" : "walk",
- "description" : "A node port of python's os.walk",
- "url" : "github.com/coolaj86/node-walk",
- "keywords" : ["util", "os", "sys", "fs", "walk", "walkSync"],
- "author" : "AJ ONeal <coolaj86@gmail.com>",
- "contributors" : [],
- "dependencies" : {
- "forEachAsync": "~2.2"
- },
- "lib" : ".",
- "main" : "./walk.js",
- "version" : "2.2.1",
- "licenses": [
- {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/mit-license.php"
- },
- {
- "type": "Apache2",
- "url": "http://opensource.org/licenses/apache2.0.php"
- }
- ]
-}
View
93 node_modules/walk/walk-async-only.js
@@ -1,93 +0,0 @@
-(function () {
- "use strict"
-
- // Array.prototype.forEachAsync(next, item, i, collection)
-
- function noop() {}
-
- var fs = require('fs')
- , forEachAsync = require('forEachAsync')
- , EventEmitter = require('events').EventEmitter
- , TypeEmitter = require('./node-type-emitter')
- ;
-
- // 2010-11-25 jorge@jorgechamorro.com
- function create(pathname, cb) {
- var emitter = new EventEmitter(),
- q = [],
- queue = [q],
- curpath;
-
- function walk() {
- fs.readdir(curpath, function(err, files) {
- if (err) {
- emitter.emit('directoryError', curpath, { error: err }, noop);
- //emitter.emit('error', curpath, { error: err });
- }
- // XXX bug was here. next() was omitted
- if (!files || 0 == files.length) {
- return next();
- }
-
- var fnodeGroups = TypeEmitter.createNodeGroups();
-
- // TODO could allow user to selectively stat
- // and don't stat if there are no stat listeners
- emitter.emit('names', curpath, files, noop);
- forEachAsync(files, function (cont, file) {
- emitter.emit('name', curpath, file, noop);
- fs.lstat(curpath + '/' + file, function (err, stat) {
- stat = stat || {};
- stat.name = file;
- if (err) {
- stat.error = err;
- //emitter.emit('error', curpath, stat);
- emitter.emit('nodeError', curpath, stat, noop);
- fnodeGroups.errors.push(stat);
- cont();
- } else {
- TypeEmitter.sortFnodesByType(stat, fnodeGroups);
- TypeEmitter.emitNodeType(emitter, curpath, stat, cont);
- }
- });
- }).then(function () {
- if (fnodeGroups.errors.length) {
- emitter.emit('errors', curpath, fnodeGroups.errors, noop);
- }
- TypeEmitter.emitNodeTypeGroups(emitter, curpath, fnodeGroups, function () {
- var dirs = [];
- fnodeGroups.directories.forEach(function (stat) {
- dirs.push(stat.name);
- });
- dirs.forEach(fullPath);
- queue.push(q = dirs);
- next();
- });
- });
- });
- }
-
- function next() {
- if (q.length) {
- curpath = q.pop();
- return walk();
- }
- if (queue.length -= 1) {
- q = queue[queue.length-1];
- return next();
- }
- emitter.emit('end');
- }
-
- function fullPath(v,i,o) {
- o[i]= [curpath, '/', v].join('');
- }
-
- curpath = pathname;
- walk();
-
- return emitter;
- }
-
- module.exports = create;
-}());
View
235 node_modules/walk/walk.js
@@ -1,235 +0,0 @@
-/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
-// Adapted from work by jorge@jorgechamorro.com on 2010-11-25
-(function () {
- "use strict";
-
- // Array.prototype.forEachAsync(next, item, i, collection)
- //require('Array.prototype.forEachAsync');
-
- function noop() {}
-
- var fs = require('fs')
- , forEachAsync = require('forEachAsync')
- , EventEmitter = require('events').EventEmitter
- , TypeEmitter = require('./node-type-emitter')
- , util = require('util')
- ;
-
- function appendToDirs(stat) {
- /*jshint validthis:true*/
- this.push(stat.name);
- }
-
- function wFilesHandlerWrapper(items) {
- /*jshint validthis:true*/
- this._wFilesHandler(noop, items);
- }
-
- function Walker(pathname, options, sync) {
- EventEmitter.call(this);
-
- var me = this
- ;
-
- me._wsync = sync;
- me._wq = [];
- me._wqueue = [me._wq];
- me._wcurpath = undefined;
- me._wfirstrun = true;
- me._wcurpath = pathname;
-
- if (me._wsync) {
- me._wWalk = me._wWalkSync;
- } else {
- me._wWalk = me._wWalkAsync;
- }
-
- // TODO just one little anony won't hurt...
- process.nextTick(function () {
- me._wWalk();
- });
- }
-
- // Inherits must come before prototype additions
- util.inherits(Walker, EventEmitter);
-
- Walker.prototype._wLstatHandler = function (err, stat) {
- var me = this
- ;
-
- stat = stat || {};
- stat.name = me._wcurfile;
-
- if (err) {
- stat.error = err;
- //me.emit('error', curpath, stat);
- me.emit('nodeError', me._wcurpath, stat, noop);
- me._wfnodegroups.errors.push(stat);
- me._wCurFileCallback();
- } else {
- TypeEmitter.sortFnodesByType(stat, me._wfnodegroups);
- // NOTE: wCurFileCallback doesn't need thisness, so this is okay
- TypeEmitter.emitNodeType(me, me._wcurpath, stat, me._wCurFileCallback, me);
- }
- };
- Walker.prototype._wFilesHandler = function (cont, file) {
- var statPath
- , me = this
- ;
-
-
- me._wcurfile = file;
- me._wCurFileCallback = cont;
- me.emit('name', me._wcurpath, file, noop);
-
- statPath = me._wcurpath + '/' + file;
-
- if (!me._wsync) {
- // TODO how to remove this anony?
- fs.lstat(statPath, function (err, stat) {
- me._wLstatHandler(err, stat);
- });
- return;
- }
-
- try {
- me._wLstatHandler(null, fs.lstatSync(statPath));
- } catch(e) {
- me._wLstatHandler(e);
- }
- };
- Walker.prototype._wOnEmitDone = function () {
- var me = this
- , dirs = []
- ;
-
- me._wfnodegroups.directories.forEach(appendToDirs, dirs);
- dirs.forEach(me._wJoinPath, me);
- me._wqueue.push(me._wq = dirs);
- me._wNext();
- };
- Walker.prototype._wPostFilesHandler = function () {
- var me = this
- ;
-
- if (me._wfnodegroups.errors.length) {
- me.emit('errors', me._wcurpath, me._wfnodegroups.errors, noop);
- }
- // XXX emitNodeTypes still needs refactor
- TypeEmitter.emitNodeTypeGroups(me, me._wcurpath, me._wfnodegroups, me._wOnEmitDone, me);
- };
- Walker.prototype._wReadFiles = function () {
- var me = this
- ;
-
- if (!me._wcurfiles || 0 === me._wcurfiles.length) {
- return me._wNext();
- }
-
- // TODO could allow user to selectively stat
- // and don't stat if there are no stat listeners
- me.emit('names', me._wcurpath, me._wcurfiles, noop);
-
- if (me._wsync) {
- me._wcurfiles.forEach(wFilesHandlerWrapper, me);
- me._wPostFilesHandler();
- } else {
- forEachAsync(me._wcurfiles, me._wFilesHandler, me).then(me._wPostFilesHandler);
- }
- };
- Walker.prototype._wReaddirHandler = function (err, files) {
- var fnodeGroups = TypeEmitter.createNodeGroups()
- , me = this
- ;
-
- me._wfnodegroups = fnodeGroups;
- me._wcurfiles = files;
-
-
- if (!err) {
- me._wReadFiles();
- return;
- }
-
- if (!me._wfirstrun) {
- me.emit('directoryError', me._wcurpath, { error: err }, noop);
- me._wReadFiles();
- return;
- }
-
- me._wfirstrun = false;
- // TODO how to remove this anony?
- fs.lstat(me._wcurpath, function (e, stat) {
-
- if (stat) {
- files = [me._wcurpath.replace(/.*\//, '')];
- me._wcurpath = me._wcurpath.replace(files[0], '');
- }
-
- me._wReadFiles();
- });
- };
- Walker.prototype._wWalkSync = function () {
- var err
- , files
- , me = this
- ;
-
- try {
- files = fs.readdirSync(me._wcurpath);
- } catch(e) {
- err = e;
- }
-
- me._wReaddirHandler(err, files);
- };
- Walker.prototype._wWalkAsync = function () {
- var me = this
- ;
-
- // TODO how to remove this anony?
- fs.readdir(me._wcurpath, function (err, files) {
- me._wReaddirHandler(err, files);
- });
- };
- Walker.prototype._wNext = function () {
- var me = this
- ;
-
- if (me._paused) {
- return;
- }
- if (me._wq.length) {
- me._wcurpath = me._wq.pop();
- me._wWalk();
- return;
- }
- me._wqueue.length -= 1;
- if (me._wqueue.length) {
- me._wq = me._wqueue[me._wqueue.length - 1];
- return this._wNext();
- }
- me.emit('end');
- };
- Walker.prototype._wJoinPath = function (v, i, o) {
- var me = this
- ;
-
- o[i] = [me._wcurpath, '/', v].join('');
- };
- Walker.prototype.pause = function () {
- this._paused = true;
- };
- Walker.prototype.resume = function () {
- this._paused = false;
- this._wNext();
- };
-
- exports.walk = function (path, opts) {
- return new Walker(path, opts, false);
- };
-
- exports.walkSync = function (path, opts) {
- return new Walker(path, opts, true);
- };
-}());
View
2  package.json
@@ -2,7 +2,7 @@
"author": "Cian Clarke <cian@cianclarke.com> (http://www.cianclarke.com)",
"name": "node-gallery",
"description": "NodeJS Photo Gallery using directory structure & exif info to output a gallery",
- "version": "0.3.1",
+ "version": "0.3.2",
"homepage": "http://www.github.com/cianclarke/node-gallery",
"repository": {
"url": ""
Please sign in to comment.
Something went wrong with that request. Please try again.