1.1.10 • Published 10 months ago

img-capicua v1.1.10

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

img-capicua

this package is used to upload, get and delete images from the service

to use this package, you must create an account here

installation

npm i img-capicua

usage

we import the CapicuaImager package and we set the API_TOKEN that we can get from here

upload image

import { CapicuaImager } from 'img-capicua';

const uploadImage = async () => {
    const capicua = new CapicuaImager('your-api-token');

    const uri = ... // local uri of the image

    const options = {
        uri,
        compress: true,
        webp: false
    }
    const uploaded = await capicua.uploadImage(options);

    console.log(uploaded.id);
}

information about image

import { CapicuaImager } from 'img-capicua';

const imageInfo = async () => {
    const capicua = new CapicuaImager('your-api-token');

    const id = '...' // id of image

    const info = await capicua.getImageInfo(id);

    console.log(info.id);
}

delete image

import { CapicuaImager } from 'img-capicua';

const deleteImage = async () => {
    const capicua = new CapicuaImager('your-api-token');

    const id = '...' // id of image

    const deleted = await capicua.deleteImage(id);

    console.log(deleted.deleted);
}

get image

to get the image, make a get request to "https://img.capicua.org.es/api/file/{id}"

1.1.10

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago