Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hokaccha/js-count-this
https://github.com/hokaccha/js-count-this
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hokaccha/js-count-this
- Owner: hokaccha
- Created: 2013-04-27T04:38:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-04-27T06:11:20.000Z (over 11 years ago)
- Last Synced: 2024-04-14T09:25:34.929Z (9 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JavaScriptのコード内のthisが代入されている変数名の数をカウントするよ。
それだけだよ。
## Install
```
$ npm install -g git://github.com/hokaccha/js-count-this.git
```## Example
```javascript
// target.jsfoo.forEach(function() {
var self = this;
});Foo.prototype.bar = function() {
var self = this;
};var foo = this;
foo.bar.baz[0] = this;bar = this;
var baz;
baz = this;var xxx = this.fuga.piyo
, hoge = this;let letSelf = this;
const constSelf = this;
``````
$ count-this target.js
self: 2
foo: 1
foo.bar.baz[0]: 1
bar: 1
baz: 1
hoge: 1
letSelf: 1
constSelf: 1
```