npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dbfg/cli

v1.4.0

Published

CLI to generate Dart barrel files

Readme

@dbfg/cli

Command-line interface for generating and maintaining Dart barrel files.

Recommended usage

The recommended usage is through bunx or the equivalent from your package of choice:

bunx @dbfg/cli@latest [options] <directory>

Installation

Globally install it with:

bun install -g @dbfg/cli

You will now have the dbfg-cli executable available.

Usage

dbfg-cli creates barrel files for your Dart projects, making it easier to manage exports.

Generation Modes

The CLI supports three generation modes:

  1. Regular mode (default): Generates a barrel file for only the specified directory
dbfg-cli <directory>
  1. Recursive mode: Generates barrel files for the target directory and all nested subdirectories
dbfg-cli --recursive <directory>
  1. Subfolders mode: Generates a single barrel file that includes exports from all files of subdirectories
dbfg-cli --subfolders <directory>

Options

-V, --version                     output the version number
-s, --subfolders                  Include subfolders in the barrel file
-r, --recursive                   Generate barrel files recursively for all nested directories
-c, --config <string>             Path to configuration file
-n, --default-barrel-name <name>  Default name for barrel files (default: "")
--excluded-dirs <dirs...>         Comma-separated list of directories to exclude (default: [])
--excluded-files <files...>       Comma-separated list of files to exclude (default: [])
--exclude-freezed                 Exclude freezed files (default: false)
--exclude-generated               Exclude generated files (default: false)
--skip-empty                      Skip directories with no files (default: false)
--append-folder-name              Append folder name to barrel file name (default: false)
--prepend-folder-name             Prepend folder name to barrel file name (default: false)
--prepend-package                 Prepend package name to exports in lib folder (default: false)
-h, --help                        display help for command

Examples

Generate a barrel file for the lib directory:

dbfg ./lib

Generate barrel files recursively for the src directory and all its subdirectories:

dbfg --recursive ./src

Generate a barrel file for lib with a custom name:

dbfg ./lib -n index

Exclude generated files:

dbfg ./src --exclude-freezed --exclude-generated

Exclude specific files using patterns:

dbfg ./src --excluded-files "*_one.dart" "*_test.dart"

Configuration File

You can use a JSON configuration file to define default options:

{
  "defaultBarrelName": "index",
  "excludeFreezed": true,
  "excludeGenerated": true,
  "excludeFileList": ["*_test.dart"],
  "excludeDirList": ["test"],
  "prependPackageToLibExport": true
}

Then simply pass the --config option:

dbfg ./src --config ./dbfg.json