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.

пре 3 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # redent [![Build Status](https://travis-ci.org/sindresorhus/redent.svg?branch=master)](https://travis-ci.org/sindresorhus/redent)
  2. > [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string)
  3. ## Install
  4. ```
  5. $ npm install --save redent
  6. ```
  7. ## Usage
  8. ```js
  9. const redent = require('redent');
  10. redent('\n foo\n bar\n', 1);
  11. //=> '\n foo\n bar\n'
  12. ```
  13. ## API
  14. ### redent(input, [count], [indent])
  15. #### input
  16. Type: `string`
  17. #### count
  18. Type: `number`
  19. Default: `0`
  20. How many times you want `indent` repeated.
  21. #### indent
  22. Type: `string`
  23. Default: `' '`
  24. The string to use for the indent.
  25. ## License
  26. MIT © [Sindre Sorhus](http://sindresorhus.com)