hebrides

Extensible module APIs

Usage no npm install needed!

<script type="module">
  import hebrides from 'https://cdn.skypack.dev/hebrides';
</script>

README

Hebrides
npm version build status

Helper for creating pluggable module APIs

var use = require('hebrides');
var api = {
  foo() {
    return 'hello';
  },
  use
};

var api2 = api.use({
  bar(obj, a) {
    return obj.foo() + ' world' + a;
  }
});

typeof api.bar //⇒ "undefined"
api2.bar('!') //⇒ "hello world!"

Licence

MIT