Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cityssm/node-windows-unc-path-connect
Ensures a UNC path that requires a user name and password is ready to use in Windows before use.
https://github.com/cityssm/node-windows-unc-path-connect
file-share node-fs unc-path windows
Last synced: 16 days ago
JSON representation
Ensures a UNC path that requires a user name and password is ready to use in Windows before use.
- Host: GitHub
- URL: https://github.com/cityssm/node-windows-unc-path-connect
- Owner: cityssm
- License: mit
- Created: 2024-04-16T17:36:24.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T10:13:14.000Z (about 1 month ago)
- Last Synced: 2024-11-12T23:44:38.934Z (about 1 month ago)
- Topics: file-share, node-fs, unc-path, windows
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@cityssm/windows-unc-path-connect
- Size: 284 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Windows UNC Path Connect for Node
[![npm (scoped)](https://img.shields.io/npm/v/%40cityssm/windows-unc-path-connect)](https://www.npmjs.com/package/@cityssm/windows-unc-path-connect)
[![DeepSource](https://app.deepsource.com/gh/cityssm/node-windows-unc-path-connect.svg/?label=active+issues&show_trend=true&token=kMenIfdyEcHVDtebaPlgkjFy)](https://app.deepsource.com/gh/cityssm/node-windows-unc-path-connect/)
[![Maintainability](https://api.codeclimate.com/v1/badges/0c0f2c336c22c3c889fa/maintainability)](https://codeclimate.com/github/cityssm/node-windows-unc-path-connect/maintainability)
[![DeepSource](https://app.deepsource.com/gh/cityssm/node-windows-unc-path-connect.svg/?label=code+coverage&show_trend=false&token=kMenIfdyEcHVDtebaPlgkjFy)](https://app.deepsource.com/gh/cityssm/node-windows-unc-path-connect/)
[![Coverage Testing](https://github.com/cityssm/node-windows-unc-path-connect/actions/workflows/coverage.yml/badge.svg)](https://github.com/cityssm/node-windows-unc-path-connect/actions/workflows/coverage.yml)Ensures a UNC path that requires a user name and password
is ready to use in Windows before use.## Installation
```sh
npm install @cityssm/windows-unc-path-connect
```## Usage
```javascript
import { connectToUncPath } from '@cityssm/windows-unc-path-connect'const uncPath = '\\\\server\\fileShare'
/*
* Connect to share
*/const success = connectToUncPath(
{
uncPath,
userName: 'user',
password: 'p@ss'
},
{
// Attempt to clean up connection on application shutdown
deleteOnExit: true
}
)/*
* Reading files should now work.
*/try {
const files = await fs.readdir(uncPath)
} catch (error) {}
```