Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-a/simplify-string
Create a primitive representation of a string
https://github.com/s-a/simplify-string
Last synced: about 5 hours ago
JSON representation
Create a primitive representation of a string
- Host: GitHub
- URL: https://github.com/s-a/simplify-string
- Owner: s-a
- License: other
- Created: 2016-10-04T18:09:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-04T19:16:21.000Z (about 8 years ago)
- Last Synced: 2024-11-09T16:50:44.064Z (8 days ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 20
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# simplify-string
[![npm version](https://badge.fury.io/js/simplify-string.svg)](https://badge.fury.io/js/simplify-string)
[![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
[![Coverage Status](https://coveralls.io/repos/github/s-a/simplify-string/badge.svg?branch=master)](https://coveralls.io/github/s-a/simplify-string?branch=master)
> Create a primitive representation of a stringI use this lib in browser and in node. The goal is to remove all special chars from a string for different use cases. Create a human readable or SEO url tag from string. Create filenames and much more. I personally use it to create search index from strings and search user input strings from GUI passed through ```simplifyString``` to search with "some" kind of "more" fuzzy. It is especially interesting when u use firebase andwant to provide a full text search.
## Installation```sh
$ npm i --save simplify-string
```## Usage
```js
require("should");
var simplifyString = require("simplify-string");describe("simplify-string", function () {
it("should simplify a string", function () {
simplifyString("üöäÜÖÄ").should.equal("uoauoa");
simplifyString("andrè").should.equal("andre");
simplifyString("a ûnîcôrn likes honey").should.equal("aunicornlikeshoney");
});
});
```
## LicenseMIT © [s-a](https://github.com/s-a)
[npm-image]: https://badge.fury.io/js/simplify-string.svg
[npm-url]: https://npmjs.org/package/simplify-string
[travis-image]: https://travis-ci.org/s-a/simplify-string.svg?branch=master
[travis-url]: https://travis-ci.org/s-a/simplify-string
[daviddm-image]: https://david-dm.org/s-a/simplify-string.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/s-a/simplify-string
[coveralls-image]: https://coveralls.io/repos/s-a/simplify-string/badge.svg
[coveralls-url]: https://coveralls.io/r/s-a/simplify-string