{"id":19240996,"url":"https://github.com/binocarlos/guilder","last_synced_at":"2025-02-23T14:27:35.788Z","repository":{"id":18650476,"uuid":"21857423","full_name":"binocarlos/guilder","owner":"binocarlos","description":"builder for g's","archived":false,"fork":false,"pushed_at":"2014-08-30T11:21:47.000Z","size":752,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T13:40:01.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binocarlos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-15T11:37:53.000Z","updated_at":"2014-07-15T11:38:17.000Z","dependencies_parsed_at":"2022-09-15T01:22:17.753Z","dependency_job_id":null,"html_url":"https://github.com/binocarlos/guilder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fguilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fguilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fguilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fguilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binocarlos","download_url":"https://codeload.github.com/binocarlos/guilder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240326630,"owners_count":19783881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T17:09:48.352Z","updated_at":"2025-02-23T14:27:35.768Z","avatar_url":"https://github.com/binocarlos.png","language":"JavaScript","readme":"guilder\n=======\n\nA project builder for g's\n\n## install\n\n```\n$ npm install guilder\n```\n\nFor the image resizing you need [ImageMagick](http://www.imagemagick.org/) on your system\n## usage\n\nguilder is a toolkit for scaffolding and building projects using source template folders.\n\nIt has tools for the following jobs:\n\n * folder copy/initialization\n * image resizing\n * writing data to template pages (using ejs)\n * installing/building components\n\nYou use it as a library in custom build scripts:\n\n```js\nvar Guilder = require('guilder')\n\n// where does the app template live\nvar source = __dirname + '/gametemplate'\n\n// where are we building the app\nvar dest = __dirname + '/dist/test'\n\n// create a project from the source template and the destination folder\n// everything from here becomes relative\nvar project = Guilder(source, dest)\n\n// handle logging\nproject.on('log', function(st){\n\tconsole.log(st)\n})\n\n// run through build steps in series\nGuilder.series([\n\n\tfunction(next){\n\t\t// do something custom\n\t\tnext()\n\t},\n\n\t// install the component in the source folder with autoReset = true\n\tproject.installComponent(true),\n\n\t// install the component in the source folder with autoReset = true\n\tproject.buildComponent(true),\n\n\t// this will create the destination folder with autoRemove = true\n\tproject.ensureFolder(true),\n\n\t// copy files using globs\n\tproject.copy('css/**', function(path){\n\t\t// you can alter the copy path here\n\t\treturn path\n\t}),\n\n\t// resize images\n\tproject.resizeImages('img/*.png', '590x600', function(path){\n\t\t// you can alter the copy path here\n\t\treturn path\n\t}),\n\n\t// write data - this can be .html pages or any other text file\n\tproject.write('config.json', JSON.stringify({}))\n\n], function(error){\n\tif(error){\n\t\tconsole.error(error)\n\t\tprocess.exit(1)\n\t}\n\telse{\n\t\tprocess.exit()\t\n\t}\n})\n```\n\n## api\n\n#### `var project = Guilder(source)`\n\nCreate a new project from a source template\n\n#### `Guilder.parallel`\n\nProxy to [async.parallel](https://github.com/caolan/async#parallel)\n\n#### `Guilder.series`\n\nProxy to [async.series](https://github.com/caolan/async#seriestasks-callback)\n\n#### `Guilder.copy(srcFolder, glob, destFolder)`\n\nStatic version of copy where you can pass the source and destination folders explicitly\n\n#### `project.ensureFolder(autoRemove)`\n\nEnsure the destination folder exists - autoRemove will delete if it exists\n\n#### `project.installComponent(autoReset)`\n\nInstall the component in the source folder - autoReset will remove the components folder before component install\n\n#### `project.buildComponent(autoReset)`\n\nBuild the component in the source folder - autoReset will remove the build folder before component build\n\n#### `project.copy(srcGlob, [processPath])`\n\nCopy each file matching the srcGlob into the dest folder\n\nprocessPath is a map function that lets you change the target location of each file\n\n#### `project.manualCopy(srcFolder, srcGlob, destFolder, [processPath])`\n\nThe same as copy but you get to specific the source and destination folders\n\n#### `project.resizeImages(srcGlob, size, [processPath])`\n\nResize images matching the glob into the destination location\n\nSize is an object with `width` and `height` properties or a string of the format `[width]x[height]`\n\nprocessPath is an optional function that can remap the destination path for the image\n\n```js\nproject.resizeImages('img/**', '100x100', function(path){\n\tif(path.match(/car/)){\n\t\treturn 'otherfolder/car.jpg'\n\t}\n\telse{\n\t\treturn path\n\t}\n})\n```\n\n#### `project.write(path, data)`\n\nWrite a 'utf8' encoded text file to the file at dest/[path]\n\nThis is useful for writing templates and other data\n\n\n#### `project.template(src, target, data)`\n\nRender an ejs template loaded from src (in the source folder) and using data, then write the output to target (in the destination folder)\n\n\n## events\n\n#### `project.on('log', function(string){})`\n\nThe logs are emitted to be handled in a custom way\n\n## licence\nMIT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fguilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinocarlos%2Fguilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fguilder/lists"}