open-index/open-npm huggingface dataset:
npm package: @mono424/interface-js
Description: Just a simple helper to create a self-checking constructor function
Author: mono424
Latest version: 0.0.2

# InterfaceJs
Just a simple helper to create a self-checking constructor function

## Get started
Install from npm
```
npm --save install @mono424/interface-js
```

Use :)

```
const interface = require('./interface');

// Create a interface constructor
const PrintInterface = interface.create([
    ["print", interface.TYPE.Function]
]);

// Create Class implementing the interface
class Foo extends PrintInterface {
    constructor() {
        super();
    }
    
    print() {
        console.log("Bar");
    }
}

// If you create an Item of the class it will check it
const item = new Foo();
```