1.0.0 • Published 10 years ago
compass-version v1.0.0
compass-version
A Node module to get the version of a compass binary in semver format
const compassVersion = require('compass-version');
compassVersion().then(version => {
version; //=> '1.0.3'
});Installation
npm install compass-versionAPI
const compassVersion = require('compass-version');compassVersion(options)
options: Object (directly passed to child_process#spawn)
Return: Object (Promise instance)
It detects the installed Compass version in compass version command.
When it finish resolving the version, it will be fulfilled with a String of the semver-valid version number.
When it fails, it will be rejected with an error object.
options
In addition to child_process#spawn, you can set bundleExec option:
options.bundleExec
Type: Boolean
Default: false
Detect the version in bundle exec compass version, instead of compass version.
const compassVersion = require('compass-version');
compassVersion({bundleExec: true}).then(version => {
version; //=> '1.0.3'
});Related project
- compass-version-callback (callback-style version)