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 🙏

© 2026 – Pkg Stats / Ryan Hefner

slovak-iban-validator

v0.4.0

Published

A TypeScript library for validating Slovak IBAN numbers

Readme

Slovak IBAN Validator

A TypeScript library for validating Slovak IBAN numbers and retrieving bank information. Includes integration with Yup and Zod validation libraries.

Installation

npm install slovak-iban-validator

# If using with Yup
npm install yup

# If using with Zod
npm install zod

Usage

Basic Usage

import { SlovakIBANValidator } from "slovak-iban-validator";

// Validate an IBAN with full details
const result = SlovakIBANValidator.validateIBAN("SK5911000000002610001237");
console.log(result);
// Output:
// {
//   valid: true,
//   errors: [],
//   formatted: 'SK59 1100 0000 0026 1000 1237',
//   bank_swift: 'TATRSKBX',
//   bank_name: 'Tatra banka, a.s.'
// }

// Example with invalid IBAN
const invalidResult = SlovakIBANValidator.validateIBAN("SK001234");
console.log(invalidResult);
// Output:
// {
//   valid: false,
//   errors: [
//     'Invalid length: expected 24 characters, got 7',
//     'Invalid format: IBAN should contain only digits after country code'
//   ],
//   formatted: null,
//   bank_swift: null,
//   bank_name: null
// }

Using with Yup

import { createYupValidator } from "slovak-iban-validator";
import * as yup from "yup";

// Create a schema with Slovak IBAN validation
const schema = yup.object({
  iban: createYupValidator().required(),
});

// Validate the IBAN
try {
  const result = await schema.validate({ iban: "SK3112000000198742637541" });
  console.log(result);
  // Output: { iban: 'SK31 1200 0000 1987 4263 7541' }
} catch (error) {
  console.error(error.errors);
}

Using with Zod

import { createZodValidator } from "slovak-iban-validator";
import { z } from "zod";

// Create a schema with Slovak IBAN validation
const schema = z.object({
  iban: createZodValidator(),
});

// Validate the IBAN
const result = schema.safeParse({ iban: "SK3112000000198742637541" });
if (result.success) {
  console.log(result.data);
  // Output: {
  //   iban: {
  //     raw: 'SK3112000000198742637541',
  //     formatted: 'SK31 1200 0000 1987 4263 7541',
  //     bank_name: 'Tatra banka, a.s.',
  //     bank_swift: 'TATRSKBX',
  //     valid: true
  //   }
  // }
} else {
  console.error(result.error);
}

Internationalization

The validator supports both Slovak (default) and English error messages. You can change the language using the setLanguage method:

import { SlovakIBANValidator } from "slovak-iban-validator";

// Use English messages
SlovakIBANValidator.setLanguage('en');

// Use Slovak messages (default)
SlovakIBANValidator.setLanguage('sk');

// Example with Slovak messages
const result = SlovakIBANValidator.validateIBAN("SK001234");
console.log(result);
// Output:
// {
//   valid: false,
//   errors: [
//     'Nesprávna dĺžka: očakávaných 24 znakov, zadaných 7',
//     'Nesprávny formát: IBAN by mal obsahovať iba číslice za kódom krajiny'
//   ],
//   formatted: null,
//   bank_swift: null,
//   bank_name: null
// }

Features

  • Comprehensive IBAN validation
  • Detailed error messages
  • Formatted IBAN output
  • Bank information retrieval (name and SWIFT code)
  • TypeScript support with full type definitions
  • Integration with Yup and Zod validation libraries

Validation Result

The validateIBAN method returns an object with the following properties:

  • valid: boolean - indicates if the IBAN is valid
  • errors: string[] - list of validation errors (empty if valid)
  • formatted: string | null - IBAN formatted with spaces for readability
  • bank_swift: string | null - SWIFT/BIC code of the bank
  • bank_name: string | null - Name of the bank

License

MIT