# @chriscalo/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 @chriscalo/file
pnpm add @chriscalo/file
yarn add @chriscalo/file
bun add @chriscalo/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-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 272 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chris Calo |
| Maintainers | chriscalo |

## Links

- npm: https://www.npmjs.com/package/@chriscalo/file
- Repository: https://github.com/chriscalo/file
- Homepage: https://github.com/chriscalo/file#readme
- Issues: https://github.com/chriscalo/file/issues
- npm.io page: https://npm.io/package/@chriscalo/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-02
- 0.1.0 — 2019-09-01
- 0.0.3 — 2019-08-19
- 0.0.2 — 2019-08-19
- 0.0.1 — 2019-08-19

## README

# @chriscalo/file

# DEPRECATED. See [ez-file](https://www.npmjs.com/package/ez-file)

No fuss utility for fetching the contents of a file.

Installation:

``` sh
npm install @chriscalo/file
# or
yarn add @chriscalo/file
```

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

Usage:

``` js
const { file } = require("@chriscalo/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/@chriscalo/file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
