Package to replace
relative
Suggested replacement(s)
Cross-platform / Unixified paths
import path from 'node:path/posix'
path.relative('/a/b', '/a/c/file.js') // '../c/file.js'
Relative path from a file
import path from 'node:path'
const fileA = 'src/components/Button.js'
const fileB = 'src/utils/helpers.js'
path.relative(path.dirname(fileA), fileB) // '../utils/helpers.js'
Relative to current working directory
import path from 'node:path'
path.relative(process.cwd(), to)
Manifest type
micro-utility (tiny utility replaceable with native code or removal)
Rationale
A simple util handling 3 different concerns in the same package
Availability
No response
Code example (optional)
Package to replace
relativeSuggested replacement(s)
Cross-platform / Unixified paths
Relative path from a file
Relative to current working directory
Manifest type
micro-utility (tiny utility replaceable with native code or removal)
Rationale
A simple util handling 3 different concerns in the same package
Availability
No response
Code example (optional)