https://github.com/czewail/node-is-class
Check if function is an ES6 class in Node.js
https://github.com/czewail/node-is-class
class es6 es6-class es6-function-class function
Last synced: 5 months ago
JSON representation
Check if function is an ES6 class in Node.js
- Host: GitHub
- URL: https://github.com/czewail/node-is-class
- Owner: czewail
- License: mit
- Created: 2019-01-17T06:44:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T06:43:06.000Z (over 7 years ago)
- Last Synced: 2025-06-27T21:24:04.691Z (11 months ago)
- Topics: class, es6, es6-class, es6-function-class, function
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/node-is-class)
[](https://www.npmjs.com/package/node-is-class)
[](https://www.npmjs.com/package/node-is-class)
[](https://github.com/czewail/node-is-class/blob/master/LICENSE)
# node-is-class
Check if function is an ES6 class (loose module)
> Does not use toString, use Reflect.ownKeys to check it
> Function.prototype.toString does not work with Proxy well
# Install
```bash
$ npm install --save node-is-class
```
# Usage
```js
const isClass = require('node-is-class')
console.log(isClass(class {}))
console.log(isClass(function() {}))
```
# Test
```bash
$ npm test
```
# License
MIT