@aniojs/node-fs-path-type

1.0.6 • Public • Published

@aniojs/node-fs-path-type

Determine the type of a path.

Type Return value
Regular File regularFile
Regular Directory regularDir
Link to a file linkToFile
Link to a directory linktToDir
Dangling link brokenLink
Non existing path nonExisting
import fs from "node:fs"
import {getTypeOfPath} from "@aniojs/node-fs-path-type"

const entries = fs.readdirSync("examples/files")

for (const entry of entries) {
	console.log(entry, await getTypeOfPath("examples", "files", entry))
}

console.log(await getTypeOfPath("/non/existing/path"))

Readme

Keywords

none

Package Sidebar

Install

npm i @aniojs/node-fs-path-type

Weekly Downloads

32

Version

1.0.6

License

MIT

Unpacked Size

61 kB

Total Files

12

Last publish

Collaborators

  • exory2024