1.1.7 • Published 4 years ago

tinyurl v1.1.7

Weekly downloads
8,927
License
MIT
Repository
github
Last release
4 years ago

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

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago