Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iguntur/object-class
Expose `prototype` and `static` method of class
https://github.com/iguntur/object-class
Last synced: about 12 hours ago
JSON representation
Expose `prototype` and `static` method of class
- Host: GitHub
- URL: https://github.com/iguntur/object-class
- Owner: iguntur
- License: mit
- Created: 2016-12-23T02:59:30.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T03:16:42.000Z (almost 8 years ago)
- Last Synced: 2024-11-03T16:03:52.040Z (5 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# object-class [![Build Status](https://travis-ci.org/iguntur/object-class.svg?branch=master)](https://travis-ci.org/iguntur/object-class)
> Expose `prototype` and `static` method of class
## Install
```
$ npm install --save object-class
```## Usage
```js
const objectClass = require('object-class');class Foo {
constructor() {
this.props = 'bar';
}
static staticMethod1() {}
static staticMethod2() {}
prototypeMethod1() {}
prototypeMethod2() {}
}console.log(Foo);
//=> [Function: Foo]console.log(new Foo());
//=> Foo { props: 'bar' }console.log(objectClass.staticOf(Foo));
//=> ['staticMethod1', 'staticMethod2']console.log(objectClass.prototypeOf(Foo));
//=> ['prototypeMethod1', 'prototypeMethod2']
```## API
### objectClass.staticOf(input)
Returns an array from function name of input
### objectClass.prototypeOf(input)
Returns an array from function name of input
#### input
Type: `function`
## License
MIT © [Guntur Poetra](http://guntur.starmediateknik.com)