# openiban

> openiban.com client for node and the browser

Latest version **1.0.1** (published 2017-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install openiban
pnpm add openiban
yarn add openiban
bun add openiban
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-09-14 |
| First published | 2017-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Chris Grieger |
| Maintainers | fourcube |
| Keywords | openiban.com, iban, validation, iban, api |

## Links

- npm: https://www.npmjs.com/package/openiban
- Repository: https://github.com/fourcube/openiban.js
- Homepage: https://github.com/fourcube/openiban.js#readme
- Issues: https://github.com/fourcube/openiban.js/issues
- npm.io page: https://npm.io/package/openiban

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-09-14
- 1.0.0 — 2017-09-13
- 0.2.1 — 2017-09-13
- 0.2.0 — 2017-09-13

## README

# openiban.js

[![Build Status](https://travis-ci.org/fourcube/openiban.js.svg)](https://travis-ci.org/fourcube/openiban.js) [![npm version](https://img.shields.io/npm/v/openiban.svg)](https://www.npmjs.com/package/openiban)

[openiban.com](https://openiban.com) API client for node and the browser. TypeScript typings are included in the repository.

# Getting it

You can install openiban.js through npm or yarn.

`npm i -S openiban`

or

`yarn add openiban`

Or you can include it on your page through a CDN (e.g. unpkg):

```html
<script type="text/javascript" src="//unpkg.com/openiban.js@0.1.0/dist/openiban.browser.js"></script>
```

# Using it

openiban.js provides a Promise API to the openiban.com IBAN validation webservice.

## Node.js
```js
const Openiban = require('openiban');

openiban
  .validate('DE89370400440532013000')
  .then((result) => {
    // result.valid should be true
  })
  .catch((err) => {
    // some http error has occurred
  });
```

## Typescript

openiban.js also publishes Typescript declarations.

```typescript
import * as Openiban from 'openiban';

Openiban.validate('DE89370400440532013000')
  .then((r: ValidationResult) => {
    console.log(r);
    // {
    //   "valid": true,
    //   "messages": [
    //     "Bank code valid: 37040044"
    //   ],
    //   "iban": "DE89370400440532013000",
    //   "bankData": {
    //     "bankCode": "37040044",
    //     "name": "Commerzbank",
    //     "zip": "50447",
    //     "city": "Köln",
    //     "bic": "COBADEFFXXX"
    //   },
    //   "checkResults": {
    //     "bankCode": true
    //   }
    // }
  })
  .catch((e) => {
    // some http error has occurred
    console.error(e);
  })
```

## Browser

When `openiban.js` is loaded inside your browser, it will be available through the global variable `Openiban`.

```html

<html>
  <head>
    <script type="text/javascript" src="//unpkg.com/openiban.js@0.1.0/dist/openiban.browser.js"></script>
  </head>
  
  <body>
    <!-- ... -->

    <script type="text/javascript">
      Openiban
        .validate('DE89370400440532013000')
        .then((result) => {
          // result.valid should be true
        })
        .catch((err) => {
          // some http error has occurred
        });
    </script>
  </body>
</html>
```

---
_Source: https://npm.io/package/openiban · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
