🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

getfiles

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getfiles

利用promise简单实现了异步获取指定目录下,指定文件的功能

latest
npmnpm
Version
1.1.0
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

说明

利用promise简单实现了异步获取指定目录下,指定文件的功能

用法1


const getFile = require('getFiles');

const A = new getFile('demo','js');

A.getResult({
    callback: function(arr){
      console.log(arr)
    }
});

用法2


const getFile = require('getFiles');

const A = new getFile('demo');

A.getResult({
    suffix:['js','css'],
    callback: function(arr){
      console.log(arr)
    }
});

用法3


const getFile = require('getFiles');

const A = new getFile();

A.getResult({
    root:'demo',
    suffix:['js','css'],
    callback: function(arr){
      console.log(arr)
    }
});

简单地说,可以构建实例的时候就确定参数,也可以构建一个实例,在调用的时候在传参。已getResult入参为准

FAQs

Package last updated on 19 May 2017

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