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

gsr

v0.3.0

Published

Tools for collecting galvanic skin response data in realtime using Node.js.

Downloads

5

Readme

node-gsr

Tools for collecting galvanic skin response data in realtime using Node.js.

Requirements

Uses Node 6.x. Tested on Windows, needs confirmation for Linux/OSX.

Supported hardware:

Optional dependencies:

  • R, for gsr-plot graphing tool
    • libs: ggplot2

Installation

For a specific project:

npm install gsr --save

Globally, for the CLI tools:

npm install gsr -g

Usage

Scripts

You can retrieve GSR data inside your own Node.js scripts and apps.

You can choose to use a specific port, but the static NeuLogGsr.find is also available. It will query all serial ports for connected hardware, returning the first device that responds.

const { NeuLogGsr } = require('gsr');
const co = require('co');

const needsSpecificLogger = true; // try changing me!

function *getLogger()
{
	if (needsSpecificLogger)
	{
		return new NeuLogGsr('COM3'); // this value depends on your configuration
	}
	else
	{
		return yield NeuLogGsr.find();
	}
}

function *main()
{
	const logger = yield getLogger();

	logger.on('data', (value, timestamp) =>
	{
		console.log(value, timestamp);
	});

	logger.start();
}

co(main);

CLI

As a quick start, you can use the bundled CLI scripts to generate CSV data. You get the absolute/relative timestamps and the value in μS.

All time-based parameters accept strings like 100ms, 10s, 30m, 2h.

Available parameters:

  • -p, --port: attach to a specific port; if omitted, will search through all connected devices and try connecting until one succeeds
  • -d, --duration: run the logger for a fixed amount of time
  • -i, --interval: control the frequency at which values are recorded

As an example, record 20 seconds of data with 10 events per second:

$ gsr-neulog -d 20s -i 100ms > experiment.csv
$ head experiment.csv
timestamp,offset,value
1472306294526,0,1.2792
1472306294626,100,1.283
1472306294726,200,1.2898
1472306294826,300,1.2983
1472306294926,400,1.3037
1472306295026,500,1.3071
1472306295126,600,1.3095
1472306295226,700,1.3085
1472306295326,800,1.3056

To generate graphs from the csv files:

$ gsr-plot experiment.csv experiment.png

It should output something like this:

To overlay the graph on some kind of source video, such as gameplay footage, use gsr-video:

$ gsr-video data.csv source_footage.mp4 output_video.mp4
Input gameplay runs at 29.97002997003 FPS at 1280x720
Rendering 588 frames using 8 cores
Rendering video from frames: C:\Users\ruan\AppData\Local\Temp\RtmpoPUvpa/frames.mp4
Merging with gameplay