# gulp-insert

> Append or Prepend a string with gulp

Latest version **0.5.0** (published 2015-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-insert
pnpm add gulp-insert
yarn add gulp-insert
bun add gulp-insert
```

## Health

**Score 33/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2015-08-05 |
| First published | 2014-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-insert) |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 61 |
| Author | Ryan Schmukler |
| Maintainers | rschmukler, nfroidure |
| Keywords | gulp, gulpplugin, append, insert, prepend |

## Links

- npm: https://www.npmjs.com/package/gulp-insert
- Repository: https://github.com/rschmukler/gulp-insert
- Homepage: https://github.com/rschmukler/gulp-insert/
- Issues: https://github.com/rschmukler/gulp-insert/issues
- npm.io page: https://npm.io/package/gulp-insert

## Dependencies (2)

- [streamqueue](https://npm.io/package/streamqueue.md) 0.0.6
- [readable-stream](https://npm.io/package/readable-stream.md) ^1.0.26-4

## Recent versions

- 0.5.0 (latest) — 2015-08-05
- 0.4.0 — 2014-06-29
- 0.3.0 — 2014-04-06
- 0.2.0 — 2014-02-02
- 0.1.0 — 2014-01-18

## README

# gulp-insert

String manipulation library for gulp

## Usage

```
npm install gulp-insert
```

```js
var insert = require('gulp-insert');
```

## Append

Appends a string onto the contents.

```js
.pipe(insert.append('world')); // Appends 'world' to the contents of every file
```

## Prepend

Prepends a string onto the contents.

```js
.pipe(insert.prepend('Hello')); // Prepends 'Hello' to the contents of every file
```
## Wrap

Wraps the contents with two strings.

```js
.pipe(insert.wrap('Hello', 'World')); // prepends 'hello' and appends 'world' to the contents
```

## Transform

Calls a function with the contents of the file.

```js
.pipe(insert.transform(function(contents, file) {
  return contents.toUpperCase();
}));
```

Transform has access to the underlying vinyl file. The following code adds a '//' comment with the full file name before the actual content.

```js
.pipe(insert.transform(function(contents, file) {

	var comment = '// local file: ' + file.path + '\n';
	return comment + contents;
}));
```

See https://github.com/wearefractal/vinyl for docmentation on the 'file' parameter.

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