1.2.4 • Published 10 years ago

pretty-selectors v1.2.4

Weekly downloads
42
License
MIT
Repository
-
Last release
10 years ago

Pretty Selectors

Pretty selectors take your ugly text and transform it to nice CSS selectors.

Installation

npm install pretty-selectors

Input/Output example

npm.io

Code example

var PrettySelectors = require('pretty-selectors');

var selector = PrettySelectors('Moje mama', {separator: 'snake',
                                selector: 'id',
                                maxWords: 3});
// result: #moje_mama

Api

PrettySelectors(text, object)

text (string) – required

object.separator (string, default: 'dash') – optional

Options: dash, snake, camel

object.selector (string) – optional, default: 'class'

Options: class, id, element

object.maxWords (number) – optional, default: 0 means no text stripping

object.fallbackSelectorPrefix (string) – optional

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago

0.0.1

11 years ago