This light weight (2K min.js) allows you to get some rails style helpers in your JavaScript projects.
"awesome".at(1); // "w"
"my awesome string".capitalize(); // "My awesome string"
"85".currency(); // "$85.00"
cost = 85.67; cost.currency(); // "$85.67"
"word".first(3); // "wor"
[[1,1],[2,2]].flatten(); // [1,1,2,2]
"word".last(3); // "ord"
" my AWesome string ".parameterize(); // "my-awesome-string"
"my awesome string".titlecase(); // "My Awesome String"
" my awesome string ".trim(); // "my awesome string"
"my awesome string".truncate(10); // "my awesome..."
"my awesome string".truncate(10,"[...]"); // "my awesome[...]"
10.0.to_s(); // "10"
"10.5".to_i(); // 10
"10.3".to_f(); // 10.3
"test".to_a(); // ["test"]
[1,2,3].any(); // true
[].any(); // false
"".any(); // false
{foo: "bar"}.any() // true
Documentation Page: http://skorecky.github.com/JShelper/
The helper.js file is tested with qUinit and you can see the test suite at http://skorecky.github.com/JShelper/test/
This file is also regurally tested at http://jshint.com
Simply include helper.js in your html file before anything that calls it.
<script type="text/javascript" src="https://raw.github.com/skorecky/JShelper/master/helpers.min.js"></script>
It's written in pure JavaScript so it should work nicely with any JS Framework / Library.