Socket
Book a DemoInstallSign in
Socket

buble-register

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buble-register

Buble require hook

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

buble-register Build Status

Bublé require hook.

Based on the excellent babel-register and adapted for Bublé.

Install

$ npm install --save buble-register

Usage

require('buble-register');

All subsequent files required with the extensions .js, .jsx, .es6 and .es will be transformed by Bublé.

API

bubleRegister([options])

options

extensions

Type: Array
Default: ['.js', '.jsx', '.es6', '.es']

Extensions to install a require hook for.

only
ignore

Type: String, Array<String, RegExp>, Boolean, RegExp, Function

Patterns to ignore or exclusively include for compiling.

const bubleRegister = require('buble-register');

bubleRegister({
	only: 'a.js'
});

bubleRegister({
	only: ['a.js', 'b.js']
});

// override `node_modules` ignoring
bubleRegister({
	only: false
});

bubleRegister({
	only: /regex/
});

bubleRegister({
	only: filename => {
		if (filename === '/path/to/es6-file.js') {
			return true;
		} else {
			return false;
		}
	}
});
cache

Type: Boolean
Default: true

Enable or disable caching of compiled sources.

Environment variables

By default buble-register saves to a file in temporary directory.

BUBLE_CACHE_PATH

Specify a different cache location.

BUBLE_CACHE_PATH=/path/to/cache.json node with-register.js

BUBLE_DISABLE_CACHE

Disable the cache.

BUBLE_DISABLE_CACHE=1 node with-register.js

License

MIT © Vadim Demedes

Keywords

buble

FAQs

Package last updated on 21 Oct 2017

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