添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
坐怀不乱的铅笔  ·  GitHub - ...·  5 天前    · 
鬼畜的仙人掌  ·  Intel Core i9-11900K ...·  5 月前    · 
玩滑板的凉面  ·  [jax2tf] DecodeError: ...·  6 月前    · 

Usage

var path = require('path');
 
requirePath({
    path: path.join(__dirname, 'my-directory'),
    include: ['**/*.js', '**/*.json'],
    exclude: ['**/*Spec.js']
  })
  // returns a standard promise
  .then(function (modules) {
    // `modules` is a map of filenames to require()'d components from those files
  })
  // don't forget to handle errors!
  .catch(handleError);

Options

Property Description include string or array of minimatch patterns. A file in the path(s) that match at least one pattern will be require(...) 'd unless the file also matches an exclusion pattern. Default: ['**/*.js', '**/*.json'] . exclude string or array of minimatch patterns. Files in the path(s) that match at least one pattern will be excluded. Default: ['**/*Spec.js'] .