prepend-file
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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.

Dependents (239)

Package Sidebar

Install

npm i prepend-file

Weekly Downloads

31,160

Version

2.0.1

License

MIT

Unpacked Size

5.95 kB

Total Files

5

Last publish

Collaborators

  • stevemao
  • hemanth
  • richienb