jsinterface
Define, enforce, and wrap duck-type interfaces to objects in Node JS
var jsInterface = ; jsInterface; var module1 = { } { } prop1: 'test' prop2: false; var module2 = { } prop2: false; // runs - no errorjsInterface; // returns trueconsole; // true // throws errortry jsInterface; catcherr console; // MissingPropertyError // returns falseconsole; // false // only interface fields & properties will be available on if1Module1var wrapped1 = jsInterface;console; // functionconsole; // undefined // throws errortry var wrapped2 = jsInterface; catcherr console; // MissingPropertyError