Skip to content

Instantly share code, notes, and snippets.

@Bamblehorse
Last active July 18, 2018 17:40
Show Gist options
  • Save Bamblehorse/20db9a31e2c742af30b09dbe677dc6e3 to your computer and use it in GitHub Desktop.
Save Bamblehorse/20db9a31e2c742af30b09dbe677dc6e3 to your computer and use it in GitHub Desktop.
const chokidar = require("chokidar");
const watcher = chokidar
.watch("src/components/**", { ignored: /node_modules/ })
.on("addDir", (path, event) => {
const name = path.replace(/.*\/components\//, "");
const goodToGo = /^[^\/_]*$/.test(name);
if (goodToGo) createFiles(path, name);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment