Socket
Socket
Sign inDemoInstall

vinyl-contents-tostring

Package Overview
Dependencies
20
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vinyl-contents-tostring

Convert vinyl file content to string


Version published
Maintainers
2
Install size
594 kB
Created

Readme

Source

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).

Keywords

FAQs

Last updated on 30 May 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc