Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out what version of Sass I'm using when running gulp-sass?

I just started using gulp-sass, is there a "easy" way to find out what version of Sass, that is being used?

Not that I think it matters too much but I'm using gulp-sass in Visual Studio 2015 (CTP6).

I need to know because I want to use a Sass mixin which requires a certain minimum version of Sass.

At the moment, if I want to find out what version of Sass is being used, I try to follow the trail like this, gulp-sass is a wrapper for node-sass which in its turn is providing Node bindings for libsass, which is a C compiler for Sass.

So to find out the version of Sass being used in my environment, I have to follow the chain and try to work out which version is used in each step and what version it then uses of the next step.

Surely there must be an easier way?

like image 343
Ola Karlsson Avatar asked Apr 22 '15 09:04

Ola Karlsson


1 Answers

We can agree that, from node-sass you can get the versions using :

var sass = require('node-sass');

console.log(sass.info);

From gulp-sass, you can send data which will be executed by node-sass. So something like this should do the trick :

var gulp = require('gulp');
var sass = require('gulp-sass'); 
console.log(sass.info);

It's going to be the .info() from node-sass who get's called in the end, giving you both it's version and libsass's version.

like image 103
Mekap Avatar answered Sep 29 '22 06:09

Mekap