You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 988B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # indent-string [![Build Status](https://travis-ci.org/sindresorhus/indent-string.svg?branch=master)](https://travis-ci.org/sindresorhus/indent-string)
  2. > Indent each line in a string
  3. ## Install
  4. ```
  5. $ npm install --save indent-string
  6. ```
  7. ## Usage
  8. ```js
  9. var indentString = require('indent-string');
  10. indentString('Unicorns\nRainbows', '♥', 4);
  11. //=> ♥♥♥♥Unicorns
  12. //=> ♥♥♥♥Rainbows
  13. ```
  14. ## API
  15. ### indentString(string, indent, count)
  16. #### string
  17. **Required**
  18. Type: `string`
  19. The string you want to indent.
  20. #### indent
  21. **Required**
  22. Type: `string`
  23. The string to use for the indent.
  24. #### count
  25. Type: `number`
  26. Default: `1`
  27. How many times you want `indent` repeated.
  28. ## Related
  29. - [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module
  30. - [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string
  31. ## License
  32. MIT © [Sindre Sorhus](http://sindresorhus.com)