https://github.com/afeiship/next-pad-start
Pad start for next.
https://github.com/afeiship/next-pad-start
pad pad-left pad-start
Last synced: 8 months ago
JSON representation
Pad start for next.
- Host: GitHub
- URL: https://github.com/afeiship/next-pad-start
- Owner: afeiship
- License: mit
- Created: 2017-08-17T03:20:02.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-11-21T02:34:54.000Z (over 5 years ago)
- Last Synced: 2025-09-13T06:48:55.580Z (9 months ago)
- Topics: pad, pad-left, pad-start
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-pad-start
> Pad start for next.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-pad-start
```
## usage
```js
import '@jswork/next-pad-start';
nx.padStart('abc', 3, '0'); // 'abc'
nx.padStart('abc', 5, '0'); // '00abc'
```
## other solution
```js
('0' + 1).slice(-2)
// "01"
('0' + 12).slice(-2)
// "12"
```
## license
Code released under [the MIT license](https://github.com/afeiship/next-pad-start/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-pad-start
[version-url]: https://npmjs.org/package/@jswork/next-pad-start
[license-image]: https://img.shields.io/npm/l/@jswork/next-pad-start
[license-url]: https://github.com/afeiship/next-pad-start/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-pad-start
[size-url]: https://github.com/afeiship/next-pad-start/blob/master/dist/next-pad-start.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-pad-start
[download-url]: https://www.npmjs.com/package/@jswork/next-pad-start