/banksy

:city_sunrise: Street art between woofmark and horsey

Primary LanguageJavaScriptMIT LicenseMIT

banksy

Street art between woofmark and horsey

Install

npm install banksy --save

Features

Banksy helps you integrate the autocompletion features of horsey into a woofmark editor. It does this as unobtrusively as possible, by listening for a few events and running commands on your editor instance. Afterwards, the banksy instance destroys the horse when you're done with it, properly cleaning up after itself.

Usage

Granted that you want to integrate a horsey instance into a woofmark editor, you can use banksy to alleviate the load, as it can be pretty confusing to make the two work in tandem.

banksy(el, options)

After instantiating both the editor and the horse, use banksy to paint a bridge between the two.

var editor = woofmark(el);
var horse = horsey(el);
var bridge = banksy(el, {
  editor: editor,
  horse: horse
});

That's it, now horse will work as you'd expect on all types of input for the woofmark editor.

bridge.destroy()

To properly destroy the bridge, you can run bridge.destroy(). Note that this will destroy the horse instance as well, calling horse.destroy().

License

MIT