open-index/open-npm huggingface dataset:
npm package: @scrapiloo/apr
Description: ## @scrapiloo/apr
Author: Carl Viktor Svensson
Latest version: 0.1.4

# Effective Interest (APR) Calculator

## @scrapiloo/apr

A simple Javascript implementation of the annual percentage rate formula described in [the EU directive (2008/48/EC) on credit agreements for consumers](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32008L0048#d1e32-84-1).

## Installation

```bash
# using yarn
yarn add @scrapiloo/apr

# using npm
npm i @scrapiloo/apr
```

## Usage

```typescript
import calculate from "@scrapiloo/apr"

const calculation = calculate({
  creditAmount: 50_000,
  months: 12 * 8, // 8 years
  nominalInterestRate: 0.0618, // 6.18 %
  monthlyAdminFee: 0,
  setupFee: 395,
});

console.log("APR:", calculation.getAPR()); // ~6.58 %
console.log("Monthly payment:", calculation.getMonthlyPayment()); // ~661 
console.log("Payment breakdown:", calculation.getPayments());
```
npm package: @scrapiloo/regex-tokenizer
Description: Minimal Regex Tokenizer.
Author: Carl Viktor Svensson
Latest version: 0.1.2

# Regex Tokenizer

Minimal Regex Tokenizer.

## Installation

```bash
# NPM
npm i @scrapiloo/regex-tokenizer

# Yarn
yarn add @scrapiloo/regex-tokenizer
```

## Usage

To use the tokenizer, call the `tokenize()` function with a regular expression as input.

```typescript
import tokenize from "@scrapiloo/regex-tokenizer";

const tokens = tokenize("(.+)@(?!gmail.com)");
console.log(tokens);
```

The code above will return the following output:

```javascript
[
  Token [”(”] {
    type: 'capture-group-perimeter', 
    value: '(', 
    scope: 'root capture-group'
  },
  Token [”.”] {
    type: 'character',
    value: '.',
    scope: 'root capture-group'
  },
  Token [”+”] {
    type: 'quantifier',
    value: '+',
    scope: 'root capture-group'
  },
  Token [”)”] {
    type: 'capture-group-perimeter',
    value: ')',
    scope: 'root capture-group'
  },
  Token [”@”] { 
    type: 'character', 
    value: '@', 
    scope: 'root' 
  },
  Token [”(”] {
    type: 'lookaround-perimeter',
    value: '(',
    scope: 'root negative-lookaround'
  },
  Token [”?!”] {
    type: 'lookaround-type',
    value: '?!',
    scope: 'root negative-lookaround'
  },
  Token [”g”] {
    type: 'character',
    value: 'g',
    scope: 'root negative-lookaround'
  },
  Token [”m”] {
    type: 'character',
    value: 'm',
    scope: 'root negative-lookaround'
  },
  Token [”a”] {
    type: 'character',
    value: 'a',
    scope: 'root negative-lookaround'
  },
  Token [”i”] {
    type: 'character',
    value: 'i',
    scope: 'root negative-lookaround'
  },
  Token [”l”] {
    type: 'character',
    value: 'l',
    scope: 'root negative-lookaround'
  },
  Token [”.”] {
    type: 'character',
    value: '.',
    scope: 'root negative-lookaround'
  },
  Token [”c”] {
    type: 'character',
    value: 'c',
    scope: 'root negative-lookaround'
  },
  Token [”o”] {
    type: 'character',
    value: 'o',
    scope: 'root negative-lookaround'
  },
  Token [”m”] {
    type: 'character',
    value: 'm',
    scope: 'root negative-lookaround'
  },
  Token [”)”] {
    type: 'lookaround-perimeter',
    value: ')',
    scope: 'root negative-lookaround'
  }
]
```