todo: rewrite shell script to node