
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Tag function for writing template literals without breaking source code indentation
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.
Side-by-side comparison between the indedent and dedent packages.
| Indedent | Dedent | |
|---|---|---|
| ECMAScript | ES6 | ES6 |
| Trims | ✓ | ✓ |
| Dedents | ✓ | ✓ |
| Indents | ✓ | No |
| Spaces | ✓ | ✓ |
| Tabs | ✓ | No |
| Source | TypeScript | JavaScript |
| Types | ||
| Size |
Requires Node.js version 6.0.0 or higher. Suitable for the browser.
Use npm to install the latest version.
npm i indedent
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
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
FAQs
Tag function for writing template literals without breaking source code indentation
We found that indedent 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.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.