goorl

3.0.1 • Public • Published

Build Status js-standard-style

goorl

Shortens url with goo.gl

Installation

From npm

$ npm i goorl

Usage

Required inputs

key Your google API key

url The URL you want to shorten

Promises

const goorl = require('goorl')
const options = {
  key: 'your-google-api-key',
  url: 'http://www.telemark.no/Planer/Regional-planstrategi/Offentlig-ettersyn-ny-regional-planstrategi'
}
 
goorl(options)
  .then(url => console.log(url))
  .catch(error => console.error(error))

Callbacks

const goorl = require('goorl')
const options = {
  key: 'your-google-api-key',
  url: 'http://www.telemark.no/Planer/Regional-planstrategi/Offentlig-ettersyn-ny-regional-planstrategi'
}
 
goorl(options, (error, url) => {
  if (error) {
    console.error(error)
  } else {
    console.log(url)
  }
})

License

MIT

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i goorl

    Weekly Downloads

    6

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    8.85 kB

    Total Files

    10

    Last publish

    Collaborators

    • cybermelmac
    • maccyber
    • telemark
    • zrrrzzt