https://github.com/willhackett/deli-space
Produces a string with groups of a custom padding value with a custom delimiter. Useful for generating credit card strings or blank strings with the correct length.
https://github.com/willhackett/deli-space
Last synced: 9 months ago
JSON representation
Produces a string with groups of a custom padding value with a custom delimiter. Useful for generating credit card strings or blank strings with the correct length.
- Host: GitHub
- URL: https://github.com/willhackett/deli-space
- Owner: willhackett
- License: mit
- Created: 2017-04-19T05:09:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:51:39.000Z (over 2 years ago)
- Last Synced: 2023-12-15T03:56:15.278Z (over 2 years ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
#deli-space
### Use:
Syntax is simple: `ds(padding, delimiter, group, group, group, ...groups)`
```javascript:
// es6 import
import ds from 'deli-space'
// commonjs require
const ds = require('deli-space')
ds('*', '-', 4, 5, 6)
// Outputs: "****-*****-******"
ds('•', ' ', 4, 4, 4, 4)
// Outputs: '•••• •••• •••• ••••')
```