@eliware/path

Import-meta-based path utilities for modern Node.js ESM applications.
Table of Contents
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- API
- Packaging
- Examples
- Support
- Links
- License
Features
Compose paths from module locations or directory strings. Convert file URLs and log path operations with an injected logger.
Requirements
Use Node.js 26 or later and native ESM.
Setup
Install @eliware/path:
npm install @eliware/path
Usage
Pass import.meta or a directory path to a helper:
import path, { pathUrl, relativePath, resolvePath } from "@eliware/path";
const filePath = path(import.meta, "config", "app.json");
const fileUrl = pathUrl(import.meta, "module.mjs");
const absolutePath = resolvePath(import.meta, "data", "input.json");
const relative = relativePath(import.meta, "data", "input.json");
Read release notes for package changes.
Development
Read the specifications index for repository requirements. Read the documentation index for user guides.
Testing
Run aggregate validation with npm test.
Run npm run lint, npm run audit, npm run format, npm run format:check, npm run typecheck, or npm run pack for focused checks.
Troubleshooting
Read the troubleshooting guide for input and URL errors.
Security
Path segments can move outside the starting directory. Check paths from user input before file access. Logging records omit path values and results.
API
Read the API reference for exported functions and types.
Packaging
The package includes src/, docs/, README.md, AGENTS.md, LICENSE, RELEASE_NOTES.md, examples/, specs/, and .env.example.
Use MAJOR.MINOR.PATCH versions and matching v<version> tags.
The npm workflow publishes only a matching version tag after validation passes.
Get Eliware Operations approval before publication.
Read the package guide for package files.
Examples
Run an example from the repository root with node examples/example.mjs.
Read the example index for all examples.
Support
For help, questions, or to chat with the author and community, visit:


