# babel-file

> Easily create a Babel File object

Latest version **3.0.0** (published 2018-08-10) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2018-08-10 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Kyle |
| Maintainers | thejameskyle |

## Links

- npm: https://www.npmjs.com/package/babel-file
- npm.io page: https://npm.io/package/babel-file

## Dependencies (1)

- [@babel/core](https://npm.io/package/@babel/core.md) ^7.0.0-beta.56

## Recent versions

- 3.0.0 (latest) — 2018-08-10
- 1.0.2 — 2017-05-25
- 1.0.1 — 2017-05-25
- 1.0.0 — 2017-05-17

## README

# babel-file

> Easily create a Babel File object

- Constructs File object
- Adds/parses code with nice errors

```js
import createFile from 'babel-file';
import createBabylonOptions from 'babylon-options';

const file = createFile(code, {
  filename: 'filename.js',
  parserOpts: createBabylonOptions({
    stage: 2,
  }),
});

file.code;
file.ast;
file.path;
```

Accepts [all the same options](https://github.com/babel/babel/blob/e155859b1253ad2665f427455eb236c9a2f6cd76/packages/babel-core/src/config/option-manager.js#L36-L75) as the normal Babel File object.

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