Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
clearbit
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
clearbit
Commits
0f18a49e
Commit
0f18a49e
authored
Nov 25, 2014
by
Alex MacCaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use clearbit.com
parent
5ac7b823
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
16 deletions
+16
-16
README.md
README.md
+5
-5
client.js
src/client.js
+1
-1
client.js
test/client.js
+4
-4
company.js
test/company.js
+1
-1
person.json
test/fixtures/person.json
+3
-3
person.js
test/person.js
+1
-1
person_company.js
test/person_company.js
+1
-1
No files found.
README.md
View file @
0f18a49e
clearbit-node [](https://travis-ci.org/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node)
=============
Node library for querying the
[
Clearbit
](
https://clearbit.co
)
business intelligence APIs. Currently supports:
Node library for querying the
[
Clearbit
](
https://clearbit.co
m
)
business intelligence APIs. Currently supports:
*
[
Person API
](
https://clearbit.co/docs#person-api
)
*
[
Company API
](
https://clearbit.co/docs#company-api
)
*
[
Person API
](
https://clearbit.co
m
/docs#person-api
)
*
[
Company API
](
https://clearbit.co
m
/docs#company-api
)
## Setup
```
bash
...
...
@@ -25,7 +25,7 @@ var clearbit = new Client({key: 'api_key'});
*
`email`
*String*
: The email address to look up
**(required)**
*
`webhook_id`
*String*
: Custom identifier for the webhook request
*
`subscribe`
*Boolean*
: Set to
`true`
to subscribe to the changes
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co/docs?shell#streaming
)
instead of webhooks
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co
m
/docs?shell#streaming
)
instead of webhooks
```
js
var
Person
=
clearbit
.
Person
;
...
...
@@ -49,7 +49,7 @@ Person.find({email: 'email@domain.com'})
#### `Company.find(options)` -> `Promise`
*
`domain`
*String*
: The company domain to look up
**(required)**
*
`webhook_id`
*String*
: Custom identifier for the webhook request
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co/docs?shell#streaming
)
instead of webhooks
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co
m
/docs?shell#streaming
)
instead of webhooks
```
js
var
Company
=
clearbit
.
Company
;
...
...
src/client.js
View file @
0f18a49e
...
...
@@ -20,7 +20,7 @@ function ClearbitClient (config) {
this
.
PersonCompany
=
require
(
'./person_company'
)(
this
);
}
var
base
=
'https://%s%s.clearbit.co/v%s'
;
var
base
=
'https://%s%s.clearbit.co
m
/v%s'
;
ClearbitClient
.
prototype
.
base
=
function
(
options
)
{
options
=
_
.
defaults
(
options
,
{
version
:
'1'
,
...
...
test/client.js
View file @
0f18a49e
...
...
@@ -45,7 +45,7 @@ describe('Client', function () {
expect
(
client
.
base
({
api
:
'person'
}))
.
to
.
equal
(
'https://person.clearbit.co/v1'
);
.
to
.
equal
(
'https://person.clearbit.co
m
/v1'
);
});
it
(
'can generate a streaming base'
,
function
()
{
...
...
@@ -53,7 +53,7 @@ describe('Client', function () {
api
:
'person'
,
stream
:
true
}))
.
to
.
equal
(
'https://person-stream.clearbit.co/v1'
);
.
to
.
equal
(
'https://person-stream.clearbit.co
m
/v1'
);
});
it
(
'can set a custom version'
,
function
()
{
...
...
@@ -61,7 +61,7 @@ describe('Client', function () {
api
:
'person'
,
version
:
'2'
}))
.
to
.
equal
(
'https://person.clearbit.co/v2'
);
.
to
.
equal
(
'https://person.clearbit.co
m
/v2'
);
});
});
...
...
@@ -70,7 +70,7 @@ describe('Client', function () {
var
mock
;
before
(
function
()
{
mock
=
nock
(
'https://person.clearbit.co'
);
mock
=
nock
(
'https://person.clearbit.co
m
'
);
});
after
(
nock
.
cleanAll
);
afterEach
(
function
()
{
...
...
test/company.js
View file @
0f18a49e
...
...
@@ -8,7 +8,7 @@ describe('Company', function () {
var
mock
;
before
(
function
()
{
mock
=
nock
(
'https://company.clearbit.co'
);
mock
=
nock
(
'https://company.clearbit.co
m
'
);
});
after
(
nock
.
cleanAll
);
afterEach
(
function
()
{
...
...
test/fixtures/person.json
View file @
0f18a49e
...
...
@@ -8,13 +8,13 @@
"email"
:
"alex@alexmaccaw.com"
,
"gender"
:
"male"
,
"location"
:
"San Francisco"
,
"bio"
:
"O'Reilly author, software engineer & traveller. Founder of https://clearbit.co"
,
"bio"
:
"O'Reilly author, software engineer & traveller. Founder of https://clearbit.co
m
"
,
"site"
:
"http://alexmaccaw.com"
,
"avatar"
:
"https://pbs.twimg.com/profile_images/1826201101/297606_10150904890650705_570400704_21211347_1883468370_n.jpeg"
,
"employment"
:
{
"name"
:
"Clearbit"
,
"title"
:
"CEO"
,
"domain"
:
"clearbit.co"
"domain"
:
"clearbit.co
m
"
},
"facebook"
:
{
"handle"
:
"amaccaw"
...
...
@@ -30,7 +30,7 @@
"twitter"
:
{
"handle"
:
"maccaw"
,
"id"
:
2006261
,
"bio"
:
"O'Reilly author, software engineer & traveller. Founder of https://clearbit.co"
,
"bio"
:
"O'Reilly author, software engineer & traveller. Founder of https://clearbit.co
m
"
,
"followers"
:
14993
,
"following"
:
1645
,
"location"
:
"San Francisco"
,
...
...
test/person.js
View file @
0f18a49e
...
...
@@ -8,7 +8,7 @@ describe('Person', function () {
var
mock
;
before
(
function
()
{
mock
=
nock
(
'https://person.clearbit.co'
);
mock
=
nock
(
'https://person.clearbit.co
m
'
);
});
after
(
nock
.
cleanAll
);
afterEach
(
function
()
{
...
...
test/person_company.js
View file @
0f18a49e
...
...
@@ -8,7 +8,7 @@ describe('PersonCompany', function () {
var
mock
;
before
(
function
()
{
mock
=
nock
(
'https://person.clearbit.co'
);
mock
=
nock
(
'https://person.clearbit.co
m
'
);
});
after
(
nock
.
cleanAll
);
afterEach
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment