# file

> Higher level path and file manipulation functions.

Latest version **0.2.2** (published 2014-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install file
pnpm add file
yarn add file
bun add file
```

## 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.2 |
| Published | 2014-02-21 |
| First published | 2012-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Anders Conbere |
| Maintainers | aconbere |

## Links

- npm: https://www.npmjs.com/package/file
- Repository: http://github.com/aconbere/node-file-utils
- Homepage: https://github.com/aconbere/node-file-utils
- Issues: http://github.com/aconbere/node-file-utils
- npm.io page: https://npm.io/package/file

## Recent versions

- 0.2.2 (latest) — 2014-02-21
- 0.2.1 — 2012-04-25
- 0.1.1 — 2012-02-11
- 0.2.0 — 2012-02-11

## README

# File - Common higher level file and path operations

## Install

<pre>
  npm install file
</pre>

<pre>
  var file = require("file");
</pre>

## API

### file.walk(start, callback)

Navigates a file tree, calling callback for each directory, passing in (null, dirPath, dirs, files).


### file.walkSync(start, callback)

Synchronus version of file.walk, calling callback for each directory, passing in (dirPath, dirs, files).


### file.mkdirs(path, mode, callback)

Makes all the directories in a path. (analgous to mkdir -P) For example given a path like "test/this/path" in an empty directory, mkdirs would make the directories "test", "this" and "path".


### file.mkdirsSync(path, mode)

Like file.mkdirs but synchronous.


### file.path.abspath(path)

Expands ".", "..", "~" and non root paths to their full absolute path. Relative paths default to being children of the current working directory.


### file.path.relativePath(root, fullPath)

Given a root path, and a fullPath attempts to diff between the two to give us an acurate path relative to root.


### file.path.join(head, tail)

Just like path.join but haves a little more sanely when give a head equal to "". file.path.join("", "tail") returns "tail", path.join("", "tail") returns "/tail"

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