Skip to content

fs.copy ​

Copies a file from one path to another.

Signature ​

luau
function copy(from: string, to: string): ()

Summary ​

Parameters ​

ParameterTypeDescription
fromstringThe path of the source file to copy.
tostringThe destination path for the copied file.

Example ​

luau
local fs = require("@std/fs")

fs.copy("template.json", "instance.json")