{"id":21599178,"url":"https://github.com/gridonic/postcss-replace","last_synced_at":"2025-04-11T01:05:16.299Z","repository":{"id":26419365,"uuid":"106821342","full_name":"gridonic/postcss-replace","owner":"gridonic","description":"PostCSS plugin for replacing strings. ","archived":false,"fork":false,"pushed_at":"2023-03-21T15:23:36.000Z","size":1219,"stargazers_count":27,"open_issues_count":8,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T21:51:07.760Z","etag":null,"topics":["postcss","postcss-plugin","replace","strings"],"latest_commit_sha":null,"homepage":"","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/gridonic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-10-13T12:26:26.000Z","updated_at":"2025-03-02T21:36:24.000Z","dependencies_parsed_at":"2024-06-18T16:46:07.151Z","dependency_job_id":"323bb50a-1652-436c-9ad0-7f4ec6615aca","html_url":"https://github.com/gridonic/postcss-replace","commit_stats":{"total_commits":118,"total_committers":11,"mean_commits":"10.727272727272727","dds":0.6355932203389831,"last_synced_commit":"ec0d9253df7fed586aba5207c69d7d4bcfb67abf"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fpostcss-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fpostcss-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fpostcss-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridonic%2Fpostcss-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridonic","download_url":"https://codeload.github.com/gridonic/postcss-replace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142940,"owners_count":21054671,"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":["postcss","postcss-plugin","replace","strings"],"created_at":"2024-11-24T18:14:37.701Z","updated_at":"2025-04-11T01:05:16.267Z","avatar_url":"https://github.com/gridonic.png","language":"JavaScript","readme":"# PostCSS Replace [\u003cimg src=\"http://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS\" width=\"90\" height=\"90\" align=\"right\"\u003e][PostCSS] \n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Coverage Status][cov-img]][cov-url]\n[![Licensing][lic-img]][lic-url]\n[![Changelog][log-img]][log-url]\n\n[PostCSS] plugin for replacing strings.\n\n**Write this:**\n\n```css\n/* CustomCSS Library v{{ version }} */\n.foo {\n  content: \"{{ author }}\";\n}\n```\n\n**And get this:**\n\n```css\n/* CustomCSS Library v1.3.7 */\n.foo {\n  content: \"Gridonic\";\n}\n```\n\n## Installation\n\n`$ npm install postcss-replace`\n\n## Usage\n\n```JS\npostcss([ require('postcss-replace') ])\n```\n\nSee [PostCSS](https://github.com/postcss/postcss) docs for [examples regarding usage](https://github.com/postcss/postcss#usage).\n\n## Options\n\n### `pattern`\n\n- Type: `string` | `RegEx`\n- Default: `'{{\\\\s?([^\\\\s]+?)\\\\s?}}'`\n\nThe default pattern will replace strings in the format of `{{ myExampleKey }}`. Adjust this pattern if you want \nsomething different, for example `/_([^\\s]+?)_/` to match strings like `_myExampleKey_`.\n\n### `commentsOnly`\n\n- Type: `boolean`\n- Default: `false`\n\nBy default the plugin will replace strings in comments _and_ values. Turn this to `true` if you _only_ want to replace strings \nin comments.\n\n### `data`\n\n- Type: `object`\n- Default: `{}`\n\nThis is the key → value object that provides the data for the plugin for replacing strings.\n\n- If the key `replaceAll` is provided all matched strings will be replaced by the given value\ne.g:\n`data: { replaceAll: 'replace all matched strings with this text' }` \n\n## Testing\n\nTests can be run via the following command:\n\n`$ npm run test`\n\nWe use mutant-testing to test the resilience of our tests. \nStryker can be run via the following command:\n\n`$ npm run test:mutate`\n\n[npm-url]: https://www.npmjs.com/package/postcss-replace\n[npm-img]: https://img.shields.io/npm/v/postcss-replace.svg\n[cli-url]: https://travis-ci.org/gridonic/postcss-replace\n[cli-img]: https://travis-ci.org/gridonic/postcss-replace.svg\n[lic-url]: LICENSE\n[lic-img]: https://img.shields.io/npm/l/postcss-replace.svg\n[log-url]: CHANGELOG.md\n[log-img]: https://img.shields.io/badge/changelog-md-blue.svg\n[cov-url]: https://coveralls.io/github/gridonic/postcss-replace?branch=master\n[cov-img]: https://coveralls.io/repos/github/gridonic/postcss-replace/badge.svg?branch=master\n\n[PostCSS]: https://github.com/postcss/postcss\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fpostcss-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridonic%2Fpostcss-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridonic%2Fpostcss-replace/lists"}