/files.macro

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

Primary LanguageJavaScript

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