https://github.com/gr2m/to-id
Normalises strings for comparison or usage as IDs
https://github.com/gr2m/to-id
Last synced: 11 months ago
JSON representation
Normalises strings for comparison or usage as IDs
- Host: GitHub
- URL: https://github.com/gr2m/to-id
- Owner: gr2m
- License: mit
- Created: 2015-05-17T10:48:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T20:48:31.000Z (about 2 years ago)
- Last Synced: 2024-10-29T23:47:16.159Z (over 1 year ago)
- Language: JavaScript
- Size: 664 KB
- Stars: 22
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# to-id
> Normalises strings for comparison or usage as IDs
[](https://travis-ci.org/gr2m/to-id)
[](https://codecov.io/gh/gr2m/to-id)
[](https://greenkeeper.io/)
## Usage
```js
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('안_형_준') // 안-형-준
```
## Installation
You can download [to-id.js](https://github.com/gr2m/tree/master/to-id.js)
and add it to your site using ``
Or install using [bower](http://bower.io/) for usage in browser:
```
bower install --save to-id
```
Install using [npm](https://npmjs.org/) for node.js or browserify:
```
npm install --save to-id
```
## Test
```
npm test
```
Tests are run with [testmate](https://github.com/gr2m/testmate).
In order to run them in a browser or through saucelabs,
set `TEST_CLIENT` accordingly, for example
```
TEST_CLIENT=selenium:firefox npm test
```