{"id":19119302,"url":"https://github.com/convertiv/node-sass-watcher","last_synced_at":"2026-06-17T18:05:28.692Z","repository":{"id":193320306,"uuid":"678434017","full_name":"Convertiv/node-sass-watcher","owner":"Convertiv","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-07T16:00:19.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-13T00:27:09.329Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Convertiv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-08-14T14:41:55.000Z","updated_at":"2023-08-14T15:09:22.000Z","dependencies_parsed_at":"2023-09-07T18:00:59.764Z","dependency_job_id":"7b1a6a47-9007-433b-b92b-4c5e536d6090","html_url":"https://github.com/Convertiv/node-sass-watcher","commit_stats":null,"previous_names":["convertiv/node-sass-watcher"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Convertiv/node-sass-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convertiv%2Fnode-sass-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convertiv%2Fnode-sass-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convertiv%2Fnode-sass-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convertiv%2Fnode-sass-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Convertiv","download_url":"https://codeload.github.com/Convertiv/node-sass-watcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Convertiv%2Fnode-sass-watcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34459690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":[],"created_at":"2024-11-09T05:09:12.536Z","updated_at":"2026-06-17T18:05:28.648Z","avatar_url":"https://github.com/Convertiv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-sass-watcher\n\nSCSS watcher with post-processing. Fork of https://github.com/kottenator/node-sass-watcher.\n\n## Why?\n\n`node-sass` has `--watch` option but it doesn't allow post-processing of the compiled CSS.\n\nThe only way is to \"watch\" the generated CSS file with another watcher. **It's not convenient**.\n\n`node-sass-watcher` provides simple way to do SCSS watching with post-processing.\n\n## Install\n\n```sh\nnpm install node-sass-watcher\n```\n\n## Usage: CLI\n\n```sh\nnode-sass-watcher src/input.scss -o dist/output.css -c 'node-sass \u003cinput\u003e | postcss -u autoprefixer --autoprefixer.browsers=\"ie \u003e= 9, \u003e 1%\"'\n```\n\n_Note:_ You need to run `node-sass` inside the post-processing command,\nbecause I don't want to deal with all `node-sass` CLI arguments.\nIn fact, current implementation is `node-sass`-independent.\n\nMore about `--command` (`-c`):\n\n* contents of the `input.scss` are passed to the command's `stdin`\n* `\u003cinput\u003e` will be replaced with the input file path\n* `\u003coutput\u003e` will be replaced with the output file path, provided with `--output` (`-o`) argument (if specified)\n* Shell syntax is allowed: pipes (`|`), FD redirects (`\u003e output.css`), etc\n\nIf there's no `-o` specified, the command output will be printed to `stdout`.\n\nAll CLI options:\n\n```\nUsage: node-sass-watcher \u003cinput.scss\u003e [options]\n\nOptions:\n  -c, --command             Pass a command to execute. Shell syntax allowed\n  -o, --output              Output CSS file path\n  -r, --root-dir            Directory to watch for addition/deletion of the files. Default: .\n  -I, --include-path        Path to look for imported files. Use multiple if needed\n  -e, --include-extensions  File extensions to watch. Default: scss, sass, css\n  -v, --verbose             Verbosity level: from -v to -vvv\n  -h, --help                Show help\n  -V, --version             Show version number\n```\n\n## Usage: JS\n\nExample: `node-sass` → `autoprefixer`.\n\n```js\n// watch-it.js\n\nconst fs = require('fs');\nconst sass = require('node-sass');\nconst postcss = require('postcss');\nconst autoprefixer = require('autoprefixer');\nconst Watcher = require('node-sass-watcher');\n\n// Input variables\nconst inputFile = process.argv[2];\nconst outputFile = process.argv[3];\nconst supportedBrowsers = process.argv[4];\n\n// Options\nconst watcherOptions = {\n  verbosity: 1,\n}\n\n// Renderer\nfunction render() {\n  console.warn('Rendering \"' + inputFile + '\" file...');\n\n  sass.render({file: inputFile}, function(err, result) {\n    if (err) {\n      console.error('Error: ' + err.message);\n      return;\n    }\n\n    const processor = postcss([\n      autoprefixer({\n        browsers: supportedBrowsers.split(/,\\s*/g)\n      })\n    ]);\n\n    console.warn('Processing with Autoprefixer for browsers: ' + supportedBrowsers);\n\n    processor.process(result.css.toString()).then(\n      function(result) {\n        console.warn('Outputting to \"' + outputFile + '\" file...');\n        fs.writeFile(outputFile, result.css);\n      },\n      function(err) {\n        console.error('Error: ' + err.message);\n      }\n    );\n  });\n}\n\n// Start watching\nconst watcher = new Watcher(inputFile, watcherOptions);\nwatcher.on('init', render);\nwatcher.on('update', render);\nwatcher.run();\n```\n\nRun your custom script:\n\n```sh\nnode watch-it.js src/input.scss dist/output.css \"ie \u003e= 9, \u003e 1%\"\n```\n\n\nAvailable options are a subset of the CLI options:\n\n* `includePaths`\n* `rootDir`\n* `verbosity`\n* `includeExtensions`\n\n## Collaboration\n\nFeel free to create a ticket or a pull-request ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvertiv%2Fnode-sass-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconvertiv%2Fnode-sass-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvertiv%2Fnode-sass-watcher/lists"}