npm.io
1.2.0 • Published 2 years ago

als-path-validator

Licence
ISC
Version
1.2.0
Deps
1
Size
2 kB
Vulns
0
Weekly
0

als-path-validator

This Node.js module provides a utility function to validate file paths based on the operating system's maximum path length and legal filename characters.

Installation

npm install als-path-validator

Usage

const isValidPath = require('als-path-validator');

// Example usage
const path = "C:\\Program Files\\Example\\file.txt";
console.log(isValidPath(path)); // Returns true or false based on validity

DetectSlash

const detectSlash = require('als-path-validator/detect-slash');
detectSlash(filePath) // return '/' | '\' |''