Socket
Socket
Sign inDemoInstall

ts-dedent

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-dedent

TypeScript package which smartly trims and strips indentation from multi-line strings


Version published
Weekly downloads
7.1M
increased by3.02%
Maintainers
1
Weekly downloads
 
Created

What is ts-dedent?

The ts-dedent package is a utility designed to remove indentation from multi-line template strings in TypeScript and JavaScript. This is particularly useful when working with code that needs to be displayed to the user or when dealing with strings that should not have additional leading whitespace that is typically introduced by code formatting in source files.

What are ts-dedent's main functionalities?

Dedentation of template strings

This feature allows you to normalize the indentation of multi-line strings to enhance readability and maintain consistent formatting. The dedent function automatically adjusts the indentation based on the least indented line in the template string.

import dedent from 'ts-dedent';

const text = dedent`
    This is a text
      with inconsistent
        indentation.`;
console.log(text); // Outputs:
// This is a text
//   with inconsistent
//     indentation.

Other packages similar to ts-dedent

Keywords

FAQs

Package last updated on 01 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc