Skip to content

Instantly share code, notes, and snippets.

@starakaj
Created February 22, 2021 21:47
Show Gist options
  • Save starakaj/7b3c1fcd1a3e0d15690c824d595f3485 to your computer and use it in GitHub Desktop.
Save starakaj/7b3c1fcd1a3e0d15690c824d595f3485 to your computer and use it in GitHub Desktop.
Babel templates so nice
const makeAddFive = template(`
var %%newVariable%% = %%oldVariable%% + 5;
`);
const addFiveStatement = makeAddFive({
newVariable: "x",
oldVariable: "y"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment