open-index/open-npm huggingface dataset:
npm package: @flasd/spaced-repetition
Description: Simple spaced repetition algorithm
Author: Marcel Coelho
Latest version: 0.1.1

# spaced-repetition

Simple spaced-repetition algorithm based on supermemo 2.

[![Build Status](https://travis-ci.org/flasd/spaced-repetition.svg?branch=master)](https://travis-ci.org/flasd/spaced-repetition)
[![Coverage Status](https://coveralls.io/repos/github/flasd/spaced-repetition/badge.svg?branch=master)](https://coveralls.io/github/flasd/spaced-repetition?branch=master)
[![npm version](https://badge.fury.io/js/spaced-repetition.svg)](https://www.npmjs.com/package/@flasd/spaced-repetition)
[![npm downloads per month](https://img.shields.io/npm/dm/spaced-repetition.svg)](https://www.npmjs.com/package/@flasd/spaced-repetition)

## Installation

Install the latest version of spaced-repetition:

```
yarn add @flasd/spaced-repetition

// or

npm install @flasd/spaced-repetition --save
```

Now you can use it in your index.html

```html
<script
  type="text/javascript"
  src="./node_modules/@flasd/spaced-repetition/dist/index.umd.js"
></script>

const { SpacedRepetition, getDueCards } = window.SpacedRepetition;
```

Or import it as a module.

```javascript
const { SpacedRepetition } = require('@flasd/spaced-repetition');

// or, in ES6+

import { SpacedRepetition } from '@flasd/spaced-repetition';
```

This module is [UMD](https://github.com/umdjs/umd) compliant, therefore it's compatible with RequireJs, AMD, CommonJs 1 & 2, etc.

## API & Usage.

#### SpacedRepetition class

Method signature:

```typescript
new SpacedRepetition(): SpacedRepetition;
```

```javascript
import { SpacedRepetition } from '@flasd/spaced-repetition';

const sr = new SpacedRepetition();

// or

const sr = new SpacedRepetition({
  debug: false,
  nowFn: () => Date.now(),
});
```

`nowFunction` should be a function that returns a number in milliseconds. `debug`
flag will enable console.logs with extra information.

#### getDueCards();

Method signature:

```typescript
getDueCards(
  cards: ISpacedRepetitionCard[],
  reviews: ISpacedRepetitionReview[],
): Array<[ISpacedRepetitionCard, TRepetition]>;
```

This method returns a list of cards that are due (or overdue) for review:

```javascript
import { SpacedRepetition, getDueCards } from '@flasd/spaced-repetition';

const cards = [{ id: '1' }, { id: '2' }, { id: '3' }];

const reviews = [
  { card: '1', timestamp: Date.now(), difficulty: 1 },
  { card: '2', timestamp: Date.now(), difficulty: 2 },
  { card: '3', timestamp: Date.now(), difficulty: 3 },
];

new SpacedRepetition().getDueCards(cards, reviews);
// « [[{ id: '1' }, 18568], { id: '2' }, 18565]

getDueCards(cards, reviews);
// « [[{ id: '1' }, 18568], { id: '2' }, 18565]
```

The return value is a tupple `[ISpacedRepetitionCard, TRepetition]`, where TRepetition is the next day (counting since date epoch, as a integer) that this card should be repeated. Only cards with TRepetition <= today will be returned.

### Copyright & License

Copyright (c) 2020 [Marcel de Oliveira Coelho](https://github.com/flasd) under the [MIT License](https://github.com/flasd/spaced-repetition/blob/master/LICENSE.md). Go Crazy. :rocket:
npm package: @flasd/stay-fresh
Description: Watches for uninstalled dependencies
Author: Marcel Coelho
Latest version: 2.0.2

# stay-fresh

Ensuring all dependencies are properly installed is crucial for smooth development and CI processes. Missing dependencies can lead to unexpected errors and failed builds.

This package helps you avoid these issues by checking for missing dependencies and optionally installing them before running your development server or CI commands.

### Installation

```sh
yarn add @flasd/stay-fresh
```

### Usage

Run the following command in your project directory before starting your development server or in your CI pipeline:

```sh
stay-fresh check [--install]
```

### Options

- `--install`: Installs missing dependencies before running the command.

### Features

- Detects missing dependencies by comparing `package.json` with installed modules.
- Supports multiple package managers (npm, yarn, pnpm, bun).
- Automatically detects the package manager based on lock files.
- Option to automatically install missing dependencies.

### Example

```sh
$ stay-fresh check
🔍 Found 2 missing dependencies:
  - lodash
  - express

$ stay-fresh check --install
🔍 Found 2 missing dependencies:
  - lodash
  - express
🚀 Installing missing dependencies...
📦 Detected npm as the package manager.
... (installation output)
✅ All dependencies have been installed!
```

### Recommended Setup

Add stay-fresh to your npm scripts in `package.json`:

```json
{
  "scripts": {
    "predev": "stay-fresh check --install",
    "dev": "your-dev-command"
  }
}
```

For Git hooks, you can use Husky to run stay-fresh on checkout and pull. First, install Husky:

```sh
yarn add husky
```

Then, add the following to your `package.json`:

```json
{
  "scripts": {
    "prepare": "husky"
  }
}
```

and run the following command:

```sh
echo "post-checkout" > .husky/post-checkout
echo "post-merge" > .husky/post-merge
```

Now open the created files and replace the content with the following:

```sh
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

yarn stay-fresh check --install

```

Do the same for the `post-merge` file.

Done! 🎉

This setup ensures that your dependencies are always up-to-date:

1. Before running your development server, stay-fresh will automatically check and install any missing dependencies.
2. After pulling changes or switching branches, stay-fresh will run automatically to ensure your local environment matches the project requirements.

By integrating stay-fresh into your workflow, you'll maintain a consistent development environment across your team and prevent errors caused by missing or outdated dependencies. This approach streamlines your development process and helps avoid "it works on my machine" scenarios, leading to smoother collaboration and more reliable CI/CD pipelines.
npm package: @flasd/whatsapp-formatting
Description: WhatsApp allows you to format selected text inside your messages.
Author: Marcel Coelho
Latest version: 0.2.0

# whatsapp formatting for the web

[![Build Status](https://travis-ci.org/flasd/whatsapp-formatting.svg?branch=master)](https://travis-ci.org/flasd/whatsapp-formatting)
[![Coverage Status](https://coveralls.io/repos/github/flasd/whatsapp-formatting/badge.svg?branch=master)](https://coveralls.io/github/flasd/whatsapp-formatting?branch=master)
[![npm version](https://badge.fury.io/js/@flasd/whatsapp-formatting.svg)](https://www.npmjs.com/package/@flasd/whatsapp-formatting)
[![npm downloads per month](https://img.shields.io/npm/dm/@flasd/whatsapp-formatting.svg)](https://www.npmjs.com/package/@flasd/whatsapp-formatting)

What if you could use an awesome text formatting syntax that millions of people are already used to in your app? Oh wait! You can! cue Whatsapp formatting. You can use \*bold\*, \_italic\_, \~strikethrough\~, \`\`\`monospace\`\`\`, or \`inline code\`. (it's only 510 bytes gzip!)

## Installation

```shell
$ yarn add @flasd/whatsapp-formatting

// or if you are feeling old school
$ npm install @flasd/whatsapp-formatting
```

## Usage

The API is very very simple.

````javascript
import { format } from "@flasd/whatsapp-formatting";

format("*hello* _world_");
// « '<strong>hello</strong> <i>world</i>'

format("~how are you?~");
// « '
how are you?
'

format("```monospace text```");
// « '<code>monospace text</code>'

format("`inline code`");
// « '<code>inline code</code>'

format(`
multiline
string
`);
// « '<br>multiline<br>string<br>'
````

## Supported Formatting

This library supports the following WhatsApp text formatting:

- **Bold**: `*text*` → `<strong>text</strong>`
- **Italic**: `_text_` → `<i>text</i>`
- **Strikethrough**: `~text~` → `
text
`
- **Monospace**: ` ```text``` ` → `<code>text</code>`
- **Inline Code**: `` `text` `` → `<code>text</code>`
- **Line breaks**: `\n` → `<br>`

You can mix and match all of the formatters. OH! And you can customize the formatting rules if you want to:

```javascript
import { format, whatsappRules } from "@flasd/whatsapp-formatting";

const customRules = [
  ...whatsappRules,
  {
    wildcard: "|",
    openTag: '<span style="font-family:monospace">',
    closeTag: "</span>",
  },
];

format("|some awesome code|", customRules);
// « '<span style="font-family:monospace">some awesome code</span>'
```

## MIT License

Copyright 2020 Marcel de Oliveira Coelho under the [MIT License](https://github.com/flasd/whatsapp-formatting/blob/master/LICENSE).
Go Crazy. :rocket: