JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 41
  • Score
    100M100P100Q67068F
  • License MIT

πŸ₯½ Provides ways of parsing UNC paths and checking whether they are valid. 🎱

Package Exports

  • @igor.dvlpr/unc-path
  • @igor.dvlpr/unc-path/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@igor.dvlpr/unc-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

UNC Path


πŸ₯½ Provides ways of parsing UNC paths and checking whether they are valid. 🎱


UNC Path




πŸ’– Support further development

I work hard for every project, including this one and your support means a lot to me!
Consider buying me a coffee. β˜•
Thank you for supporting my efforts! πŸ™πŸ˜Š


Donate to igorskyflyer

@igorskyflyer



πŸ•΅πŸΌ Usage

Install it by executing:

npm i "@igor.dvlpr/unc-path"

🀹🏼 API

isValid() => returns whether the given path is a UNC one.


Signature

isValid(path): boolean

Parameters

path: string // a string that represents the path to process

Example

import { isValid } from '@igor.dvlpr/unc-path'

console.log(isValid('//ComputerName/SharedFolder/')) // returns true
console.log(isValid('//ComputerName/SharedFolder/file.mp4')) // returns true
console.log(isValid('/ComputerName/SharedFolder/')) // returns false


parse() => parses the provided UNC path and returns UNC path's components as

{
    'server': string,
    'resource': string
}

Signature

parse(path): Object

Parameters

path: string // a string that represents the path to process

Example

import { parse } from '@igor.dvlpr/unc-path'

console.log(parse('//Server/Dev/file.js'))
/*
returns {
              server: 'Server',
            resource: '/Dev/file.js',
          }
*/

console.log(parse('/Server/Dev/file.js'))
/*
returns {
              server: '',
               resource: '',
          }
*/

πŸͺͺ License

Licensed under the MIT license which is available here, MIT license.


@igor.dvlpr/encode-entities

πŸƒβ€β™‚οΈ Fast and simple Map and RegExp based HTML entities encoder. 🍁

@igor.dvlpr/regkeys

πŸ“š An NPM package for fetching Windows registry keys. πŸ—

@igor.dvlpr/upath

🎍 Provides a universal way of formatting file-paths in Unix-like and Windows operating systems as an alternative to the built-in path.normalize(). 🧬

@igor.dvlpr/is-rootdir

πŸ”Ό Provides a way to check if the given path is the root drive/directory. β›”

@igor.dvlpr/valid-path

🧰 Provides ways of testing whether a given value can be a valid file/directory name. 🏜



Provided by Igor Dimitrijević (@igorskyflyer).