repo
replacements.fyi

// package

path-root-regex

type: "module"

// preferences

// replacements (1)

snippet::path-root

Simple or drop-in replacement

This package is no longer necessary. You can use `parse` from `node:path` and read its `root` property to get the root of a path.

// example

import { parse } from 'node:path';

const pathRoot = (filepath) =>
	parse(filepath).root;