1.0.0 • Published 4 years ago

lanza.me v1.0.0

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

lanza.me

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

Install with "npm i shorten-with-lanza.me".

var lanzame = require('shorten-with-lanza.me')

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
	
})
1.0.0

4 years ago