npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cbinsights

v0.2.11

Published

Simple module for using CB Insights's API in node.js

Downloads

92

Readme

cbi-node

Simple module for using CB Insights's API in node.js. Currently this is just a wrapper, but we aim to make it a more full-featured client in the near future.

To use this module you need access to the CB Insights API.

Other API wrappers:

Installation

npm install cbinsights

Usage

The best way is to set the environment variables CBI_API_KEY and CBI_SECRET_KEY to your API key and secret key respectively and do:

var CBInsights = require('cbinsights');
var cbi = new CBInsights();

If you don't want to do that, you can specify your credentials directly like so:

var cbi = new CBInsights({
	apiKey: 'your API Key',
	secretKey: 'your Secret Key'
});

After you've done that, making a request is easy as pie! Here we grab Foursquare's company info:

cbi.sendAuthenticatedRequest('company/info/?names=Foursquare', function (response) {
	console.log(response);
});

This gives you:

[ { address:
     { city: 'New York',
       continent: 'North America',
       country: 'United States',
       fax: null,
       idAddress: 27590,
       idCity: 3033,
       idContinent: 6,
       idCountry: 1,
       idState: 32,
       phone: '346-494-0946',
       state: 'New York',
       street1: '568 Broadway',
       street2: '10th Floor',
       zipCode: '10012' },
    company: 'Foursquare',
    description: 'Foursquare offers an online mobile social networking service which leverages smartphones and GPS as part of a location-based social network that enables users to voluntarily check-in to different venues. By checking into locations, users collect virtual badges which may also enable special deals by the venue to users who are loyal or who avail themselves of a particular promotion.\n\nFoursquare has applications for the iPhone, Android, Blackberry and Windows Mobile.\n\nThe firm was co-founded by Dennis Crowley and Naveen Selvadurai. Crowley formerly co-founded Dodgeball, a concept similar in some ways to Foursquare. Dodgeball was acquired by Google in 2005.\n\nFourSquare API - The Foursquare API was open to a limited number of developers until November 2009 at which time it was opened up to developers. The foursquare API enables developers to build applications that interact with the foursquare platform. Developers can use the API to create new ways to check-in to foursquare or visualize the data generated by the foursquare community. Developers looking to build a simple widget based on their check-in history are not best served by the full API but instead can leverage the Foursquare\'s feeds system. \n\nThe Foursquare API has aided in the company\'s growth and adoption by users as developer apps have lead to greater reach for the company.',
    email: null,
    founded: '2008-11-30',
    geo: null,
    idCompany: 27741,
    idGeo: null,
    mobileapps: [ [Object], [Object] ],
    ownership: 'Private',
    status: 'Alive / Active',
    url: 'foursquare.com' } ]

For more info, check out the CB Insights API Documentation.

Initialization Options

Option | Description | Default :--- | :--- | :--- useSandbox| Set to true while you're developing your app to not waste any API credit. | false apiKey | Your API key. | The environment variable CBI_API_KEY secretKey | Your secret key. | The environment variable CBI_SECRET_KEY

License

The MIT License (MIT)

Copyright (c) 2014 CB Insights

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.