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

soda-js

v0.2.3

Published

js library for accessing a soda2 api

Downloads

836

Readme

h1. soda-js "!https://secure.travis-ci.org/socrata/soda-js.png!":http://travis-ci.org/socrata/soda-js

A client implementation of the Socrata Open Data API in Coffeescript and Javascript.

h2. Important Note

In order to access the SODA API via HTTPS, clients must now "support the Server Name Indication (SNI)":https://dev.socrata.com/changelog/2016/08/24/sni-now-required-for-https-connections.html extension to the TLS protocol. What does this mean? It means that if you're using @soda-js@, you must use a JavaScript VM that supports SNI:

  • "Internet Explorer 7+":https://en.wikipedia.org/wiki/Server_Name_Indication#Support
  • "Mozilla Firefox 2+":https://en.wikipedia.org/wiki/Server_Name_Indication#Support
  • "Apple Safari (all versions)":https://en.wikipedia.org/wiki/Server_Name_Indication#Support
  • "Google Chrome 6.0+":https://en.wikipedia.org/wiki/Server_Name_Indication#Support
  • "node.js 0.5.3+":https://github.com/nodejs/node/blob/e1643ccc5a5ecf7cb779472d244459469c9971a1/doc/changelogs/CHANGELOG_ARCHIVE.md#20110801-version-053-unstable

h2. Supported Operations

Supports both consumer and producer API, but does not currently support creating datasets or the import workflow.

h2. Usage

See the @sample/@ directory for sample code, but here's the general idea:

bc.. var soda = require('soda-js');

h3. Consumer API

You can query a dataset by SODA2 clauses, or supply a custom SoQL query to be run.

bc.. var consumer = new soda.Consumer('explore.data.gov');

consumer.query() .withDataset('644b-gaut') .limit(5) .where({ namelast: 'SMITH' }) .order('namelast') .getRows() .on('success', function(rows) { console.log(rows); }) .on('error', function(error) { console.error(error); });

h3. Producer API

You can add, update, replace, delete, and upsert rows, as well as truncate a dataset.

bc.. var producer = new soda.Producer('sandbox.demo.socrata.com', sodaConnectionOptions);

var data = { mynum : 42, mytext: "hello world" }

producer.operation() .withDataset('rphc-ayt9') .add(data) .on('success', function(row) { console.log(row); }) .on('error', function(error) { console.error(error); })

h2. License

Provided under the MIT license.