npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

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.

install

npm i compass-version-callback

Downloadsweekly downloads

9

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability