# buba

> Buble + little bit of babel for your esnext tests

Latest version **4.0.2** (published 2017-01-13) · MIT license · 0 weekly downloads

## Install

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

Provides the command `buba`.

## 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 | 4.0.2 |
| Published | 2017-01-13 |
| First published | 2016-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | David Chase |
| Maintainers | davidchase |
| Keywords | babel, buble, es6, esnext, harmony, testings, tests |

## Links

- npm: https://www.npmjs.com/package/buba
- Repository: https://github.com/davidchase/buba
- Homepage: https://github.com/davidchase/buba#readme
- Issues: https://github.com/davidchase/buba/issues
- npm.io page: https://npm.io/package/buba

## Dependencies (5)

- [buble](https://npm.io/package/buble.md) 0.15.2
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [commander](https://npm.io/package/commander.md) 2.9.0
- [babel-core](https://npm.io/package/babel-core.md) 6.21.0
- [babel-plugin-transform-es2015-modules-commonjs](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs.md) 6.18.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 4.0.2 (latest) — 2017-01-13
- 4.0.1 — 2016-09-20
- 4.0.0 — 2016-09-20
- 3.0.1 — 2016-09-10
- 3.0.0 — 2016-09-07
- 2.0.4 — 2016-09-02
- 2.0.3 — 2016-08-26
- 2.0.2 — 2016-08-13
- 2.0.1 — 2016-08-09
- 2.0.0 — 2016-08-09
- 1.0.7 — 2016-08-06
- 1.0.6 — 2016-08-05
- 1.0.5 — 2016-07-12
- 1.0.4 — 2016-07-11
- 1.0.3 — 2016-07-11
- … 3 more at https://npm.io/package/buba/versions

## README

# buba
> Bublé transform + a little bit of Babel

[![Build Status](https://travis-ci.org/davidchase/buba.svg?branch=master)](https://travis-ci.org/davidchase/buba) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![npm version](https://img.shields.io/npm/v/buba.svg)](https://www.npmjs.com/package/buba)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b3b512a5e0854a98bea75538647e84c4)](https://www.codacy.com/app/davidchase/buba?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=davidchase/buba&amp;utm_campaign=Badge_Coverage)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Why?
Because a wise man once said your source code should be transpiled with same tool as your tests to avoid any hidden bugs.

The usecase would be transpiling es* source code with Bublé and have tests match as well. An alternative to using `babel-register`

The primary transformer here is [Bublé](https://buble.surge.sh/#) we only use [Babel](https://babeljs.io) for support with module import/exports.


## Install

```sh
npm install buba --save-dev
```

## Usage

### Source code

**CLI**
```sh
buba -i input.js -o output.js
# or with a directory
buba -i src/ -o lib/
# to enable sourceMaps
buba -i input.js -o output.js -s
```

**API Usage**
```js
import { transformFile } from 'buba'

const { code, map } = transformFile('input.js', {
  buble: {} // buble options
  babel: {} // babel options
})
```

### Tests
```sh
mocha --require buba/register tests/**/*.js
# or
tape --require buba/register tests/**/*.js
```

With `mocha` you can also provide buba within the `mocha.opts` config file:

```sh
 --require buba/register
 --reporter spec
 --ui bdd
```

Currently we only plan to use Babel for modules but you can add support for something like generators by adding a `.babelrc` file.

**API Usage**

Just make sure that `buba` is the 1st thing you require

```js
require('buba/register')
const prelude = require('./prelude') // prelude has import/export, arrow functions, etc
```


## Todo
- [x] Add Tests
- [x] Add Bublé options
- [x] Add CLI supoort - thanks [@TylorS](https://github.com/TylorS)

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