Registry / devops / vinyl-tf-babel

vinyl-tf-babel

JSON →
library0.1.0jsnpmunverified

A Vinyl Transformer for Babel that integrates Babel compilation into vinyl-fs pipelines or Gulp. Version 0.1.0 is the latest stable release. It requires babel-core as a peer dependency and supports both ES modules and CommonJS. Differentiators include a class-based transformer (`BabelTransformer`) and a convenience function (`transform`) for Gulp, aligning with vinyl transformer standards.

npm install vinyl-tf-babel
INSTALL
IMPORT
SIG · VINYL-TF-BABEL
V
vinyl-tf-babel
devopsjavascriptv0.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BabelTransformer
import { BabelTransformer } from 'vinyl-tf-babel'
const BabelTransformer = require('vinyl-tf-babel').BabelTransformer
Supports both ESM and CJS; named export.
transform
import { transform } from 'vinyl-tf-babel'
const transform = require('vinyl-tf-babel').transform
Named export, often used as a Gulp plugin function.
default import
import vinylTfBabel from 'vinyl-tf-babel'
const vinylTfBabel = require('vinyl-tf-babel')
Default export is the transform function (an alias for `transform`); is the same as `import { transform as babel }`.

Shows using the transform function with Gulp to compile JavaScript with Babel presets.

import gulp from 'gulp'; import { transform as babel } from 'vinyl-tf-babel'; gulp.task('babel', () => { return gulp.src('src/**/*.js') .pipe(babel({ presets: ['@babel/preset-env'] })) .pipe(gulp.dest('dist')); });
Debug
Known issues
gotchababel-core must be installed separately; calling without it will throw 'Cannot find module babel-core'.
fix
Install babel-core as a dependency: npm install babel-core
affects: >=0.1.0
deprecatedbabel-core is deprecated in favor of @babel/core. This transformer may not work with @babel/core directly.
fix
Use vinyl-tf-babel with babel-core 6.x or switch to a transformer like gulp-babel.
affects: >=0.1.0
gotchaOptions passed to BabelTransformer or transform are forwarded directly to Babel; invalid options may cause silent failures.
fix
Consult Babel options documentation and validate configuration.
affects: >=0.1.0
gotchaThis package is a Vinyl Transformer; it expects Vinyl objects in the stream. Using with non-Vinyl streams may cause errors.
fix
Ensure the stream provides Vinyl file objects (e.g., from gulp.src or vinyl-fs src).
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-core'
babel-core is not installed: it's a peer dependency not bundled with vinyl-tf-babel.
fix
npm install babel-core
TypeError: transformer is not a function
Using default import incorrectly or forgetting to call new BabelTransformer.
fix
Use `new BabelTransformer()` or `transform()` accordingly.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
babel-corerequiredpeer dependency, not included; must be installed separately for Babel compilation
Agent activity
4 hits · last 30 days
node
4
Resources
vinyl-tf-babel — npm install vinyl-tf-babel · libregistry