map-file
Map a file into another file in Node.js
npm install map-file
API
mapFile({from, to, map=identity}, callback=done)
from
is the reading filename- supports relative or absolute
to
is the writing filename- supports relative or absolute
- makes nonexistent directories via
fs.mkdir
map
is the function you use to map the content- default returns the original text
callback
is a function to call after mapping- default throws errors and logs success
Usage
const mapFile =
Copy file
Trim file
Slice file
Callback