compass-version-callback

1.0.1 • Public • Published

compass-version-callback

NPM version Build Status Build status Coverage Status Dependency Status devDependency Status

Callback-style version of compass-version

const compassVersionCallback = require('compass-version-callback');

compassVersionCallback((err, version) => {
  if (err) {
    throw err;
  }

  version; //=> '1.0.3'
});

Installation

Use npm.

npm install compass-version-callback

API

const compassVersionCallback = require('compass-version-callback');

compassVersionCallback([options,] callback)

options: Object (directly passed to child_process#spawn)
callback: Function

It detects the installed Compass version in compass version command.

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.

callback(error, version)

error: Error when it fails to run compass (or bundle exec compass) command, otherwise null
version: String (looks like '1.0.3')

const compassVersionCallback = require('compass-version-callback');

compassVersionCallback({bundleExec: true}, (err, version) => {
  if (err) {
    throw err;
  }

  version; //=> '1.0.3'
});

Testing

Requires Git, Node v4+ and Docker machine.

  1. Clone this repository and change CWD to the cloned compass-version-callback directory.
  2. Run npm install.
  3. Create and run a container with no additional settings.
  4. Run npm test.

License

Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.

Dependents (1)

Package Sidebar

Install

npm i compass-version-callback

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • shinnn