New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

indedent

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indedent

Tag function for writing template literals without breaking source code indentation

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Indedent

Multi-line template literals make source code ugly. Packages such as dedent solve this problem however, interpolated multi-line strings in nested lines are not adjusted to match the indentation of the interpolating line.

This package indents interpolated multi-line strings, in addition to dedenting and trimming the template literal.

Features

Side-by-side comparison between the indedent and dedent packages.

IndedentDedent
ECMAScriptES6ES6
Trims
Dedents
IndentsNo
Spaces
TabsNo
SourceTypeScriptJavaScript
Types
Size

Install

Requires Node.js version 6.0.0 or higher. Suitable for the browser.

Use npm to install the latest version.

npm i indedent

Usage

import indedent from 'indedent'
// or
const { indedent } = require('indedent')

console.log(dedent`this is some string
                   with multiple lines
                   below the first one`)
this is some string
with multiple lines
below the first one

Build

This package is writen in TypeScript. For better interoperability, we compile to both ESM and CommonJS. Conditional exports take care of the rest.

Use the compile script to build the package.

npm run compile

Remember to test it afterwards.

npm run test

Keywords

dedent

FAQs

Package last updated on 24 Jul 2022

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