imagenarium
Version:
Use to optimize, handler formats and crop images
71 lines (46 loc) • 2.33 kB
Markdown
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Get the default resolution time based on the current node version, optionally overridable.
Originally implemented by [@dinoboff][dinoboff] in [gulpjs/undertaker
Split out for standalone use.
```js
var defaultResolution = require('default-resolution');
defaultResolution();
//-> 1000 (1 second) in node 0.10
//-> 1 (millisecond) in node 0.11+
// use a different value
defaultResolution(12);
//-> 12 always
```
Returns the default resolution, based on the node platform. See [Default resolution table][default-table] below for resolutions.
Optionally takes a resolution number to force override any platform resolutions.
| node version | resolution |
|--------------|------------|
| 0.10 | 1s |
| 0.11+ | 1ms |
More information at https://github.com/gulpjs/undertaker/pull/17#issuecomment-82374512
MIT
[]: https://github.com/dinoboff
[]: https://github.com/gulpjs/undertaker/pull/17
[]:
[]: http://img.shields.io/npm/dm/default-resolution.svg
[]: https://www.npmjs.com/package/default-resolution
[]: http://img.shields.io/npm/v/default-resolution.svg
[]: https://travis-ci.org/gulpjs/default-resolution
[]: http://img.shields.io/travis/gulpjs/default-resolution.svg?label=travis-ci
[]: https://ci.appveyor.com/project/gulpjs/default-resolution
[]: https://img.shields.io/appveyor/ci/gulpjs/default-resolution.svg?label=appveyor
[]: https://coveralls.io/r/gulpjs/default-resolution
[]: http://img.shields.io/coveralls/gulpjs/default-resolution/master.svg
[]: https://gitter.im/gulpjs/gulp
[]: https://badges.gitter.im/gulpjs/gulp.svg