Socket
Socket
Sign inDemoInstall

imgur-tags

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    imgur-tags

Interacts with the ImgurTags API.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Installation

npm i imgur-tags --save

Initialize in node

const tags = require("imgur-tags");

Simple module - 3 commands.

tags.get(tag)

Attempts to get a tag from the API.

  • tag (string): The tag you want to fetch.

Returns a promise:

  • On resolve: returns a link to an image with the tag.
  • On reject: returns a string describing an error.
tags.get("dog")
    .then(resp => {
        console.log("Image url: " + resp);
    })
    .catch(err => {
        console.error(err);
    });

tags.add(tag, imgUrl)

Attempts to add a tag to the API.

  • tag (string): The tag you want to add.
  • imgUrl (string): A url that contains the image to link the tag to. The url is automatically cleaned of query strings.

Returns a promise:

  • On resolve: returns a link to an image with the tag.
  • On reject: returns a string describing an error.
tags.add("cat", "some.pictureo.fa/cat.png")
    .then(resp => {
        console.log("Image url: " + resp);
    })
    .catch(err => {
        console.error(err);
    });

tags.count()

Counts up all the tags available for use and returns them in an array.

Returns a promise:

  • On resolve: returns an array of tags (all of them).
  • On reject: returns a string describing an error.
tags.count()
    .then(resp => {
        console.log("tags: " + resp);
    })
    .catch(err => {
        console.error(err);
    });

Keywords

FAQs

Last updated on 28 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc