Socket
Socket
Sign inDemoInstall

vinyl-contents-tostring

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl-contents-tostring

Convert vinyl file content to string


Version published
Maintainers
2
Created
Source

vinyl-contents-tostring

Travis npm package Coverage Status Dependency Status devDependency Status

Convert vinyl content into string

Install

$ npm install vinyl-contents-tostring

Usage

const vfs = require('vinyl-fs');
const map = require('map-stream');
const asCallback = require('ascallback');
const vinylToString = require('vinyl-contents-tostring');

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

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

Package last updated on 03 Nov 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc