simplify-string

1.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i simplify-string

Weekly Downloads

70

Version

1.0.3

License

MIT

Last publish

Collaborators

  • s-a