# file-wrapper

> A small class wrapping a node file to provide some common fields.

Latest version **0.1.0** (published 2018-04-18) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2018-04-18 |
| First published | 2018-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lorenzo Ruiz |
| Maintainers | larsbs |
| Keywords | file, fs, wrapper |

## Links

- npm: https://www.npmjs.com/package/file-wrapper
- Repository: https://github.com/Drawbotics/file-wrapper
- Homepage: https://github.com/Drawbotics/file-wrapper#readme
- Issues: https://github.com/Drawbotics/file-wrapper/issues
- npm.io page: https://npm.io/package/file-wrapper

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-04-18

## README

# File Wrapper

A small class wrapping a node file to provide some common fields.


## Usage Example

```javascript
const fs = require('fs-extra');
const File = require('file-wrapper');


async function main() {
  const filePath = '/folder/file.txt';
  const fileData = await fs.readFile(filePath);

  const file = new File(filePath, fileData);

  console.log(file.name);  // file.txt
  console.log(file.dir);   // /folder
  console.log(file.data);  // file contents
  console.log(file.path);  // /folder/file.txt
}
```


## LICENSE

MIT. See [LICENSE](LICENSE).

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