{"bugs":{"url":"https://github.com/tanepiper/node-bitly/issues"},"dist":{"shasum":"9e69118b79b30ec6d11bc5015a0ba54739c50c3e","tarball":"https://registry.npmjs.org/bitly/-/bitly-5.1.7.tgz","fileCount":16,"integrity":"sha512-iL1uAEws18Ae9ERr65QERkDyilO9LGz83jVim/0s8O1cXPQCOFv+NaNE/H6VZmZYe6vH+IKiQkDzgFyScAUVZg==","signatures":[{"sig":"MEYCIQDYy3xMpkOg5CkMFmOPQTpefQphv0HJCfccnoWGpYyKTwIhAN5thGSMl+Z+3hmmc8HVghg48TDv98zJAdOQi0Y6DV4G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIWapCRA9TVsSAnZWagAA/P0P+gPCP+xNyP379adQ91oY\nFK0Te4z6IakEQY1y2GwDmaglriWLsUo+T5R9GBE21DBARLVPIA2FHz3rJC5C\nhA3EUT2UDcyQczQmNrSyczCoXBZXKwm3MFI+p5re0ujCRMKW9OHZVcA+9eEB\npINkNryhFILqn6FIfeq7tki9xxx+KSZTpWK2g6S80BdGFZHqZ/b2sUe8VP8H\nbGJlpkbY8UUWurwjwQt1hGLGZBjgeRTX0ABQolfZi12MnPcXevI5+PeL8Aw4\n7WWdPc7hZB4/U7ytKgILz8Y8biOHH5XSGkVfzoLaAhbrG2ZDzHvAqsiyL3ks\nRqIZ72kwHSYAHIuA4ALuD0Th1t9hKMwMMqGhXizwDzM13JTcfe4tUqyAClxZ\n32o1LREGv2RnPrQVb2MFKtjZkOp/2hrYFIBzkrBRHuK3p/wMyI3mJtC7uUJP\nsDxAYMi17RieDzW/uXBgHT06dtwR4nOFJwM1LtJVYi2MYldJpHzEmJqY1Z6y\n/GQgCMyM64GIN62bxW1kCZr4yXiSoMP9wEio1HabKIDLY5uKSh0pNIqTRGiw\npGCRgRgMCQJwB+DjZyX0rhjEJhySrhx/Y8H5iVR1aM2BVbKyk2iqEFxdxDLj\nKbA0lvdaSxdFQ0AyM4M8MeWgLME2irxcuHEKSzQYHvXywzLKY4NtxdxhRcaW\nJ5Hh\r\n=mg1q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/bitly.js","name":"bitly","author":{"url":"https://github.com/tanepiper","name":"Tane Piper","email":"piper.tane@gmail.com"},"readme":"# node-bitly - Unofficial Bitly API for nodejs\n\n[![CircleCI](https://circleci.com/gh/tanepiper/node-bitly.svg?style=svg)](https://circleci.com/gh/tanepiper/node-bitly) [![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)\n\n## Current Versions\n\n* [v6.0.x](https://github.com/tanepiper/node-bitly) - Support for Node >=6. Available on npm as `npm install bitly@latest`\n* [v5.1.x](https://github.com/tanepiper/node-bitly/tree/v5.x.x) - Support for Node >=4. Available on npm as `npm install bitly@stable`\n\nVersion 5 is end-of-life and will only recieve minor updates in the future and is considered stable.  This will only ever support the **Bitly v3** API\n\nVersion 6 is the current in-development version, re-written in Typescript. This version currently only supports the **Bitly v3** API and will continue to do so in `v6.0.x`. Version `6.1.x` will introduce **Bitly v4** support.\n\n## Module Features\n\nThis module provides calls to the [Bitly](http://bitly.com) API for [Nodejs](http://nodejs.org).\n\nFor more information on the API request and responses visit the [Bitly API docs](https://dev.bitly.com/api.html)\n\n`node-bitly` is programmed with `TypeScript` but is compiled to JavaScript and supports `node 6, 8, 10`.  When you import the client you get full type information.  There maybe be some gaps in the information but this will be filled in, in future releases.\n\n**Currently `node-bitly` only supports Bitly's `v3` API and has this hard coded in the parameter type.  Support for version 4 will be added in a future release**\n\n## Installation\n\nTo install via NPM type the following: `npm install bitly`\n\nYou can also install via git by cloning: `git clone https://github.com/tanepiper/node-bitly.git /path/to/bitly`\n\n## Usage\n\nThis library uses the API provided by bitly and requires an OAuth token to use.\nTo get your access token, visit [OAuth Apps](https://bitly.com/a/oauth_apps) (under Generic Access Token)\n\nSee [http://dev.bitly.com](http://dev.bitly.com/) for format of returned objects from the API\n\nTo see the available libary APIs, you can view the [API Documentation](docs/index.html) offline, or you can view the index here (the generated documentation does not work on Github).\n\n### Code\n\n#### TypeScript / ES6 Imports\n\n```js\nimport { BitlyClient } from 'bitly';\nconst bitly = new BitlyClient('<accessToken>', {});\n\nasync function init() {\n  let result;\n  try {\n    result = await bitly.shorten('https://github.com/tanepiper/node-bitly');\n  } catch (e) {\n    throw e;\n  }\n  return result;\n}\n\ninit();\n```\n\n#### JavaScript\n\n```js\nconst { BitlyClient } = require('bitly');\nconst bitly = new BitlyClient('<accessToken>', {});\n\nlet result;\ntry {\n  result = await bitly.shorten(uri);\n} catch(e) {\n  throw e;\n}\nreturn result;\n```\n\nIf you are not using `node 8` then you can still use the library with `Promise` values:\n\n```js\nconst BitlyClient = require('bitly');\nconst bitly = new BitlyClient('<accessToken>');\n\nbitly\n  .shorten('https://github.com/tanepiper/node-bitly')\n  .then(function(result) {\n    console.log(result);\n  })\n  .catch(function(error) {\n    console.error(error);\n  });\n```\n\nYou can also do raw requests to any Bitly endpoint. With this you need to pass the access\ntoken to the method\n\n```js\nconst BitlyClient = require('bitly');\nconst bitly = new BitlyClient('<accessToken>');\n\ntry {\n  return await bitly.bitlyRequest('link/referrers_by_domain', {\n    link: 'https://github.com/tanepiper/node-bitly',\n    unit: 'hour',\n    timezone: 'Europe/Amsterdam'\n  });\n} catch(e) {\n  throw e;\n}\n```\n\n### Tests\n\nTo run tests type `npm test`. Please note one test will fail if you use your own API key, please update the string accordingly.\n\n## Support This Project\nThis module is a side project of mine and I don't actively use the module except to completly over-engineer the CI pipeline and re-write it in Typescript all in the name of learning.  But to add features like the v4 API would take a lot of work, so if you use this library a lot please consider donating using the links below. Or if you learned something useful from one of my blog posts talking about the changes I've done with this module please consider leaving a tip.\n\n[![Beerpay](https://beerpay.io/tanepiper/node-bitly/badge.svg?style=beer-square)](https://beerpay.io/tanepiper/node-bitly)  [![Beerpay](https://beerpay.io/tanepiper/node-bitly/make-wish.svg?style=flat-square)](https://beerpay.io/tanepiper/node-bitly?focus=wish)\n\nYou can also [PayPal Me](https://paypal.me/tanepiper).\n","engines":{"node":">= 4.8.0"},"gitHead":"9aee7493ff264bbf756492d12feadafefc135415","license":"MIT","scripts":{"docs":"jsdoc -c jsdoc.json -R README.md","lint":"eslint --config=./.eslintrc.json src/**.js","test":"VCR_MODE=cache mocha-webpack --reporter list src/*.spec.js","build":"webpack --config=webpack.config.js","ghdocs":"jsdoc2md --configure jsdoc.json src/*.js > docs/api.md"},"_npmUser":{"name":"tanepiper","email":"piper.tane@gmail.com"},"homepage":"https://github.com/tanepiper/node-bitly","keywords":["url","bitly","shortner","util"],"deprecated":"Please use >=7.0.0 as this version no longer works with the Bitly API","repository":{"url":"git+https://github.com/tanepiper/node-bitly.git","type":"git"},"_npmVersion":"5.6.0","description":"A Bit.ly API library for Node.JS","directories":{},"maintainers":[{"name":"tanepiper","email":"piper.tane@gmail.com"}],"_nodeVersion":"8.11.2","contributors":[{"name":"Tane Piper","email":"piper.tane@gmail.com"},{"name":"François de Metz","email":"francois@2metz.fr"},{"name":"zephrax"},{"name":"jessefulton"},{"name":"coaxial","email":"coaxial@cxial.tk"},{"name":"Ildar Sagdejev","email":"specious@gmail.com"}],"dependencies":{"request":"^2.83.0","valid-url":"^1.0.9","babel-polyfill":"^6.26.0","request-promise":"^4.2.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"np":"^2.20.1","chai":"^4.1.2","jsdoc":"^3.5.5","mocha":"^4.1.0","sepia":"^2.0.2","eslint":"^4.19.1","minami":"^1.2.3","webpack":"^3.12.0","ts-loader":"^3.5.0","babel-core":"^6.26.3","typescript":"^2.9.1","jsdoc-babel":"^0.3.0","babel-eslint":"^8.2.3","mocha-webpack":"^1.1.0","@babel/preset-env":"^7.0.0-beta.51","jsdoc-to-markdown":"^3.0.4","babel-preset-es2017":"^6.24.1","webpack-node-externals":"^1.7.2","babel-plugin-transform-runtime":"^6.23.0","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0"},"_npmOperationalInternal":{"tmp":"tmp/bitly_5.1.7_1528915624720_0.4573495761933566","host":"s3://npm-registry-packages"},"_id":"bitly@5.1.7","version":"5.1.7"}