{"id":21144324,"url":"https://github.com/gilbert/node-sass-endpoint","last_synced_at":"2025-09-29T08:08:33.089Z","repository":{"id":136581198,"uuid":"43178584","full_name":"gilbert/node-sass-endpoint","owner":"gilbert","description":"Easily server a SASS file from express.","archived":false,"fork":false,"pushed_at":"2019-01-23T23:09:35.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T09:45:00.223Z","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/gilbert.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}},"created_at":"2015-09-25T22:33:41.000Z","updated_at":"2019-01-23T23:09:37.000Z","dependencies_parsed_at":"2023-04-11T18:52:57.602Z","dependency_job_id":null,"html_url":"https://github.com/gilbert/node-sass-endpoint","commit_stats":null,"previous_names":["mindeavor/node-sass-endpoint"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gilbert/node-sass-endpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbert%2Fnode-sass-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbert%2Fnode-sass-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbert%2Fnode-sass-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbert%2Fnode-sass-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilbert","download_url":"https://codeload.github.com/gilbert/node-sass-endpoint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilbert%2Fnode-sass-endpoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277483347,"owners_count":25825566,"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-29T02:00:09.175Z","response_time":84,"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-20T08:16:53.992Z","updated_at":"2025-09-29T08:08:33.045Z","avatar_url":"https://github.com/gilbert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-sass-endpoint\n\nEasily serve a SASS file as CSS from an express endpoint. No grunt/gulp, no build files, no required configuration – just pure data.\n\n### Dependencies\n\n- [node-sass](https://www.npmjs.com/package/node-sass) (taken care of by npm install)\n- ES6 `Object.assign` (either use node v4.0+ or a [polyfill](https://www.npmjs.com/package/es6-object-assign))\n\n### Installation\n\n    $ npm install node-sass-endpoint --save\n\n## Usage - Easy Version\n\nAssuming you have the following directory structure:\n\n```\nclient/\n├── app.scss\n└── index.html\n\n\nserver/\n└── index.js\n\npackage.json\n```\n\nThen you can write the following as your `server/index.js`:\n\n```javascript\n// server.js\nvar express = require('express');\nvar sass = require('node-sass-endpoint');\nvar app  = express();\n\n// Serve CSS\napp.get('/assets/app-bundle.css',\n  sass.serve('./client/app.scss'));\n\n// Serve HTML\nvar path = require('path')\napp.get('/', function (req, res) {\n  res.sendFile( path.resolve(__dirname, '../client/public/admin.html') )\n})\n\nconsole.log(\"Listening on port 5555...\");\napp.listen(5555);\n```\n\nAnd run `node server/index.js`.\n\nNow any GET request to `localhost:5555/assets/app-bundle.css` will compile and serve the SASS file located at `./client/app.scss`. Any `@import` statements within `app.scss` will also be included in the final output.\n\nWith that said, here is an example of using your sass-compiled CSS in `client/index.html`:\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003clink rel=\"stylesheet\" href=\"/assets/app-bundle.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003c!-- page content --\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Advanced Usage\n\n```javascript\napp.get(\n  '/assets/app-bundle.css',\n  sass.serve('./client/app.scss', {\n\n    // (dev only) defaults to parent folder of scss file.\n    // Any sass file changes in this directory will clear the output cache.\n    watchDir: './client/',\n\n    // Defaults to parent folder of scss file.\n    // The node_modules/ is always included.\n    includePaths: ['./client/'],\n\n    // Defaults to \"nested\". Can be one of: \"nested\", \"expanded\", \"compact\", or \"compressed\".\n    outputStyle: 'compressed',\n\n    // Defaults to false\n    debug: false\n  })\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilbert%2Fnode-sass-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilbert%2Fnode-sass-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilbert%2Fnode-sass-endpoint/lists"}