drive-by-path
Returns the drive to which a path belongs
Last updated 9 years ago by zkochan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install drive-by-path 
SYNC missed versions from official npm registry.

drive-by-path

Status Build status

Returns the drive to which a path belongs

Install

Install it via npm.

npm install drive-by-path

Usage

const driveByPath = require('drive-by-path')

driveByPath('/zkochan/foo')
  .then(drive => console.log(drive))
//> {
//    matchedMountpointPath: '/'
//    device: '/dev/disk0',
//    displayName: '/dev/disk0',
//    ...
//  }

API

driveByPath(path): Promise<DriveInfo>

Returns info abouth the drive under which the path is located. Also returns what mountpoint was matched via matchedMountpointPath: one drive can have multiple mountpoints.

Arguments:

  • path - string - the filepath for which the drive is searched

License

MIT

Current Tags

  • 1.0.0                                ...           latest (9 years ago)
  • 0.1.2                                ...           next (9 years ago)

8 Versions

  • 1.0.0                                ...           9 years ago
  • 0.1.2                                ...           9 years ago
  • 0.1.1                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.0.3                                ...           9 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
  • 0.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |