apostopher
apostopher

Reputation: 293

LoDash for node.js

How do I custom build lodash for node.js projects? I don't want any opera, IE, firefox based code in the custom build as i will always be using v8. Is it possible? kindly help.

Upvotes: 1

Views: 4633

Answers (4)

Mo.
Mo.

Reputation: 27445

Simply install npm install --save lodash

Use wherever needed with with

const _ = require('lodash');

const array = [1];
const other = _.concat(array, 2, [3], [[4]]);

Upvotes: 0

rus1
rus1

Reputation: 680

There's a specific Node package: lodash-node

Upvotes: 0

ericsoco
ericsoco

Reputation: 26253

From the docs:

  • Use the exports argument to pass comma separated names of ways to export the LoDash function.
    Valid exports are “amd”, “commonjs”, “global”, “node”, and “none”.

    lodash exports=amd,commonjs,node
    lodash exports="amd, commonjs, node"

More on generating custom builds here.

Upvotes: 1

robertklep
robertklep

Reputation: 203251

There's an existing Node package for lodash:

npm install lodash

Upvotes: 4

Related Questions