referenxe
v1.0.1
Published
ReferenXe: A powerful Node.js package and CLI tool for resolving file paths, managing file references, and simplifying asset management in your projects. Developed by Leumas Tech.
Maintainers
Readme
ReferenXe
ReferenXe is a powerful Node.js package and CLI tool designed to simplify how you manage file paths and references across your projects. It provides robust capabilities for resolving file locations, listing directory contents, and maintaining consistent project structures, making asset management and development workflows smoother.
Developed by Leumas Tech.
Features
- NPM Package: Integrate robust path resolution capabilities directly into your Node.js applications.
- CLI Tool: Manage file references and resolve paths quickly from your command line.
- Flexible Path Resolution: Resolve relative paths to absolute paths with ease.
- File & Directory Listing: Efficiently list files and directories, with optional filtering by extensions.
Installation
You can install ReferenXe as a dependency in your Node.js project:
npm install referenxeOr, install it globally to use the CLI tool:
npm install -g referenxeQuickstart
Using the NPM Package
Integrate PathResolver into your Node.js application:
import { PathResolver } from 'referenxe';
import path from 'path';
const resolver = new PathResolver(process.cwd()); // Initialize with current working directory
// Resolve a relative path
const relativePath = 'src/my-module.js';
const absolutePath = resolver.resolvePath(relativePath);
console.log(`Resolved path: ${absolutePath}`);
// Example output: /path/to/your/project/src/my-module.js
// List JavaScript files in a directory
const jsFiles = resolver.getFiles('public', ['.js']);
console.log('\nJavaScript files in public/:');
jsFiles.forEach(file => console.log(file));
// List all directories in the root
const directories = resolver.getDirectories('.');
console.log('\nDirectories in root:');
directories.forEach(dir => console.log(dir));Using the CLI Tool
Once installed globally, you can use the referenxe command from your terminal:
Resolve a path:
referenxe resolve public/index.htmlList files in a directory (with optional extension filter):
referenxe get-files src .jsList directories:
referenxe get-dirs .For more commands and options, use:
referenxe --helpDocumentation
For detailed usage guides, API references, and more examples, please visit our Documentation Page.
Contributing
We welcome contributions! Please see our GitHub repository for more details.
License
ReferenXe is ISC Licensed.
