Skip to content

Commit

Permalink
Ouptut a deprecation warning to stdout when using process.sass
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xzyfer committed Mar 26, 2016
1 parent d76923b commit adb6166
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/index.js
Expand Up @@ -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; },
};

0 comments on commit adb6166

Please sign in to comment.