Skip to content

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

License

Notifications You must be signed in to change notification settings

slcnguye/plusify

 
 

Repository files navigation

plusify NPM version Build Status

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

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

Install

Install with npm:

$ npm install plusify --save

Usage

var plusify = require('plusify');

plusify('fooBar');
//=> 'foo+bar'
plusify('fooBarBaz');
//=> 'foo+bar+baz'
plusify('foo bar');
//=> 'foo+bar'
plusify('foo barBaz');
//=> 'foo+bar+baz'
plusify('foo barBaz quux');
//=> 'foo+bar+baz+quux'

Related projects

Some other awesome string libs:

Running tests

Install dev dependencies:

$ npm install -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

Sang Nguyen

License

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


This file was generated by verb, v0.9.0, on March 11, 2017.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%