Wakefield's Daily Tips

Know the difference between PsychoJS and jsPsych

PsychoPy was orginally written as a set of Python libraries to support the programming of cognitive psychology experiments, much like Psychtoolbox for MATLAB. However, PsychoPy is also used to refers to the PsychoPy Builder, an experimental generator which allows a user to create experiments in Python using the PsychoPy libraries via a graphical user interface. The Python script generated by PsychoPy Builder can be further customised through the use of code components.

PsychoJS is a parallel set of libraries which allow experiments created in PsychoPy Builder to be translated into JavaScript so that the same experiment can run in a Browser. Any Python code components also have to be translated, though this is often seamless thanks to the Auto->JS transpiler. PsychoJS experiments are almost always hosted on Pavlovia which provides a revenue stream for PsychoPy/PsychoJS/Pavlovia development. Programming in PsychoJS directly is not recommended since most PsychoPy users are more familiar with Python than JavaScript.

jsPsych is not the same as PsychoJS. It is a set of JavaScript plugins which allow someone to extend JavaScript code to incorporate the kinds of features needed for a cognitive psychology experiment. There is a jspsych-pavlovia plugin which allows experiments written in jsPsych to be hosted on Pavlovia, but other options are also available. If you want help with an experiment written in jsPsych, please use the appropriate category. However, I would also recommend that you use their GitHub Discussions area.

1 Like