ts-simple-fsrs
A minimal implementation of the FSRS (Free Spaced Repetition Scheduler) algorithm written in TypeScript.
Published December 31, 2024 (Updated December 31, 2024)
simple-ts-fsrs offers a lightweight implementation of the FSRS algorithm. I created this package because I wanted a simple TypeScript library to use in a language learning program I'm making.
simple-ts-fsrs takes great inspiration from the Open Spaced Repetition project and I want to give thanks for all the contributors.
Installation
Even though the package is created using Deno it can be used with node.js as well.
Node.js
npx jsr add @austinshelby/simple-ts-fsrs
Deno
deno add jsr:@austinshelby/simple-ts-fsrs
I decided to host the package on JSR (https://jsr.io/@austinshelby/simple-ts-fsrs) because I got intrigued by this new package registry. Getting to develop my package fully in TypeScript was a massive productivity boost and I highly recommend giving JSR a go.
Quickstart
Getting started with simple-ts-fsrs
is easy. To assess your ability to recall information, first initialize FSRS (the default parameters are reasonable) and call the assessRecall
method with your rating.
The package is 100% TypeScript so you'll have great IDE autocompletion.
To assess already previously recalled information, just pass the previous assessment into the method.
You can also optionally pass a date as the time of the assessment.