0.1.4 • Published 8 months ago

gyazo-api-ts v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Gyazo-API-TS

Gyazo API wrapper for Node.js written in TypeScript.

Usage

Register new application and get ACCESS TOKEN, then

Upload Image

import fs from 'node:fs';
import { Gyazo } from 'gyazo-api-ts';

const gyazo = new Gyazo('your-access-token');
const imageBuffer = fs.readFileSync('path/to/image.png');
const { success, error} = await gyazo.upload(imageBuffer, {
  filename: 'image.png',
  contentType: 'image/png',
  /** ...ohter options */
});

if(error) {
  console.error(error);
} else {
  console.log(success);
}

Get Image

import { Gyazo } from 'gyazo-api-ts';

const gyazo = new Gyazo('your-access-token');
const { success, error} = await gyazo.get('image-id');

if(error) {
  console.error(error);
} else {
  console.log(success);
}

Delete Image

import { Gyazo } from 'gyazo-api-ts';

const gyazo = new Gyazo('your-access-token');
const { success, error} = await gyazo.delete('image-id');

if(error) {
  console.error(error);
} else {
  console.log(success);
}

List Images

import { Gyazo } from 'gyazo-api-ts';

const gyazo = new Gyazo('your-access-token');
const { success, error} = await gyazo.list();

if(error) {
  console.error(error);
} else {
  console.log(success);
}
0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago