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'
import { State, Rating } from '../src'
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:
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.