npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

leitner-box

v1.0.6

Published

This library implements a data-structure that supports the next workflow (taken from [wikipedia](https://en.wikipedia.org/wiki/Leitner_system))

Downloads

11

Readme

leitner-box

This library implements a data-structure that supports the next workflow (taken from wikipedia)

With this method, there are 12 boxes. One is the Current Deck, one is the Retired Deck, and the remaining 10 boxes are named with these numbers:

  • 0-2-5-9
  • 1-3-6-0
  • 2-4-7-1
  • 3-5-8-2
  • 4-6-9-3
  • 5-7-0-4
  • 6-8-1-5
  • 7-9-2-6
  • 8-0-3-7
  • 9-1-4-8

Learning sessions are numbered from 0 to 9, then the numbering starts over again (i.e. 0, 1, 2, ..., 8, 9, 0, 1, 2, ...).

All cards begin in Deck Current. All cards in Deck Current are done at every learning session.

If a learner is successful at a card from Deck Current, it gets transferred to the deck that begins with that session's number. For example, if this is session 0, a successful card in Deck Current moves to box 0-2-5-9; If this is session 3, a successful card from Deck Current moves to box 3-5-8-2.

A box of cards is reviewed when its name contains the current session number. For example, if this is session 0, boxes 0-2-5-9, 1-3-6-0, 5-7-0-4, and 8-0-3-7 are done because they all contain the number 0.

If a reviewed card isn't successful, it moves back to Deck Current.

If a reviewed card is successful and the last number of its box matches the current session number, then that card moves to the Retired Deck. For example, if this is session 9 and you're reviewing box 0-2-5-9, then any successful cards from this box will move to the Retired Deck.

If a reviewed card is successful and the last number of its box doesn't match the current session number, then that card stays where it is.

The effect is identical to a 5-box Leitner system, however, whereas in that system each box represents the proficiency level of its contents, here each box represents the session in which it is done.

Usage

Basic flow might look something like this

export {
  addToUnknown,
  createLeitnerBox,
  moveToLearned,
  moveToLessons,
  setCurrentLesson,
  isLastLessonForCard,
  getCardsForCurrentLesson
} from 'leitner-box';

let cards = [
  { word: "learn", translation: "aprender" }
  { word: "box", translation: "caja" }
];

let leitnerBox = createLeitnerBox();

cards.forEach(card => {
  leitnerBox = addToUnknown(leitnerBox, card);
});

// then, after initial acquaintance we move cards from "unknown" to "lessons"
// for subsequent repetitions
cards.forEach(card => {
  const identity = ({ word }) => word === card.word;
  leitnerBox = moveToLessons(leitnerBox, identity);
});

// then, after we done with unknown we might want to move to the repetition
cards = getCardsForCurrentLesson(leitnerBox);

// and at some point switch current lesson
leitnerBox = setCurrentLesson(leitnerBox, (getCurrentLesson(leitnerBox) + 1) % 9);

// at the end we might want to put cards into "learned" box
// make sure to check if this is the last repetition for the card
cards.forEach(card => {
  const identity = ({ word }) => word === card.word;

  if (isLastLessonForCard(leitnerBox, identity)) {
    leitnerBox = moveToLearned(leitnerBox, identity);
  }
});

For more examples please consider looking into specs

Development notes

To create a new version do the following steps

  • Bump version in package.json
  • Create a new tag (for example git tag v1.0.10)
  • Push tags into origin git push origin --tags