# fsreadfileastype

> Parse the contents of files as JavaScript objects.

Latest version **0.0.4** (published 2014-01-27) · 0 weekly downloads

## Install

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

## 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.0.4 |
| Published | 2014-01-27 |
| First published | 2013-10-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Michael Phillips |
| Maintainers | createbang |

## Links

- npm: https://www.npmjs.com/package/fsreadfileastype
- Repository: https://github.com/createbang/fsReadFileAsType
- Issues: https://github.com/createbang/fsReadFileAsType/issues
- npm.io page: https://npm.io/package/fsreadfileastype

## Dependencies (2)

- [underscore](https://npm.io/package/underscore.md) 1.5.2
- [shellvarparser](https://npm.io/package/shellvarparser.md) 0.0.3

## Recent versions

- 0.0.4 (latest) — 2014-01-27
- 0.0.3 — 2013-10-19
- 0.0.2 — 2013-10-19
- 0.0.1 — 2013-10-19

## README

fsReadFileAsType
==============

![Build Status](https://travis-ci.org/createbang/fsReadFileAsType.png)

Parse the contents of files as JavaScript objects.

.env file
```sh
VAR1=foobar
VAR2=bazbang
```

.jsonfile file
```json
{
  "foo": "bar",
  "baz": "bang"
}
```

js file
```js
var fsReadFileAsType = require('fsreadfileastype');

var jsonData = fsReadFileAsType.sync(__dirname + '/.jsonfile', 'json');
// returns {foo: "bar", baz: "bang"}
var shellVarData = fsReadFileAsType.sync(__dirname + '/.env', 'shell');
// returns {VAR1: "foo", VAR2: "bar"}
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Running tests

```bash
npm install
npm test
```

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