puke

1.0.0 • Public • Published

puke

scaffolds a folder structure from a jsonish description

example

npm install puke

const puke = require('puke')
 
const name = 'module-foobar'
// in current directory (=== process.cwd())
const foldername = name
 
puke(foldername, scaffold(name))
// => creates in ./<foldername>/* the directory structure
//    specified in the `scaffold` function below
 
function scaffold (name) {
  return {
    "node_modules": {
      "level-callerid": {
        "index.js": `
 
        `,
        "package.json": `
 
        `
      }
    },
    [`source-${name}`]: {
      "node_modules": {
        "d": {
          "d.js": `
 
          `,
          "package.json": `
 
          `
        },
        "e": {
          "node_modules": {
            "d": {
              "d.js": `
 
              `,
              "package.json": `
 
              `
            }
          },
          "e.js": `
 
          `,
          "f.js": `
 
          `,
          "package.json": `
 
          `
        }
      },
      "index.js": `
 
      `
    },
    "a.js": `
    `,
    "b.js": `
 
    `,
    "c.js": `
 
    `,
    "package.json": `
 
    `
  }
}

Package Sidebar

Install

npm i puke

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.84 kB

Total Files

106

Last publish

Collaborators

  • serapath