Socket
Socket
Sign inDemoInstall

dashify-unicode

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dashify-unicode

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


Version published
Weekly downloads
1
Maintainers
1
Install size
3.81 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 31 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc