https://github.com/gulpjs/default-resolution
Get the default resolution time based on the current node version, optionally overridable
https://github.com/gulpjs/default-resolution
Last synced: 8 months ago
JSON representation
Get the default resolution time based on the current node version, optionally overridable
- Host: GitHub
- URL: https://github.com/gulpjs/default-resolution
- Owner: gulpjs
- License: mit
- Created: 2015-04-11T21:23:07.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-08-27T02:46:48.000Z (almost 3 years ago)
- Last Synced: 2025-10-08T18:47:17.343Z (9 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# default-resolution
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Get the default resolution time based on the current node version, optionally overridable.
Originally implemented by [@dinoboff][dinoboff] in [gulpjs/undertaker#17][original].
Split out for standalone use.
## Usage
```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
```
## API
### `defaultResolution([resolution])`
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.
### Default resolutions
| node version | resolution |
| ------------ | ---------- |
| 0.10 | 1s |
| 0.11+ | 1ms |
More information at https://github.com/gulpjs/undertaker/pull/17#issuecomment-82374512
# License
MIT
[downloads-image]: https://img.shields.io/npm/dm/default-resolution.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/default-resolution
[npm-image]: https://img.shields.io/npm/v/default-resolution.svg?style=flat-square
[ci-url]: https://github.com/gulpjs/default-resolution/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/default-resolution/dev?style=flat-square
[coveralls-url]: https://coveralls.io/r/gulpjs/default-resolution
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/default-resolution/master.svg?style=flat-square
[dinoboff]: https://github.com/dinoboff
[original]: https://github.com/gulpjs/undertaker/pull/17
[default-table]: #default-resolutions