bigpicture-node
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "bigpicture-node", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "BigPicture API wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -16,16 +16,4 @@ bigpicture-node | ||
Using ES6 modules and async/await: | ||
```js | ||
const bigpicture = require('bigpicture-node')('api_key'); | ||
// or | ||
const { Client } = require('bigpicture-node'); | ||
const bigPicture = new Client('api_key'); | ||
let Company = bigPicture.Company; | ||
Company.find({domain: 'stripe.com'}) | ||
.then(company => console.log(company.id)) | ||
.catch(error => console.error(error)); | ||
``` | ||
Or using ES6 modules and async/await: | ||
```js | ||
import BigPicture from 'bigpicture-node'; | ||
@@ -43,2 +31,15 @@ const bigPicture = BigPicture('api_key'); | ||
Or using commonjs modules: | ||
```js | ||
const bigpicture = require('bigpicture-node').default('api_key'); | ||
// or | ||
const { Client } = require('bigpicture-node'); | ||
const bigPicture = new Client('api_key'); | ||
let Company = bigPicture.Company; | ||
Company.find({domain: 'stripe.com'}) | ||
.then(company => console.log(company.id)) | ||
.catch(error => console.error(error)); | ||
``` | ||
## Quering the API | ||
@@ -45,0 +46,0 @@ |
@@ -6,2 +6,3 @@ var assert = require("chai").assert; | ||
const { Client } = require("../dist/client"); | ||
const pkg = require('../package.json'); | ||
const { | ||
@@ -78,3 +79,3 @@ QueuedError, | ||
assert.equal(options.headers.Authorization, API_KEY); | ||
assert.equal(options.user_agent, "BigPictureNode/v1.0.0"); | ||
assert.equal(options.user_agent, `BigPictureNode/v${pkg.version}`); | ||
}); | ||
@@ -81,0 +82,0 @@ }); |
36109
700
123