# andreypopp/autobind-decorator

Decorator to automatically bind methods to class instances

Repository: https://github.com/andreypopp/autobind-decorator
Canonical: https://ross.abutalabs.com/products/autobind-decorator
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2023-01-03T15:19:36+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4162, "days_push": 1338, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1444, forks 65 (observed 2026-08-28T04:04:44.956343+00:00)

## What it is
A JavaScript class and method decorator that automatically binds methods to class instances so `this` is always correct, even when methods are detached. It is commonly used in React components to avoid repeated `.bind(this)` calls when passing methods as event handlers.

## Use cases
- bind react event handlers without .bind(this)
- automatically bind class methods to instances in javascript
- pass detached methods as callbacks while preserving this
- use decorators with babel or typescript to bind methods
- avoid binding methods in class component constructors

## When to choose
- you use class-based React components and pass methods as props or handlers
- you want a small decorator-based solution with TypeScript typings included
- you already use Babel with legacy decorator support

## When to avoid
- you use functional React components with hooks instead of classes
- your build setup does not support decorators (legacy or modern spec)
- you need a library under active development with frequent updates

## Facets
- artifact type: library
- maturity: maintenance
- function: middleware, developer-tools
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: javascript-decorators, this-binding, react, babel, typescript, nodejs, javascript

## Member repositories
- andreypopp/autobind-decorator (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:44.956343+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:36:17.299033+00:00, confidence not recorded.
  - readme: https://github.com/andreypopp/autobind-decorator (fetched 2026-08-28T04:04:44.956343+00:00, sha f207330624d1)
  - registry_npm: https://registry.npmjs.org/autobind-decorator (fetched 2026-08-29T11:46:32.013106+00:00, sha 909d9c698d01)
- Data as of 2026-08-30T08:39:29.467469+00:00.
