nl_tokens: Creates file resources based on another file resource
pl_tokens: function scaffold ( { source = '' , destination = 'destination' , onlyFiles = false , exclude = [ ] , variableRegex = / \{\{\s?([A-Za-z0-9-]+_?[A-Za-z0-9-]+)+\s?\}\} / g , } = { } , data = { } , ) { const cwd = process . cwd ( ) ; const thisSource = pathIsAbsolute ( source ) ? source : path . join ( cwd , source ) ; const thisDestination = pathIsAbsolute ( destination ) ? destination : path . join ( cwd , destination ) ; const thisOnlyFiles = onlyFiles ; const thisExclude = exclude ; const thisVariableRegex = variableRegex ; try { const listOfFiles = fs . readdirSync ( thisSource ) ; const destinationExists = fs . existsSync ( thisDestination ) ; if ( ! destinationExists ) { fs . mkdirSync ( thisDestination ) ; } listOfFiles . forEach ( ( file ) => { const thisFile = path . join ( thisSource , file ) ; const stat = fs . statSync ( thisFile ) ; const destinationFilename = getProcessedPath ( file , data ) ; const destinationPath = path . join ( thisDestination , destinationFilename ) ; if ( stat && stat . isDirectory ( ) && ! thisOnlyFiles && ! thisExclude . includes ( file ) ) { scaffold ( { source : thisFile , destination : destinationPath , onlyFiles : thisOnlyFiles , exclude : thisExclude , variableRegex : thisVariableRegex , } , data ) ; } else if ( ! stat . isDirectory ( ) ) { const template = fs . readFileSync ( thisFile , 'utf-8' ) ; const filledTemplate = getRenderedTemplate ( template , data , thisVariableRegex ) ; fs . writeFileSync ( destinationPath , filledTemplate ) ; } } ) ; } catch ( e ) { throw new <mask> ( e ) ; } }