quecto
v1.0.3
Published
Official wrapper for Quecto (A Open Source Link Shortener)
Downloads
1
Readme
node-quecto
node-quecto is the official Node.js client for Quecto.
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);
});