junk
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.0 • Public • Published

    junk

    Filter out system junk files like .DS_Store and Thumbs.db

    Install

    $ npm install junk
    

    Usage

    import fs from 'node:fs/promises';
    import {isNotJunk} from 'junk';
    
    const files = await fs.readdir('some/path');
    
    console.log(files);
    //=> ['.DS_Store', 'test.jpg']
    
    console.log(files.filter(isNotJunk));
    //=> ['test.jpg']

    API

    isJunk(filename)

    Returns true if filename matches a junk file.

    isNotJunk(filename)

    Returns true if filename does not match a junk file.

    junkRegex

    Regex used for matching junk files.

    Install

    npm i junk

    DownloadsWeekly Downloads

    4,266,577

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    4.33 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus