{"id":17472697,"url":"https://github.com/shinnn/clean-css-promise","last_synced_at":"2025-08-04T06:32:43.522Z","repository":{"id":52171844,"uuid":"43735192","full_name":"shinnn/clean-css-promise","owner":"shinnn","description":"Promisified version of clean-css","archived":false,"fork":false,"pushed_at":"2021-05-06T12:30:43.000Z","size":103,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-18T21:02:06.405Z","etag":null,"topics":["async","clean-css","css","javascript","minification","nodejs","optimization","promise","style","wrapper"],"latest_commit_sha":null,"homepage":"https://github.com/jakubpawlowicz/clean-css","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinnn.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":"2015-10-06T07:06:36.000Z","updated_at":"2024-07-01T19:25:20.000Z","dependencies_parsed_at":"2022-09-16T15:00:51.879Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/clean-css-promise","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fclean-css-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fclean-css-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fclean-css-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fclean-css-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/clean-css-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228604603,"owners_count":17944281,"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":["async","clean-css","css","javascript","minification","nodejs","optimization","promise","style","wrapper"],"created_at":"2024-10-18T17:34:07.043Z","updated_at":"2024-12-07T13:16:03.621Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clean-css-promise\n\n[![npm version](https://img.shields.io/npm/v/clean-css-promise.svg)](https://www.npmjs.com/package/clean-css-promise)\n[![Github Actions](https://action-badges.now.sh/shinnn/clean-css-promise)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/clean-css-promise)\n[![codecov](https://codecov.io/gh/shinnn/clean-css-promise/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/clean-css-promise)\n\n[clean-css](https://github.com/jakubpawlowicz/clean-css) with the default [Promise](https://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Promise) interface and some improvements\n\n```javascript\nconst CleanCssPromise = require('clean-css-promise');\n\n(async () =\u003e {\n  const {styles} = await new CleanCssPromise().minify(`\np {\n  color: #ff0000;\n}\n\nb {\n  /* nothing */\n}\n`); //=\u003e 'p{color:red}'\n})();\n```\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install clean-css-promise\n```\n\n## API\n\n```javascript\nconst CleanCssPromise = require('clean-css-promise');\n```\n\n### class CleanCssPromise([*options*])\n\n*options*: `Object` ([clean-css constructor options](https://github.com/jakubpawlowicz/clean-css#constructor-options))  \n\nAlmost the same the original `clean-css`, except for:\n\n* [`returnPromise` option](https://github.com/jakubpawlowicz/clean-css#promise-interface) is enabled by default, and cannot be disabled.\n* [*onRejected*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then#Parameters) function receives an `Error` instead of an `Array`.\n* All problems that clean-css considers as *warnings*, for example broken CSS syntax, are regarded as *errors*.\n\n```javascript\nconst CleanCssPromise = require('clean-css-promise');\n\nnew CleanCssPromise({})\n.minify('@import url(/foo);}')\n.catch(err =\u003e {\n  err.message;\n  /*=\u003e `2 errors found while optimizing CSS with clean-css:\n  1. Ignoring local @import of \"/foo\" as resource is missing.\n  2. Invalid character(s) '?' at 1:18. Ignoring.\n\nclean-css dangerously ignores these errors but clean-css-promise doesn't, because it's much more reasonable to update the CSS to fix all problems than to pretend that you didn't see the errors.` */\n});\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 - 2019 Watanabe Shinnosuke\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fclean-css-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fclean-css-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fclean-css-promise/lists"}