make use of duktape buffer