Normalises strings for comparison or usage as IDs
toId('Inside a $34 smartphone') // inside-a-34-smartphone
toId('Kore: a fast web server') // kore-a-fast-webserver
toId(' L. (YC S15) - Is Hiring ') // l-yc-s15-is-hiring
toId('안_형_준') // 안-형-준
You can download to-id.js
and add it to your site using <script src="to-id.js"></script>
Or install using bower for usage in browser:
bower install --save to-id
Install using npm for node.js or browserify:
npm install --save to-id
npm test
Tests are run with testmate.
In order to run them in a browser or through saucelabs,
set TEST_CLIENT
accordingly, for example
TEST_CLIENT=selenium:firefox npm test