
Security News
Cline CLI npm Package Compromised via Suspected Cache Poisoning Attack
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.
base-fs-tree
Advanced tools
Base plugin for creating file trees using archy. Requires the base-fs plugin, but can also be used as a gulp plugin.
Base plugin for creating file trees using archy. Requires the base-fs plugin, but can also be used as a gulp plugin.
Install with npm:
$ npm install --save base-fs-tree
var tree = require('base-fs-tree');
The following examples will work with base-fs, gulp, verb, assemble, generate, update or any other application that supports vinyl streams.
var tree = require('base-fs-tree');
var gulp = require('gulp');
gulp.task('default', function(cb) {
return gulp.src('some-files/**/*.*')
.pipe(tree.create())
.pipe(gulp.dest('trees'))
});
Get files before they're modified
If you want to create a tree from the original unmodified source file paths, use .capture() first thing in the stream:
var tree = require('base-fs-tree');
var gulp = require('gulp');
gulp.task('default', function(cb) {
return gulp.src('some-files/**/*.*')
.pipe(tree.capture()) //<= capture files
// gulp plugin pipeline
.pipe(otherPlugins())
.pipe(gulp.dest('dist'))
.pipe(tree.create()) //<= create tree
.pipe(gulp.dest('trees'))
});
You can conditionally generate trees using a command line flag, like --tree.
var tree = require('base-fs-tree');
var gulp = require('gulp');
var argv = require('yargs-parser')(process.argv.slice(2), {
default: {tree: false}
});
gulp.task('default', function(cb) {
return gulp.src('some-files/**/*.*')
.pipe(tree.create(argv))
.pipe(gulp.dest('trees'))
});
This can also be used as a non-pipeline plugin with base applications. It works by adding .preWrite middleware and a taskEnd listener, so that anytime taskEnd is emitted, a tree will be automatically generates.
This can be useful when you want to automatically generate trees for all tasks in a generate generator, for example.
var tree = require('base-fs-tree');
var vfs = require('base-fs');
var Base = require('base');
var base = new Base();
base.use(vfs());
base.use(tree());
app.task('default', function(cb) {
app.src('some-files/**/*.*')
.pipe(app.dest('trees'))
.on('end', function() {
// emit `taskEnd` with the name of the task
app.emit('taskEnd', 'default');
cb();
});
});
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.28, on July 31, 2016.
FAQs
Base plugin for creating file trees using archy. Requires the base-fs plugin, but can also be used as a gulp plugin.
We found that base-fs-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.