JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 705221
  • Score
    100M100P100Q178595F
  • License MIT

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

Package Exports

  • dashify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dashify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dashify NPM version Build Status

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

I'm using this for converting object keys to dash-case. Most slugify libs are too heavy for this, so I made this as a fast and light alternative.

Install

Install with npm:

$ npm i dashify --save

Usage

var dashify = require('dashify');

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'

Some other awesome string libs:

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

If this project doesn't do what you need, please let us know!

Author

Jon Schlinkert

License

Copyright © 2015-2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb on January 03, 2016.