shorten-anonymize-url v1.6.1
shorten-anonymize-url

Contents
- Commandline Usage
- 'Right-Click' URL Shortener (macOS)
- Programmatic Usage
- Platform Support
- Roadmap
- Contribute
- Author
Commandline Usage
Installation
$ npm install --global shorten-anonymize-urlUsage
$ shorten-anonymize-url "<url>"⚠️ Enclose URLs in quotes to handle special characters like as question marks ⚠️
Show Help and Options
$ shorten-anonymize-url --helpExample
$ shorten-anonymize-url "https://www.google.de/?gfe_rd=cr&ei=WDE4We-3BcfPXr7dpdgH&gws_rd=ssl"
>> http://bit.ly/2sglJKgRight-Click URL Shortener (macOS only)

The module includes a global Service for macOS Automator, as well as an automated installation and uninstallation routine.
Features
The global shortener service does the following:
- It takes any marked url within macOS,
- shortens and anonymizes it,
- copies the resulting shortened and anonymized URL to the macOS clipboard.
This enables global url shortening and anonymizing.
Compatibility
The global nature of macOS Services makes this module available to nearly all macOS apps, such as Safari, Finder, Google Chrome or Microsoft Office for Mac.
Requirements for the macOS Service
Install the commandline module.
Install the macOS Service
Run the commandline module with the --service-install argument:
$ shorten-anonymize-url --service-installUninstall the macOS Service
Run the commandline module with the --service-uninstall argument:
$ shorten-anonymize-url --service-uninstallUse the macOS Service
- Mark any URL (or any text),
- right-click,
- open the 'Services' menu,
- Click 'shorten-anonymize-url'
The clipboard now contains the shortened and anonymized URL.
Programmatic Usage
Installation
$ npm install --save shorten-anonymize-urlAPI
The module returns a Function which takes 3 arguments and returns a Promise:
const shortenAnonymizeUrl = require('shorten-anonymize-url')
shortenAnonymizeUrl(url, bitlyKey, googlKey)
.then((shorturl) => {
console.log(shorturl);
})- url String - Bundle identifier for the callback function
- bitlyKey optional String - bit.ly API key
- googlKey optional String - goo.gl API key
The Promise resolves with:
- shorturl String - Shortened anonymised bit.ly url
Example
const shortenAnonymizeUrl = require('shorten-anonymize-url')
shortenAnonymizeUrl('reddit.com')
.then((url) => {
console.log(url);
// http://bit.ly/2qWTDzM
})
.catch((err) => {
console.error(err);
})Platform Support
Tested on:
- macOS Sierra
- Windows 10 Anniversary
- Ubuntu 17.10
Global 'Right-Click' url shortening only supported on macOS for now.
Roadmap 
- Global Right-Click URL shortening for Windows + Linux
- CI-based automated Testing
Contribute 
Read the contribution documentation first.
Author
sidneys 2017