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

tinyurl

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinyurl

TinyURL.com URL Shortener Node.js Module

  • 1.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

NPM

TinyURL Build Status

http://TinyURL.com URL Shortener Node.js Module

Example Shorten:

First run npm install TinyURL to install the TinyURL package to your system.

var TinyURL = require('tinyurl');

TinyURL.shorten('http://google.com', function(res, err) {
  if (err)
    console.log(err)
	console.log(res);
});

// Shorten with Alias Example
const data = { 'url': 'https://google.com', 'alias': 'custom-alias-for-google' }

TinyURL.shortenWithAlias(data, function(res, err) {
  if (err)
    console.log(err)
	console.log(res); //Returns a shorter version of http://google.com - http://tinyurl.com/2tx
});

// Promise Example
TinyURL.shorten('http://google.com').then(function(res) {
    console.log(res)
}, function(err) {
    console.log(err)
})

// Shorten with Alias Promise Example
const data = { 'url': 'https://google.com', 'alias': 'custom-alias-for-google' }

TinyURL.shortenWithAlias(data).then(function(res) {
    console.log(res)
}, function(err) {
    console.log(err)
})

// Resolve Example
TinyURL.resolve("https://tinyurl.com/2tx").then(
  function(res) {
    console.log(res); //Returns http://google.com, the full URL located at http://tinyurl.com/2tx
  },
  function(err) {
    console.log(err);
  }
);

This Package Is Licensed Under The MIT License

Keywords

FAQs

Package last updated on 11 Aug 2020

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