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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jspsych-timelines/spatial-nback

v0.3.0

Published

A deployable spatial grid n-back timeline for jsPsych. Supports custom grid sizes, n-back levels, feedback, and more.

Readme

@jspsych-timelines/spatial-nback

Overview

A deployable spatial n-back timeline for jsPsych experiments. The spatial n-back task is a working memory test where participants must remember the position of stimuli across trials and identify when the current position matches the position from n trials ago.

Loading

Via CDN

<script src="https://unpkg.com/@jspsych-timelines/spatial-nback"></script>

Via npm

npm install @jspsych-timelines/spatial-nback
import { createTimeline } from '@jspsych-timelines/spatial-nback';

Compatibility

spatial-nback requires jsPsych v8.0.0 or later.

Quick Start

Basic Usage

import { initJsPsych } from 'jspsych';
import { createTimeline } from '@jspsych-timelines/spatial-nback';

const jsPsych = initJsPsych({
  on_finish: function() {
    jsPsych.data.displayData();
  }
});

// Create a basic 1-back task with instructions
const timeline = createTimeline({
  n_back: 1,
  total_trials: 20,
  target_percentage: 40,
  include_instructions: true,
  show_feedback_text: true
});

jsPsych.run(timeline);

Practice Session

import { createPracticeTimeline } from '@jspsych-timelines/spatial-nback';

// Short practice with feedback
const practiceTimeline = createPracticeTimeline({
  n_back: 1,
  include_instructions: true
});

jsPsych.run(practiceTimeline);

Using Presets

import { presetConfigurations } from '@jspsych-timelines/spatial-nback';

// Easy configuration (1-back, 20 trials, feedback enabled)
const easyTask = presetConfigurations.easy();

// Research configuration (multi-level 1-3 back, 50 trials each)
const researchTask = presetConfigurations.research();

Documentation

createTimeline

createTimeline(options) ⇒ timeline

Creates a spatial n-back timeline with the specified parameters.

Key Parameters:

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | n_back | number | 1 | The n-back level (trials to remember back) | | total_trials | number | 20 | Total number of trials | | target_percentage | number | 40 | Percentage of trials that are targets | | rows | number | 3 | Grid rows | | cols | number | 3 | Grid columns | | include_instructions | boolean | false | Include instruction pages | | show_feedback_text | boolean | false | Show correctness feedback |

timelineUnits

  • createPracticeTimeline(options) - Creates a short practice version (6 trials, feedback enabled)
  • createMultiLevelNBackTimeline(options) - Creates timeline with multiple n-back levels

utils

  • presetConfigurations - Pre-configured timelines (easy, medium, hard, research)
  • generateNBackSequence() - Generate stimulus sequences
  • createInstructions() - Create instruction pages with optional TTS

Author / Citation

Author: Abdullah Hunter Farhat
Also known as: A. Hunter Farhat
ORCID: 0009-0008-7042-469X
GitHub: @farhat60

How to Cite

If you use this timeline in academic work, please cite it as:

APA Style:

Farhat, A. H. (2024). @jspsych-timelines/spatial-nback: A deployable spatial grid n-back timeline for jsPsych (Version 0.0.2) [Software]. GitHub. https://github.com/jspsych/jspsych-timelines/tree/main/packages/spatial-nback

BibTeX:

@software{farhat2024spatial,
  author = {Farhat, Abdullah Hunter},
  title = {{@jspsych-timelines/spatial-nback: A deployable spatial grid n-back timeline for jsPsych}},
  url = {https://github.com/jspsych/jspsych-timelines/tree/main/packages/spatial-nback},
  version = {0.0.2},
  year = {2024}
}

Citations help demonstrate that this software is used and valued, which supports continued development and maintenance.