vinyl-contents-tostring

6.1.1 • Public • Published

vinyl-contents-tostring

Build Status npm package Coverage Status

Convert vinyl content into string

Install

$ npm install vinyl-contents-tostring

Usage

import { callbackify } from 'node:util';
import vfs from 'vinyl-fs';
import map from 'map-stream';
import toString from 'vinyl-contents-tostring';

vfs.src(['./package.json'])
  .pipe(map(
    callbackify(file => toString(file).then(contents => console.log(contents))),
  ));

API

vinylToString(file, enc)

Returns a promise to the contents of the vinyl file, regardless of stream or buffer files. Optionally, it accepts the encoding of the file

License

See the LICENSE file for license rights and limitations (MIT).

Readme

Keywords

Package Sidebar

Install

npm i vinyl-contents-tostring

Weekly Downloads

1,119

Version

6.1.1

License

SEE LICENSE IN LICENSE.md

Unpacked Size

4.39 kB

Total Files

4

Last publish

Collaborators

  • perrin4869
  • 20lives