JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q37306F
  • License (MIT OR Apache-2.0)

A library to simplify the creation of shells in Node.js

Package Exports

  • customshells

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (customshells) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CustomShells

A Node.js library to simplify the use of shells and navigation of file systems.

npm version npm version npm version



npm install customshells

CustomShell API Documentation
Tree API Documentation

Example Usage:

// Find all CSS and HTML files in a nested file structure
myTree.getLeaves('example/project/root/', [
    '.css',
    '.html'
    ]);

// Deal with files asynchronously
myTree.on('file', (file, dir, extension) =>{

    // Pipe output to myLogs.txt
    myShell.toFile('myLogs.txt');  

    // Run Node.js applications dynamically
    if(extension === '.html') 
        myShell.node('handleHTML.js', file); 

    // Optionally, pass a parameter
    if(extension === '.css') 
        myShell.node('handleCSS.js', file);   
        
    myShell
        .at(dir)   // Dynamically choose where it runs
        .create(); // Chain commands

});

                   // OR

        // Use the tree method to run
        // a Node.js app in every
        // nested directory found

myShell
    .node('example/module.js')
    .tree('example/root/dir')
    .create();