Skip to content

Extensible Data Format (XDF) for persisting multi-modal, time-series data with metadata

License

Notifications You must be signed in to change notification settings

neurodevs/node-xdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-xdf

Extensible Data Format (XDF) for persisting multi-modal, time-series data with metadata

Table of Contents

Overview

This package is a Node wrapper around the C++ libxdf library. It uses a fork of the library to serialize the XDF data to a JSON string that Node can use. It was developed and tested on a macOS system with an M-series chip.

Installation (macOS)

First, you need to install the forked libxdf library.

git clone https://github.com/neurodevs/libxdf.git
cd libxdf && cmake -S . -B build && cmake --build build
sudo mkdir -p /opt/local/lib/
sudo cp build/libxdf.dylib /opt/local/lib/

Then, install the package with your preferred package manager:

npm install @neurodevs/node-xdf

or

yarn add @neurodevs/node-xdf

Usage

XdfFileLoader

import { XdfFileLoader } from '@neurodevs/node-xdf'

async function loadXdf() {
    const loader = await XdfFileLoader.Create()

    const data = await loader.load('/path/to/file.xdf')
    console.log('XDF Data:', data)
}

Test Doubles

This package was developed using test-driven development (TDD). If you also follow TDD, you'll likely want test doubles to fake, mock, or spy certain behaviors for these classes.

import { XdfFileLoader, FakeXdfLoader } from '@neurodevs/node-lsl'

async function someTestFunction() {
    XdfFileLoader.Class = FakeXdfLoader
    const fake = await XdfFileLoader.Create()
}

About

Extensible Data Format (XDF) for persisting multi-modal, time-series data with metadata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published