Socket
Socket
Sign inDemoInstall

prepend-file

Package Overview
Dependencies
7
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prepend-file

Prepend data to a file, creating it if it doesn't exist.


Version published
Maintainers
3
Install size
169 kB
Created

Readme

Source

prepend-file Build Status Code Coverage

Prepend data to a file, creating it if it doesn't exist.

Install

npm install prepend-file

Usage

const prependFile = require('prepend-file');

(async () => {
  await prependFile('message.txt', 'some data');
});

API

prependFile(filename, data)

prependFile.sync(filename, data)

filename

Type: string

The file to prepend the data to.

data

Type: string | Buffer

The data to prepend.

Keywords

FAQs

Last updated on 11 Jan 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