JSPM

telefile

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q18976F
  • License MIT

Uploading media files to telegra.ph

Package Exports

  • telefile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (telefile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

telefile

Uploading media files to telegra.ph

Install

npm i telefile

Usage

Always returns promise with link to media file like https://telegra.ph/file/hash.jpg

Common

NOTE: Just specify the file name

const link = await telefile('cat.jpg')
console.log(link)

Custom

Specify other type of source via object

file name

telefile({ source: 'kitten.jpg' })

url

telefile({ url: 'https://placekitten.com/300/200' })

stream

telefile({ stream: fs.createReadStream('kitten.jpg') })