Skip to content

Read files name from folder at build time and use as regular array of strings

Notifications You must be signed in to change notification settings

Ridermansb/files.macro

Repository files navigation

files.macro

Travis (.org) branch npm Babel Macro Greenkeeper badge FOSSA Status

Get array with file names in build time

Usage

Just call function passing directory parameter:

import files from "files.macro";

const allImages = files("./assets/images");

// Will transpiled to

//    ↓ ↓ ↓ ↓ ↓ ↓

const allImages = [ 'avatar.png', 'catalog.png' ] 

License

MIT

FOSSA Status

About

Read files name from folder at build time and use as regular array of strings

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •