Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rapid-shrink

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rapid-shrink

A package to Shorten and generate Redirect URL's

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
0
Weekly downloads
 
Created
Source

Rapid Shrink Package

This package provides functionality to shorten and generate redirect URLs. It is designed to be simple and easy to integrate into any Node.js application.

Installation

You can install the package using npm:

npm install rapid-shrink

Usage

Generating a Shortened URL in Node.js

To generate a shortened URL, you can use the generate function provided by the package:

const { generate } = require('rapid-shrink');

(async () => {
  try {
    const link = 'https://example.com';
    const redirectUrl = await generate(link);
    console.log('Redirect URL:', redirectUrl);
  } catch (error) {
    console.error('Error:', error);
  }
})();

Generating a Shortened URL in Bash

You can use Node.js to run a JavaScript file from the command line:

Create a JavaScript file , for example : shorten.js:

const { generate } = require('rapid-shrink');

(async () => {
  try {
    const link = 'https://example.com';
    const redirectUrl = await generate(link);
    console.log('Redirect URL:', redirectUrl);
  } catch (error) {
    console.error('Error:', error);
  }
})();

Run the script using Node.js:

node shorten.js

Visit the URL

You can Visit the URL logged in the Terminal

Keywords

FAQs

Package last updated on 30 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc