Mapping a file.
The mapped value.
import { mapping } from "file-mapping";const data = mapping("./data.json", {});data.name = "Jacob";data.age = 19;// Then, the file should be write automatically and only once.
The path to the file.
Optional
The fallback value to use if the file is not existing at the beginning.
The callback to trigger when the file is written.
Generated using TypeDoc
Mapping a file.
Returns
The mapped value.
Example