At that point, we are venturing into LISP territory where the line between mini-language and library is truly thin (and sometimes non-existant like in the CL loop macro).
My standard: Can a common JS interpreter (say firefox) execute the code without modifications?
If that is true, then said "thing" is a library.