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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-fed

v1.0.10

Published

Execute an arbitrary shell command for each directories in the configuration file

Downloads

59

Readme

For Each Directories (fed)

This developers tools allows to execute an arbitrary shell command for each directories listed in the fed.json configuration file.

Installation

$ sudo npm install --global node-fed

Usage

$ fed [directories...] <command>
  • directories Name(s) of directory or group to loop through. If loop through all directories (from config) by default

  • command Arbitrary shell command

fed.json

List all directories

{
    "dirs" : [
        {
            "name"   : "Dir1",
            "groups" : ["group1"]
        },
        {
            "name"   : "Dir2",
            "groups" : ["group1", "group2"]
        },
        {
            "name"   : "Dir3",
            "groups" : ["group2"]
        }
    ]
}
  • name {String} Directory name
  • groups {String[]} Optional, Use to groups or alias a directory

Commands

By default, fed execute the command as following:

$ cd <dir.name>
$ <command>
$ cd -

Examples

List all files in all directories

$ fed ls

On dir1...

README.md	file1

On dir2...

README.md	file2

On dir3...
    
README.md	file3

List all files of directory group

$ fed group1 ls

On dir1...

README.md	file1

On dir2...

README.md	file2
    

Special commands

fed-list

List all directories register in the fed.json configuration file

Usage

$ fed [directories...] fed-list [-v|--verbose]

Examples

List all directories

$ fed fed-list 
dir1
dir2
dir3

List all directories in the specified group

$ fed group1 fed-list
dir1
dir2

List all directories with verbose option

$ fed group1 fed-list -v
dir1
{
    "name" : "dir1",
    "groups" : ["group1"]
}

dir2
{
    "name" : "dir2",
    "groups" : ["group1", "group2"]
}

fed-modules

List all fed modules currently loaded

Usage

$ fed fed-modules

Examples

$ fed fed-modules
fed-git

fed-add-modules

Add fed module(s) globally or locally

Usage

$ fed fed-add-modules <modules...> [-g|--global]
    

Examples

$ fed fed-add-modules fed-git --global

fed-rm-modules

Remove fed module(s) globally or locally

Usage

$ fed fed-rm-modules <modules...> [-g|--global]

Examples

$ fed fed-rm-modules fed-git --global

Examples usage

Create a copyright file in all of your directory

$ fed echo "Copyright (c) 2015" '>' copyright.txt
$ fed ls
    
On dir1...

README.md	file1   copyright.txt

On dir2...

README.md	file2   copyright.txt

On dir3...
    
README.md	file3   copyright.txt

Modules

A fed module is a node package which customize the command to execute. Once one fed find a module that can treat the command, it execute use it.

A fed module looks like this:

/**
 * Name of the fed module
 *
 * @type {String}
 */
exports.name = "Name of the fed module";

/**
 * When true, fed will not try to browse into the directory. 
 * The command will then be executed from the current working directory.
 * 
 * For example a command like `git clone` doesn't need to browse to the sub-directory,
 * because it suppose to not yet exist.
 * The fed-git module don't browse to the directory in case of `git clone` command.
 *
 * @type {Boolean=false}
 */
exports.preventBrowse = false|true;

/**
 * By default fed output the message `On <dir.name> ...\n', before each command. 
 * If preventDefaultEcho = true that default message will be skipped  
 *
 * @type {Boolean=false}
 */
exports.preventDefaultEcho = false|true;

/**
 * Indicates if fed have to stop his iteration after the command execution.
 * @type {Boolean=false}
 */
exports.stopIteration = false|true;

/**
 * Indicates if the current module is able to treat the 
 * specified command
 *
 * @param {String} command Command that fed will to execute 
 * @param {Object} dir Directory object
 *
 * @return {Boolean} True if the module can execute the command
 */
exports.canDo = function (command, dir) {};

/**
 * Returns the command to execute
 * 
 * If the return value is falsy, fed will do nothing for this command/directory
 *
 * @param {String} command Command that fed will execute
 * @param {Object} dir Directory object
 * @return {String|null} Command to execute 
 */
exports.getCommand = function (command, dir) {};

fed_modules.json

Fed modules can be declared globally at the root of '/fed' installation, or locally at the root of the working directory.

Simply add a file name fed_modules.json with the following format:

[
    {
        "name" : "name of the module 1"
    },
    {
        "name" : "name of the module 2"
    }
]

The order of the module is important, the last module have higher priority than the first. Local modules are higher priorities than global modules.