Pay particular attention to the smfoote link provided.
The specific syntax you need to โloadโ the vacuum cleaners in node:
var dust = require('dustjs-linkedin'); dust.helper = require('dustjs-helpers');
Note that this is not what is written on the link, the document links that it should be dust.helper (S) with 's'.
You will not find this phrase anywhere on the main documentation site.
Apparently, it should be completely intuitively clear that everything should be so connected.
Sometimes I feel that people who do not document the impact of the significant changes they make to their projects are stealing my life. This particular gap in documentation crept in about 5 hours.
To help those souls who launched both npm install dustjs-linkedin AND npm install assistive vacuum cleaners and wonder why this doesnโt just work automatically (since this is practically what all the documentation on the site offers), I will recover errors, which you will usually have when you get this error here:
if( dust.helpers[name]){ ^
and then one of ...
TypeError: Cannot read property 'if' of undefined TypeError: Cannot read property 'math' of undefined TypeError: Cannot read property 'eq' of undefined TypeError: Cannot read property 'not eq' of undefined TypeError: Cannot read property 'ne' of undefined TypeError: Cannot read property 'lt' of undefined TypeError: Cannot read property 'gt' of undefined TypeError: Cannot read property 'select' of undefined TypeError: Cannot read property 'size' of undefined TypeError: Cannot read property 'tap' of undefined TypeError: Cannot read property 'contextDump' of undefined TypeError: Cannot read property 'idx' of undefined TypeError: Cannot read property 'sep' of undefined
Interestingly, if you assign dustjs helpers to "helpers" rather than "helpers", you get another error:
undefined:1 ").write("</form>").write("\n\n").helper("contextDump",ctx,{},null).write("\n\ ^ TypeError: Cannot call method 'write' of undefined
Itโs trivial to write a little code to detect when someone is trying to use something starting with โ@โ and say .. hey, you probably havenโt loaded into your auxiliary library ... and make it work in node and not- node ... or they can just fix the documentation.
I sincerely hope that the extra 15 minutes I spent to put together the answer that Google can make Grock will save someone else 5 hours that I just lost.
-ft