{"id":16184597,"url":"https://github.com/rmariuzzo/grunt-fb-flo","last_synced_at":"2025-03-19T02:31:19.043Z","repository":{"id":17427577,"uuid":"20200771","full_name":"rmariuzzo/grunt-fb-flo","owner":"rmariuzzo","description":"Starts a fb-flo server","archived":false,"fork":false,"pushed_at":"2015-05-11T15:53:25.000Z","size":273,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T14:11:16.073Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmariuzzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-26T23:13:17.000Z","updated_at":"2024-02-21T19:09:03.000Z","dependencies_parsed_at":"2022-09-26T21:30:48.474Z","dependency_job_id":null,"html_url":"https://github.com/rmariuzzo/grunt-fb-flo","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fgrunt-fb-flo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fgrunt-fb-flo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fgrunt-fb-flo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fgrunt-fb-flo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmariuzzo","download_url":"https://codeload.github.com/rmariuzzo/grunt-fb-flo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960435,"owners_count":20375102,"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-10T07:10:39.793Z","updated_at":"2025-03-19T02:31:18.780Z","avatar_url":"https://github.com/rmariuzzo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-fb-flo\n\n\u003e Starts a fb-flo server.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-fb-flo --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-fb-flo');\n```\n\n## Grunt Flo task\n\n_Run this task with the `grunt fb-flo` command._\n\n### Usage\n\n#### Example with auto resolvers\n\nInstead of writing full function resolver inside your Gruntfile you can use _auto resolvers_. This will help you dramatically reduce the amount of code to write.\n\n```js\ngrunt.initConfig({\n    flo: {\n        serve: {\n            options: {\n                \n                // fb-flo options.\n                dir: './',\n                glob: [\n                    '!**/.subl*.tmp'\n                ],\n\n                // auto resolvers.\n                resolvers: [{\n                    files: ['assets/**/*.js'],\n                    tasks: ['jshint']\n                }, {\n                    files: ['assets/**/*.scss'],\n                    tasks: ['sass:dev'],\n                    callback: {\n                        resourceURL: 'assets/css/main.css',\n                        contentsPath: 'assets/css/main.css'\n                    }\n                }, {\n                    files: ['views/**/*.html', 'views/**/*.hbs'],\n                    tasks: ['targethtml:dev'],\n                    callback: {\n                        reload: true\n                    }\n                }]\n            }\n        }\n    }\n}\n```\n\n**Notes about auto resolvers**\n\n - The `files` property is an array of [minimatch patterns](https://github.com/isaacs/minimatch).\n - The `tasks` property is an array of grunt tasks to run when a watched files changes.\n - The `callback` property is optional. If not provided, then the path of the changed file will be used as the resourceURL and its contents as the contents to be passed to fb-flo client. The `callback` have an custom property called `contentsPath` where you can set the path of the file to read its content (all other properties are the same as the original callback object defined by fb-flo). Also, the `callback` property can be a function that return a callback object (the function will received the filepath).\n\n#### Example with full resolver\n\n```js\ngrunt.initConfig({\n    flo: {\n        serve: {\n            options: {\n                dir: 'assets/',\n                resolver: function (filepath, callback) {\n                    exec('make', function(err) {\n                        if (err) throw err;\n                        callback({\n                            resourceURL: 'dist' + path.extname(filepath),\n                            contents: fs.readFileSync('src' + path.extname(filepath)).toString()\n                        })\n                    });\n                }\n            }\n        }\n    }\n}\n```\n\n### Options\n\n#### port\nType: `number`\nDefault value: `8888`\n\nThe port to start the fb-flo server.\n\n#### host\nType: `string`\nDefault value: `localhost`\n\nThe host to listen on.\n\n#### verbose\nType: `boolean`\nDefault value: `false`\n\nIndicates if flo should be noisy.\n\n#### glob\nType: `array`\nDefault value: `[]`\n\nA glob string or array of globs to match against the files to watch.\n\n#### useFilePolling\nType: `boolean`\nDefault value: `false`\n\nIndicates if the file watcher should work in polling mode.\n\n#### pollingInterval\nType: `number`\nDefault value: `localhost`\n\nInterval at which to poll for file changes (if `useFilePolling` is set to true).\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmariuzzo%2Fgrunt-fb-flo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmariuzzo%2Fgrunt-fb-flo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmariuzzo%2Fgrunt-fb-flo/lists"}