Prepend data to a file, creating it if it doesn't exist.
When the file (to be prepended to) has a 'hash bang' a.k.a. shebang command at the first line, this will be kept intact.
npm install prepend-file
const prependFile = require('prepend-file');
(async () => {
await prependFile('message.txt', 'some data');
});
Type: string
The file to prepend the data
to.
Type: string | Buffer
The data to prepend.