About The Project
fsrs.js is a JS Package implements Free Spaced Repetition Scheduler algorithm. It helps developers apply FSRS in their flashcard apps.
Getting Started
npm install fsrs.js
Usage
Create a card and review it at a given time:
import * as fsrsjs from 'fsrs.js'
let fsrs = new fsrsjs.FSRS;
let card = new fsrsjs.Card;
conslog(fsrs.p.w)
let now = new Date(2022, 10, 29, 12, 30, 0, 0);
let scheduling_cards = fsrs.repeat(card, now);
console.log(scheduling_cards);
There are four ratings:
1: Forget
2: Hard
3: Good
4: Easy
There are four states:
0: New
1: Learning
2: Review
3: Relearning
scheduling_cards[0].card
scheduling_cards[1].card
scheduling_cards[2].card
scheduling_cards[3].card
card = scheduling_cards[2].card
due = card.due
state = card.state
review_log = scheduling_cards[2].review_log
License
Distributed under the MIT License. See LICENSE
for more information.