# path-tools

> common path toolkits, based on Node.js path module

Latest version **0.2.0** (published 2014-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-tools
pnpm add path-tools
yarn add path-tools
bun add path-tools
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2014-10-29 |
| First published | 2014-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Herman Lee |
| Maintainers | threeday0905 |
| Keywords | path, utils |

## Links

- npm: https://www.npmjs.com/package/path-tools
- Repository: git@github.com:threeday0905/path-tools
- Homepage: https://github.com/threeday0905/path-tools
- Issues: https://github.com/threeday0905/path-tools/issues
- npm.io page: https://npm.io/package/path-tools

## Dependencies (1)

- [args-expect](https://npm.io/package/args-expect.md) 0.2.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2014-10-29
- 0.1.0 — 2014-10-27

## README

path-tools
==========
common path toolkits, based on Node.js path module

---
### APIs

##### isPathAvailable (filePath )

return `true` if file path contains unix-hidden folder

Example:
    
    isPathAvailable('/home/app/.git'); //return false
    isPathAvailable('/home/app/.svn/to); //return false
    
##### isPathAsJS (filePath )

return `true` if file is a js file.


##### isPathAbsolute ( filePath )

return `true` if file path is absolute.

##### parsePathToAbsolute ( filePath, rootFolder )

if filePath is not abosoled, resovle with rootFolder, otherwise return.

##### addExtnameIfNotExists (filePath, extname )

if filePath does not contains extname, then add it. otherwise return.

##### parseToFullPath ( filePath, rootPath, extname )

resolve filePath with rootPath, and add extname.

##### isChildFile ( parentPath, childPath )

return `true` if childPath is under the parentPath

Example:

    isChildFile('/home/app/index.js', '/home/app/folder/index.js'); //true
    isChildFile('/home/app/index.js', '/home/index.js'); //false
    
---
### Questions?

If you have any questions, feel free to create a new issue.

---
_Source: https://npm.io/package/path-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
