pax_global_header00006660000000000000000000000064127124606200014512gustar00rootroot0000000000000052 comment=07f531b2e7b3587f1c6cbce3f83054f50aa5cc97 process-nextick-args-1.0.8/000077500000000000000000000000001271246062000155735ustar00rootroot00000000000000process-nextick-args-1.0.8/.travis.yml000066400000000000000000000001601271246062000177010ustar00rootroot00000000000000language: node_js node_js: - "0.8" - "0.10" - "0.11" - "0.12" - "1.7.1" - 1 - 2 - 3 - 4 - 5 process-nextick-args-1.0.8/index.js000066400000000000000000000020201271246062000172320ustar00rootroot00000000000000'use strict'; if (!process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = nextTick; } else { module.exports = process.nextTick; } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== 'function') { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } process-nextick-args-1.0.8/license.md000066400000000000000000000020501271246062000175340ustar00rootroot00000000000000# Copyright (c) 2015 Calvin Metcalf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.** process-nextick-args-1.0.8/package.json000066400000000000000000000011021271246062000200530ustar00rootroot00000000000000{ "name": "process-nextick-args", "version": "1.0.8", "description": "process.nextTick but always with args", "main": "index.js", "files": [ "index.js" ], "scripts": { "test": "node test.js" }, "repository": { "type": "git", "url": "https://github.com/calvinmetcalf/process-nextick-args.git" }, "author": "", "license": "MIT", "bugs": { "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" }, "homepage": "https://github.com/calvinmetcalf/process-nextick-args", "devDependencies": { "tap": "~0.2.6" } } process-nextick-args-1.0.8/readme.md000066400000000000000000000007031271246062000173520ustar00rootroot00000000000000process-nextick-args ===== [![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) ```bash npm install --save process-nextick-args ``` Always be able to pass arguments to process.nextTick, no matter the platform ```js var nextTick = require('process-nextick-args'); nextTick(function (a, b, c) { console.log(a, b, c); }, 'step', 3, 'profit'); ``` process-nextick-args-1.0.8/test.js000066400000000000000000000010161271246062000171060ustar00rootroot00000000000000var test = require("tap").test; var nextTick = require('./'); test('should work', function (t) { t.plan(5); nextTick(function (a) { t.ok(a); nextTick(function (thing) { t.equals(thing, 7); }, 7); }, true); nextTick(function (a, b, c) { t.equals(a, 'step'); t.equals(b, 3); t.equals(c, 'profit'); }, 'step', 3, 'profit'); }); test('correct number of arguments', function (t) { t.plan(1); nextTick(function () { t.equals(2, arguments.length, 'correct number'); }, 1, 2); });