Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created October 31, 2017 20:27
Show Gist options
  • Select an option

  • Save tanepiper/d4753e18c2293c1ec6df1b8bda7d65ab to your computer and use it in GitHub Desktop.

Select an option

Save tanepiper/d4753e18c2293c1ec6df1b8bda7d65ab to your computer and use it in GitHub Desktop.
node-bitly examples
const BitlyClient = require('bitly');
const bitly = BitleyClient('<accessToken>');
const uri = 'https://github.com/tanepiper/node-bitly';
bitly.shorten(uri).then(result => {
console.log(result);
});
const BitlyClient = require('bitly');
const bitly = BitleyClient('<accessToken>');
const myFunc = async(uri = 'https://github.com/tanepiper/node-bitly') => {
try {
return await bitly.shorten(uri);
} catch(e) {
throw e;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment