lanzame

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i lanzame

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

3.81 kB

Total Files

5

Last publish

Collaborators

  • jorgedesaliceta