https://github.com/smallhelm/gen-css-identifier
Generate a unique css class or id name.
https://github.com/smallhelm/gen-css-identifier
Last synced: about 1 year ago
JSON representation
Generate a unique css class or id name.
- Host: GitHub
- URL: https://github.com/smallhelm/gen-css-identifier
- Owner: smallhelm
- License: mit
- Created: 2015-12-03T05:46:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-03T06:16:03.000Z (over 10 years ago)
- Last Synced: 2025-02-04T22:28:06.123Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gen-css-identifier
Generate a unique css class or id name.
```js
var gen = require("gen-css-identifier");
//just a simple function that returns a string
gen();// -> g1
gen();// -> g2
...
...
gen();// -> gz2a
//by default they are prefixed with "g"
//you can use the factory to set your own prefix
var factory = require("gen-css-identifier/factory");
var myGen = factory("my-prefix-");
myGen();// -> my-prefix-2zq
myGen();// -> my-prefix-2zr
```
## unique?
Not globally unique, only unique to the current executing process.
## License
MIT