prepend-file
v2.0.0 fs file prepend
prepend-file
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.
npm i [email protected]
Source Code
github.com/hemanth/node-prep...Metadata
- MIT
- >=10.17 <11 || >=11.14
- Hemanth.HM
- released 8/1/2020