Socket
Socket
Sign inDemoInstall

alien-bind

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

alien-bind

An implementation of bind that does not use Function.prototype.bind.


Version published
Maintainers
1
Created
Source

Alien Bind

An implementation of bind that does not use Function.prototype.bind (alien being the opposite of native).

Motivation

Many libraries such as underscore.js use the native bind function from Function.prototype however some people (ಠ_ಠ MooTools) like to overwrite this with a version that only works partially. Use this to be confident that bind will work as expected.

Installation

npm install alien-bind

Usage

Example shamelessly stolen from underscore.js.

var bind = require('alien-bind')
var func = function (greeting){ return greeting + ': ' + this.name }
func = bind(func, {name: 'moe'}, 'hi')
func()
// => 'hi: moe'

Compatibility

Tests pass in

  • IE8+
  • Chrome
  • Firefox
  • Opera

FAQs

Package last updated on 03 Jun 2015

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