@softonic/text-slug

1.0.2 • Public • Published

TextSlug

TextSlug is a set of helpers to convert text to semantic url separated by hyphens and vice versa.

Active maintainer: miquel.roset@softonic.com

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

  1. Fork it: git clone ssh://git@bitbucket.org:softonic-development/text-slug.git
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Added some feature'
  4. Check the build: npm run build
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D

Readme

Keywords

none

Package Sidebar

Install

npm i @softonic/text-slug

Weekly Downloads

291

Version

1.0.2

License

Apache-2.0

Last publish

Collaborators

  • softonic