These are chat archives for ericelliott/stampit

30th
Jan 2015
Eric Elliott
@ericelliott
Jan 30 2015 20:42
Stylint looks cool. =)
I'd be happy with a .proto() alias.
Will Vaughn
@nackjicholson
Jan 30 2015 20:48
Hey, this is sort of an unrelated question, but I think stampit is the first place I ran into mout. I’m looking to implement a module which uses a similar structure where you can require individual pieces like require(‘mout/array/pluck’). Is there a good resource or documentation that you know about which would help me figure out how to expose modules like that. Essentially what I want to avoid is something like this var pluck = require(‘mout’).array.pluck;
Can you literally just use directory structure with require?
Eric Elliott
@ericelliott
Jan 30 2015 20:52
Just npm install mout and explore the node_modules/mout folder to see how it works. =)
Will Vaughn
@nackjicholson
Jan 30 2015 20:53
:+1: Derp. Good advice. Thanks!
Will Vaughn
@nackjicholson
Jan 30 2015 20:59
Harder than I thought. They have a build process to move everything out of the src dir before npm publishing. Cool stuff though.
Eric Elliott
@ericelliott
Jan 30 2015 21:03
yeah, but you don't need the build process to make it happen if you author in node style modules.
Will Vaughn
@nackjicholson
Jan 30 2015 21:04
You mean just having everything floating in the top level of the module?
I kind of like having everything in a lib directory.
and then test mirroring that.
Eric Elliott
@ericelliott
Jan 30 2015 21:05
if you npm install mout, you'll see the compiled node style module outputs that mirror the same directory structure.. inside node_modules/mout, you'll see object, collection, function, math, etc..
in each of those, you'll find regular node style modules that can be required with ('mout/object/find'), etc..
Will Vaughn
@nackjicholson
Jan 30 2015 21:06
Indeed I do see that.
Eric Elliott
@ericelliott
Jan 30 2015 21:07
so to make that possible with your module, just make sure that anything you want to enable that kind of require for follows the proper directory structure to make that happen.. you can put everything in a lib folder, but then people will need to do require('foo/lib/bar/baz')
Will Vaughn
@nackjicholson
Jan 30 2015 21:08
Yup, I’m internally debating if I want to break my tradition of putting things in lib just cuz that’s been my preference.
I think I’m okay with just moving everything out to the top. Thanks for letting me bounce that off ya. I’ve only been full time node developing for a few months.
Eric Elliott
@ericelliott
Jan 30 2015 21:58
For apps, I try to minimize what I keep in the root. For libs, I think that's less important. =)