https://github.com/letitcode/telefile
Uploading media files to telegra.ph
https://github.com/letitcode/telefile
Last synced: 8 days ago
JSON representation
Uploading media files to telegra.ph
- Host: GitHub
- URL: https://github.com/letitcode/telefile
- Owner: LetItCode
- Created: 2020-12-03T18:15:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-03T18:22:17.000Z (over 5 years ago)
- Last Synced: 2025-10-10T21:09:48.316Z (9 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# telefile
Uploading media files to [telegra.ph](https://telegra.ph)
## Install
```sh
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
```js
const link = await telefile('cat.jpg')
console.log(link)
```
### Custom
Specify other type of source via object
#### file name
```js
telefile({ source: 'kitten.jpg' })
```
#### url
```js
telefile({ url: 'https://placekitten.com/300/200' })
```
#### stream
```js
telefile({ stream: fs.createReadStream('kitten.jpg') })
```