/fsrs.js

A spaced repetition algorithm which overtakes Anki and catches up with SuperMemo.

Primary LanguageJavaScriptMIT LicenseMIT

JavaScript module of Free Spaced Repetition Scheduler algorithm, based on the DSR model proposed by Piotr Wozniak, author of SuperMemo.

Usage

npm install fsrs.js to import this module.

Example

const fsrs = require("fsrs.js")

//input data
var cardData={id:'id'},
    grade=-1,//Grade `-1` means learn new card,and `0, 1, 2` means review old card.
    globalData=null;

var outputData = fsrs(cardData,grade,globalData)//Return {cardData,globalData}. You can save this output data and use it as input data the next time you update grade.

console.log(outputData)