But they are a bit too heavy for what I need right now.
My dir structure looks a bit like this
/lib/schemas/schemas.js - contains smart schemas
/lib/collection.js - contains db and collection declaration and collection helpers afterwards
I want these functions to be shared so hence the lib dir. But it’s a bit awkward to specify load order. My options, in order of preference are:
- Name files based on alphabetical sort order (_helper.js anyone?)
- Nest folder levels (/lib/helper, /lib/helper/collection, /lib/helper/collection/schemas)
- Have a large monolithic file that does it all
Is there a better method without looking into packages?
Bonus question: Why doesn’t this work?
Books = Books || new Mongo.Collection('books')