Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitly

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitly - npm Package Compare versions

Comparing version 4.1.1 to 5.0.0

.babelrc

34

package.json

@@ -12,3 +12,3 @@ {

"homepage": "https://github.com/tanepiper/node-bitly",
"version": "4.1.1",
"version": "5.0.0",
"author": {

@@ -51,23 +51,29 @@ "name": "Tane Piper",

"engines": {
"node": ">= 0.12.0"
"node": ">= 8.0.x"
},
"scripts": {
"compile": "babel --source-maps --out-dir lib/ src/",
"test": "node_modules/.bin/mocha test/ --recursive --compilers js:babel/register",
"coverage": "node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --compilers js:babel/register --colors --reporter dot test/",
"prepublish": "npm run compile"
"prepublishOnly": "npm test && npm run build",
"test": "VCR_MODE=cache mocha --reporter list src/*.spec.js",
"build": "webpack --config=webpack.config.js"
},
"devDependencies": {
"babel": "^5.8.29",
"chai": "^3.4.0",
"istanbul": "^0.4.0",
"mocha": "^2.3.3",
"sepia": "^2.0.1"
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2017": "^6.24.1",
"chai": "^4.1.2",
"eslint": "^4.10.0",
"mocha": "^4.0.1",
"sepia": "^2.0.2",
"webpack": "^3.8.1",
"webpack-node-externals": "^1.6.0"
},
"dependencies": {
"boom": "^2.10.0",
"isomorphic-fetch": "^2.2.0",
"request": "^2.83.0",
"request-promise": "^4.2.2",
"valid-url": "^1.0.9"
},
"main": "lib/bitly.js"
"main": "dist/bitly.js"
}
# node-bitly - Bitly API for nodejs
[![Build Status](https://secure.travis-ci.org/tanepiper/node-bitly.png)](http://travis-ci.org/tanepiper/node-bitly)
[![CircleCI](https://circleci.com/gh/tanepiper/node-bitly/tree/refactor.svg?style=svg)](https://circleci.com/gh/tanepiper/node-bitly/tree/refactor)
[![NPM version](https://badge.fury.io/js/bitly.png)](http://badge.fury.io/js/bitly)
[![Dependencies](https://david-dm.org/tanepiper/node-bitly.svg)](https://david-dm.org/tanepiper/node-bitly)
This module provides calls to the [Bitly](http://bitly.com) API for [Nodejs](http://nodejs.org).
For more information on the API request and responses visit the [Bitly API docs](http://dev.bitly.com/api.html)
Version 5 of this library only support `Node 8.x.x` and above as it uses `async/await`
### **** Important update from Version 4 onwards ****
From version 4.0 of this library, the callback in methods have been removed and the library only provides
promises for each method response. The library has also been re-written in ES2015/ES6. The transpiled version
is only distributed via NPM, or can be created the command `npm run compile` if you fork the source. Finally
support is no longer provided for `node < 0.12`.
## Installation

@@ -34,27 +30,29 @@

```js
// For ES2015/ES6
const BitlyClient = require('bitly');
const bitly = BitleyClient('<accessToken>');
import Bitly from 'bitly';
const myFunc = async(uri = 'https://github.com/tanepiper/node-bitly') => {
try {
return await bitly.shorten(uri);
} catch(e) {
throw e;
}
}
```
let bitly = new Bitly('<YOUR ACCESS TOKEN>');
You can also do raw requests to any Bitly endpoint. With this you need to pass the access
token to the method
bitly.shorten('http://nodejs.org', (response) => {
console.log(response);
}, (error) => {
console.log(error);
});
```js
const BitlyClient = require('bitly');
const MY_API_TOKEN = '<accessToken>';
const bitly = BitleyClient(MY_API_TOKEN);
// For ES5
var Bitly = require('bitly');
var bitly = new Bitly('<YOUR ACCESS TOKEN>');
bitly.shorten('https://github.com/tanepiper/node-bitly')
.then(function(response) {
var short_url = response.data.url
// Do something with data
}, function(error) {
throw error;
});
const myFunc = async(method, data) => {
try {
return await bitly.doRequest({accessToken: MY_API_TOKEN, method, data});
} catch(e) {
throw e;
}
}
```

@@ -69,2 +67,3 @@

* info
* shorten

@@ -75,6 +74,2 @@ * expand

* countries
* bitly_pro_domain
* lookup
* info
* history
* link_edit
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc