space - nodef/extra-string GitHub Wiki

Returns a string of spaces.

  • 5x Faster than ' '.repeat(n).
  • Uses cache & substr.
var space = require('@extra-string/space');
// space(<length>)

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

extra-string

⚠️ **GitHub.com Fallback** ⚠️