Gathering detailed insights and metrics for auto-bind
Gathering detailed insights and metrics for auto-bind
Gathering detailed insights and metrics for auto-bind
Gathering detailed insights and metrics for auto-bind
npm install auto-bind
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
96.8
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (79.17%)
TypeScript (20.83%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
459 Stars
36 Commits
34 Forks
5 Watchers
1 Branches
7 Contributors
Updated on Jul 12, 2025
Latest Version
5.0.1
Package Id
auto-bind@5.0.1
Size
2.71 kB
NPM Version
7.20.3
Node Version
14.17.5
Published on
Oct 18, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
Automatically bind methods to their class instance
It also correctly binds inherited properties.
1npm install auto-bind
1import autoBind from 'auto-bind'; 2 3class Unicorn { 4 constructor(name) { 5 this.name = name; 6 autoBind(this); 7 } 8 9 message() { 10 return `${this.name} is awesome!`; 11 } 12} 13 14const unicorn = new Unicorn('Rainbow'); 15 16// Grab the method off the class instance 17const message = unicorn.message; 18 19// Still bound to the class instance 20message(); 21//=> 'Rainbow is awesome!' 22 23// Without `autoBind(this)`, the above would have resulted in 24message(); 25//=> Error: Cannot read property 'name' of undefined
Bind methods in self
to their class instance.
Returns the self
object.
Type: object
An object with methods to bind.
Type: object
Type: Array<string | RegExp>
Bind only the given methods.
Type: Array<string | RegExp>
Bind methods except for the given methods.
Same as autoBind
but excludes the default React component methods.
1import autoBindReact from 'auto-bind/react'; 2 3class Foo extends React.Component { 4 constructor(props) { 5 super(props); 6 autoBindReact(this); 7 } 8 9 // … 10}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More