Rake's #pathmap method for javascript