{"id":17736610,"url":"https://github.com/parro-it/folderify","last_synced_at":"2025-04-28T15:24:09.246Z","repository":{"id":12326047,"uuid":"14963422","full_name":"parro-it/folderify","owner":"parro-it","description":"A browserify transform to convert calls to include-folder to inline file content","archived":false,"fork":false,"pushed_at":"2020-10-02T12:59:54.000Z","size":65,"stargazers_count":31,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T06:41:57.634Z","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":"resmo/ansible-role-ntp","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parro-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-05T19:25:35.000Z","updated_at":"2023-03-04T06:29:50.000Z","dependencies_parsed_at":"2022-08-02T20:15:41.382Z","dependency_job_id":null,"html_url":"https://github.com/parro-it/folderify","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ffolderify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ffolderify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ffolderify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ffolderify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parro-it","download_url":"https://codeload.github.com/parro-it/folderify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251336807,"owners_count":21573264,"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-10-26T00:23:44.389Z","updated_at":"2025-04-28T15:24:09.215Z","avatar_url":"https://github.com/parro-it.png","language":"JavaScript","readme":"\n\n# folderify\n[![Build Status](https://img.shields.io/travis/parro-it/folderify.svg)](http://travis-ci.org/parro-it/folderify) \n[![Npm module](https://img.shields.io/npm/dt/folderify.svg)](https://npmjs.org/package/folderify) \n[![Code Climate](https://img.shields.io/codeclimate/github/parro-it/folderify.svg)](https://codeclimate.com/github/parro-it/folderify)\n[![Coverage](https://img.shields.io/codeclimate/coverage/github/parro-it/folderify.svg)](https://codeclimate.com/github/parro-it/folderify)\n[![Dependencies](https://img.shields.io/versioneye/d/parro-it/folderify.svg)](https://codeclimate.com/github/parro-it/folderify)\n\n\n\n\n\nbrowserify call to [includeFolder](https://github.com/parro-it/include-folder)\n\n\nThis module is a plugin for [browserify](http://browserify.org) to parse the AST\nfor `includeFolder()` calls so that you can inline folder contents into your\nbundles.\n\nEven though this module is intended for use with browserify, nothing about it is\nparticularly specific to browserify so it should be generally useful in other\nprojects.\n\n## Getting Started\nInstall the module with: `npm install folderify --save`\n\nthen, for a main.js:\n\n``` js\nvar includeFolder = require('include-folder'),\n    folder = includeFolder(\"./aFolder\");\n```\n\nand a [aFolder like this](https://github.com/parro-it/include-folder/tree/master/test/files):\n\n\nwhen you run the browserify command:\n\n```\n$ browserify -t folderify main.js \u003e bundle.js\n```\n\nnow in the bundle output file you get,\n\n``` js\nvar includeFolder = undefined,\n    folder =  {\n               file3OtherFile: 'this is file3OtherContent content',\n               file1: 'this is file1 content',\n               file1_1: 'this is file1_1 content'\n           };\n```\n\n\n## or with the api\n\n``` js\nvar browserify = require('browserify');\nvar fs = require('fs');\n\nvar b = browserify('example/main.js');\nb.transform('folderify');\n\nb.bundle().pipe(fs.createWriteStream('bundle.js'));\n```\n\n\n\n\n##How it works\n\nFolderify inline a whole directory content in browserify results.\n\n1. It uses falafel to intercepts calls to [include-folder](https://github.com/parro-it/include-folder)\n2. use include-folder to generate source code of a function with a fs.readFileSync call for each file in directory\n3. feed brfs stream with generated source code\n4. replace include-folder call with brfs output\n\n\n##Use cases\n\nI use it to inline my HTML templates folder when I browserify\n sites, but I guess it could be useful in many situations...\n\n##Custom file extensions\n\nBy default, supported file extensions are:\n- `.es`\n- `.es6`\n- `.js`\n- `.jsx`\n\nThe list is exposed as a property `validExtensions` on the folderify function and can be easily extended:\n```js\nvar browserify = require('browserify');\nvar folderify = require('folderify');\nfolderify.validExtensions.push('.custom-js');\n\nvar b = browserify('example/main.js');\nb.transform(folderify);\n```\n\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\nAdd unit tests for any new or changed functionality.\n\n\n## License\n\nCopyright (c) 2013 Andrea Parodi\n\nLicensed under the MIT license.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Ffolderify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparro-it%2Ffolderify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Ffolderify/lists"}