prepend-file
Prepend data to a file, creating it if it doesn't exist.
Last updated 4 years ago by richienb .
MIT · Repository · Bugs · Original npm
$ cnpm install prepend-file 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

2 Versions

  • 2.0.1                                ...           4 years ago
  • 1.3.1                                ...           9 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org