lodash-node

Tom Hughes tom at compton.nu
Wed Jul 30 10:23:15 UTC 2014


On 17/04/14 19:02, Jamie Nguyen wrote:
> On 16/04/14 16:35, Tom Hughes wrote:
>> I have an existing package that has a new version with a dependency on
>> lodash-node so I was trying to package it but ran into the question of
>> exactly what it is and how to deal with it...
>>
>> We have lodash packaged already and as bast I can figure out lodash-node
>> is the result of using lodash-cli to build node modules from lodash.
>> Though I'm not sure what that means when lodash is already a node module?!?
>>
>> In any case does that mean I should package lodash-cli first and then
>> make the lodash-node package do that build step?
>
> lodash-cli allows commands like this:
>
>    $ lodash compat
>    $ lodash underscore
>    $ lodash modern
>
> The file created by each of the above contain a subset of lodash
> functionality tailored to whatever preset you've chosen.
>
> lodash-node contains three subsets (compat, underscore, modern), but
> splits every single routine/function/method into a separate file. This
> allows individual methods to be required:
>
>    var isEqual = require('lodash-node/modern/objects/isEqual');
>
> The lodash-node module can be re-built by doing this:
>
>    $ lodash modularize compat -o compat
>    $ lodash modularize underscore -o underscore
>    $ lodash modularize modern -o modern
>
> So you'll probably need to package lodash-cli first, remove
> lodash-node/{compat,modern,underscore}, and rebuild using the above
> commands.

Further to all this, the package I had which required lodash-node has 
now switched to using half a dozen lodash.xxx modules instead.

We also have open review tickets for a large number of such modules, 
including three of the six that I now need.

Looking at it, it seems all those modules are built with lodash-cli by 
running:

   lodash modularize modern exports="npm" -o ./npm/

which creates an entire directory full of 150+ lodash.xxx node modules.

Rather than packing each one individually, and in the spirit of 
packaging from source, should we in fact just have one SRPM which builds 
all the RPMs from source using lodash-cli?

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/


More information about the nodejs mailing list