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

grunt-npm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-npm - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "grunt-npm",
"version": "0.0.1",
"version": "0.0.2",
"description": "A set of helpers for dealing with NPM from Grunt.",

@@ -5,0 +5,0 @@ "bugs": {

@@ -18,6 +18,6 @@ # grunt-npm

### grunt npm-show
### grunt npm-show (also aliased as show)
Show all the files that would be published to NPM. This is useful if you wanna make sure you are not publishing files you don't want to...
### grunt npm-publish
### grunt npm-publish (also aliased as publish)

@@ -37,1 +37,15 @@ #### Configuration

```
### grunt npm-contributors (also aliased as contributors)
Update contributors in `package.json` - all developers who commited to the repository, sorted by number of commits. A `.mailmap` file can be used to map multiple emails to a single person.
#### Configuration
```js
'npm-contributors': {
options: {
file: 'package.json',
commit: true,
commitMessage: 'Update contributors'
}
}
```

@@ -76,2 +76,47 @@ module.exports = function(grunt) {

});
/**
* Generate contributors, all developers who contributed, sorted by number of commits.
*/
grunt.registerTask('npm-contributors', 'Update contributors in package.json', function() {
var done = this.async();
var opts = this.options({
file: 'package.json',
commit: true,
commitMessage: 'Update contributors'
});
exec('git log --pretty=short | git shortlog -nse', function(err, stdout) {
var pkg = grunt.file.readJSON(opts.file);
pkg.contributors = stdout.toString().split('\n').slice(1, -1).map(function(line) {
return line.replace(/^[\W\d]+/, '');
});
grunt.file.write(opts.file, JSON.stringify(pkg, null, ' ') + '\n');
exec('git status -s ' + opts.file, function(err, stdout) {
if (!stdout) {
grunt.log.ok('The contributors list is already up to date.');
return done();
}
exec('git commit ' + opts.file + ' -m "' + opts.commitMessage + '"', function(err, stdout, stderr) {
if (err) {
grunt.log.error('Cannot commit contributors changes:\n ' + stderr);
} else {
grunt.log.ok('The contributors list has been updated.');
}
done();
});
});
});
});
// aliases
grunt.registerTask('contributors', 'npm-contributors');
grunt.registerTask('show', 'npm-show');
grunt.registerTask('publish', 'npm-publish');
};
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