# cimis-node

> Node wrapper for the Cimis API

Latest version **1.1.2** (published 2016-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install cimis-node
pnpm add cimis-node
yarn add cimis-node
bun add cimis-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2016-12-16 |
| First published | 2016-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | dphaener |
| Maintainers | dphaener |

## Links

- npm: https://www.npmjs.com/package/cimis-node
- npm.io page: https://npm.io/package/cimis-node

## Dependencies (4)

- [ramda](https://npm.io/package/ramda.md) ^0.22.1
- [moment](https://npm.io/package/moment.md) ^2.17.1
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.0.5
- [fetch-everywhere](https://npm.io/package/fetch-everywhere.md) ^1.0.5

## Recent versions

- 1.1.2 (latest) — 2016-12-16
- 1.1.1 — 2016-12-16
- 1.1.0 — 2016-12-13
- 1.0.1 — 2016-12-13
- 1.0.0 — 2016-12-12

## README

# Cimis Node

A small Node wrapper for the Cimis API.

## Installation

### NPM

```bash
$ npm install cimis-node
```

### Yarn

```bash
$ yarn add cimis-node
```

## Usage

You must have an app key supplied by CIMIS in order to use most parts of the
API. Details about registereing with CIMIS can be found here: http://et.water.ca.gov/Home/Register/

```js
import Cimis from 'cimis-node';

const cimis = Cimis("my-super-secret-app-key");

cimis.stations.all().then(stations => {
  stations[1].fetchData().then(data => console.log(data))
});
```

## API

### Cimis

```
(appKey) -> { stations: Stations }
```

The main wrapper for the API, allows you to fetch all of the stations.
When stations are fetched, will return a list of `Station` objects.

### Stations

```
{ all: () -> List<Station> }
```

The canonical way to get a list of all Stations.

### Station

```
{
  detail: Object,
  fetchData: ({ options: Object, hourly: Boolean = true }) -> Object
}
```

A CIMIS weather station. The `detail` key contains data about the station itself
and the `fetchData` function fetches data for that station.

#### StationOptions

```
{
  startDate: DateString = CurrentDate,
  endDate: DateString = CurrentDate
}
```

#### DateString

```
String<YYYY-MM-DD>
```

#### CurrentDate

Today's date, formatted as a `DateString`

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