Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
node-sass-tilde-importer
Advanced tools
A node-sass custom importer which turns ~ into absolute paths to the nearest parent node_modules directory.
The node-sass-tilde-importer package is a custom importer for node-sass that allows you to use the tilde (~) character to import Sass files from node_modules. This can simplify the process of managing and importing dependencies in your Sass files.
Importing Sass files from node_modules
This feature allows you to import Sass files from node_modules using the tilde (~) character. The code sample demonstrates how to configure node-sass to use the tilde importer.
const sass = require('node-sass');
const tildeImporter = require('node-sass-tilde-importer');
sass.render({
file: 'path/to/your/main.scss',
importer: tildeImporter
}, function(error, result) {
if (!error) {
console.log(result.css.toString());
} else {
console.error(error);
}
});
The sass-module-importer package provides similar functionality by allowing you to import Sass files from node_modules. It uses a different syntax and configuration compared to node-sass-tilde-importer.
A node-sass custom importer which turns ~ into absolute paths to the nearest parent node_modules directory.
npm install node-sass-tilde-importer --save-dev
var sass = require('node-sass');
var tildeImporter = require('node-sass-tilde-importer');
var result = sass.renderSync({
data: scss_content,
importer: tildeImporter
});
node-sass
cli example:
node-sass style.scss --importer=node_modules/node-sass-tilde-importer
Please refer to the node-sass readme for full instruction on how to use custom importers.
FAQs
A node-sass custom importer which turns ~ into absolute paths to the nearest parent node_modules directory.
The npm package node-sass-tilde-importer receives a total of 124,416 weekly downloads. As such, node-sass-tilde-importer popularity was classified as popular.
We found that node-sass-tilde-importer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.