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

github-api-tags-full

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-api-tags-full - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0

21

example.js
var GitHubApi = require('github'),
GithubApiTags = require('./'),
path = require('path'),
ProgressBar = require('progress');
ProgressBar = require('progress'),
moment = require('moment');

@@ -22,3 +23,3 @@ var repoId = {

var bar = new ProgressBar('Fetching commit :current/:total [:bar] :percent :etas', { total: 100 });
var bar = new ProgressBar('Fetching tag/commit :current/:total [:bar] :percent :etas', { total: 100 });

@@ -32,6 +33,20 @@ var tagChanged = function() {

var byAuthorDateAsc = function(tagA, tagB) {
return githubCompareDates(
tagA.commit.author.date,
tagB.commit.author.date
);
};
var githubCompareDates = function(dateStrA, dateStrB) {
return moment(dateStrA).diff(dateStrB);
};
console.log('...');
gat.fetch(repoId, github)
.then(function(tags) {
console.log('All tags fetched, ready for sorting.');
var tagsSortedDateDesc = tags.sort(byAuthorDateAsc).reverse();
console.log('Tags sorted:');
console.log(tagsSortedDateDesc);
});

@@ -72,2 +72,3 @@ var Promise = require('bluebird'),

self.emit('tag-commit', tagCommit);
return tagCommit;
});

@@ -74,0 +75,0 @@ });

2

package.json

@@ -10,3 +10,3 @@ {

"name": "github-api-tags-full",
"version": "5.0.0",
"version": "6.0.0",
"description": "Gets all tags with their respective commit for sorting from Github API",

@@ -13,0 +13,0 @@ "main": "index.js",

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