Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/compass-version
Get the version of a compass binary in semver format
https://github.com/shinnn/compass-version
Last synced: 27 days ago
JSON representation
Get the version of a compass binary in semver format
- Host: GitHub
- URL: https://github.com/shinnn/compass-version
- Owner: shinnn
- License: unlicense
- Created: 2015-10-16T10:22:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-03T06:52:15.000Z (over 8 years ago)
- Last Synced: 2024-09-16T15:49:13.922Z (about 2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compass-version
[![NPM version](https://img.shields.io/npm/v/compass-version.svg)](https://www.npmjs.com/package/compass-version)
[![Build Status](https://travis-ci.org/shinnn/compass-version.svg?branch=master)](https://travis-ci.org/shinnn/compass-version)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/compass-version.svg)](https://coveralls.io/r/shinnn/compass-version)
[![Dependency Status](https://david-dm.org/shinnn/compass-version.svg)](https://david-dm.org/shinnn/compass-version)
[![devDependency Status](https://david-dm.org/shinnn/compass-version/dev-status.svg)](https://david-dm.org/shinnn/compass-version#info=devDependencies)A [Node](https://nodejs.org/) module to get the version of a [`compass`](http://compass-style.org/help/documentation/command-line/) binary in [semver](http://semver.org/) format
```javascript
const compassVersion = require('compass-version');compassVersion().then(version => {
version; //=> '1.0.3'
});
```## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install compass-version
```## API
```javascript
const compassVersion = require('compass-version');
```### compassVersion([*options*])
*options*: `Object` (directly passed to [`child_process#spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options))
Return: `Object` ([Promise](https://promisesaplus.com/) instance)It detects the installed [Compass](http://compass-style.org/) version in `compass version` command.
When it finish resolving the version, it will be [fulfilled](https://promisesaplus.com/#point-26) with a `String` of the [semver](https://github.com/npm/node-semver)-valid version number.
When it fails, it will be [rejected](https://promisesaplus.com/#point-30) 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`.
```javascript
const compassVersion = require('compass-version');compassVersion({bundleExec: true}).then(version => {
version; //=> '1.0.3'
});
```## Related project
* [compass-version-callback](https://github.com/shinnn/compass-version-callback) ([callback](http://thenodeway.io/posts/understanding-error-first-callbacks/)-style version)
## License
[The Unlicense](./LICENSE)