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 3.0.3 to 4.0.0

.eslintrc

34

package.json
{
"name": "bitly",
"description": "A Bit.ly API library for Node.JS",
"license": {
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
},
"tags": [

@@ -10,4 +14,8 @@ "url",

],
"version": "3.0.3",
"author": "Tane Piper <piper.tane@gmail.com>",
"version": "4.0.0",
"author": {
"name": "Tane Piper",
"email": "piper.tane@gmail.com",
"url": "https://github.com/tanepiper"
},
"contributors": [

@@ -39,17 +47,27 @@ {

"type": "git",
"url": "http://github.com/tanepiper/node-bitly.git"
"url": "https://github.com/tanepiper/node-bitly.git"
},
"bugs": {
"url": "https://github.com/tanepiper/node-bitly/issues"
},
"engines": {
"node": ">= 0.10.0"
"node": ">= 0.12.0"
},
"scripts": {
"test": "VCR_MODE=cache node_modules/.bin/nodeunit test"
"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"
},
"devDependencies": {
"nodeunit": "^0.9.1",
"babel": "^5.8.29",
"chai": "^3.4.0",
"istanbul": "^0.4.0",
"mocha": "^2.3.3",
"sepia": "^2.0.1"
},
"dependencies": {
"q": "^1.4.1"
}
"valid-url": "^1.0.9"
},
"main": "lib/bitly.js"
}

@@ -1,3 +0,2 @@

node-bitly - Bitly API for nodejs
====================
# node-bitly - Bitly API for nodejs

@@ -11,4 +10,12 @@ [![Build Status](https://secure.travis-ci.org/tanepiper/node-bitly.png)](http://travis-ci.org/tanepiper/node-bitly)

Installation
------------
### **** 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
To install via NPM type the following: `npm install bitly`

@@ -18,29 +25,33 @@

Usage
-----
## Usage
This library uses the API provided by bitly and requires an OAuth token to use.
To get your access token, visit https://bitly.com/a/oauth_apps (under Generic Access Token)
See http://dev.bitly.com/ for format of returned objects from the API
#### Code
```js
var Bitly = require('bitly');
var bitly = new Bitly('<YOUR ACCESS TOKEN>');
// To get your access token, visit https://bitly.com/a/oauth_apps (under Generic Access Token)
// For ES2015/ES6
/**
* With callback
*/
bitly.shorten('https://github.com/tanepiper/node-bitly', function(err, response) {
if (err) throw err;
import Bitly from 'bitly';
// See http://dev.bitly.com/ for format of returned object
var short_url = response.data.url
let bitly = new Bitly('<YOUR ACCESS TOKEN>');
// Do something with data
bitly.shorten('http://nodejs.org', (response) => {
console.log(response);
}, (error) => {
console.log(error);
});
/**
* With promise
*/
// For ES5
var Bitly = require('bitly');
var bitly = new Bitly('<YOUR ACCESS TOKEN>');
bitly.shorten('https://github.com/tanepiper/node-bitly')
.then(function(response) {
// See http://dev.bitly.com/ for format of returned object
var short_url = response.data.url
// Do something with data

@@ -52,8 +63,7 @@ }, function(error) {

Tests
-----
To run tests type `npm test`
## Tests
To run tests type `npm test`. For coverage type `npm run coverage`
Bit.ly Features
---------------
### Bit.ly Features
This module is limited to the following API methods:

@@ -60,0 +70,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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