file-firstline-replace

0.0.3 • Public • Published

file-firstline-replace

Replace the first line of a file with something else.

Use case

If you need to replace the first line in a file, this module will allow you to do that. Particularly built for CSVs, https://github.com/madwire-media/lets-make-csvs, but you can use it for anything.

Installation

npm install file-firstline-replace

Usage

var filename = "thing.csv"
var newHeader = `"foo","bar","baz","bang"`
replaceFirstLineOfFile(filename, newHeader, function(err) {
  if (err) throw err
  /* ... */
})

Package Sidebar

Install

npm i file-firstline-replace

Weekly Downloads

459

Version

0.0.3

License

MIT

Unpacked Size

3.87 kB

Total Files

4

Last publish

Collaborators

  • drj
  • jtruant