Skip to content

Instantly share code, notes, and snippets.

@JesterXL
Last active August 29, 2015 14:27
Show Gist options
  • Save JesterXL/7b7c6d5baf14fcea3f81 to your computer and use it in GitHub Desktop.
Save JesterXL/7b7c6d5baf14fcea3f81 to your computer and use it in GitHub Desktop.
Example browserify in node
// validators.js
var lodash = require('lodash');
var XRegExpLib = require('xregexp').XRegExp;
var momentLib = require('moment');
var predicate = require('./predicate');
var arrayValidator = require('./native/array');
var validators = {
predicate: predicate,
array: arrayValidator,
};
// This prints out correct object in Node console
console.log("arrayValidator:", arrayValidator);
module.exports = validators;
// main.js
var validators = require('../some/path/validators');
console.log("validators:", validators); // {}
// if I loop through the properties, there are none... it's an empty object!?
@JesterXL
Copy link
Author

I took out the module.exports = validators and same thing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment