using helpers as well as filters in combination....
...does not work, at least not in a commonJs environment as the bootstrapping function relies on a global available dust instance.
@zaphod1984 sould you give a code example of how you are using them?
sure, no problem:
var dust = require('dustjs-helpers');
when requiring, the lib checks for a global available dust instance, if not available, it requires dust and exports it. (https://github.com/linkedin/dustjs-helpers/blob/master/lib/dust-helpers.js#L514) the filters lib just enhances dust if not in global context.
the filters module does the same. i do realize that both of the modules rely on dust being a singleton but it would be much nicer if both would behave the same and the enhancment with helpers and filters would be done in a more explizit way.
By the filters module, do you mean this:
https://github.com/linkedin/dustjs-filters-secure
exactly.
a sane way without clobbering the global namespace would be something like this:
var dust = require('dustjs-linkedin');
require('dustjs-filters-secure').enhance(dust);
require('dustjs-helpers').enhance(dust);
+1. The way that helpers currently works is nonsensical - if they are indeed helpers then they should augment dust, not just clobber it.
ie:
var dust = require('dustjs-linkedin');
require('dustjs-helpers')(dust)