# vinyl-string

> Pretend a string is coming from a file on disk

Latest version **1.0.2** (published 2016-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install vinyl-string
pnpm add vinyl-string
yarn add vinyl-string
bun add vinyl-string
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-04-25 |
| First published | 2016-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wynn Slater |
| Maintainers | armordog |
| Keywords | vinyl |

## Links

- npm: https://www.npmjs.com/package/vinyl-string
- npm.io page: https://npm.io/package/vinyl-string

## Dependencies (1)

- [vinyl](https://npm.io/package/vinyl.md) ^1.1.1

## Recent versions

- 1.0.2 (latest) — 2016-04-25
- 1.0.1 — 2016-04-22

## README

#vinyl-string
[![Build Status](https://travis-ci.org/armordog/vinyl-string.svg?branch=master)](https://travis-ci.org/armordog/vinyl-string)

For the terminally lazy

###constructor(fileContents, options)
#### fileContents
The contents of the pretend file

Type: `String` or `Buffer`

#### options
An options object for the creation of a [vinyl file](https://github.com/gulpjs/vinyl/blob/master/README.md#constructoroptions).

#### options.keepOpen
Set to `true` to keep the stream open. Use when piping /into/ the vinyl-string object.


###example
```javascript
var vs = require('vinyl-string');
var vFile = vs(
  "my file contents!",
  {
    path: "filename.txt"
  }
);

vFile.pipe(gulp.dest("./output"));
```

```javascript
/* if vFile is also a stream destination, set keepOpen: true */
var vs = require('vinyl-string');
var vFile = vs(
  "my file contents!",
  {
    path: "filename.txt",
    keepOpen: true // allow piping in to vFile
  }
);

gulp.src(["./src/*.txt"])
  .pipe(vFile)
  .pipe(gulp.dest("./output");
```

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