prepend-file

v0.1.0
Prepend data to a file.
fs file prepend

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.

Metadata

  • MIT
  • >=0.10.0
  • Hemanth.HM
  • released 6/20/2014

Downloads

Maintainers