{"id":19707084,"url":"https://github.com/geyang/karma-text2js-preprocessor","last_synced_at":"2026-04-17T04:03:31.121Z","repository":{"id":29353681,"uuid":"32887950","full_name":"geyang/karma-text2js-preprocessor","owner":"geyang","description":"karma preprocessor that turns text documents into strings. [angular module mode available]","archived":false,"fork":false,"pushed_at":"2015-03-25T23:44:27.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-27T18:10:03.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/geyang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T20:06:24.000Z","updated_at":"2015-03-25T23:44:28.000Z","dependencies_parsed_at":"2022-09-05T20:51:20.921Z","dependency_job_id":null,"html_url":"https://github.com/geyang/karma-text2js-preprocessor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geyang/karma-text2js-preprocessor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fkarma-text2js-preprocessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fkarma-text2js-preprocessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fkarma-text2js-preprocessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fkarma-text2js-preprocessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geyang","download_url":"https://codeload.github.com/geyang/karma-text2js-preprocessor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fkarma-text2js-preprocessor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31914462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11T21:37:54.286Z","updated_at":"2026-04-17T04:03:31.101Z","avatar_url":"https://github.com/geyang.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karma-text2js-preprocessor\n\n\u003e Preprocessor for converting text files to javascript strings.\n\n## Installation\n\nThe easiest way is to keep `karma-text2js-preprocessor` as a devDependency in your `package.json`.\n```json\n{\n  \"devDependencies\": {\n    \"karma\": \"~0.10\",\n    \"karma-text2js-preprocessor\": \"~0.1\"\n  }\n}\n```\n\nYou can simple do it by:\n```bash\nnpm install karma-text2js-preprocessor --save-dev\n```\n\n## Configuration\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    preprocessors: {\n      '**/*.html': ['text2js']\n    },\n\n    files: [\n      '*.js',\n      '*.html',\n      '*.html.ext',\n      // if you wanna load template files in nested directories, you must use this\n      '**/*.html'\n    ],\n\n    text2JsPreprocessor: {\n      // strip this from the file path\n      stripPrefix: 'public/',\n      stripSufix: '.ext',\n      // prepend this to the\n      prependPrefix: 'served/',\n\n      // or define a custom transform function\n      cacheIdFromPath: function(filepath) {\n        return cacheId;\n      },\n\n      // in angular mode, angular modules are created\n      angularMode: true,\n      // setting this option will create only a single module that contains templates\n      // from all the files, so you can load them all with module('foo')\n      moduleName: 'foo'\n    }\n  });\n};\n```\n\n----\n\nFor more information on Karma see the [homepage].\n\n\n[homepage]: http://karma-runner.github.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fkarma-text2js-preprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeyang%2Fkarma-text2js-preprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fkarma-text2js-preprocessor/lists"}