Socket
Socket
Sign inDemoInstall

telegraph-uploader

Package Overview
Dependencies
17
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    telegraph-uploader

A package that helps you to upload media files to telegra.ph


Version published
Maintainers
1
Install size
834 kB
Created

Readme

Source

telegraph-uploader

A package that helps you to upload media files to telegra.ph.

Usage

uploadByBuffer

uploadByBuffer(buffer, contentType, [agent]) => Promise<Response>

uploadByUrl

uploadByUrl(url, [agent]) => Promise<Response>

Agent

An instance of https.Agent class (you can use this for proxies, search https-proxy-agent, socks5-proxy-agent etc.)

Response

{link: String, path: String}

Examples

By buffer
const {uploadByBuffer} = require('telegraph-uploader')
const fs = require('fs')

uploadByBuffer(fs.readFileSync('image.png'), 'image/png')
  .then((result) => {
    console.log(result)
    /* {
         link: 'https://telegra.ph/file/...',
         path: '/file/...',
       } */
  })
By URL
const {uploadByUrl} = require('telegraph-uploader')

uploadByUrl('https://link.to/image')
  .then((result) => {
    console.log(result)
    /* {
         link: 'https://telegra.ph/file/...',
         path: '/file/...',
       } */
  })

Keywords

FAQs

Last updated on 23 Sep 2019

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