Rake's #pathmap method for JavaScript