ss
simplify-string
npm i simplify-string
ss

simplify-string

Create a primitive representation of a string

by Stephan Ahlf

1.0.3 (see all)License:MITTypeScript:Not Found
npm i simplify-string
Readme

simplify-string

npm version Build Status Dependency Status Coverage Status

Create a primitive representation of a string

I 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

$ npm i --save simplify-string

Usage

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");
  });
});

License

MIT © s-a

Downloads/wk

79

GitHub Stars

21

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.3
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial