Couldn't you accomplish this with djbdns' dnsrewrite or pdns_recursor's lua scripting?
Why anyone would want to write DNS server (=something that needs to be very fast) in Javascript is beyond my comprehension. The ASCII art is probably better work than the DNS server.