{"id":18570084,"url":"https://github.com/stephanebachelier/inline-coverage-styles","last_synced_at":"2026-04-26T22:31:19.888Z","repository":{"id":142396656,"uuid":"174959390","full_name":"stephanebachelier/inline-coverage-styles","owner":"stephanebachelier","description":"Inline CSS for code coverage reports","archived":false,"fork":false,"pushed_at":"2019-03-14T17:16:11.000Z","size":347,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T22:12:57.217Z","etag":null,"topics":["azure-devops","codecoverage","css","inline-styles","vsts"],"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/stephanebachelier.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-11T08:43:36.000Z","updated_at":"2019-03-14T17:16:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"23a721ee-1fe3-4126-aca3-09038c57d3c6","html_url":"https://github.com/stephanebachelier/inline-coverage-styles","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stephanebachelier/inline-coverage-styles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephanebachelier%2Finline-coverage-styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephanebachelier%2Finline-coverage-styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephanebachelier%2Finline-coverage-styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephanebachelier%2Finline-coverage-styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephanebachelier","download_url":"https://codeload.github.com/stephanebachelier/inline-coverage-styles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephanebachelier%2Finline-coverage-styles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32315711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T21:09:39.134Z","status":"ssl_error","status_checked_at":"2026-04-26T21:09:21.240Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["azure-devops","codecoverage","css","inline-styles","vsts"],"created_at":"2024-11-06T22:37:34.564Z","updated_at":"2026-04-26T22:31:19.874Z","avatar_url":"https://github.com/stephanebachelier.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inline coverage styles\n\n[![Build Status](https://travis-ci.org/stephanebachelier/inline-coverage-styles.svg?branch=master)](https://travis-ci.org/stephanebachelier/inline-coverage-styles)\n[![codecov](https://codecov.io/gh/stephanebachelier/inline-coverage-styles/branch/master/graph/badge.svg)](https://codecov.io/gh/stephanebachelier/inline-coverage-styles)\n\n## Description\n\nInline CSS stylesheets into HTML files.\n\nThe goal of this project is to fix an issue on VSTS or Azure devops, where code coverage report assets can't be loaded, as the reports are loaded in a sandboxed iframe.\n\nSee :\n - Github issue on [azure-pipelines-tasks](https://github.com/Microsoft/azure-pipelines-tasks/issues/3027) repository.\n - [Article](https://davidsekar.com/aspnetcore/code-coverage-html-reports-are-missing-styles-in-vsts)  from `vsts-coverage-styles` author.\n\n*Nota Bene*\n\nThis project can be used not only for inlining linked stylesheets in HTML code coverage reports, but also for any folder with HTML files.\n\n## Installation\n\nLocally :\n\n - npm : `npm i inline-coverage-styles`\n - yarn : `yarn add inline-coverage-styles`\n\nOr globally :\n\n - npm : `npm i -g inline-coverage-styles`\n - yarn : `yarn global add inline-coverage-styles`\n\n## Usage\n\n```\nconst ics = require('inline-coverage-styles')\n\nics({ baseDir: 'coverage' })\n```\n\n## Options\n\n### baseDir: string (required)\n\nThe **absolute path** to the coverage report directory. A relative path might work but it's not tested.\n\n### css: string (optional)\n\nA string with a bunch of css rules to inject in a `\u003cstyle\u003e` tag. Injected before the `\u003chead\u003e` closing tag to avoid any cascade issue.\n\n## Examples\n\nTwo examples are provided in this repository:\n - [Inlining coverage](examples/inline_coverage.js)\n - [Inlining coverage with extra css injection](examples/inline_coverage_with_extra_css.js)\n\nTo run these tests :\n - clone this repository\n - `yarn install`\n - `yarn run test \u0026\u0026 node ./examples/inline_coverage.js`\n - or `yarn run test \u0026\u0026 node ./examples/inline_coverage_with_extra_css.js`\n\n## Roadmap\n\n - [ ] Add CLI\n - [ ] Increase code coverage\n - [ ] test support for relative path\n\n## Inspiration \u0026 motivation\n\nThese project is directly inspired from [vsts-coverage-styles](https://www.npmjs.com/package/vsts-coverage-styles).\nI've decided to build this project :\n\n - `vsts-coverage-styles` is difficult to mock in my custom build processes,\n - `vsts-coverage-styles` does not have tests,\n - I wanted to have a solution with streams instead of having the whole file loaded in memory, to avoid memory issues. Some coverage folders may have a log of HTML reports files.\n - There is no caching of linked CSS files in memory contrary to `vsts-coverage-styles`. The linked stylesheets are first minified and then only the minified version will be loaded from filesystem using stream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanebachelier%2Finline-coverage-styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephanebachelier%2Finline-coverage-styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephanebachelier%2Finline-coverage-styles/lists"}