# ez-file

> No fuss utility for fetching the contents of a file.

Latest version **0.1.2** (published 2019-09-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-09-11 |
| First published | 2019-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 275.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chris Calo |
| Maintainers | chriscalo |

## Links

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

## Dependencies (1)

- [caller](https://npm.io/package/caller.md) ^1.0.1

## Recent versions

- 0.1.2 (latest) — 2019-09-11
- 0.1.1 — 2019-09-11

## README

# ez-file

No fuss utility for fetching the contents of a file.

Installation:

``` sh
npm install ez-file
# or
yarn add ez-file
```

Works for relative paths, absolute paths, and module paths (`node_modules` folder).

Usage:

``` js
const { file } = require("ez-file");

const contents1 = file("./relative/path/to/file.txt");
const contents2 = file("/absolute/path/to/file.txt");
const contents3 = file("module/path/to/file.txt");
const contents4 = file("./path/to/file.txt", {
  // override options passed to fs.readFileSync()
  encoding: "base64", // defaults to "utf-8"
});
```

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