SuperMemo
A JavaScript/TypeScript implementation of the SuperMemo 2 (SM2) algorithm for spaced based repetition flashcards.
Hit the Star button if you love this project ⭐️
Explanation
; ; supermemoitem: SuperMemoItem, grade: SuperMemoGrade: SuperMemoItem
- item
- repetition: the number of continous correct responses. The initial
repetition
value should be0
. - interval: inter-repetition interval after the repetitions (in days). The initial
interval
value should be0
. - efactor: easiness factor reflecting the easiness of memorizing and retaining a given item in memory. The initial
efactor
value should be2.5
.
- repetition: the number of continous correct responses. The initial
- grade:
- 5: perfect response.
- 4: correct response after a hesitation.
- 3: correct response recalled with serious difficulty.
- 2: incorrect response; where the correct one seemed easy to recall.
- 1: incorrect response; the correct one remembered.
- 0: complete blackout.
Installation
For Webpack
npm install --save supermemo
;
For Node
npm install --save supermemo
const supermemo = ;
For Deno
;
Usage
; console.logitem; item = supermemoitem, 5;console.logitem; item = supermemoitem, 4;console.logitem;
How to implement SuperMemo with DayJS?
;; ; console.logflashcard; flashcard = practiceflashcard, 5;console.logflashcard; flashcard = practiceflashcard, 3;console.logflashcard;