UNPKG

sugar-generate

Version:

Auto generate OAS 3.0 REST + GraphQL APIs (Node + MongoDB)

33 lines (24 loc) 843 B
const fs = require('fs'); const beautify = require('js-beautify').js; module.exports = async (fileName) => { fileName = `${fileName}/README.md`; const code = ` # Next.js with material ui example ## How to use Download the example [or clone the repo](https://github.com/mui-org/material-ui): \`\`\`sh curl https://codeload.github.com/mui-org/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/nextjs cd nextjs \`\`\` Install it and run: \`\`\`sh npm install npm run dev \`\`\` ## The idea behind the example [Next.js](https://github.com/zeit/next.js) is a framework for server-rendered React apps. [Hooks](https://reactjs.org/docs/hooks-state.html) are an upcoming feature of React. `; const pretty = beautify(code, { indent_size: 2, space_in_empty_paren: true }); fs.writeFileSync(fileName, pretty); };