# path-string-prepend

> Prepends a path to a platform-specfic delimited path string and removes duplicate paths

Latest version **1.1.10** (published 2026-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-string-prepend
pnpm add path-string-prepend
yarn add path-string-prepend
bun add path-string-prepend
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.10 |
| Published | 2026-09-12 |
| First published | 2020-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=0.8 |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kevin Malakoff |
| Maintainers | kmalakoff |
| Keywords | autonode, prepend, path |

## Links

- npm: https://www.npmjs.com/package/path-string-prepend
- Repository: https://github.com/kmalakoff/path-string-prepend
- Issues: https://github.com/kmalakoff/path-string-prepend/issues
- npm.io page: https://npm.io/package/path-string-prepend

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.1.10 (latest) — 2026-09-12
- 1.1.9 — 2026-05-26
- 1.1.8 — 2025-12-12
- 1.1.7 — 2025-12-12
- 1.1.6 — 2025-12-04
- 1.1.5 — 2025-12-04
- 1.1.4 — 2025-12-02
- 1.1.3 — 2025-11-06
- 1.1.2 — 2025-10-21
- 1.1.1 — 2025-10-21
- 1.1.0 — 2025-06-29
- 1.0.25 — 2025-06-22
- 1.0.24 — 2025-06-20
- 1.0.23 — 2025-06-18
- 1.0.22 — 2025-06-02
- … 24 more at https://npm.io/package/path-string-prepend/versions

## README

# path-string-prepend

Prepends a path to a platform-specific delimited path string and removes every later entry whose string contains that path.

## Installation

```sh
npm install path-string-prepend
```

## Usage

```js
var assert = require('assert');
var prepend = require('path-string-prepend');

var delimiter = require('path').delimiter;
var envPath = ['other/path', 'install/path', 'another/path', 'install/path'].join(delimiter);
var result = prepend(envPath, 'install/path');

assert.equal(result, ['install/path', 'other/path', 'another/path'].join(delimiter));
console.log(result);
```

The default delimiter is `:` on POSIX and `;` on Windows. By default, an entry is removed when it contains the prepended path string. Pass `{ delimiter, filter }` to customize filtering, or `{ changes: true }` to receive `added`, `removed`, and `path` fields.

## License

MIT

---
_Source: https://npm.io/package/path-string-prepend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
