{"id":21448974,"url":"https://github.com/stackcss/style-deps","last_synced_at":"2025-07-14T20:31:30.018Z","repository":{"id":14012256,"uuid":"16713789","full_name":"stackcss/style-deps","owner":"stackcss","description":"Traverse the dependency graph of a CSS project using npm-style import statements","archived":false,"fork":false,"pushed_at":"2015-09-09T11:29:12.000Z","size":336,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-01T19:07:35.306Z","etag":null,"topics":[],"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/stackcss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-11T00:10:15.000Z","updated_at":"2016-09-18T15:08:44.000Z","dependencies_parsed_at":"2022-08-30T14:31:52.562Z","dependency_job_id":null,"html_url":"https://github.com/stackcss/style-deps","commit_stats":null,"previous_names":["requireio/style-deps"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/stackcss/style-deps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackcss%2Fstyle-deps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackcss%2Fstyle-deps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackcss%2Fstyle-deps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackcss%2Fstyle-deps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackcss","download_url":"https://codeload.github.com/stackcss/style-deps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackcss%2Fstyle-deps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265344830,"owners_count":23750566,"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":[],"created_at":"2024-11-23T03:17:46.348Z","updated_at":"2025-07-14T20:31:29.650Z","avatar_url":"https://github.com/stackcss.png","language":"JavaScript","readme":"# style-deps #\n\nTraverse the dependency graph of a CSS project using npm-style import\nstatements, asynchronously. Basically:\n[rework-npm](http://github.com/conradz/rework-npm/) meets\n[module-deps](http://github.com/substack/module-deps/).\n\n## Usage ##\n\n### `styleDeps(file, [opts], done)` ###\n\nStarting with `file` as the entry file, traverse your project's dependency\ntree and come back with a single CSS bundle. Accepts for the following options:\n\n* `compress`: whether to minify the final CSS. Defaults to `false`.\n* `debug`: set to `true` to enable CSS sourcemaps. Defaults to `false`.\n* `transforms`: transform streams for modifying your CSS before it gets parsed.\n* `pipe`: accept streaming input by piping to the stream this function returns.\n\nReturns a text stream which will simply emit the bundle as a single chunk when\ncomplete. This stream will also emit a `file` event for each file included\nin the bundle so that you can easily plug `style-deps` and its dependants\ninto file-watching tools such as\n[watchify](http://github.com/substack/watchify).\n\n### Text Transforms ###\n\nMuch like browserify transforms, each text transform is a function which takes\nthe absolute file path and returns a through stream that modifies the file\nbefore it's parsed:\n\n``` javascript\nconst through = require('through2')\nconst deps = require('style-deps')\n\ndeps(__dirname + '/index.css', { transforms: [ lowerCase ] })\n  .pipe(process.stdout)\n\n// Lower-case all of your project's CSS\nfunction lowerCase (file) {\n  return through((chunk, enc, next) =\u003e {\n    this.push(chunk.toString().toLowerCase())\n    next()\n  })\n}\n```\n\n### Source Transforms ###\n\nSimilar to text transforms, except instead of returning a stream source\ntransforms should return a function. This function should accept a CSS AST\ngenerated by [css-parse](http://github.com/reworkcss/css-parse), modifying it\nto make changes to the stylesheet after being parsed but before importing any\nmodules.\n\nUsing source transforms instead of text transforms is recommended, considering\nthat in the latter case transforms tend to parse/stringify content repeatedly\nresulting in unnecessary overhead.\n\nEach returned source transform function is passed two arguments:\n\n* `style`: the parsed CSS AST to process.\n* `next(err, new)`: a callback to be called when complete. You can either\n  pass the callback nothing, or provide a `new` replacement value for the\n  AST to use in the next modifier.\n\n``` javascript\nconst shade = require('rework-shade')\nconst deps = require('style-deps')\n\ndeps(__dirname + '/index.css', { transforms: [ modifier ] })\n  .pipe(process.stdout)\n\nfunction modifier (file, style, next) {\n  shade()(style)\n  next(null, style)\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackcss%2Fstyle-deps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackcss%2Fstyle-deps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackcss%2Fstyle-deps/lists"}