New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

files-of-type

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

files-of-type

A small utility that grabs and returns an array of all the file names of a specific type located in specified directory.

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

File-of-type Build Status npm

A small utility that grabs and returns a promise that resolves to an array of all the file names of a specific type located in specified directory. Returns an empty array if no files were found.

Getting Started

npm i files-of-type

or

yarn add files-of-type

Use

/**
 * Create an array of filenames of specific type.
 * @param fileType - the file extension you are searching for
 * @param filePath - the path to directory you would like to search. Defaults to __dirname
 * @returns <Promise> which will eventually resolve to an array with either the files names or empty
 */

const filesOfType = require('file-of-type');

filesOfType('.js').
  then(files => {
    files.map(file => console.log(file));
  });

Keywords

FAQs

Package last updated on 27 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc