Path.unlinkSync() method
pathlib-ts > Path > unlinkSync
Path.unlinkSync() method
Section titled “Path.unlinkSync() method”Remove the file or link synchronously.
Signature:
unlinkSync(options?: { missingOk?: boolean; }): void;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
options |
{ missingOk?: boolean; } |
(Optional) Deletion behaviour flags ( |
Returns:
void
Remarks
Section titled “Remarks”Mirrors Path.unlink() but executes synchronously.
Example
Section titled “Example”Cleaning up generated files synchronously
import { Path } from "pathlib-ts";
const artifact = new Path("./dist/app.js");artifact.unlinkSync({ missingOk: true });