Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openiban

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openiban

openiban.com client for node and the browser

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

openiban.js

Build Status npm version

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):

<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

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.

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>
  <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>

Keywords

FAQs

Package last updated on 14 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc