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

bigstock-node-client

v1.0.3

Published

A node.js client to use with Bigstock, an easy-to-use marketplace for stock images.

Downloads

1

Readme

Bigstock API Client

A node.js client to use with Bigstock

Installation

npm install bigstock-node-client --save

Usage

var Bigstock = require('bigstock-node-client');
var bs = bs = new Bigstock({
	'key': '769967',
	'secret': 'ef1b5fa0c05deef8a9768bb442e1726f2b3fee86',
	// 'hostname': 'https://apitest.bigstockphoto.com/'
});

Documentation

The Bigstock client comes with some useful objects for you to utilize in your node.js project. All API endpoints return a promise object.

Bigstock

Bigstock.asset(id, type)

Fetches an asset from the Bigstock API endpoint

Bigstock.image(id)

Alias for Bigstock.asset - Returns a BigImage object

Bigstock.video(id)

Alias for Bigstock.asset - Returns a Video object

Bigstock.purchase(id, type, size)

Returns a Purchase object and id for you to generate a download URL

Bigstock.lightbox(id, params, shareKey)

Returns a Lightbox object

Bigstock.search(query, params)

Returns a Search object

Bigstock.category(language)

Returns a Category object

BigImage

BigImage.toJSON()

Returns the full object details in JSON

Video

Video.toJSON()

Returns the full object details in JSON

Purchase

Purchase.getResponse()

Returns the raw response from the API server

Purchase.toJSON()

Returns the full object details in JSON

Lightbox

Lightbox.hasNextPage()

Determines if there is another page to lightbox

Lightbox.hasPrevPage()

Determines if there is a previous page to lightbox

Lightbox.getNextPage()

Gets the next page number to lightbox

Lightbox.getPrevPage()

Gets the previous page number to lightbox

Lightbox.getImages()

Gets the images contained in the lightbox

Lightbox.getResponse()

Returns the raw response from the API server

Lightbox.toJSON()

Returns the full object details in JSON

Search

Search.hasNextPage()

Determines if there is another page to search

Search.hasPrevPage()

Determines if there is a previous page to search

Search.getNextPage()

Gets the next page number to search

Search.getPrevPage()

Gets the previous page number to search

Search.getImages()

Gets the images contained in the search

Search.getResponse()

Returns the raw response from the API server

Search.toJSON()

Returns the full object details in JSON

Category

Category.getResponse()

Returns the raw response from the API server

Category.toJSON()

Returns the full object details in JSON

Examples

Search

bs.search('duck', { 'response_detail': 'all', 'vectors' : true }).then(function(Search) {
	var images = Search.getImages(),
		image = {};
	for (var i in images) {
		image = images[i];
		console.log(image.toJSON());
	});
}

Get a list of categories

Bigstock.category({ language: 'de' }).then(function(Category) {
	console.log(Category.toJSON());
});

Get an image

Bigstock.asset(1326961, 'image').then(function(BigImage) {
	console.log(BigImage.toJSON())
});

Purchase an image

Bigstock.purchase(1326961, 'image', 'l').then(function(Purchase) {
	if (Purchase.getResponse().response_code === 200) {
		console.log(bs.getDownloadUrl(Purchase.id)); // use this URL to download your image
	}
});

License

MIT © 2014-2017 Shutterstock Images, LLC