Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

indent-string

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Issues
File Explorer

Advanced tools

indent-string

Indent each line in a string

    5.0.0latest

Version published
Maintainers
1
Weekly downloads
31,808,984
decreased by-2.92%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 860ac63
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/indent-string/compare/v4.0.0...v5.0.0

Readme

Source

indent-string

Indent each line in a string

Install

$ npm install indent-string

Usage

import indentString from 'indent-string'; indentString('Unicorns\nRainbows', 4); //=> ' Unicorns\n Rainbows' indentString('Unicorns\nRainbows', 4, {indent: '♥'}); //=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows'

API

indentString(string, count?, options?)

string

Type: string

The string to indent.

count

Type: number
Default: 1

How many times you want options.indent repeated.

options

Type: object

indent

Type: string
Default: ' '

The string to use for the indent.

includeEmptyLines

Type: boolean
Default: false

Also indent empty lines.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is indent-string?

Indent each line in a string

Is indent-string popular?

The npm package indent-string receives a total of 26,669,705 weekly downloads. As such, indent-string popularity was classified as popular.

Is indent-string well maintained?

We found that indent-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 17 Apr 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc