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

updater-contributors

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

updater-contributors - npm Package Compare versions

Comparing version 0.1.0 to 0.1.2

12

package.json
{
"name": "updater-contributors",
"description": "Update the contributors array in package.json with the contributors returned by the GitHub API.",
"version": "0.1.0",
"version": "0.1.2",
"homepage": "https://github.com/update/updater-contributors",

@@ -25,5 +25,5 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"async-array-reduce": "^0.2.0",
"github-base": "^0.4.1",
"github-contributors": "^0.3.0",
"async-each": "^1.0.1",
"github-base": "^0.5.1",
"github-contributors": "^0.4.0",
"stringify-author": "^0.1.3"

@@ -52,3 +52,3 @@ },

"toc": false,
"layout": "default",
"layout": "global",
"tasks": [

@@ -75,2 +75,2 @@ "readme"

}
}
}

@@ -7,6 +7,6 @@ # updater-contributors [![NPM version](https://img.shields.io/npm/v/updater-contributors.svg?style=flat)](https://www.npmjs.com/package/updater-contributors) [![NPM downloads](https://img.shields.io/npm/dm/updater-contributors.svg?style=flat)](https://npmjs.org/package/updater-contributors)

Install with [npm](https://www.npmjs.com/):
Install globally with [npm](https://www.npmjs.com/)
```sh
$ npm install --save updater-contributors
$ npm install --global updater-contributors
```

@@ -20,2 +20,29 @@

## Help
Common [update](https://github.com/update/update) commands.
```console
Usage: update <command> [options]
Command: updater or tasks to run
Options:
--config, -c Save a configuration value to the `update` object in package.json
--cwd Set or display the current working directory
--help, -h Display this help menu
--init, -i Prompts you to specify default updaters to run
--run Force updaters/tasks to run regardless of other flags used
--silent, -S Silence all tasks and updaters in the terminal
--version, -V Display the current version of update
--verbose, -v Display all verbose logging messages
```
If this is the first time you've used [update](https://github.com/update/update), run the following command to add this updater to your default updaters:
```sh
$ update init
```
## About

@@ -64,2 +91,2 @@

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 31, 2016._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._
'use strict';
var each = require('async-each');
var contributors = require('github-contributors');
var stringify = require('stringify-author');
var reduce = require('async-array-reduce');
var GitHub = require('github-base');

@@ -10,6 +10,11 @@

var github;
var auth;
app.task('authenticate', function(cb) {
github = new GitHub();
// todo
auth = {
username: app.options.username || app.options.u,
password: app.options.password || app.options.p
};
github = new GitHub(auth);
cb();

@@ -21,12 +26,13 @@ });

contributors(data.repo, function(err, arr) {
contributors(data.repo, auth, function(err, arr) {
if (err) return cb(err);
if (!Array.isArray(arr) || arr.length === 1) {
if (!Array.isArray(arr) || arr.length <= 1) {
cb();
return;
}
users(arr, function(err, res) {
users(arr, function(err, contributors) {
if (err) return cb(err);
app.pkg.set('contributors', res);
app.pkg.set('contributors', contributors);
app.pkg.save();

@@ -39,12 +45,18 @@ cb();

function users(arr, cb) {
reduce(arr, [], function(acc, user, next) {
github.get(`/users/${user.login}`, function(err, res) {
var acc = [];
each(arr, function(user, next) {
if (!user || !user.login) {
next(null, acc);
return;
}
github.get('/users/' + user.login, function(err, res) {
if (err) return next(err);
var contributor = {name: res.name};
var url = res.blog || res.html_url
var email = res.email;
if (email) contributor.email = email;
var contributor = { name: res.name };
var url = res.blog || res.html_url;
if (res.email) contributor.email = res.email;
if (url) contributor.url = url;
acc.push(stringify(contributor));
next(null, acc);
next(null, stringify(contributor));
});

@@ -54,2 +66,1 @@ }, cb);

};
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