{"id":20083169,"url":"https://github.com/sparkbox/splinter","last_synced_at":"2025-08-20T12:06:30.295Z","repository":{"id":14048194,"uuid":"75742782","full_name":"sparkbox/splinter","owner":"sparkbox","description":"🐭 Parse and split SCSS files based on functions and mixins.","archived":false,"fork":false,"pushed_at":"2024-12-03T05:55:36.000Z","size":441,"stargazers_count":2,"open_issues_count":25,"forks_count":0,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-12-17T02:03:12.389Z","etag":null,"topics":["ast","postcss","scss"],"latest_commit_sha":null,"homepage":"","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/sparkbox.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-06T15:10:13.000Z","updated_at":"2020-11-16T22:49:11.000Z","dependencies_parsed_at":"2024-12-03T06:26:39.936Z","dependency_job_id":"88b0d0cb-9477-4cdd-8b7b-09541e0cede1","html_url":"https://github.com/sparkbox/splinter","commit_stats":{"total_commits":28,"total_committers":7,"mean_commits":4.0,"dds":0.5,"last_synced_commit":"951fa098d3efed484c199def12405206e26db0d5"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkbox%2Fsplinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkbox%2Fsplinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkbox%2Fsplinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkbox%2Fsplinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sparkbox","download_url":"https://codeload.github.com/sparkbox/splinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233682439,"owners_count":18713551,"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":["ast","postcss","scss"],"created_at":"2024-11-13T15:46:11.146Z","updated_at":"2025-01-13T01:47:21.665Z","avatar_url":"https://github.com/sparkbox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/sparkbox/splinter.svg?style=shield)](https://circleci.com/gh/sparkbox/splinter)\n\nscss-splinter enables the creation of multiple stylesheets from a common set of modules with minimal effort via SCSS mixins and functions.\n\n## Usage\n\nscss-splinter accepts an options object that specifies a `partial`, a `base`, and a optional `keyword` to grep for.\n\n```js\n  const parse = require('scss-splinter');\n\n  parse({\n    partial: 'src/scss/_brands.scss',\n    base: 'src/scss/_base.scss',\n    keyword: 'split',\n  })\n```\n\n1. Partial is the name of the file that scss-splinter will generate with \"split\" code, e.g. code that is specified in the matching mixin or sass-function.\n\n2. Base is the name of the main `sass` index file in a project. This is the file scss-splinter will use to find all the files it needs to parse.\n\nscss-splinter fills the `partial` file with \"split\" `scss` and returns a promise that contains \"global\" `scss`. It's up to the project to determine what to do with this global string. One approach would be to run the string through `node-sass` and write the compiled `css` to a file.\n\n```js\n  const fs = require('fs');\n  const parse = require('scss-splinter');\n  const nodeSass = require('node-sass');\n\n  parse({\n    partial: 'src/scss/_brands.scss',\n    base: 'src/scss/_base.scss',\n    keyword: 'split',\n  })\n  .then((scss) =\u003e {\n    const compiledGlobal = nodeSass.renderSync({\n      data: scss,\n    });\n\n    fs.writeFileSync('global.css', compiledGlobal.css.toString());\n  });\n```\n\n# cwd\n\nIf your `SCSS` files are not located at `src/scss`, you can pass `cwd` in the params:\n\n```js\n  const parse = require('scss-splinter');\n\n  parse({\n    partial: '_brands.scss',\n    base: '_base.scss',\n    keyword: 'split',\n    cwd: 'i/keep/my/scss/files/here',\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkbox%2Fsplinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparkbox%2Fsplinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkbox%2Fsplinter/lists"}