Re: Import: why are single-export modules favored?

2013-07-21 Thread Axel Rauschmayer
OK, good. Favoring single-export modules over multi-export modules seems like the right call, then. On Jul 22, 2013, at 7:23 , Ryan Florence wrote: >> Have single-export modules in npm been counted? > > A look at npm would not be a representative sampling of JavaScript modules. > > NPM houses

Re: Re: Import: why are single-export modules favored?

2013-07-21 Thread Ryan Florence
> Have single-export modules in npm been counted? A look at npm would not be a representative sampling of JavaScript modules. NPM houses library code, which lends itself more toward multi-export than application code does, in my experience anyway. Every client app I've worked on has some sort o

Re: Import: why are single-export modules favored?

2013-07-04 Thread Sean Silva
On Thu, Jul 4, 2013 at 5:05 PM, Axel Rauschmayer wrote: > In Node.js, the difference is: > > module.exports = function () { … }; > > versus > > module.exports = { > foo: …, > bar: …, > baz: … > }; > > So, conceptually, the former piece of code exports a single

Re: Import: why are single-export modules favored?

2013-07-04 Thread Axel Rauschmayer
In Node.js, the difference is: module.exports = function () { … }; versus module.exports = { foo: …, bar: …, baz: … }; So, conceptually, the former piece of code exports a single value, while the latter exports multiple values. Axel On Jul 4, 2013, at 23:4

Re: Import: why are single-export modules favored?

2013-07-04 Thread Sean Silva
On Thu, Jul 4, 2013 at 7:43 AM, Axel Rauschmayer wrote: > When importing from a multi-export module, you need to wrap things in > braces, which enables convenient syntax for single-export modules. > Why? Have single-export modules in npm been counted? Are there more than > multi-export modules? >

Import: why are single-export modules favored?

2013-07-04 Thread Axel Rauschmayer
When importing from a multi-export module, you need to wrap things in braces, which enables convenient syntax for single-export modules. Why? Have single-export modules in npm been counted? Are there more than multi-export modules? I’m guessing that single-export modules will usually export func