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:
const fsrsJs = require("fsrs.js")
let fsrs = new fsrsJs.FSRS();
let card = new fsrsJs.Card();
let rating= fsrsJs.Rating;
let state = fsrsJs.State;
console.log(fsrs.p)
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:
rating.Again
rating.Hard
rating.Good
rating.Easy
There are four states:
state.New
state.Learning
state.Review
state.Relearning
scheduling_cards[rating.Again].card
scheduling_cards[rating.Hard].card
scheduling_cards[rating.Good].card
scheduling_cards[rating.Easy].card
card = scheduling_cards[rating.Good].card
due = card.due
state = card.state
review_log = scheduling_cards[rating.Good].review_log
License
Distributed under the MIT License. See LICENSE
for more information.