{"id":13268,"library":"gulp-bem-bundler-fs","title":"Gulp BEM Filesystem Bundler","description":"gulp-bem-bundler-fs is a Gulp plugin designed to process BEM (Block, Element, Modifier) entities by reading them directly from the filesystem. It integrates into a Gulp build pipeline to facilitate the bundling of BEM-structured projects, often used in conjunction with `gulp-bem-bundle-builder` to manage dependencies and construct output files like CSS or JavaScript. The package, at version 0.0.10, is part of an older `gulp-bem` ecosystem. Its primary function is to create a stream of BEM bundles from specified filesystem paths, which can then be piped to other Gulp plugins for further processing. Development on this standalone package ceased, with the repository marked as deprecated and moved to a monorepo structure within `bem/gulp-bem` since March 2018. Consequently, it has no ongoing release cadence and is not recommended for new projects. It requires Node.js environments `>= 4.0`, an EOL version from 2018, making it incompatible with modern Node.js releases and potentially exposing projects to security vulnerabilities from unmaintained dependencies.","status":"abandoned","version":"0.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/gulp-bem/gulp-bem-bundler-fs","tags":["javascript","gulp","bem","bundler","fs"],"install":[{"cmd":"npm install gulp-bem-bundler-fs","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-bem-bundler-fs","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-bem-bundler-fs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is a Gulp plugin, requiring Gulp as a peer dependency for operation within a Gulp build system.","package":"gulp","optional":false},{"reason":"Commonly used in conjunction with this package to process the BEM bundles created by gulp-bem-bundler-fs.","package":"gulp-bem-bundle-builder","optional":true},{"reason":"Frequently used to concatenate the output streams generated after BEM processing.","package":"gulp-concat","optional":true}],"imports":[{"note":"This package is a CommonJS module, designed for Node.js environments that predate widespread ESM adoption. Use `require()` for importing the default function.","wrong":"import bundler from 'gulp-bem-bundler-fs';","symbol":"bundler","correct":"const bundler = require('gulp-bem-bundler-fs');"},{"note":"The package exports a single default function, not named exports. Destructuring will result in `undefined`.","wrong":"const { bundler } = require('gulp-bem-bundler-fs');","symbol":"bundler","correct":"const bundler = require('gulp-bem-bundler-fs');"},{"note":"Due to its age and abandonment, there are no official or community-maintained TypeScript type definitions available for `gulp-bem-bundler-fs`.","symbol":"Type definitions","correct":"// No TypeScript type definitions are provided or maintained for this package."}],"quickstart":{"code":"const gulp = require('gulp');\nconst bundler = require('gulp-bem-bundler-fs');\nconst Builder = require('gulp-bem-bundle-builder');\nconst concat = require('gulp-concat');\n\n// Define your BEM levels and techMap as per your project structure\nconst builder = Builder({\n  levels: [\n    'blocks',\n    'components'\n  ],\n  techMap: {\n    js: ['vanilla.js', 'browser.js', 'js'],\n    css: ['styl', 'css']\n  }\n});\n\n// Gulp task to build CSS bundles from BEM entities\ngulp.task('build:css', () => {\n  return bundler('bundles/*') // Reads BEM bundles from the 'bundles' directory\n    .pipe(builder({ // Passes bundles to the builder for processing\n      css: bundle => bundle.src('css').pipe(concat('bundle.css')) // Gathers CSS files and concatenates them\n    }))\n    .pipe(gulp.dest('./dist/css')); // Outputs the final CSS bundles\n});\n\n// Gulp task to build JS bundles from BEM entities\ngulp.task('build:js', () => {\n  return bundler('bundles/*') // Reads BEM bundles from the 'bundles' directory\n    .pipe(builder({ // Passes bundles to the builder for processing\n      js: bundle => bundle.src('js').pipe(concat('bundle.js')) // Gathers JS files and concatenates them\n    }))\n    .pipe(gulp.dest('./dist/js')); // Outputs the final JS bundles\n});\n\n// Default task to run both CSS and JS builds\ngulp.task('default', gulp.parallel('build:css', 'build:js'));","lang":"javascript","description":"This quickstart demonstrates how to use `gulp-bem-bundler-fs` with `gulp-bem-bundle-builder` and `gulp-concat` to process BEM-structured files from the filesystem into concatenated CSS and JavaScript bundles. It sets up two Gulp tasks, one for CSS and one for JS, and a default task to run both."},"warnings":[{"fix":"Migrate to modern bundling tools or investigate the `bem/gulp-bem` monorepo for the current recommended approach, although that project also shows limited recent activity.","message":"The `gulp-bem-bundler-fs` package is officially deprecated and its repository has been moved to a monorepository structure within `bem/gulp-bem`. The standalone package is no longer maintained.","severity":"breaking","affected_versions":">=0.0.10"},{"fix":"Avoid using this package in any environment requiring modern Node.js or security compliance. Consider alternative BEM-aware build tools or a different build methodology.","message":"This package explicitly requires Node.js `>= 4.0`. Node.js 4.x reached End-of-Life in 2018 and is not compatible with modern JavaScript features or secure environments. Using this package will necessitate an extremely old Node.js version, which is highly discouraged.","severity":"gotcha","affected_versions":">=0.0.10"},{"fix":"Do not use this package for new projects. For existing projects, conduct a thorough security audit of its dependency tree and migrate to a actively maintained solution.","message":"Given its abandonment, this package and its transitive dependencies likely contain numerous unpatched security vulnerabilities. Using it in a production environment poses significant risks.","severity":"gotcha","affected_versions":">=0.0.10"},{"fix":"Explore modern build tools and component-based architectures that offer similar capabilities for dependency resolution and asset bundling, such as Webpack, Rollup, or Vite, possibly with custom plugins for BEM-specific logic if absolutely necessary.","message":"The entire `gulp-bem` ecosystem, including `gulp-bem-bundler-fs`, appears to be largely inactive or abandoned. Relying on this ecosystem for new development is not advisable due to lack of support and outdated practices.","severity":"deprecated","affected_versions":">=0.0.10"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you are using `const bundler = require('gulp-bem-bundler-fs');` in your Gulpfile, which should typically be a CommonJS module.","cause":"Attempting to import `gulp-bem-bundler-fs` using ES module syntax (e.g., `import bundler from 'gulp-bem-bundler-fs'`) instead of CommonJS `require()`, or destructuring a non-existent named export.","error":"TypeError: bundler is not a function"},{"fix":"Install the required peer/conceptual dependency: `npm install --save-dev gulp-bem-bundle-builder`.","cause":"The `gulp-bem-bundler-fs` package is often used with `gulp-bem-bundle-builder`, but `gulp-bem-bundle-builder` has not been installed or is not correctly resolved.","error":"Error: Cannot find module 'gulp-bem-bundle-builder'"},{"fix":"This specific error indicates incompatibility with your Node.js version. Your best option is to upgrade to a modern build system; if forced to use this package, you might need to install a specific (and very old) Node.js version compatible with the native modules.","cause":"While not directly from `gulp-bem-bundler-fs`, old Gulp setups (like those using this package) often rely on deprecated versions of `node-sass` or other native addons that fail to build on newer Node.js versions.","error":"Error: node-sass: `libsass` bindings not found. Try `npm rebuild node-sass`?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}