1.0.0 • Published 3 years ago

lanzame v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

lanza.me

Shorten URLs using Lanza.me shortener in Node.js with 0 dependencies.

Install with "npm i lanzame".

var lanzame = require('lanzame')

lanzame.shorten({_id: '1234567890', url: 'google.es'}).then(function(json){
	
  if(json.shortUrl){
	console.log('OK ', json.shortUrl) // ok
  }else{
	console.log('FAIL ', json.error) // fail some option, probably
  }
	
}).catch(function(err){
	
  console.log('ERROR ', err.error)	// a error message
  console.log('FALLB ', err.shortUrl) // fallback, returns the original long url
	
})