ruban-providers
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

ruban-providers

This is a sub module of ruban.js

Installation

npm install ruban-providers

Usage Examples

HttpProvider

You can pass with the options object the timeout and all known HTTP headers.

import {HttpProvider} from 'ruban-providers';

const options = {
    timeout: 20000,
    headers: [
        {
            name: 'Access-Control-Allow-Origin', value: '*'
        },
        ...
    ]
};

const httpProvider = new HttpProvider('http://localhost:8545', options); 

ProviderResolver

The ProviderResolver resolves an url or an given provider object to the correct provider class. Because of the resolves does ruban has internally just one provider interface and we have no direct dependency to third party providers.

import {ProviderResolver} 'ruban-providers';

const socketProviderAdapter = new ProviderResolver().resolve('http://localhost:8545');

Types

All the typescript typings are placed in the types folder.

Readme

Keywords

none

Package Sidebar

Install

npm i ruban-providers

Weekly Downloads

0

Version

0.1.5

License

LGPL-3.0

Unpacked Size

242 kB

Total Files

10

Last publish

Collaborators

  • fengxiao.guo