# open_secrets

> NodeJS toolset for working with the OpenSecrets API

Latest version **0.0.1** (published 2015-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install open_secrets
pnpm add open_secrets
yarn add open_secrets
bun add open_secrets
```

Provides the command `open_secrets`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-03-08 |
| First published | 2015-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonathan D. Baker |
| Maintainers | jondbaker |
| Keywords | open_secrets, opensecrets |

## Links

- npm: https://www.npmjs.com/package/open_secrets
- Repository: https://github.com/voltaicio/open_secrets
- Issues: https://github.com/voltaicio/open_secrets/issues
- npm.io page: https://npm.io/package/open_secrets

## Dependencies (3)

- [nconf](https://npm.io/package/nconf.md) ^0.7.1
- [request](https://npm.io/package/request.md) ^2.53.0
- [commander](https://npm.io/package/commander.md) ^2.6.0

## Recent versions

- 0.0.1 (latest) — 2015-03-08

## README

open_secrets
============

A NodeJS toolset for working with the OpenSecrets API.

Overview
--------

This project is largely based upon the work started with
https://github.com/ameensol/opensecrets. The NodeJS module contained herein
implements a different API than ameensol's module, thus simple pull-requests
were deemed inappropriate. Additionally, this module:

1. Includes a CLI client
2. Includes unit tests
3. Features an expanded list of methods that interact with the OpenSecrets API
4. Does not include any hard-coded API parameters

Setup
-----

You need an OpenSecrets API key to use this module; register for one here:
https://www.opensecrets.org/api/admin/index.php?function=signup

Module Usage
------------

Format:

    client.<method>(<config>, <callback>);

Example:

    var OpenSecretsClient = require("/index");

    var client = new OpenSecretsClient("<api_key>"),
        config = {
            cid: "N00008051",
            cycle: 2014,
            output: "json"
        },
        callback = function(err, response) {
            if (err) { throw err; }
            console.log(response);
        };

    client.candContrib(config, callback);

CLI Usage
---------

Format:

    $ ./open_secrets.js <api_key> <method> [params]

Example:

    $ ./open_secrets.js 0123456789 candContrib --cid=N00008051 --cycle=2014 --output=json

Examples
--------

To run the examples:

1. Create a config.json file in the module root:

    $ echo '{ "apiKey": "<api_key>" }' > config.json

2. Execute (WARNING: use judiciously because the examples submit live
   requests that count against your API quota):

    $ node examples.js

Testing
-------

The unit tests are written for Jasmine and can be executed with:

    $ npm test

Contributions
-------------

Contributions are absolutely welcome and should be accompanied by necessary and
passing tests.

---
_Source: https://npm.io/package/open_secrets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
