{"library":"node-sass-tilde-importer","title":"Node Sass Tilde Importer","description":"node-sass-tilde-importer is a custom importer for node-sass that enabled the resolution of Sass `@import` statements beginning with a tilde (~) to absolute paths within the nearest `node_modules` directory. This functionality was essential for integrating npm-installed Sass libraries (e.g., Bootstrap's SCSS files) into projects built with `node-sass` and bundlers like Webpack (via `sass-loader`). The package's current stable version is 1.0.2, last published in March 2018. It has no discernible release cadence, indicating it is no longer actively maintained. Its primary differentiator was providing `~` path resolution for `node-sass`, a feature now largely superseded or natively handled by modern Sass compilers (Dart Sass, available as the `sass` npm package) and contemporary bundler loaders (e.g., `sass-loader` v8+). Given the end-of-life status and deprecation of `node-sass` itself, this package is considered obsolete for new projects and for migrations to modern Sass environments.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-sass-tilde-importer"],"cli":null},"imports":["const tildeImporter = require('node-sass-tilde-importer');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const sass = require('node-sass');\nconst tildeImporter = require('node-sass-tilde-importer');\n\nconst scssContent = `\n  // Example of importing a node_module like Bootstrap\n  @import \"~bootstrap/scss/functions\";\n  @import \"~bootstrap/scss/variables\";\n  @import \"~bootstrap/scss/mixins\";\n  \n  .my-component {\n    color: $blue;\n    padding: map-get($spacers, 3);\n  }\n`;\n\nsass.render({\n  data: scssContent,\n  importer: tildeImporter,\n  outputStyle: 'expanded'\n}, function(error, result) {\n  if (error) {\n    console.error(`Sass compilation error: ${error.message} on line ${error.line} in ${error.file}`);\n  } else {\n    console.log('Compiled CSS:\\n', result.css.toString());\n  }\n});","lang":"javascript","description":"Demonstrates how to use node-sass-tilde-importer with the deprecated `node-sass` compiler to resolve tilde imports.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}