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

fdpa-fusiontables

v1.1.0

Published

Fair Districts PA fusiontables language binding

Downloads

11

Readme

Fair Districts PA fusiontables api language binding

Provides a JS ES2015|ES6 module, src/js/fusionApi.js, which defines JS language bindings for the Google cloud FDPA Resolutions project, using the Google fusiontable API.

The harness directory contains a demo-test harness in the form of a web page that exercises fusionApi.js. Not enough functionality exists to be worth a formal test procedure.

ES2015 or ES6 Usage

To access the ES2015/ES6 version from an import statement, download ./src/js/fusionApi.js, and put it in your path.

Then add the following to the module where you want to use it:

import fdpaResolutions from 'fdpa/fusionApi.js';

The resolutions API can now be accessed within that module as properties of the local variable fdpaResolutions.

ES5 Usage

To access an ES5 version of fusionApi.js from a script tag, download ./distribution/fusionApi_es5.js and reference it in the src attribute in the page HTML:

<script src="./PATH/fusionApi_es5.js"></script>

The resolutions API can now be accessed via the global variable fdpaResolutions.

fdpaResolutions methods

function getResolutionsCount(options)

which returns

{
   verified: boolean, true means the request was submitted
   errorFields: array, lists fields that failed if verified is false
   googleApiKey: options.googleApiKey or an error message
   fusionTable: options.fusionTable or a sensible default
   statusSought: an array of status strings derived from options.status,
     or an error message
}

and where options is of the form:

{
   googleApiKey: required string,
   fusiontable: optional string, defaults to the expected table
   status: optional string, defaults to '-'
   successHandler: optional function, defaults to an empty function
}

and where:

  • googleApiKey is an API key created in the Google developers console for the FDPA Resolutions project.
  • fusiontable is the ID of a Google fusiontable for the FDPA Resolutions project.
  • status may be '-', 'inWork', 'materialsSent', 'passed', 'refusedOrOther', or a combination of these separated by a comma and no space.
  • successHandler function has the prototype function(count), where count is an integer returned from the query.

Build from Source

To build the ES5 distribution:

  1. Clone the source
  2. npm install
  3. npm run build

npx webpack --config --output-library webpack.distribution.config.js

The result will be the creation of ./distribution/fusionApi.js.

To build the test harness:

  1. Clone the source
  2. npm install
  3. Edit harness/app.js and change the API key
  4. npm run test
  5. Follow the instructions at the end of the npm run test output