1.0.3 • Published 10 months ago

quecto v1.0.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
10 months ago

node-quecto

node-quecto is the official Node.js client for Quecto.

preview

Installation

npm install quecto

Usage

Create a client

const { Quecto } = require('quecto');
const client = new Quecto("https://s.oriondev.fr");

Shorten a link

const { Quecto } = require('quecto');
const client = new Quecto("https://s.oriondev.fr");

// Password is optional
client.shortUrl("https://example.com", "password").then((res) => {
    console.log(res.shorten);
}).catch((err) => {
    console.error(err);
});

Unshorten a link

const { Quecto } = require('quecto');
const client = new Quecto("https://s.oriondev.fr");

// Password is optional
client.unshortUrl("https://s.oriondev.fr/s/189cb2abab6ce", "password").then((res) => {
    console.log(res.url);
}).catch((err) => {
    console.error(err);
});

Verify if a domain is a Quecto instance

const { Quecto } = require('quecto');
const client = new Quecto("https://s.oriondev.fr");

client.isValidInstance().then((res) => {
    console.log(res);
}).catch((err) => {
    console.error(err);
});

License

GPL3

Contributors

Contributors

1.0.3

10 months ago

1.0.1

10 months ago