Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buba

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buba

Buble + little bit of babel for your esnext tests

  • 2.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
941
increased by2513.89%
Maintainers
1
Weekly downloads
 
Created
Source

buba

Bublé transform + a little bit of Babel

Build Status js-standard-style npm version Codacy Badge Commitizen friendly

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é we only use Babel for support with module import/exports.

Install

npm install buba --save-dev

Usage

Source code

CLI

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

import { transformFile } from 'buba'

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

Tests

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:

 --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

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

Todo

  • Add Tests
  • Add Bublé options
  • Add CLI supoort - thanks @TylorS

Keywords

FAQs

Package last updated on 26 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc