npm.io
2.0.20 • Published 6 years ago

@extra-string/space

Licence
MIT
Version
2.0.20
Deps
0
Size
2 kB
Vulns
0
Weekly
0
Stars
7
DeprecatedThis package is deprecated

Returns a string of spaces.

  • 5x Faster than ' '.repeat(n).
  • Uses cache & substr.

This is part of package extra-string.

var space = require('@extra-string/space');
// space(<length>)

space(4);  // '    '
space(6);  // '      '
space(0);  // ''
space(-1); // ''

extra-string

Keywords