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

gh-gif

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-gif - npm Package Compare versions

Comparing version 0.3.0 to 0.3.2

36

bin/gif.js

@@ -41,2 +41,5 @@ /*

'reaction': String,
'comment': String,
'best': Boolean,
'bestof': Number,
'repo': String,

@@ -49,2 +52,5 @@ 'user': String

'R': [ '--reaction' ],
'c': [ '--comment' ],
'b': [ '--best' ],
'B': [ '--bestof' ],
'r': [ '--repo' ],

@@ -63,6 +69,4 @@ 'u': [ '--user' ]

if (options.image || options.reaction) {
logger.logTemplate('{{prefix}}Adding comment on {{greenBright "#" options.number}}', {
options: options
});
if (!options.comment && !options.reaction) {
logger.error('Missing options command.');
}

@@ -77,2 +81,6 @@

}
logger.logTemplate('Adding comment on #{{options.number}}', {
options: options
});
};

@@ -83,3 +91,4 @@

options.comment = '![](' + image + ')';
options.comment = (options.comment) ? options.comment + '<br>' : '';
options.comment += '![](' + image + ')';

@@ -96,2 +105,6 @@ this.issue.comment(function(err) {

Gif.prototype.getRandomItem = function (array) {
return array[Math.floor(Math.random() * array.length)];
};
Gif.prototype.reaction = function() {

@@ -115,4 +128,15 @@ var instance = this,

random = result[Math.floor(Math.random() * result.length)];
if (options.best) {
options.image = result[0].images.original.url;
instance.image(options.image);
return;
}
if (options.bestof > 0) {
result = result.slice(0, options.bestof);
}
random = instance.getRandomItem(result);
options.image = random.images.original.url;
instance.image(options.image);

@@ -119,0 +143,0 @@ });

2

package.json
{
"name": "gh-gif",
"description": "NodeGH plugin for commenting on pull requests/issues using GIF reactions",
"version": "0.3.0",
"version": "0.3.2",
"author": {

@@ -6,0 +6,0 @@ "name": "Zeno Rocha",

@@ -31,2 +31,5 @@ # GH Gif

`-R`, `--reaction` | **Required** | `String`
`-c`, `--comment` | *Optional* | `String`
`-b`, `--best` | *Optional* | `Boolean`
`-B`, `--bestof` | *Optional* | `Number`
`-i`, `--image` | *Optional* | `String`

@@ -44,2 +47,8 @@ `-r`, `--repo` | *Optional* | `String`

You can also use --comment
```
gh gif 75 --comment "This is cool" --reaction congratulation
```
* Comment on pull request/issue #75 of a certain repo with a surprised reaction.

@@ -63,2 +72,14 @@

* Comment on pull request/issue #75 with the best search result
```
gh gif 75 --reaction happy --best
```
* Comment on pull request/issue #75 with a random GIF of the first three result items.
```
gh gif 75 --reaction happy --bestof 3
```
## Testing

@@ -65,0 +86,0 @@

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