From adb6166b5570e567fa31ea98d623fc0892be9bf5 Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 26 Mar 2016 17:38:09 +1100 Subject: [PATCH] Ouptut a deprecation warning to stdout when using process.sass This is an undocumented internal API that will be removed. Access `process.sass` will produce the following warning. >Deprecation warning: `process.sass` is an undocumented internal that will be removed in future versions of Node Sass. --- lib/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index b8dc2ad78..c40797474 100644 --- a/lib/index.js +++ b/lib/index.js @@ -441,10 +441,14 @@ module.exports.NULL = binding.types.Null.NULL; * TODO: remove for 4.0 */ +function processSassDeprecationMessage() { + console.log('Deprecation warning: `process.sass` is an undocumented internal that will be removed in future versions of Node Sass.'); +} + process.sass = process.sass || { - versionInfo: module.exports.info, - binaryName: sass.getBinaryName(), - binaryUrl: sass.getBinaryUrl(), - binaryPath: sass.getBinaryPath(), - getBinaryPath: sass.getBinaryPath, + get versionInfo() { processSassDeprecationMessage(); return module.exports.info; }, + get binaryName() { processSassDeprecationMessage(); return sass.getBinaryName(); }, + get binaryUrl() { processSassDeprecationMessage(); return sass.getBinaryUrl(); }, + get binaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath(); }, + get getBinaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath; }, };