@softonic/text-slug
v1.0.2
Published
TextSlug is a set of helpers to convert text to semantic url separated by hyphens and vice versa.
Downloads
542
Readme
TextSlug
TextSlug is a set of helpers to convert text to semantic url separated by hyphens and vice versa.
Active maintainer: [email protected]
Installation
Node
npm install @softonic/text-slug
Browser
The package is available as a UMD module: compatible with AMD, CommonJS and exposing a global variable TextSlug
in dist/TextSlug.js
.
It can be installed with npm...
npm install @softonic/text-slug
...or downloaded directly from Bitbucket:
https://bitbucket.org/softonic-development/text-slug
Documentation
Is available in the docs
folder after executing:
npm run doc
Usage
import { textToSlug, slugToText } from '@softonic/text-slug';
textToSlug('Some software by Softonic©!!!');
// return some-software-by-softonic
slugToText('some-software-by---softonic');
// return some software by softonic
Testing
Clone the repository and execute:
npm test
Contribute
- Fork it:
git clone ssh://[email protected]:softonic-development/text-slug.git
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some feature'
- Check the build:
npm run build
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D