{"id":19505912,"url":"https://github.com/morlay/br-processor","last_synced_at":"2025-07-10T16:35:53.841Z","repository":{"id":20237143,"uuid":"23509166","full_name":"morlay/br-processor","owner":"morlay","description":null,"archived":false,"fork":false,"pushed_at":"2016-04-07T03:39:14.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T14:12:26.640Z","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/morlay.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-08-31T08:05:45.000Z","updated_at":"2016-04-07T03:19:06.000Z","dependencies_parsed_at":"2022-07-23T05:02:02.596Z","dependency_job_id":null,"html_url":"https://github.com/morlay/br-processor","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/morlay%2Fbr-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbr-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbr-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbr-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morlay","download_url":"https://codeload.github.com/morlay/br-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240754364,"owners_count":19852189,"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-10T22:34:54.126Z","updated_at":"2025-02-25T22:15:49.362Z","avatar_url":"https://github.com/morlay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## br processor\n\nUse for [browserify transform](https://github.com/substack/node-browserify#btransformopts-tr)\nand translate code of template engine or pre-proccessor to javascript string.\n\n[![Build Status](https://travis-ci.org/morlay/br-processor.svg?branch=master)](https://travis-ci.org/morlay/br-processor)\n[![Dependencies](https://david-dm.org/morlay/br-processor.png)](https://david-dm.org/morlay/br-processor)\n\nSupport most pre-precessor which has sync api;\n\n## Options\n\n* `processorList`\n  - `matchTest` to test file's ext and return boolean to tell browserfiy transform;\n  - `process` a process translate **input string** to browserify js code;\n\n## Demo\n\nThen use for `b.transform(transformOpts,brProcessor)`\n\n\n    var jade = require('jade');\n\n    var transformOpts = {\n      processorList: [{\n        matchTest: function(file) {\n          return /\\.jade$/.exec(file);\n        },\n        process: function(inputString) {\n          return html2jsWraper(jade.render(inputString, jadeOpts));\n        }\n      }]\n    }\n\n    function html2jsWraper(string) {\n      return [\n        'module.exports=',\n        escapeContent(string),\n        ';'\n      ].join('\\'')\n    }\n\n    function escapeContent(content) {\n      return content.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, '\\\\\\'').replace(/\\r?\\n/g,\n        '\\\\n\\' +\\n    \\'');\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbr-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorlay%2Fbr-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbr-processor/lists"}