Socket
Socket
Sign inDemoInstall

file-paths-win32

Package Overview
Dependencies
17
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    file-paths-win32

Find paths of file(s) matching file name(s) on Windows


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
145 kB
Created
Weekly downloads
 

Readme

Source

file-paths-win32 NPM version js-standard-style

Find paths of files matching file name on Windows

install

$ 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

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)

License

MIT © Andrew Carpenter

Keywords

FAQs

Last updated on 22 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc