open-index/open-npm huggingface dataset:
npm package: @p4d/hermes
Description: Hermes client library for JS (browser & NodeJs)
Author: Brian Ail
Latest version: 1.3.2

# Hermes JS Library

## Description

Hermes library performs the following tasks:

* Queue service
* Event messaging

### Queue Service

This service handles the device storage, when there's a new message, it will always be saved in the storage.
If storage is unavailable, it will mantain a cache queue that will get deleted on page leave.

### Event Messaging

This service needs to be initialized with the hermes url, and then will send events that are in the queue whenever the connection is available

## Installation

Simply require the javascript file into your project!

```html

<script type="text/javascript" src="js/hermes-js.js"></script>

```

## Usage

The first step is to create the Hermes object, with the following initial configuration:

* (string) Url: Hermes URL (should be http://hermes.p4d.com.ar:8080)
* (json) Project: A project object is composed of the project ID  (e.g: 'nike_run_analysis') and the project readable name (e.g: 'Nike Run Analysis NBA')
* (string) Type: The type of events that will be sent, will probably be either appData or deviceStatus type

### Configuration example

```javascript
// Este es el use case tipico
	var hermes = new Hermes({
		url: 'http://hermes.p4d.com.ar:8080',
		project: {
			"id": 'nike_run_analysis',
			"name": 'Nike Run Analysis'
		},
		type: 'appData'
	})
```

After setting up the object, all that remains is to send messages, and there is a simple way to do so:

#### Send(data)

The send event will send the data to hermes, if internet is not connected, it will be saved in the cache to be sent when internet is available.

Data sent can be anything! But Hermes expects it to be a JSON object. A warning will be sent if it isn't.


## Full example

```html
<script type="text/javascript" src="hermes-js.js"></script>

<script type="text/javascript">

	var config = {
		url: 'http://hermes.p4d.com.ar:8080',
		project: {
			"id": 'nike_run_analysis',
			"name": 'Nike Run Analysis'
		},
		type: 'appData'
	}
	var hermes = new Hermes(config)

	var event = {
		name: 'new_experience',
		experience_id: 2
	}
	hermes.send(event)
	
</script>
```

## TO-DO

* Code needs some refactoring, as of now, all work lies within the Hermes Class, and probably needs to shift some responsabilities to the HermesEvent class
npm package: @p4d/hermes-js
Description: Hermes client library for JS (browser & NodeJs)
Author: Brian Ail
Latest version: 1.4.1

# Hermes JS Library

## Description

Hermes library performs the following tasks:

* Queue service
* Event messaging

### Queue Service

This service handles the device storage, when there's a new message, it will always be saved in the storage.
If storage is unavailable, it will mantain a cache queue that will get deleted on page leave.

### Event Messaging

This service needs to be initialized with the hermes url, and then will send events that are in the queue whenever the connection is available

## Installation

Simply require the javascript file into your project!

```html

<script type="text/javascript" src="js/hermes-js.js"></script>

```

## Usage

The first step is to create the Hermes object, with the following initial configuration:

* (string) Url: Hermes URL (should be http://hermes.p4d.com.ar:8080)
* (json) Project: A project object is composed of the project ID  (e.g: 'nike_run_analysis') and the project readable name (e.g: 'Nike Run Analysis NBA')
* (string) Type: The type of events that will be sent, will probably be either appData or deviceStatus type

### Configuration example

```javascript
// Este es el use case tipico
	var hermes = new Hermes({
		url: 'http://hermes.p4d.com.ar:8080',
		project: {
			"id": 'nike_run_analysis',
			"name": 'Nike Run Analysis'
		},
		type: 'appData'
	})
```

After setting up the object, all that remains is to send messages, and there is a simple way to do so:

#### Send(data)

The send event will send the data to hermes, if internet is not connected, it will be saved in the cache to be sent when internet is available.

Data sent can be anything! But Hermes expects it to be a JSON object. A warning will be sent if it isn't.


## Full example

```html
<script type="text/javascript" src="hermes-js.js"></script>

<script type="text/javascript">

	var config = {
		url: 'http://hermes.p4d.com.ar:8080',
		project: {
			"id": 'nike_run_analysis',
			"name": 'Nike Run Analysis'
		},
		type: 'appData'
	}
	var hermes = new Hermes(config)

	var event = {
		name: 'new_experience',
		experience_id: 2
	}
	hermes.send(event)
	
</script>
```

## TO-DO

* Code needs some refactoring, as of now, all work lies within the Hermes Class, and probably needs to shift some responsabilities to the HermesEvent class
npm package: @p4d/hermes-nodejs
Description: Hermes messaging library - server version
Author: Tomás Migone
Latest version: 1.4.0

# Hermes NodeJS Package

## Description

Small NPM package that forwards event messages to the queue server ([RPi-Queue](https://www.npmjs.com/package/@p4d/rpi-queue)) through a socket server on port 9999.

## Installation

```bash
npm install --save @p4d/hermes-nodejs
```

## Usage
### Require package
```javascript
	const Hermes = require('@p4d/hermes-nodejs')
```
### Create hermes object
```javascript
	// Specifying configuration
	var hermes = new Hermes({
		type: 'testAppData',
		project: {
			id: 'test_project',
			name: 'Test Project'
		},
		kronosId: 'abc123'
	})

	// Using default RPi information (Requires properly configured Raspberry Pi)
	var hermes = new Hermes({
		type: 'testAppData'
	})
```
To configure RPi use [rpi-config](https://www.npmjs.com/package/@p4d/rpi-config).

### Send events
```javascript
	hermes.send(data)
```
Where data is a JSON object.

## Full example

```javascript
	const Hermes = require('@p4d/hermes-nodejs')

	var hermes = new Hermes({
		type: 'testAppData',
		project: {
			id: 'test_project',
			name: 'Test Project'
		},
		kronosId: 'abc123'
	})
	var data = {
		name: 'new_experience',
		experience_id: 2
	}
	hermes.send(data)
```

## Limitations

This module requires that the queue server is correctly configured. It does not send messages on it's own. For documentation on the queue server see: [RPi-Queue](https://www.npmjs.com/package/@p4d/rpi-queue)
npm package: @p4d/hermes-server
Description: Hermes messaging library - server version
Author: Shipupi
Latest version: 1.0.1

# Hermes Node Package

## Description

Small package that forwards event messages to the queue server ([Located here](http://git.p4design.com.ar/onecloud/rpi-cloud-utils)) through a socket

## Installation

```bash
npm install p4d-hermes-server
```

## Usage

### Configure project and queue server details
```javascript
	hermes.config(url, eventType, projectName, kronosId)
```

### Send events
```javascript
	hermes.send(data)
```

## Full example

```javascript
	var hermes      = require('p4d-hermes-server')

	hermes.config("http://192.168.88.48:9119", 'appData', 'nike_run_nba', 'nike_run_nba_1')

	var data = {
		name: 'new_experience',
		experience_id: 2
	}
	hermes.send(data)
```

## Limitations

This module is dependant on the queue server being setup properly, and does not send messages on it's own

## Possible future implementations

* If queue server connection is not available, this package could try to send the event on it's own, while not providing a queue functionality, it would make it easier to send messages and not need to install a second node server.
npm package: @p4d/network-monitor
Description: Raspberry Pi utility that emits alerts periodically with network status.
Author: Tomás Migone
Latest version: 1.8.0

# Network-Monitor
Network utility written in NodeJS that emits alerts periodically to a Hermes server with network status.

Network-Monitor is a command line utility:
+ it can be run manually at anytime
+ it's scheduled to be run every 5 minutes by a cron job

Network-Monitor uses Hermes nodejs library, this means that if internet connection is available to the RPi, the alerts are guaranteed to reach Hermes server.

## Requirements
+ cron installed on RPi
+ Hermes server configured and available
+ RPi in ready state (Project id, Kronos id and Hermes Url must be assigned) - See [RPi Status docs](https://www.npmjs.com/package/@p4d/rpi)

## Installation
RPi is distributed via NPM:
```
sudo npm install -g --unsafe-perm @p4d/network-monitor
```

Notes:
+ `-g` - Global flag is required so that the utility is accessible from anywhere in the system.
+ `--unsafe-perm` - This flag is required to set up the cron job for sudo user.

## Usage
Manual usage:
```bash
# Just running the command will do it
network-monitor
```

Automatic usage:
```bash
# The cron job that automates it
*/5 * * * * network-monitor
```
npm package: @p4d/rpi-boot
Description: Raspberry Pi utility that emits alerts when device is booted.
Author: Tomás Migone
Latest version: 1.8.0

# RPi-Boot
Raspberry Pi utility written in NodeJS that emits alerts to a Hermes server when device is booted.

RPi-Boot is a command line utility:
+ it can be run manually at anytime
+ it's scheduled to be run at reboot by a cron job

RPi-Boot uses Hermes nodejs library, this means that if internet connection is available to the RPi, the alerts are guaranteed to reach Hermes server.

## Requirements
+ cron installed on RPi - Already installed if using P4D Pi Bakery image
+ Hermes server configured and available
+ RPi in ready state (Project id, Kronos id and Hermes URL must be assigned) - See [RPi Status docs](https://www.npmjs.com/package/@p4d/rpi)

## Installation
RPi is distributed via NPM:
```
sudo npm install -g --unsafe-perm @p4d/rpi-boot
```

Notes:
+ `-g` - Global flag is required so that the utility is accessible from anywhere in the system.
+ `--unsafe-perm` - This flag is required to set up the cron job for sudo user.

## Usage
Manual usage:
```bash
# Just running the command will do it
rpi-boot
```

Automatic usage:
```bash
# The cron job that automates it
@reboot rpi-boot
```
npm package: @p4d/rpi-cloud-client
Description: Raspberry Pi client for RPi cloud.
Author: Tomás Migone
Latest version: 1.9.1


# RPi-Cloud-Client

RPi-Cloud-Client is the client version of the RPi-Cloud that runs on RPi devices.
It enables any RPi device to be connected to the RPi-Cloud, and in turn, be configured and controlled from the RPi-Panel.

## Installation
RPi-Cloud-Client is already pre-installed on RPi-Bakery based RPi's.
It is distributed via NPM:
```
sudo npm install -g --unsafe-perm @p4d/rpi-cloud-client
```

Notes:
+ `-g` - Global flag is required so that the utility is accessible from anywhere in the system.
+ `--unsafe-perm` - This flag is required to set up the cron job for sudo user.


## Documentation

RPi-Cloud-Client is a socket based client for the RPi-Cloud.
By connecting the RPi to the RPi-Cloud, it provides the ability of being remotely controlled and configured.
See [RPi-Cloud-Server](http://git.p4design.com.ar/p4d/rpi/rpi-cloud/server) and [RPi-Cloud-Panel](http://git.p4design.com.ar/p4d/rpi/rpi-cloud/panel)


# Build and publish
Commands only for development purposes

## Publish NPM package
1. Run `npm version major/minor/patch` following [SEMVER](http://semver.org/) guidelines.
2. Run `npm publish --access public` to publish the package
npm package: @p4d/rpi-monitor
Description: Raspberry Pi utility that emits alerts periodically with device status.
Author: Tomás Migone
Latest version: 1.4.0

# RPi-Monitor
Raspberry Pi utility written in NodeJS that emits alerts periodically to a Hermes server with device status.

RPi-Monitor is a command line utility:
+ it can be run manually at anytime
+ it's scheduled to be run every 5 minutes by a cron job

RPi-Monitor uses Hermes nodejs library, this means that if internet connection is available to the RPi, the alerts are guaranteed to reach Hermes server.

## Requirements
+ cron installed on RPi
+ Hermes server configured and available
+ RPi in ready state (Project id, Kronos id and Hermes Url must be assigned) - See [RPi Status docs](https://www.npmjs.com/package/@p4d/rpi)

## Installation
RPi is distributed via NPM:
```
sudo npm install -g --unsafe-perm @p4d/rpi-monitor
```

Notes:
+ `-g` - Global flag is required so that the utility is accessible from anywhere in the system.
+ `--unsafe-perm` - This flag is required to set up the cron job for sudo user.

## Usage
Manual usage:
```bash
# Just running the command will do it
rpi-monitor
```

Automatic usage:
```bash
# The cron job that automates it
*/5 * * * * rpi-monitor
```
npm package: @p4d/rpi-queue
Description: Raspberry Pi queue server for Hermes events.
Author: Tomás Migone
Latest version: 1.6.0


# RPi-Queue

RPi-Queue is a daemon that sends queued messages to Hermes server when internet connection is available.
It runs on a Raspberry Pi.

## Installation
RPi-Queue is already pre-installed on RPi-Bakery based RPi's.
It is distributed via NPM:
```
sudo npm install -g --unsafe-perm @p4d/rpi-queue
```

Notes:
+ `-g` - Global flag is required so that the utility is accessible from anywhere in the system.
+ `--unsafe-perm` - This flag is required to set up the cron job for sudo user.

## Documentation

RPi-Queue is a socket server running on port 9999 which is scoped for localhost usage.
To add items to the queue from a nodejs based application refer to [hermes-nodejs](https://www.npmjs.com/package/@p4d/hermes-nodejs)


# Build and publish
Commands only for development purposes

## Publish NPM package
1. Run `npm version major/minor/patch` following [SEMVER](http://semver.org/) guidelines.
2. Run `npm publish --access public` to publish the package
npm package: @p4d/socket-logs
Description: General logging for socket.io
Author: Brian Ail
Latest version: 1.0.1

# Socket Logs

## Description

Small NPM package that receives a socket io connection instance and prints on the console generic data about the connection, errors, and disconnects

## Installation

```bash
npm install --save @p4d/socket-logs
```

## Usage
### Require package
```javascript
	const socketLogs = require('@p4d/socket-logs')
```
### Create hermes object
```javascript

var io = socketio.listen(config.socket.port)
io.on('connection', (socket) => {
	socketLogs.start(socket)
})

```

## Future updates

Logs are currently printed on the console, may be worth exploring logging to a specific file or somewhere else