New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prepend-file

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepend-file

Prepend data to a file, creating the file if it not yet exists.

  • 1.3.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

NPM version Build Status Dependency Status

Prepend data to a file, creating the file if it not yet exists.

Install

$ npm install --save prepend-file

Usage

var prependFile = require('prepend-file');

prependFile('message.txt', 'data to prepend', function (err) {
	if (err) {
		// Error
	}

	// Success
	console.log('The "data to prepend" was prepended to file!');
});

API

prependFile(filename, data, [options], callback)

    * filename String
    * data String | Buffer
    * options Object
        encoding String | Null default = 'utf8'
        mode Number default = 438 (aka 0666 in Octal)
    * callback Function

Asynchronously prepend data to a file, creating the file if it not yet exists. The data can be a string or a buffer.

prependFile.sync(filename, data, [options])

The synchronous version of prependFile. Returns undefined.

License

MIT © Hemanth.HM

Keywords

FAQs

Package last updated on 26 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc