Skip to content

Instantly share code, notes, and snippets.

View vladyslav-dotsenko's full-sized avatar

Vlad Dotsenko vladyslav-dotsenko

View GitHub Profile
git checkout master &&
git branch -D gh-pages &&
git branch gh-pages &&
git checkout gh-pages &&
yarn install &&
yarn build &&
rm -rf node_modules public README.md src yarn.lock build-gh-pages.sh &&
mv build/* ./ &&
rm -rf build &&
git add . &&
@vladyslav-dotsenko
vladyslav-dotsenko / index.js
Last active May 30, 2018 20:53
NodeJS sample of `index.js` file that wraps all sibling files in a folder
'use strict';
const trimName = filename => filename.replace(/\.(js|json)$/i, '');
const modules = require("fs")
.readdirSync(__dirname)
.map((file) => [trimName(file), require("./" + file)]);
module.exports = modules.reduce((acc, module) => {
acc[module[0]] = module[1];