New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 6.0.0 to 6.0.1-beta.871

3

package.json

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

"homepage": "https://github.com/tanepiper/node-bitly",
"version": "6.0.0",
"version": "6.0.1-beta.871",
"author": {

@@ -73,2 +73,3 @@ "name": "Tane Piper",

},
"typings": "./global.d.ts",
"dependencies": {

@@ -75,0 +76,0 @@ "request": "^2.87.0",

@@ -28,13 +28,24 @@ # node-bitly - Bitly API for nodejs

### Code
#### TypeScript / ES6 Imports
```js
import { BitlyClient } from 'bitly';
const bitly = new BitlyClient('<accessToken>', {});
try {
return await bitly.shorten(uri);
} catch(e) {
throw e;
async function init() {
let result;
try {
result = await bitly.shorten('https://github.com/tanepiper/node-bitly');
} catch (e) {
throw e;
}
return result;
}
init();
```
#### JavaScript
```js

@@ -44,8 +55,9 @@ const { BitlyClient } = require('bitly');

let result;
try {
const data = await bitly.shorten(uri);
result = await bitly.shorten(uri);
} catch(e) {
throw e;
}
return data;
return result;
```

@@ -57,14 +69,15 @@

const BitlyClient = require('bitly');
const bitly = BitlyClient('<accessToken>');
const bitly = new BitlyClient('<accessToken>');
bitly.shorten('https://github.com/tanepiper/node-bitly')
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.error(error);
});
bitly
.shorten('https://github.com/tanepiper/node-bitly')
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.error(error);
});
```
You can also do raw requests to any Bitly endpoint. With this you need to pass the access
You can also do raw requests to any Bitly endpoint. With this you need to pass the access
token to the method

@@ -89,2 +102,2 @@

To run tests type `npm test`. Please note one test will fail if you use your own API key, please update the string accordingly.
To run tests type `npm test`. Please note one test will fail if you use your own API key, please update the string accordingly.

Sorry, the diff of this file is not supported yet

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