Socket
Book a DemoInstallSign in
Socket

binded

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binded

binded methods as pure functions

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

binded

NPM version Build Status Coveralls Status Dependency Status

binded methods as pure functions

Install

npm install --save binded

Usage

import binded from 'binded';

const { log, warn } = binded(console);
const { resolve, reject, all } = binded(Promise);

resolve('unicorns').then(log) // unicorns

binded(console); /*
  { log: [Function: bound bound ],
    info: [Function: bound bound ],
    warn: [Function: bound bound ],
    error: [Function: bound bound ],
    dir: [Function: bound bound ],
    time: [Function: bound bound ],
    timeEnd: [Function: bound bound ],
    trace: [Function: bound bound trace],
    assert: [Function: bound bound ],
    Console: [Function: bound Console] } */

binded(Promise); /*
  { resolve: [Function: bound resolve],
    all: [Function: bound all],
    race: [Function: bound race],
    reject: [Function: bound reject] } */

API

binded(input)

Return an Object with functions of methods binded to input, so you can use log from console without it throwing an Error.

input

Required
Type: Function or Object

Function Constructor or an Object.

License

MIT © Vladimir Starkov

Keywords

bind

FAQs

Package last updated on 05 Apr 2016

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