Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

tirij-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tirij-api

Install

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

tirij-api

Install

npm i tirij-api

Example

Free use

Links created in free use 7-day type and qr cannot be created.

import { LinkService } from "tirij-api"

const service = new LinkService()
await service.createFree(longUrl);

Basic Auth use

FeildTypeDescription
usernamestringApi public key
passwordstringApi secret key
slugstringStore slug
expireTypestring ("never" or "date", or "count")Expire type
expireAtstring ( "Date(1650611871048)" or "Date(2022-04-22T07:08:34.090Z)" or "2022-04-22T07:08:34.090Z")Expire date
clickCount{ max: number, count: number }Click Count

You can shorten any type of link you want through a store belonging to your account.

import { LinkService } from "tirij-api"

const service = new LinkService({}, { username, password })
await service.create(slug, {
  longUrl: longUrl,
  expireType: expireType,
  expireAt: expireAt,
  clickCount:{
    max: max,
    count: count
  },
});

Create Qr

FeildTypeDescription
usernamestringApi public key
passwordstringApi secret key
slugstringStore slug
_idstringLink id
typestring ("short" or "long")Link type
optionsILinkQrOptionsqr-code-styling-node-options

While creating qr, qr-code-styling-node package was used. You can forward all qr-code-styling-node settings from options.


import { LinkService } from "tirij-api"

const service = new LinkService({}, { username, password })
const result = await service.createQr(slug, _id, "short" || "long", { type: "svg"});

require("fs").writeFile(`${result.data._id}.svg`, result.data.base64, 'base64', function(err) {
  console.log(err);
});

FAQs

Package last updated on 22 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts