dashify-unicode

1.0.2 • Public • Published

dashify-unicode

Convert a camelcase or space-separated string to a dash-separated string.

NPM

a Dashifier for JavaScript that Accepts Unicode Characters ( not just ASCII chars )

It is similar to dashify package, but it can also convert other characters in addition to ASCII chars.

Install

$ npm install dashify --save

Usage

const dashify = require("dashify");
const dashifyUnicode = require("dashify-unicode");
 
dashify("سلام، خوبی !?");
//=> ""
dashifyUnicode("سلام، خوبی !?");
//=> "سلام،-خوبی"
 
 
dashify("Hello دنیا !");
//=> "hello"
dashifyUnicode("Hello دنیا !");
//=> "hello-دنیا"
 
/*** They are similar in English ***/
dashify('fooBar');
//=> 'foo-bar'
dashify('fooBarBaz');
//=> 'foo-bar-baz'
dashify('foo bar');
//=> 'foo-bar'
dashify('foo barBaz');
//=> 'foo-bar-baz'
dashify('foo barBaz quux');
//=> 'foo-bar-baz-quux'
 
dashifyUnicode('fooBar');
//=> 'foo-bar'
dashifyUnicode('fooBarBaz');
//=> 'foo-bar-baz'
dashifyUnicode('foo bar');
//=> 'foo-bar'
dashifyUnicode('foo barBaz');
//=> 'foo-bar-baz'
dashifyUnicode('foo barBaz quux');
//=> 'foo-bar-baz-quux'

Thanks to @jonschlinkert

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    2
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i dashify-unicode

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

3.9 kB

Total Files

4

Last publish

Collaborators

  • smrsan