All Projects → jonschlinkert → Dashify

jonschlinkert / Dashify

Licence: mit
Convert a camelcase or space-separated string to a dash-separated string.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dashify

Bitcoin Wordpress Plugin
GoUrl Official Bitcoin Payment Gateway for Wordpress 3.5+ (or higher). Sell Products, Files, Digital Downloads, Membership on your website. Accept Bitcoin, Litecoin, Dogecoin, Darkcoin, Reddcoin, etc Payments Online. Use Pay-Per-Download, Pay-Per-Product, Pay-Per-Membership, Pay-Per-Page/Video-Access on your website. It is Easy!
Stars: ✭ 49 (-30.99%)
Mutual labels:  dash
Str
A SIMD optimized fixed-length string class along with an adaptive hash table for fast searching
Stars: ✭ 60 (-15.49%)
Mutual labels:  string
Better Strings
Java String Interpolation Plugin
Stars: ✭ 66 (-7.04%)
Mutual labels:  string
Golang Combinations
Golang library which provide an algorithm to generate all combinations out of a given string array.
Stars: ✭ 51 (-28.17%)
Mutual labels:  string
Dash Docset Builder
Dash Docset Builder in PHP.
Stars: ✭ 54 (-23.94%)
Mutual labels:  dash
String Interner
A data structure to efficiently intern, cache and restore strings.
Stars: ✭ 60 (-15.49%)
Mutual labels:  string
Slugify Cli
Slugify a string
Stars: ✭ 49 (-30.99%)
Mutual labels:  slug
Sluggish
Toy CPU and GPU implementations of the Slug rendering algorithm
Stars: ✭ 70 (-1.41%)
Mutual labels:  slug
Cape
String encryption for Arduino, limited microcontrollers and other embedded systems.
Stars: ✭ 58 (-18.31%)
Mutual labels:  string
Fitly
Self hosted web analytics for endurance athletes
Stars: ✭ 65 (-8.45%)
Mutual labels:  dash
Cargo Docset
Cargo subcommand to generate a Dash/Zeal docset for your Rust packages.
Stars: ✭ 53 (-25.35%)
Mutual labels:  dash
Cryptocurrency Dashboard
Crypto Currency Dashboard Using Twitter 🐦 And Coinmarketcap 🚀 API
Stars: ✭ 54 (-23.94%)
Mutual labels:  dash
Fuzzy Swift
🔍 simple and fast fuzzy string matching in Swift
Stars: ✭ 61 (-14.08%)
Mutual labels:  string
Speakingurl
Generate a slug – transliteration with a lot of options
Stars: ✭ 1,056 (+1387.32%)
Mutual labels:  slug
Unis
UNIS: A Common Architecture for String Utilities within the Go Programming Language.
Stars: ✭ 69 (-2.82%)
Mutual labels:  string
Xible
Visualize your workflow
Stars: ✭ 49 (-30.99%)
Mutual labels:  string
String Calc
PHP calculator library for mathematical terms (expressions) passed as strings
Stars: ✭ 60 (-15.49%)
Mutual labels:  string
Indigo Player
Highly extensible, modern, JavaScript video player. Handles MPEG-Dash / HLS / MPEG-4 and is built on top of the HTML5 video element.
Stars: ✭ 1,173 (+1552.11%)
Mutual labels:  dash
Slugifier
Just a simple, clean and pure functional implementation for creating slugs
Stars: ✭ 69 (-2.82%)
Mutual labels:  slug
String Pixel Width
Blazingly fast measure string width in pixels on the server in Javascript (Node.Js)
Stars: ✭ 65 (-8.45%)
Mutual labels:  string

dashify NPM version NPM monthly downloads NPM total downloads Linux Build Status

Convert a camelcase or space-separated string to a dash-separated string. ~12 sloc, fast, supports diacritics.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.

Install

Install with npm:

$ npm install --save dashify

Why another dashify lib?

Most slugify libs cover way too many corner cases and are bloated and slow as a result. I made this as a fast and light alternative (it even supports diacritics in ~12 sloc).

Usage

var dashify = require('dashify');

console.log(dashify('fooBar'));
//=> 'foo-bar'

console.log(dashify('fooBarBaz'));
//=> 'foo-bar-baz'

console.log(dashify('foo bar'));
//=> 'foo-bar'

console.log(dashify('foo barBaz'));
//=> 'foo-bar-baz'

console.log(dashify('foo barBaz quux'));
//=> 'foo-bar-baz-quux'

console.log(dashify('São Tomé and Príncipe'));
//=> 'são-tomé-and-príncipe'

options.condense

Type: boolean

Default: undefined

Condense multiple consecutive dashes to one.

console.log(dashify('Foo----Bar'));
//=> 'foo----bar'

console.log(dashify('Foo----Bar', {condense: true}));
//=> 'foo-bar'

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

Other awesome string libs you might like:

Contributors

Commits Contributor
23 jonschlinkert
1 der-On
1 jeffreypriebe

Author

Jon Schlinkert

License

Copyright © 2018, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on November 19, 2018.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].