Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

energyhub-events

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

energyhub-events

An attempted solution for the [EnergyHub Coding Sample](https://gist.github.com/lseidman3/8951d958d345da5b2262a929315e6b40).

  • 0.1.0-alpha
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

energyhub-events

An attempted solution for the EnergyHub Coding Sample.

Dependencies

NPM is required to install this package. Node.js required to execute this package.

This package was developed with Node v6.11.2 and NPM v3.10.10 on macOS Sierra 10.12.16. This package has been tested with Node v6.11.2 and Node v10.12.0 on macOS Sierra 10.12.16.

For directions on installing Node (which bundles NPM), visit the Node.js website.

Installation

$ npm install -g energyhub-events

Execution

The general format for executing the package is:

$ energyhub-events [--field <field>[...]]            \
                   [--driver-option <key=value>[...] \
                   [--optimize <optimization>]       \
                   <uri> <date-time>

To see the available optimizations:

$ energyhub-events --help

The available drivers can by seen with:

$ energyhub-events driver list

To see the options accepted by a driver:

$ energyhub-events driver describe <driver>

Reading Local Files

$ energyhub-events --field schedule     \
                   --field ambientTemp  \
                   audit-data.tar.gz    \
                   2016-05-04T10:15:32
{"state":{"ambientTemp":73,"schedule":true},"ts":"2016-05-04T10:15:32"}

Reading S3 Objects

$ energyhub-events --driver-option accessKeyId=<accessKeyId>         \
                   --driver-option secretAccessKey=<secretAccessKey> \
                   --field schedule     \
                   --field ambientTemp  \
                   s3://net.energyhub.assets/public/dev-exercises/audit-data.tar.gz \
                   2016-05-04T10:15:32
{"state":{"ambientTemp":73,"schedule":true},"ts":"2016-05-04T10:15:32"}

Note the appearance in the above command of two --driver-option flags.

Caching remote files

By default, reading an S3 object will result in the object being saved to the local cache directory (by default, $HOME/.cache/energyhub-events).

Subsequent requests for that S3 object will be directed to the local cache directory rather that the remote S3 endpoint.

To use a cache directory other than the default, supply a --cache-dir flag, e.g.:

$ energyhub-events --cache-dir /tmp/.energyhub-events-cache \
                   --driver-option accessKeyId=<accessKeyId>         \
                   --driver-option secretAccessKey=<secretAccessKey> \
                   --field schedule                         \
                   --field ambientTemp                      \
                   s3://net.energyhub.assets/public/dev-exercises/audit-data.tar.gz \
                   2016-05-04T10:15:32

To disable the use of caching, supply either the no-cache-remote-data or none optimizations, e.g.:

$ energyhub-events --optimize no-cache-remote-data     \
                   --driver-option accessKeyId=<accessKeyId>         \
                   --driver-option secretAccessKey=<secretAccessKey> \
                   --field schedule    \
                   --field ambientTemp \
                   s3://net.energyhub.assets/public/dev-exercises/audit-data.tar.gz \
                   2016-05-04T10:15:32

Development and Testing

Download Sources

To download sources, some additional dependencies may be required.

With Git

$ git clone git@github.com:maxenglander/energyhub-events
$ cd energyhub-events

For directions on installing Git, visit the Git website.

With cURL and tar

$ curl -sL https://github.com/maxenglander/energyhub-events/tarball/master.tar.gz | tar xzf -
$ cd energyhub-events-master

Installing cURL and tar is outside of the scope of this project.

Install Additional Dependencies

After downloading sources, change directory into the source code folder and run npm install. For example, if you downloaded sources with Git:

$ cd energyhub-events
$ npm install

Run Tests

$ npm test

FAQs

Package last updated on 15 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc