1. prepend-file
Prepend data to a file, creating it if it doesn't exist.
prepend-file
Package: prepend-file
Created by: hemanth
Last modified: Fri, 24 Jun 2022 14:19:05 GMT
Version: 2.0.1
License: MIT
Downloads: 161,791
Repository: https://github.com/hemanth/node-prepend-file

Install

npm install prepend-file
yarn add prepend-file

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.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin