@plurid/pipes.finder

Files Finder Pipe

Usage no npm install needed!

<script type="module">
  import pluridPipesFinder from 'https://cdn.skypack.dev/@plurid/pipes.finder';
</script>

README



License: DEL

plurid' pipes

Utility Pipes for Scripts

File Finder Pipe


Contents

Install

It is preferred to install the pipe globally

npm install -g @plurid/pipes.finder

and run the script with the global NODE_PATH

export NODE_PATH=$(npm root --quiet -g) && node path/to/script.js

Usage

// finder-script.js
const finder = require('@plurid/pipes.finder').default;


// all the files in the `process.cwd()` directory
const allFiles = finder();

// all the files except those containing `'node_modules'` in name
const filesExclude = finder({
    exclude: [
        'node_modules',
    ],
});

// all the files with the extension `'.ts'`, except those in `'node_modules'`
const tsFiles = finder({
    extension: '.ts', // accepts RegExp
    exclude: [
        'node_modules',
    ],
});

// all the files from the `'path/to/root'` directory
const rootedFiles = finder({
    root: 'path/to/root',
});

Packages

Version

@plurid/pipes.finder • files finder pipe

Version

@plurid/pipes.replacer • content replacer pipe

Codeophon