Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-lodash

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-lodash - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

2

LICENSE.txt

@@ -1,2 +0,2 @@

Copyright 2013 The Dojo Foundation <http://dojofoundation.org/>
Copyright 2013-2015 The Dojo Foundation <http://dojofoundation.org/>
Based on Grunt-Lodashbuilder 0.1.7, copyright 2012 Sebastian Golasch

@@ -3,0 +3,0 @@

{
"name": "grunt-lodash",
"version": "0.3.0",
"version": "0.4.0",
"description": "A Grunt wrapper around lodash-cli.",
"homepage": "https://github.com/lodash/grunt-lodash",
"license": "MIT",
"keywords": [
"builder",
"compile",
"customize",
"gruntplugin",
"lodash",
"underscore",
"util"
],
"author": "Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"keywords": "builder, compile, customize, gruntplugin, lodash, underscore, util",
"author": "Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
"contributors": [
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)",
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)",
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)",
"Sebastian Golasch <public@asciidisco.com> (http://asciidisco.com/)"
],
"bugs": "https://github.com/lodash/grunt-lodash/issues",
"repository": { "type": "git", "url": "git://github.com/lodash/grunt-lodash.git" },
"repository": "lodash/grunt-lodash",
"scripts": { "test": "grunt travis --verbose" },
"engines": {
"node": ">=0.8.19"
},
"scripts": {
"test": "grunt travis --verbose"
},
"peerDependencies": {
"lodash-cli": ">=1.3.1"
},
"dependencies": {
"lodash": "2.0.0"
"lodash": "3.0.0"
},
"devDependencies": {
"lodash-cli": ">=1.3.1",
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.4.4",
"grunt-cli": "~0.1.13",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-watch": "~0.4.4",
"lodash-cli": ">=1.3.1",
"semver": "~2.1.0"
},
"peerDependencies": {
"lodash-cli": ">=1.3.1"
},
"files": [

@@ -47,0 +39,0 @@ "LICENSE.txt",

@@ -1,4 +0,4 @@

# grunt-lodash v0.3.0
# grunt-lodash v0.4.0
A Grunt wrapper around [lodash-cli](https://npmjs.org/package/lodash-cli).
A Grunt wrapper around the [lodash](https://lodash.com/) command-line interface, [lodash-cli](https://npmjs.org/package/lodash-cli).

@@ -11,6 +11,6 @@ ## Getting Started

```bash
npm install grunt-lodash --save-dev
$ npm i --save-dev grunt-lodash
```
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Once grunt-lodash has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

@@ -33,4 +33,4 @@ ```js

// modifiers for prepared builds
// backbone, legacy, modern, mobile, strict, underscore
'modifier': 'backbone'
// modern, strict, compat
'modifier': 'modern'
}

@@ -45,8 +45,17 @@ }

```bash
lodash backbone -o build/lodash.build.js
$ lodash modern -o build/lodash.build.js
```
Finally, include the `lodash` invocation in your desired build task:
```js
grunt.registerTask('build', [
'clean:dist',
'lodash'
]);
```
## Configuration options
For a more in-depth explanation of the build options head on over to the [lodash-cli documentation](http://lodash.com/custom-builds).
For a more in-depth explanation of the build options head on over to the [lodash-cli documentation](https://lodash.com/custom-builds).

@@ -61,6 +70,6 @@ ```js

// modifiers for prepared builds
// backbone, legacy, modern, mobile, strict, underscore
'modifier': 'backbone',
// modern, strict, compat
'modifier': 'modern',
'modularize': true,
'category': ['collections', 'functions'],
'category': ['collection', 'function'],
'exports': ['amd', 'commonjs', 'node'],

@@ -79,4 +88,4 @@ 'iife': '!function(window,undefined){%output%}(this)',

'--stdout',
'debug',
'--minify',
'development',
'--production',
'source-map'

@@ -90,4 +99,4 @@ ],

'-d',
'm',
'-p'
'p',
'-m'
]

@@ -100,33 +109,5 @@ }

grunt-lodash has been tested in at least Node.js 0.8.19-0.10.7, 0.10.12, 0.10.16 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working).
Tested in Node.js 0.8.28 & 0.10.35.<br>
**Note:** Node.js 0.10.8-0.10.11 [have](https://github.com/joyent/node/issues/5622) [bugs](https://github.com/joyent/node/issues/5688) preventing minified builds.
## Release Notes
### <sup>v0.3.0</sup>
* Added modularize option + tests
* Tested with Lo-Dash 2.0.0 release
The full changelog is available [here](https://github.com/lodash/grunt-lodash/wiki/Changelog).
## Contributing
If you’d like to file an issue or submit a pull request, please check the [contributing guidelines](https://github.com/lodash/grunt-lodash/blob/master/CONTRIBUTING.md).
## Resources
- [grunt](https://github.com/gruntjs/grunt)
- [Getting started](http://gruntjs.com/getting-started)
- [Lo-Dash](http://lodash.com/)
## Author
| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") |
|---|
| [Blaine Bublitz](http://iceddev.com/) |
## Contributors
| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
|---|---|---|
| [John-David Dalton](http://allyoucanleet.com/)| [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
The changelog for this release is available on our [wiki](https://github.com/lodash/grunt-lodash/wiki/Changelog).
module.exports = function(grunt) {
'use strict';
var pkg = require('lodash-cli/package.json');
var bin = pkg.bin.lodash;
var builder = require.resolve('lodash-cli/' + bin);
var _ = require('lodash');
var pkg = require('lodash-cli/package.json'),
bin = pkg.bin.lodash,
builder = require.resolve('lodash-cli/' + bin);
var customOptions = ['modifier', 'modularize', 'flags', 'shortFlags'];

@@ -16,6 +16,9 @@

/*--------------------------------------------------------------------------*/
/** Register the task with Grunt */
grunt.registerMultiTask('lodash', 'Builds a customized Lo-Dash', function() {
grunt.registerMultiTask('lodash', 'Builds a customized lodash', function() {
var done = this.async();
var opts = this.options({
var options = this.options({
'modifier': '',

@@ -26,45 +29,36 @@ 'flags': [],

var args = _.map(omitCustom(opts), function(val, opt) {
if (_.isArray(val)) {
val = val.join(',');
var args = _.map(omitCustom(options), function(value, key) {
if (_.isArray(value)) {
value = value.join(',');
}
return opt + '=' + val;
return key + '=' + value;
});
var flags = _.map(opts.flags, function(flag) {
if (flag.indexOf('--') > -1) {
return flag;
}
return '--' + flag;
var flags = _.map(options.flags, function(flag) {
return flag.replace(/^(?:--)?/, '--');
});
var shortFlags = _.map(opts.shortFlags, function(flag) {
if (flag.indexOf('-') > -1) {
return flag;
}
return '-' + flag;
var shortFlags = _.map(options.shortFlags, function(flag) {
return flag.replace(/^(?:-)?/, '-');
});
var command = [builder];
if (opts.modularize) {
command.push('modularize');
var spawnArgs = [builder];
if (options.modularize) {
spawnArgs.push('modularize');
}
if (opts.modifier) {
command.push(opts.modifier);
if (options.modifier) {
spawnArgs.push(options.modifier);
}
spawnArgs = spawnArgs.concat(args, flags, shortFlags, '--output', this.files[0].dest);
var output = ['--output', this.files[0].dest];
var spawnArgs = command.concat(args, flags, shortFlags, output);
grunt.verbose.writeln('lodash-cli version: ' + pkg.version);
grunt.verbose.writeln('Build arguments: ' + spawnArgs.slice(1).join(' '));
grunt.verbose.writeln('Lo-Dash CLI Version: ' + pkg.version);
grunt.verbose.writeln('Build Arguments: ' + spawnArgs.join(' '));
grunt.util.spawn({
'cmd': 'node',
'args': spawnArgs
}, function(err, data) {
if (err) {
grunt.log.error(err.toString());
done(err);
}, function(error, data) {
if (error) {
grunt.log.error(error.toString());
done(error);
}

@@ -71,0 +65,0 @@ grunt.verbose.write(data.toString());

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc