{"id":15823284,"url":"https://github.com/simplrjs/css-to-ts","last_synced_at":"2025-09-07T10:35:12.187Z","repository":{"id":135182093,"uuid":"87448253","full_name":"SimplrJS/css-to-ts","owner":"SimplrJS","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-08T12:35:19.000Z","size":123,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-27T07:45:50.293Z","etag":null,"topics":["css","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/SimplrJS.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-06T15:57:32.000Z","updated_at":"2023-02-06T17:26:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bd40aff-e9de-484e-8ca9-9d98f20cd143","html_url":"https://github.com/SimplrJS/css-to-ts","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/SimplrJS/css-to-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplrJS%2Fcss-to-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplrJS%2Fcss-to-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplrJS%2Fcss-to-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplrJS%2Fcss-to-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimplrJS","download_url":"https://codeload.github.com/SimplrJS/css-to-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplrJS%2Fcss-to-ts/sbom","scorecard":{"id":130348,"data":{"date":"2025-08-11","repo":{"name":"github.com/SimplrJS/css-to-ts","commit":"5cc4ea36e4114137034ca913d422ebb3ff40f77e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":8,"reason":"Found 6/7 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"39 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T05:08:33.145Z","repository_id":135182093,"created_at":"2025-08-16T05:08:33.145Z","updated_at":"2025-08-16T05:08:33.145Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274026710,"owners_count":25209739,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"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":["css","typescript"],"created_at":"2024-10-05T08:07:42.101Z","updated_at":"2025-09-07T10:35:12.122Z","avatar_url":"https://github.com/SimplrJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-to-ts\n\nCompiles css files to importable TypeScript files.\n\n## Installation\n\n```sh\nnpm install css-to-ts -g\n```\n\nGlobal installation is not necessary. You can install this package with:\n\n```sh\nnpm install css-to-ts\n```\n\nand use it with [`npm-scripts`](https://docs.npmjs.com/misc/scripts).\n\n## Features\n\n- Takes css files and output TypeScript files with exported string containing content of your css file.\n- CLI tool for watching and files compilation.\n- Works with [node-glob](https://github.com/isaacs/node-glob) pattern.\n\n## Command line\n\n### Usage\n\n```sh\ncss-to-ts -h\n```\n\n### Arguments\n\n| Argument                      | Type      | Default                   | Description                                                                   |\n|-------------------------------|-----------|---------------------------|-------------------------------------------------------------------------------|\n| -h, --help                    | boolean   | `false`                   | Show help.                                                                    |\n| -v, --version                 | boolean   | `false`                   | Show current version.                                                         |\n| --rootDir                     | string    | `./`                      | Specifies the root directory of input files.                                  |\n| --outDir                      | string    | `./`                      | Redirect output structure to the directory.                                   |\n| --outExt                      | string    | `ts`                      | Specifies extension of output TypeScript file.                                |\n| --pattern                     | string    | `**/*.css`                | Files glob pattern.                                                           |\n| -w, --watch                   | boolean   | `false`                   | Watch for changes of input files.                                             |\n| --prefix                      | string    |                           | Prefix added to output file name.                                             |\n| --suffix                      | string    |                           | Suffix added to output file name.                                             |\n| --delimiter                   | string    | `-`                       | Specifies delimiter for prefix and suffix. Required if one of these are set.  |\n| --removeSource                | boolean   | `false`                   | Remove all source files specified by glob pattern.                            |\n| --header                      | string    |                           | Specifies header comment in generated TS file.                                |\n| --cwd                         | string    | `process.cwd()`           | Specifies current working directory.                                          |\n| --exclude                     | array     | `[\"**/node_modules/**\"]`  | Specifies an array of globs to exclude.                                       |\n| --varName                     | string    |                           | Specifies name of variable to be exported in TypeScript file.                 |\n| --varType                     | string    | `const`                   | Specifies type of variable to be exported in TypeScript file.                 |\n\n## Example\n\n```sh\ncss-to-ts --rootDir \"./src\" --outDir \"./dist\" --pattern \"*.css\" --header \"File generated with css-to-ts\"\n```\n\nInput file `./src/orange.css`:\n\n```css\n.orange {\n    color: orange;\n    border: 1px solid yellow;\n}\n```\n\nGenerated `./dist/orange.ts`:\n\n```ts\n// File generated with css-to-ts\nexport const Orange = `.orange {\n    color: orange;\n    border: 1px solid yellow;\n}`;\n\n```\n\n## API\n\n### `ConvertCssToTs(stringifiedCss: string, variableName: string, headerComment?: string, varType: VarType = VarType.Const): string`\n\nTakes stringified css and outputs TypeScript code with exported string containing content of your css file.\n\nUsage:\n\n```ts\nimport { ConvertCssToTs } from \"css-to-ts\";\n```\n\n| Argument          | Type   | Required | Description                                               |\n|-------------------|--------|----------|-----------------------------------------------------------|\n| `stringifiedCss`  | string | *        | Stringified css to be exported in TypeScript file.        |\n| `variableName`    | string | *        | Name of variable to be exported in TypeScript file.       |\n| `headerComment`   | string |          | Comment placed in the top of exported TypeScript file.    |\n| `varType`         | string |          | Type of variable to be exported in TypeScript file.       |\n\n```ts\nexport enum VarType {\n    Var = \"var\",\n    Let = \"let\",\n    Const = \"const\"\n}\n```\n\n### `new CssToTsConverter(outputDir, outputFileName, cssDir, cssFileName, varName, header, removeSource, varType)`\n\nCompiles css files to importable TypeScript files.\n\nUsage:\n\n```ts\nimport { CssToTsConverter } from \"css-to-ts\";\n\nconst converter = new CssToTsConverter(\n    outputDir,\n    outputFileName,\n    cssDir,\n    cssFileName,\n    varName,\n    header,\n    removeSource\n);\n\ntry {\n    await converter.Convert();\n} catch(error) {\n    console.error(error);\n}\n```\n\n| Constructor argument  | Type      | Required  | Description                                                   |\n|-----------------------|-----------|-----------|---------------------------------------------------------------|\n| `outputDir`           | string    | *         | Directory of output file.                                     |\n| `outputFileName`      | string    | *         | Name of output file.                                          |\n| `cssDir`              | string    | *         | Directory of css file.                                        |\n| `cssFileName`         | string    | *         | File name of css file.                                        |\n| `varName`             | string    | *         | Name of variable to be exported in TypeScript file.           |\n| `header`              | string    |           | Comment placed in the top of exported TypeScript file.        |\n| `removeSource`        | boolean   |           | Should css file be deleted after TypeScript file emitted.     |\n| `varType`             | VarType   |           | Type of variable to be exported in TypeScript file.           |\n\n## License\n\nReleased under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplrjs%2Fcss-to-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplrjs%2Fcss-to-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplrjs%2Fcss-to-ts/lists"}