Class utilities for Node.js and JavaScript
Class utilities for Node.js and JavaScript
Installation ·
Usage ·
API
Follow @eldorplus and @httpiejs for updates!
---
@httpie/classes package provides a handful methods around classes in Node.js and JavaScript. For example, determine whether a given input is a class using the .isClass(input) method.```
npm i @httpie/classes
is pretty straightforward. Install and import the package and use it right away:`js
const { isClass } = require('@httpie/classes')isClass(class Rabbit {})
// true
isClass(function classLikeRabbitFunc () {})
// false
`
API
####
isClass(input)
Determine whether the given input is a class.`js
const { isClass } = require('@httpie/classes')isClass(class YourClass {})
// true
`
####
isFunction(input)
Determine whether the given input is a function.`js
const { isFunction } = require('@httpie/classes')isFunction(function sum () {})
// true
`
Contributing
Do you miss a class-related function? We very much appreciate your contribution! Please send in a pull request 😊1. Create a fork
2. Create your feature branch:
git checkout -b my-feature
3. Commit your changes: git commit -am 'Add some feature'
4. Push to the branch: git push origin my-new-feature`---
> httpiejs.com ·
> GitHub @httpie ·
> Twitter @httpiejs