
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
string-remove-duplicate-heads-tails
Advanced tools
Detect and (recursively) remove head and tail wrappings around the input string
Detect and (recursively) remove head and tail wrappings around the input string
This package is pure ESM. If you're not ready yet, install an older version of this program, 5.1.0 (npm i string-remove-duplicate-heads-tails@5.1.0).
npm i string-remove-duplicate-heads-tails
import { strict as assert } from "assert";
import { remDup } from "string-remove-duplicate-heads-tails";
assert.equal(
remDup("{{ Hi {{ first_name }}! }}", {
heads: "{{ ",
tails: " }}",
}),
"Hi {{ first_name }}!",
);
Please visit codsen.com for a full description of the API. If you’re looking for the Changelog, it’s here.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License
Copyright © 2010-2025 Roy Revelt and other contributors

FAQs
Detect and (recursively) remove head and tail wrappings around the input string
We found that string-remove-duplicate-heads-tails demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.