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

datasift-node

v1.5.0

Published

DataSift REST API Client

Downloads

28

Readme

Build Status

DataSift Node Client Library

This NodeJS client library for DataSift supports the full REST API and streaming API's.

Getting Started

To get started choose one of our quick start guides:

Usage & Examples

For example code take a look at the /examples folder in the repo.

Full API reference documentation can be found on the DataSift developer site.

Creating A Client

Use the following code to create a DataSift client.

var ds = new DataSift('username', 'apikey');

The DataSift client supports both the REST and streaming APIs.

REST API Requests

All of the DataSift REST endpoints are available as functions on the DataSift object. Use this pattern to call an endpoint:

new DataSift('username', 'apikey').<api_method>(<method_params),
  function (err, response) {
	console.log(response);
});

For example to validate a CSDL filter you can use the validate endpoint:

ds.validate({
	'csdl': 'interaction.content contains "hello"'
}, function(err, response) {
	if (err)
		console.log(err);
	else
		console.log("CSDL is valid");
});

Each object takes an object list of parameters, in our instance we can see the only parameter is csdl.

Streaming API

The Node.JS Quickstart Guide explains how to use the streaming API. Or, take look at the /examples folder in the repo.

Supported Operating Enviroment

Tested on Node v0.10.26.

Contributing

Please feel free to contribute to this library.

Running Tests

The client library uses Grunt to run it's tests and will also lint the files. To run Grunt make sure you have Grunt installed and run the grunt command in the directory.

Changelog

  • 1.5.0: Moved to v1.5 of the DataSift API, adding support for Media Strategies API.
  • 1.4.0: Moved to v1.4 of the DataSift API, adding Task API.
  • 1.3.0: Moved to v1.3 of the DataSift API, adding pylon/update endpoint.
  • 1.2.3: Added support for pylon/sample and account/usage endpoints
  • 1.2.2: Hotfix for request method
  • 1.2.1: Added support ODP ingestion
  • 1.2.0: Moved to version 1.2 of the API
  • 1.1.2: Removed old tests ready for new test suite
  • 1.1.1: PYLON GA release
  • 1.1.0: Added PYLON endpoints & examples
  • 1.0.0: Promoted out of BETA
  • 0.5.7: Fixed incorrectly required parameter. Added parameter to allow disabling of auto-reconnect.
  • 0.5.6: Corrected incorrect timeout for auto-reconnect.
  • 0.5.5: Removed the api.datasift.com/stream API endpoint; it is not fit for production usage! Consider using Push Delivery or the Streaming API.
  • 0.5.4: Added managed source resource & auth add and remove endpoints
  • 0.5.2: Each parameter type is now enforced. There are only two types (int|string).