troygoode / node-require-directory

Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Require Directory of json files

jonmorehouse opened this issue · comments

I'm trying to load in a directory of only json files, but can't seem to get require-directory to work properly.

requireDirectory = require "require-directory"
seedData = requireDirectory module, __dirname + "/seed", null, null

I've tried adding in a third parameter function to always return false to ensure the files are loaded, but haven't had any luck. Has anyone else been able to dynamically load up json files like this?

published to npm as version 1.2.0 (see issue #4)