Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doesdev/file-paths-win32
Find paths of file(s) matching file name(s) on Windows
https://github.com/doesdev/file-paths-win32
Last synced: about 20 hours ago
JSON representation
Find paths of file(s) matching file name(s) on Windows
- Host: GitHub
- URL: https://github.com/doesdev/file-paths-win32
- Owner: doesdev
- License: mit
- Created: 2016-10-22T19:56:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T23:31:29.000Z (over 7 years ago)
- Last Synced: 2024-08-10T03:15:03.785Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# file-paths-win32 [![NPM version](https://badge.fury.io/js/file-paths-win32.svg)](https://npmjs.org/package/file-paths-win32) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) [![Dependency Status](https://dependencyci.com/github/doesdev/file-paths-win32/badge)](https://dependencyci.com/github/doesdev/file-paths-win32)
> Find paths of files matching file name on Windows
## install
```sh
$ npm install --save file-paths-win32
```## api
### returns
Promise is returned with
- **resolve** *(array) [Array of file paths, empty if not found]*
- **reject** *(error)*### arguments
- **filename(s)** *(string || array)*
- **opts** *(object) optional*
- **hints** *(array - %HOMEPATH% unless file is EXE) [paths to search]*
- **full** *(boolean - false) [search all drives recursively]*## usage
```js
const filePaths = require('file-paths-win32')
let fpOpts// search for single file in default paths
filePaths('someFile.txt').then(console.log).catch(console.error)// search for single EXE in default executable paths
filePaths('someApp.exe').then(console.log).catch(console.error)// search for array of files in default paths
filePaths(['someFile.txt', 'someApp.exe']).then(console.log).catch(console.error)// search for single file in specific paths
fpOpts = {hints: ['C:\\some\\path', 'C:\\some\\other\\path\\']}
filePaths('someFile', fpOpts).then(console.log).catch(console.error)// search for single file in all drives recursively
fpOpts = {full: true}
filePaths('someFile', fpOpts).then(console.log).catch(console.error)
```## related
- [file-paths-win32-cli](https://github.com/doesdev/file-paths-win32-cli) `Find file paths from the command line by their name`## License
MIT © [Andrew Carpenter](https://github.com/doesdev)