Skip to content

Instantly share code, notes, and snippets.

@erasmo-marin
Created December 2, 2017 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erasmo-marin/3d5033ef4e82f19418565d5239b7e980 to your computer and use it in GitHub Desktop.
Save erasmo-marin/3d5033ef4e82f19418565d5239b7e980 to your computer and use it in GitHub Desktop.
import fsPath from "fs-path";
const saveUrlToFile = ({ html = "", pathName = "/", output = "." }) => {
const path = pathName == "/"
? `${output}/index.html`
: `${output}${pathName}.html`;
fsPath.writeFile(path, html, err => {
if (err) {
throw err;
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment