Wondering what’s next for npm?Check out our public roadmap! »

    require-paths-in-cwd

    0.0.1 • Public • Published

    require-paths-in-cwd

    npm version Build Status Coverage Status

    Like require.resolve.paths(), but only retrieves paths inside the current working directory

     

    Installation

    Use npm.

    npm install require-paths-in-cwd
    

    API

    const readdirClean = require('require-paths-in-cwd');

    readdirClean(path)

    path: string Buffer URL (directory path)
    Return: Promise<Array<string>>

    Similar to Node.js built-in fs.readdir, but different in the following points:

    readdirClean('path/to/dir').then(paths => {
      paths.includes('.Spotlight-V100'); //=> false
      paths.includes('.Trashes'); //=> false
      paths.includes('Desktop.ini'); //=> false
    });

    License

    ISC License © 2017 Shinnosuke Watanabe

    Install

    npm i require-paths-in-cwd

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    ISC

    Last publish

    Collaborators

    • avatar