pad-left

WebJar for pad-left

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

pad-left
Последняя версия

Последняя версия

2.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

pad-left
WebJar for pad-left
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jonschlinkert/pad-left

Скачать pad-left

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pad-left/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pad-left</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pad-left/
implementation 'org.webjars.npm:pad-left:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/pad-left/
implementation ("org.webjars.npm:pad-left:2.1.0")
'org.webjars.npm:pad-left:jar:2.1.0'
<dependency org="org.webjars.npm" name="pad-left" rev="2.1.0">
  <artifact name="pad-left" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pad-left', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "pad-left" % "2.1.0"
[org.webjars.npm/pad-left "2.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : repeat-string jar [1.5.4,2)

Модули Проекта

Данный проект не имеет модулей.

pad-left NPM version NPM downloads Build Status

Left pad a string with zeros or a specified string. Fastest implementation.

You might also be interested in word-wrap.

Install

Install with npm:

$ npm install pad-left --save

Usage

var pad = require('pad-left');
pad(  '4', 4, '0') // 0004
pad( '35', 4, '0') // 0035
pad('459', 4, '0') // 0459

Benchmarks

Benchmarks for node.js v6.5.0 versus left-pad.

# benchmark/fixtures/10-custom-char.js (37 bytes)
  pad-left x 14,660,838 ops/sec ±1.43% (84 runs sampled)
  left-pad x 9,189,792 ops/sec ±1.36% (81 runs sampled)

# benchmark/fixtures/10.js (32 bytes)
  pad-left x 13,357,570 ops/sec ±1.91% (84 runs sampled)
  left-pad x 20,375,277 ops/sec ±1.40% (82 runs sampled)

# benchmark/fixtures/100-custom-char.js (38 bytes)
  pad-left x 13,671,301 ops/sec ±1.58% (83 runs sampled)
  left-pad x 8,917,004 ops/sec ±1.84% (79 runs sampled)

# benchmark/fixtures/100.js (34 bytes)
  pad-left x 15,442,944 ops/sec ±1.68% (81 runs sampled)
  left-pad x 7,850,636 ops/sec ±1.47% (83 runs sampled)

# benchmark/fixtures/1000-custom-char.js (40 bytes)
  pad-left x 13,624,072 ops/sec ±1.25% (84 runs sampled)
  left-pad x 5,907,915 ops/sec ±1.13% (86 runs sampled)

# benchmark/fixtures/1000.js (35 bytes)
  pad-left x 14,241,788 ops/sec ±1.23% (81 runs sampled)
  left-pad x 5,418,351 ops/sec ±1.52% (80 runs sampled)

Related projects

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 07, 2016.

Версии библиотеки

Версия
2.1.0
1.0.2